#!/usr/bin/env python

"""
Simple script which prints out information about a vst plugin
"""

import time
import nosuch.vstutil
import sys
from nosuch.vstutil import *

if len(sys.argv) > 1:
	dll = sys.argv[1]
else:
	print "Usage: vstinfo {path-to-plugin.dll}"
	sys.exit(1)

def vstinfo(v1,doparams=0):
	print "VSTINFO for ",v1.name()
	print "Is VST2 = ",v1.is_vst2()
	print "Is synth = ",v1.is_synth()
	print "num_params = ",v1.num_params()
	print "num_inputs = ",v1.num_inputs()
	print "num_outputs = ",v1.num_outputs()
	print "can_receive_midi = ",v1.can_receive_midi()
	print "can_send_midi = ",v1.can_send_midi()
	print "product = ",v1.product_string()
	print "can_midi_program_names = ",v1.can_midi_program_names()
	print "numCategories = ",v1.num_categories()
	print "num_programs = ",v1.num_programs()
	for i in range(v1.num_programs()):
		print "program 0,",i," = ",v1.program_name(i,0)
	for i in range(v1.num_params()):
		print "param",i," name = ",v1.param_name(i)
		print "param",i," label = ",v1.param_label(i)
		print "param",i," display = ",v1.param_display(i)
		print "param",i," isswitch = ",v1.param_properties_isswitch(i)
		print "value",i," value = ",v1.get_param(i)
		v1.set_param(i,1.0)
		print "value",i," 1.0 display = ",v1.param_display(i)
		v1.set_param(i,0.0)
		print "value",i," 0.0 display = ",v1.param_display(i)

v = VstPlugin(dll=dll)
vstinfo(v)
sys.exit(0)

