00001 //------------------------------------------------------------------------ 00002 // Project : VST SDK 00003 // Version : 3.0 00004 // 00005 // Category : Interfaces 00006 // Filename : ivstaudioprocessor.h 00007 // Created by : Steinberg, 10/2005 00008 // Modified : $Date: 2008/01/09 12:51:44 $ 00009 // Description : VST Audio Processing Interfaces 00010 // 00011 //----------------------------------------------------------------------------- 00012 // LICENSE 00013 // © 2008, Steinberg Media Technologies GmbH, All Rights Reserved 00014 //----------------------------------------------------------------------------- 00015 // This Software Development Kit may not be distributed in parts or its entirety 00016 // without prior written agreement by Steinberg Media Technologies GmbH. 00017 // This SDK must not be used to re-engineer or manipulate any technology used 00018 // in any Steinberg or Third-party application or software module, 00019 // unless permitted by law. 00020 // Neither the name of the Steinberg Media Technologies nor the names of its 00021 // contributors may be used to endorse or promote products derived from this 00022 // software without specific prior written permission. 00023 // 00024 // THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND 00025 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00026 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00027 // IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, 00028 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00029 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00030 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00031 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 00032 // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 00033 // OF THE POSSIBILITY OF SUCH DAMAGE. 00034 //---------------------------------------------------------------------------------- 00035 00036 #ifndef __ivstaudioprocessor__ 00037 #define __ivstaudioprocessor__ 00038 00039 #include "ivstcomponent.h" 00040 00041 //------------------------------------------------------------------------ 00042 #include "pluginterfaces/base/falignpush.h" 00043 //------------------------------------------------------------------------ 00044 00045 //------------------------------------------------------------------------ 00046 // Class Categories 00047 //------------------------------------------------------------------------ 00048 #ifndef kVstAudioEffectClass 00049 #define kVstAudioEffectClass "Audio Module Class" 00050 #endif 00051 00052 00053 //------------------------------------------------------------------------ 00054 namespace Steinberg { 00055 namespace Vst { 00056 00057 class IEventList; 00058 class IParameterChanges; 00059 struct ProcessContext; 00060 00061 //------------------------------------------------------------------------ 00063 //------------------------------------------------------------------------ 00064 namespace PlugType 00065 { 00066 //------------------------------------------------------------------------ 00067 const CString kAnalyzer = "Fx|Analyzer"; 00068 const CString kDelay = "Fx|Delay"; 00069 const CString kDistortion = "Fx|Distortion"; 00070 const CString kDynamics = "Fx|Dynamics"; 00071 const CString kEQ = "Fx|EQ"; 00072 const CString kFilter = "Fx|Filter"; 00073 const CString kGenerator = "Fx|Generator"; 00074 const CString kMastering = "Fx|Mastering"; 00075 const CString kModulation = "Fx|Modulation"; 00076 const CString kReverb = "Fx|Reverb"; 00077 const CString kRestoration = "Fx|Restoration"; 00078 const CString kPitchShift = "Fx|PitchShift"; 00079 const CString kSurround = "Fx|Surround"; 00080 00081 const CString kInstrumentDrum = "Instrument|Drum"; 00082 const CString kInstrumentSampler = "Instrument|Sampler"; 00083 const CString kInstrumentSynth = "Instrument|Synth"; 00084 00085 const CString kSpatial = "Spatial"; 00086 const CString kOnlyRealTime = "OnlyRT"; 00087 //------------------------------------------------------------------------ 00088 } 00089 00090 //------------------------------------------------------------------------ 00092 //------------------------------------------------------------------------ 00093 enum ComponentFlags 00094 { 00095 //------------------------------------------------------------------------ 00096 kDistributable = 1 << 0, 00097 kSimpleModeSupported = 1 << 1 00098 //------------------------------------------------------------------------ 00099 }; 00100 00101 //------------------------------------------------------------------------ 00103 //------------------------------------------------------------------------ 00104 enum ProcessSampleSize 00105 { 00106 kSample32, 00107 kSample64 00108 }; 00109 00110 //------------------------------------------------------------------------ 00112 //------------------------------------------------------------------------ 00113 enum ProcessMode 00114 { 00115 kRealtime, 00116 kPrefetch, 00117 kOffline 00118 }; 00119 00120 //------------------------------------------------------------------------ 00122 //------------------------------------------------------------------------ 00123 struct ProcessSetup 00124 { 00125 //------------------------------------------------------------------------ 00126 int32 processMode; 00127 int32 symbolicSampleSize; 00128 int32 maxSamplesPerBlock; 00129 SampleRate sampleRate; 00130 //------------------------------------------------------------------------ 00131 }; 00132 00133 //------------------------------------------------------------------------ 00140 //------------------------------------------------------------------------ 00141 struct AudioBusBuffers 00142 { 00143 //------------------------------------------------------------------------ 00144 int32 numChannels; 00145 uint64 silenceFlags; 00146 union 00147 { 00148 Sample32** channelBuffers32; 00149 Sample64** channelBuffers64; 00150 }; 00151 //------------------------------------------------------------------------ 00152 }; 00153 00154 //------------------------------------------------------------------------ 00159 //------------------------------------------------------------------------ 00160 struct ProcessData 00161 { 00162 //------------------------------------------------------------------------ 00163 int32 processMode; 00164 int32 symbolicSampleSize; 00165 int32 numSamples; 00166 int32 numInputs; 00167 int32 numOutputs; 00168 AudioBusBuffers* inputs; 00169 AudioBusBuffers* outputs; 00170 00171 IParameterChanges* inputParameterChanges; 00172 IParameterChanges* outputParameterChanges; 00173 IEventList* inputEvents; 00174 IEventList* outputEvents; 00175 ProcessContext* processContext; 00176 //------------------------------------------------------------------------ 00177 }; 00178 00179 //------------------------------------------------------------------------ 00180 // IAudioProcessor Interface 00181 //------------------------------------------------------------------------ 00187 class IAudioProcessor: public FUnknown 00188 { 00189 public: 00190 //------------------------------------------------------------------------ 00191 //** Try to set (from host) a predefined arrangement for inputs and outputs. */ 00192 virtual tresult PLUGIN_API setBusArrangements (SpeakerArrangement* inputs, int32 numIns, 00193 SpeakerArrangement* outputs, int32 numOuts) = 0; 00194 00195 //** Gets the bus arrangement for a given direction (input/output) and index. */ 00196 virtual tresult PLUGIN_API getBusArrangement (BusDirection dir, int32 index, SpeakerArrangement& arr) = 0; 00197 00198 //** Ask if a given samplesize is supported (@see ProcessSampleSize). */ 00199 virtual tresult PLUGIN_API canProcessSampleSize (int32 symbolicSampleSize) = 0; 00200 00201 //** Gets the current Latency in samples. */ 00202 virtual uint32 PLUGIN_API getLatencySamples () = 0; 00203 00204 //** Called in disable state (not active) before processing will begin. */ 00205 virtual tresult PLUGIN_API setupProcessing (ProcessSetup& setup) = 0; 00206 00208 virtual tresult PLUGIN_API setProcessing (TBool state) = 0; 00209 00210 //** The Process call, where all information (parameter changes, event, audio buffer) are passed. */ 00211 virtual tresult PLUGIN_API process (ProcessData& data) = 0; 00212 00213 //** Gets tail size in samples (for example the reverb time of a reverb Plug-In). */ 00214 virtual uint32 PLUGIN_API getTailSamples () = 0; 00215 00216 //------------------------------------------------------------------------ 00217 static const FUID iid; 00218 }; 00219 00220 DECLARE_CLASS_IID (IAudioProcessor, 0x42043F99, 0xB7DA453C, 0xA569E79D, 0x9AAEC33D) 00221 00222 //------------------------------------------------------------------------ 00223 } // namespace Vst 00224 } // namespace Steinberg 00225 00226 //------------------------------------------------------------------------ 00227 #include "pluginterfaces/base/falignpop.h" 00228 //------------------------------------------------------------------------ 00229 00230 #endif // __ivstaudioprocessor__