//------------------------------------------------------------------ // Storm3D_Material::Storm3D_Material //------------------------------------------------------------------ Storm3D_Material::Storm3D_Material(Storm3D *s2,const char *_name) : Storm3D2(s2), texture_base(NULL), texture_base2(NULL), texture_bump(NULL), texture_reflection(NULL), texture_distortion(NULL), color(1,1,1), self_illum(0,0,0), specular(1,1,1), specular_sharpness(25), doublesided(false), wireframe(false), bumpheight(1.0f), alphablend_type(ATYPE_NONE), transparency(0), glow(0), glow_factor(1.f), multitexture_type(MTYPE_COLORONLY), shader_handle(0), scrollEnabled(false), scrollUpdateFrame(-1), local_reflection(false), reflection_blend_factor(0.f) { // Copy name name=new char[strlen(_name)+1]; strcpy(name,_name); storm3d_material_allocs++; effectTextureName = getEffectName(name); }
//------------------------------------------------------------------------------------------------------- long AudioEffectX::dispatcher (long opCode, long index, long value, void *ptr, float opt) { long v = 0; switch(opCode) { // VstEvents case effProcessEvents: v = processEvents ((VstEvents*)ptr); break; // parameters and programs case effCanBeAutomated: v = canParameterBeAutomated (index) ? 1 : 0; break; case effString2Parameter: v = string2parameter (index, (char*)ptr) ? 1 : 0; break; case effGetNumProgramCategories: v = getNumCategories (); break; case effGetProgramNameIndexed: v = getProgramNameIndexed (value, index, (char*)ptr) ? 1 : 0; break; case effCopyProgram: v = copyProgram (index) ? 1 : 0; break; // connections, configuration case effConnectInput: inputConnected (index, value ? true : false); v = 1; break; case effConnectOutput: outputConnected (index, value ? true : false); v = 1; break; case effGetInputProperties: v = getInputProperties (index, (VstPinProperties*)ptr) ? 1 : 0; break; case effGetOutputProperties: v = getOutputProperties (index, (VstPinProperties*)ptr) ? 1 : 0; break; case effGetPlugCategory: v = (long)getPlugCategory (); break; // realtime case effGetCurrentPosition: v = reportCurrentPosition (); break; case effGetDestinationBuffer: v = (long)reportDestinationBuffer (); break; // offline case effOfflineNotify: v = offlineNotify ((VstAudioFile*)ptr, value, index != 0); break; case effOfflinePrepare: v = offlinePrepare ((VstOfflineTask*)ptr, value); break; case effOfflineRun: v = offlineRun ((VstOfflineTask*)ptr, value); break; // other case effSetSpeakerArrangement: v = setSpeakerArrangement ((VstSpeakerArrangement*)value, (VstSpeakerArrangement*)ptr) ? 1 : 0; break; case effProcessVarIo: v = processVariableIo ((VstVariableIo*)ptr) ? 1 : 0; break; case effSetBlockSizeAndSampleRate: setBlockSizeAndSampleRate (value, opt); v = 1; break; case effSetBypass: v = setBypass (value ? true : false) ? 1 : 0; break; case effGetEffectName: v = getEffectName ((char *)ptr) ? 1 : 0; break; case effGetErrorText: v = getErrorText ((char *)ptr) ? 1 : 0; break; case effGetVendorString: v = getVendorString ((char *)ptr) ? 1 : 0; break; case effGetProductString: v = getProductString ((char *)ptr) ? 1 : 0; break; case effGetVendorVersion: v = getVendorVersion (); break; case effVendorSpecific: v = vendorSpecific (index, value, ptr, opt); break; case effCanDo: v = canDo ((char*)ptr); break; case effGetIcon: v = (long)getIcon (); break; case effSetViewPosition: v = setViewPosition (index, value) ? 1 : 0; break; case effGetTailSize: v = getGetTailSize (); break; case effIdle: v = fxIdle (); break; case effGetParameterProperties: v = getParameterProperties (index, (VstParameterProperties*)ptr) ? 1 : 0; break; case effKeysRequired: v = (keysRequired () ? 0 : 1); // reversed to keep v1 compatibility break; case effGetVstVersion: v = getVstVersion (); break; // version 1.0 or unknown default: v = AudioEffect::dispatcher (opCode, index, value, ptr, opt); } return v; }
//------------------------------------------------------------------------------------------------------- long AudioEffectX::dispatcher (long opCode, long index, long value, void *ptr, float opt) { long v = 0; switch(opCode) { // VstEvents case effProcessEvents: v = processEvents ((VstEvents*)ptr); break; // parameters and programs case effCanBeAutomated: v = canParameterBeAutomated (index) ? 1 : 0; break; case effString2Parameter: v = string2parameter (index, (char*)ptr) ? 1 : 0; break; case effGetNumProgramCategories: v = getNumCategories (); break; case effGetProgramNameIndexed: v = getProgramNameIndexed (value, index, (char*)ptr) ? 1 : 0; break; case effCopyProgram: v = copyProgram (index) ? 1 : 0; break; // connections, configuration case effConnectInput: inputConnected (index, value ? true : false); v = 1; break; case effConnectOutput: outputConnected (index, value ? true : false); v = 1; break; case effGetInputProperties: v = getInputProperties (index, (VstPinProperties*)ptr) ? 1 : 0; break; case effGetOutputProperties: v = getOutputProperties (index, (VstPinProperties*)ptr) ? 1 : 0; break; case effGetPlugCategory: v = (long)getPlugCategory (); break; // realtime case effGetCurrentPosition: v = reportCurrentPosition (); break; case effGetDestinationBuffer: v = (long)reportDestinationBuffer (); break; // offline case effOfflineNotify: v = offlineNotify ((VstAudioFile*)ptr, value, index != 0); break; case effOfflinePrepare: v = offlinePrepare ((VstOfflineTask*)ptr, value); break; case effOfflineRun: v = offlineRun ((VstOfflineTask*)ptr, value); break; // other case effSetSpeakerArrangement: v = setSpeakerArrangement ((VstSpeakerArrangement*)value, (VstSpeakerArrangement*)ptr) ? 1 : 0; break; case effProcessVarIo: v = processVariableIo ((VstVariableIo*)ptr) ? 1 : 0; break; case effSetBlockSizeAndSampleRate: setBlockSizeAndSampleRate (value, opt); v = 1; break; case effSetBypass: v = setBypass (value ? true : false) ? 1 : 0; break; case effGetEffectName: v = getEffectName ((char *)ptr) ? 1 : 0; break; case effGetErrorText: v = getErrorText ((char *)ptr) ? 1 : 0; break; case effGetVendorString: v = getVendorString ((char *)ptr) ? 1 : 0; break; case effGetProductString: v = getProductString ((char *)ptr) ? 1 : 0; break; case effGetVendorVersion: v = getVendorVersion (); break; case effVendorSpecific: v = vendorSpecific (index, value, ptr, opt); break; case effCanDo: v = canDo ((char*)ptr); break; case effGetIcon: v = (long)getIcon (); break; case effSetViewPosition: v = setViewPosition (index, value) ? 1 : 0; break; case effGetTailSize: v = getGetTailSize (); break; case effIdle: v = fxIdle (); break; case effGetParameterProperties: v = getParameterProperties (index, (VstParameterProperties*)ptr) ? 1 : 0; break; case effKeysRequired: v = (keysRequired () ? 0 : 1); // reversed to keep v1 compatibility break; case effGetVstVersion: v = getVstVersion (); break; #if VST_2_1_EXTENSIONS case effEditKeyDown: if (editor) { VstKeyCode keyCode = {index, (unsigned char)value, (unsigned char)opt}; v = editor->onKeyDown (keyCode); } break; case effEditKeyUp: if (editor) { VstKeyCode keyCode = {index, (unsigned char)value, (unsigned char)opt}; v = editor->onKeyUp (keyCode); } break; case effSetEditKnobMode: if (editor) v = editor->setKnobMode (value); break; case effGetMidiProgramName: v = getMidiProgramName (index, (MidiProgramName*)ptr); break; case effGetCurrentMidiProgram: v = getCurrentMidiProgram (index, (MidiProgramName*)ptr); break; case effGetMidiProgramCategory: v = getMidiProgramCategory (index, (MidiProgramCategory*)ptr); break; case effHasMidiProgramsChanged: v = hasMidiProgramsChanged (index) ? 1 : 0; break; case effGetMidiKeyName: v = getMidiKeyName (index, (MidiKeyName*)ptr) ? 1 : 0; break; case effBeginSetProgram: v = beginSetProgram () ? 1 : 0; break; case effEndSetProgram: v = endSetProgram () ? 1 : 0; break; #endif // VST_2_1_EXTENSIONS #if VST_2_3_EXTENSIONS case effGetSpeakerArrangement: v = getSpeakerArrangement ((VstSpeakerArrangement**)value, (VstSpeakerArrangement**)ptr) ? 1 : 0; break; case effSetTotalSampleToProcess: v = setTotalSampleToProcess (value); break; case effShellGetNextPlugin: v = getNextShellPlugin ((char*)ptr); break; case effStartProcess: v = startProcess (); break; case effStopProcess: v = stopProcess (); break; case effSetPanLaw: v = setPanLaw (value, opt) ? 1 : 0; break; case effBeginLoadBank: v = beginLoadBank ((VstPatchChunkInfo*)ptr); break; case effBeginLoadProgram: v = beginLoadProgram ((VstPatchChunkInfo*)ptr); break; #endif // VST_2_3_EXTENSIONS // version 1.0 or unknown default: v = AudioEffect::dispatcher (opCode, index, value, ptr, opt); } return v; }