Ejemplo n.º 1
0
//-------------------------------------------------------------------------------------------------------
VstIntPtr AudioEffect::dispatcher (VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt)
{
	VstIntPtr v = 0;
	
	switch (opcode)
	{
		case effOpen:				open ();											break;
		case effClose:				close ();											break;
		case effSetProgram:			if (value < numPrograms) setProgram ((VstInt32)value); break;
		case effGetProgram:			v = getProgram ();									break;
		case effSetProgramName: 	setProgramName ((char*)ptr);						break;
		case effGetProgramName: 	getProgramName ((char*)ptr);						break;
		case effGetParamLabel:		getParameterLabel (index, (char*)ptr);				break;
		case effGetParamDisplay:	getParameterDisplay (index, (char*)ptr);			break;
		case effGetParamName:		getParameterName (index, (char*)ptr);				break;

		case effSetSampleRate:		setSampleRate (opt);								break;
		case effSetBlockSize:		setBlockSize ((VstInt32)value);						break;
		case effMainsChanged:		if (!value) suspend (); else resume ();				break;
	#if !VST_FORCE_DEPRECATED
		case effGetVu:				v = (VstIntPtr)(getVu () * 32767.);					break;
	#endif

		//---Editor------------
		case effEditGetRect:		if (editor) v = editor->getRect ((ERect**)ptr) ? 1 : 0;	break;
		case effEditOpen:			if (editor) v = editor->open (ptr) ? 1 : 0;			break;
		case effEditClose:			if (editor) editor->close ();						break;		
		case effEditIdle:			if (editor) editor->idle ();						break;
		
	#if (TARGET_API_MAC_CARBON && !VST_FORCE_DEPRECATED)
		case effEditDraw:			if (editor) editor->draw ((ERect*)ptr);				break;
		case effEditMouse:			if (editor) v = editor->mouse (index, value);		break;
		case effEditKey:			if (editor) v = editor->key (value);				break;
		case effEditTop:			if (editor) editor->top ();							break;
		case effEditSleep:			if (editor) editor->sleep ();						break;
	#endif
		
		case DECLARE_VST_DEPRECATED (effIdentify):	v = CCONST ('N', 'v', 'E', 'f');	break;

		//---Persistence-------
		case effGetChunk:			v = getChunk ((void**)ptr, index ? true : false);	break;
		case effSetChunk:			v = setChunk (ptr, (VstInt32)value, index ? true : false);	break;
	}
	return v;
}
Ejemplo n.º 2
0
//-----------------------------------------------------------------------------
long AudioEffect::dispatcher(long opCode, long index, long value, void *ptr, float opt)
{
	long v = 0;

	switch(opCode)
	{
		case effOpen:				open();												break;
		case effClose:				close();											break;
		case effSetProgram:			if(value < numPrograms)	setProgram(value);			break;
		case effGetProgram:			v = getProgram();									break;
		case effSetProgramName: 	setProgramName((char *)ptr);						break;
		case effGetProgramName: 	getProgramName((char *)ptr);						break;
		case effGetParamLabel:		getParameterLabel(index, (char *)ptr);				break;
		case effGetParamDisplay:	getParameterDisplay(index, (char *)ptr);			break;
		case effGetParamName:		getParameterName(index, (char *)ptr);				break;

		case effSetSampleRate:		setSampleRate(opt);									break;
		case effSetBlockSize:		setBlockSize(value);								break;
		case effMainsChanged:		if(!value) suspend(); else resume();				break;
		case effGetVu:				v = (long)(getVu() * 32767.);						break;

	// editor
	
		case effEditGetRect:		if(editor) v = editor->getRect((ERect **)ptr);		break;
		case effEditOpen:			if(editor) v = editor->open(ptr);					break;
		case effEditClose:			if(editor) editor->close();							break;		
		case effEditIdle:			if(editor) editor->idle();							break;
		
		#if MAC
		case effEditDraw:			if(editor) editor->draw((ERect *)ptr);				break;
		case effEditMouse:			if(editor) v = editor->mouse(index, value);			break;
		case effEditKey:			if(editor) v = editor->key(value);					break;
		case effEditTop:			if(editor) editor->top();							break;
		case effEditSleep:			if(editor) editor->sleep();							break;
		#endif
		
	// new

		case effIdentify:			v = 'NvEf';											break;
		case effGetChunk:			v = getChunk((void**)ptr, index ? true : false); break;
		case effSetChunk:			v = setChunk(ptr, value, index ? true : false); break;
	}
	return v;
}