ivstcomponent.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Project     : VST SDK
00003 // Version     : 3.0
00004 //
00005 // Category    : Interfaces
00006 // Filename    : ivstcomponent.h
00007 // Created by  : Steinberg, 04/2005
00008 // Modified    : $Date: 2008/01/15 11:28:20 $
00009 // Description : Basic VST 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 __ivstcomponent__
00037 #define __ivstcomponent__
00038 
00039 #include "pluginterfaces/base/ipluginbase.h"
00040 #include "vsttypes.h"
00041 
00042 //------------------------------------------------------------------------
00043 #include "pluginterfaces/base/falignpush.h"
00044 //------------------------------------------------------------------------
00045 
00046 namespace Steinberg {
00047 class IBStream;
00048 
00049 //------------------------------------------------------------------------
00050 namespace Vst {
00051 
00052 const int32 kDefaultFactoryFlags = PFactoryInfo::kUnicode; 
00053 
00054 #define BEGIN_FACTORY_DEF(vendor,url,email) using namespace Steinberg; \
00055         EXPORT_FACTORY IPluginFactory* PLUGIN_API GetPluginFactory () { \
00056         if (!gPluginFactory) \
00057         {       static PFactoryInfo factoryInfo = { vendor,url,email,Vst::kDefaultFactoryFlags }; \
00058                 gPluginFactory = new CPluginFactory (factoryInfo);
00059 
00060 //------------------------------------------------------------------------
00062 //------------------------------------------------------------------------
00063 enum MediaTypes
00064 {
00065 //------------------------------------------------------------------------
00066         kAudio = 0,             
00067         kEvent,                 
00068         kNumMediaTypes
00069 //------------------------------------------------------------------------
00070 };
00071 
00072 //------------------------------------------------------------------------
00074 //------------------------------------------------------------------------
00075 enum BusDirections
00076 {
00077 //------------------------------------------------------------------------
00078         kInput = 0,             
00079         kOutput                 
00080 //------------------------------------------------------------------------
00081 };
00082 
00083 //------------------------------------------------------------------------
00085 //------------------------------------------------------------------------
00086 enum BusTypes
00087 {
00088 //------------------------------------------------------------------------
00089         kMain = 0,              
00090         kAux                    
00091 //------------------------------------------------------------------------
00092 };
00093 
00094 //------------------------------------------------------------------------
00096 //------------------------------------------------------------------------
00097 enum IoModes
00098 {
00099         kSimple = 0,    
00100         kAdvanced               
00101 };
00102 
00103 //------------------------------------------------------------------------
00105 //------------------------------------------------------------------------
00106 struct BusInfo
00107 {
00108 //------------------------------------------------------------------------
00109         MediaType mediaType;            
00110         BusDirection direction;         
00111         int32 channelCount;                     
00112         String128 name;                         
00113         BusType busType;                        
00114         uint32 flags;                           
00115         enum BusFlags 
00116         {
00117                 kDefaultActive = 1<<0   
00118         };              
00119 //------------------------------------------------------------------------
00120 };
00121 
00122 //------------------------------------------------------------------------
00124 //------------------------------------------------------------------------
00125 struct RoutingInfo
00126 {
00127         MediaType mediaType;    
00128         int32 busIndex;                 
00129         int32 channel;                  
00130 };
00131 
00132 //------------------------------------------------------------------------
00133 // IComponent Interface
00134 //------------------------------------------------------------------------
00139 class IComponent: public IPluginBase
00140 {
00141 public:
00142 //------------------------------------------------------------------------      
00144         virtual tresult PLUGIN_API getControllerClassId (TUID classId) = 0;
00145         
00147         virtual tresult PLUGIN_API setIoMode (IoMode mode) = 0;
00148 
00150         virtual int32 PLUGIN_API getBusCount (MediaType type, BusDirection dir) = 0;
00151 
00153         virtual tresult PLUGIN_API getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& bus /*out*/) = 0;
00154 
00156         virtual tresult PLUGIN_API getRoutingInfo (RoutingInfo& inInfo, RoutingInfo& outInfo /*out*/) = 0;
00157 
00159         virtual tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, int32 index, TBool state) = 0;
00160 
00162         virtual tresult PLUGIN_API setActive (TBool state) = 0;
00163 
00165         virtual tresult PLUGIN_API setState (IBStream* state) = 0;
00166 
00168         virtual tresult PLUGIN_API getState (IBStream* state) = 0;
00169 
00170 //------------------------------------------------------------------------
00171         static const FUID iid;
00172 };
00173 
00174 DECLARE_CLASS_IID (IComponent, 0xE831FF31, 0xF2D54301, 0x928EBBEE, 0x25697802)
00175 
00176 //------------------------------------------------------------------------
00177 } // namespace Vst
00178 } // namespace Steinberg
00179 
00180 //------------------------------------------------------------------------
00181 #include "pluginterfaces/base/falignpop.h"
00182 //------------------------------------------------------------------------
00183 
00184 #endif // __ivstcomponent__
Empty

Copyright ©2008 Steinberg Media Technologies. All Rights Reserved.