audioeffectx.hpp (5246B)
1 /* 2 * Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com> 3 * Copyright 2024 Steinberg Media Technologies GmbH 4 * 5 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 * 7 * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 * 9 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 10 * 11 * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14 */ 15 16 #pragma once 17 #include "aeffectx.h" 18 #include "audioeffect.hpp" 19 #include "vstmidi.h" 20 #include "vstpin.h" 21 #include "vstspeaker.h" 22 #include "vsttypes.h" 23 24 class AudioEffectX : public AudioEffect { 25 public: 26 AudioEffectX(audioMasterCallback audioMaster, VstInt32 __unk00, VstInt32 __unk01); 27 virtual ~AudioEffectX(); 28 29 protected: 30 // Internal 31 virtual VstIntPtr control(VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value) override; 32 33 public: 34 // AEffect/AEffectX 35 virtual void canDoubleReplacing(bool value); 36 virtual void noTail(bool value); 37 38 virtual void processDoubleReplacing(double** inputs, double** outputs, VstInt32 sampleFrames){}; 39 40 // Audio Master (sorted by AEffectMasterOpCodes) 41 virtual VstTimeInfo* getTimeInfo(VstInt32 filter); 42 virtual bool sendVstEventsToHost(VstEvents* events); 43 virtual bool ioChanged(); 44 virtual bool sizeWindow(VstInt32 width, VstInt32 height); 45 virtual VstInt32 getCurrentProcessLevel(); 46 virtual bool getHostVendorString(char* text); 47 virtual bool getHostProductString(char* text); 48 virtual VstInt32 getHostVendorVersion(); 49 virtual VstInt32 canHostDo(char* text); 50 virtual bool beginEdit(VstInt32 paramIndex); 51 virtual bool endEdit(VstInt32 paramIndex); 52 virtual bool updateDisplay(); 53 54 // Audio Plugin (sorted by AEffectOpCodes) 55 virtual VstInt32 processEvents(VstEvents* events) 56 { 57 return 0; 58 } 59 virtual bool canParameterBeAutomated(VstInt32 index) 60 { 61 return false; 62 } 63 virtual bool string2parameter(VstInt32 index, char* text) 64 { 65 return false; 66 } 67 virtual bool getProgramNameIndexed(VstInt32 category, VstInt32 index, char* text) 68 { 69 return false; 70 } 71 virtual bool getInputProperties(VstInt32 index, VstPinProperties* properties) 72 { 73 return false; 74 } 75 virtual bool getOutputProperties(VstInt32 index, VstPinProperties* properties) 76 { 77 return false; 78 } 79 virtual VstPlugCategory getPlugCategory() 80 { 81 return kPlugCategUnknown; 82 } 83 virtual bool setSpeakerArrangement(VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput) 84 { 85 return false; 86 } 87 virtual bool setBypass(bool onOff) 88 { 89 return false; 90 } 91 virtual bool getEffectName(char* name) 92 { 93 return false; 94 } 95 virtual bool getVendorString(char* text) 96 { 97 return false; 98 } 99 virtual bool getProductString(char* text) 100 { 101 return false; 102 } 103 virtual VstInt32 getVendorVersion() 104 { 105 return 0; 106 } 107 virtual VstIntPtr vendorSpecific(VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, float floatArg) 108 { 109 return 0; 110 } 111 virtual VstInt32 canDo(char* text) 112 { 113 return 0; 114 } 115 virtual VstInt32 getGetTailSize() 116 { 117 return 0; 118 } 119 virtual bool getParameterProperties(VstInt32 index, VstParameterProperties* p) 120 { 121 return false; 122 } 123 virtual VstInt32 getMidiProgramName(VstInt32 channel, MidiProgramName* midiProgramName) 124 { 125 return 0; 126 } 127 virtual VstInt32 getCurrentMidiProgram(VstInt32 channel, MidiProgramName* currentProgram) 128 { 129 return 0; 130 } 131 virtual VstInt32 getMidiProgramCategory(VstInt32 channel, MidiProgramCategory* category) 132 { 133 return 0; 134 } 135 virtual bool hasMidiProgramsChanged(VstInt32 channel) 136 { 137 return false; 138 } 139 virtual bool getMidiKeyName(VstInt32 channel, MidiKeyName* keyName) 140 { 141 return false; 142 } 143 virtual bool getSpeakerArrangement(VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput) 144 { 145 return false; 146 } 147 virtual VstInt32 startProcess() 148 { 149 return 0; 150 } 151 virtual VstInt32 stopProcess() 152 { 153 return 0; 154 } 155 virtual bool setProcessPrecision(VstInt32 precision) 156 { 157 return false; 158 } 159 virtual VstInt32 getNumMidiInputChannels() 160 { 161 return 0; 162 } 163 virtual VstInt32 getNumMidiOutputChannels() 164 { 165 return 0; 166 } 167 };