00001 //------------------------------------------------------------------------ 00002 // Project : VST SDK 00003 // Version : 3.0 00004 // 00005 // Category : Examples 00006 // Filename : again.h 00007 // Created by : Steinberg, 04/2005 00008 // Modified : $Date: 2008/01/09 12:51:05 $ 00009 // Description : AGain Example for VST SDK 3.0 00010 // Simple gain plugin with gain, bypass values and 1 midi input 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 __again__ 00037 #define __again__ 00038 00039 #include "public.sdk/source/vst/vstaudioeffect.h" 00040 00041 using namespace Steinberg::Vst; 00042 00043 //------------------------------------------------------------------------ 00044 // define the UIDs for the component and the controller. 00045 // Note: be sure that you generate unique ID, you can use Create GUID from Visual Studio 00046 #define gComponentUID1 0x84e8de5f 00047 #define gComponentUID2 0x92554f53 00048 #define gComponentUID3 0x96fae413 00049 #define gComponentUID4 0x3c935a18 00050 #define gComponentUID gComponentUID1, gComponentUID2, gComponentUID3, gComponentUID4 00051 00052 #define gControllerUID1 0xD39D5B65 00053 #define gControllerUID2 0xD7AF42FA 00054 #define gControllerUID3 0x843F4AC8 00055 #define gControllerUID4 0x41EB04F0 00056 #define gControllerUID gControllerUID1, gControllerUID2, gControllerUID3, gControllerUID4 00057 00058 //------------------------------------------------------------------------ 00059 // AGain: directly derived from the helper class AudioEffect 00060 //------------------------------------------------------------------------ 00061 class AGain: public AudioEffect 00062 { 00063 public: 00064 AGain (); 00065 //------------------------------------------------------------------------ 00066 // create function required for plugin factory, 00067 // it will be called to create new instances of this plugin 00068 //------------------------------------------------------------------------ 00069 static FUnknown* createInstance (void* context) 00070 { 00071 return (IAudioProcessor*)new AGain; 00072 } 00073 00074 //------------------------------------------------------------------------ 00075 // AudioEffect overrides: 00076 //------------------------------------------------------------------------ 00078 tresult PLUGIN_API initialize (FUnknown* context); 00079 00081 tresult PLUGIN_API terminate (); 00082 00084 tresult PLUGIN_API setActive (TBool state); 00085 00087 tresult PLUGIN_API process (ProcessData& data); 00088 00090 tresult receiveText (const char* text); 00091 00093 tresult PLUGIN_API setState (IBStream* state); 00094 tresult PLUGIN_API getState (IBStream* state); 00095 00097 tresult PLUGIN_API setupProcessing (ProcessSetup& newSetup); 00098 00100 tresult PLUGIN_API setBusArrangements (SpeakerArrangement* inputs, int32 numIns, SpeakerArrangement* outputs, int32 numOuts); 00101 00102 //------------------------------------------------------------------------ 00103 private: 00104 // our model values 00105 float fGain; 00106 float fGainReduction; 00107 float fVuPPMOld; 00108 00109 int32 currentProcessMode; 00110 00111 bool bHalfGain; 00112 bool bBypass; 00113 }; 00114 00115 #endif //__again__