vstcomponent.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Project     : VST SDK
00003 // Version     : 3.0
00004 //
00005 // Category    : Helpers
00006 // Filename    : vstcomponent.h
00007 // Created by  : Steinberg, 04/2005
00008 // Modified    : $Date: 2008/01/09 12:51:06 $
00009 // Description : Basic VST Plug-In Implementation
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 __vstcomponent__
00037 #define __vstcomponent__
00038 
00039 #include "public.sdk/source/vst/vstcomponentbase.h"
00040 #include "public.sdk/source/common/linkedlist.h"
00041 #include "pluginterfaces/vst/ivstcomponent.h"
00042 
00043 //------------------------------------------------------------------------
00044 namespace Steinberg {
00045 namespace Vst {
00046 
00047 //------------------------------------------------------------------------
00048 // Bus
00049 //------------------------------------------------------------------------
00051 class Bus: public CListElement
00052 {
00053 public:
00054 //------------------------------------------------------------------------
00056         Bus (const TChar* name, BusType busType, int32 flags);
00057         
00059         TBool isActive () const { return active; }
00060         
00062         void setActive (TBool state) { active = state; }
00063         
00065         virtual bool getInfo (BusInfo&);
00066 
00067 //------------------------------------------------------------------------
00068 protected:
00069         Steinberg::UString128 name;     
00070         BusType busType;                        
00071         int32 flags;                            
00072         TBool active;                           
00073 };
00074 
00075 //------------------------------------------------------------------------
00076 // EventBus
00077 //------------------------------------------------------------------------
00079 class EventBus: public Bus
00080 {
00081 public:
00082 //------------------------------------------------------------------------
00084         EventBus (const TChar* name, BusType busType, int32 flags, int32 channelCount);
00085 
00086         //---from Bus-------
00088         virtual bool getInfo (BusInfo& info);
00089 
00090 //------------------------------------------------------------------------
00091 protected:
00092         int32 channelCount;
00093 };
00094 
00095 //------------------------------------------------------------------------
00096 // BusList
00097 //------------------------------------------------------------------------
00099 class BusList: public CLinkedList
00100 {
00101 public:
00102 //------------------------------------------------------------------------
00104         BusList (MediaType type, BusDirection dir);
00105 
00107         MediaType getType () const { return type; }
00108 
00110         BusDirection getDirection () const { return direction; }
00111 
00112 //------------------------------------------------------------------------
00113 protected:
00114         MediaType type;
00115         BusDirection direction;
00116 };
00117 
00118 //------------------------------------------------------------------------
00119 // Component
00120 //------------------------------------------------------------------------
00122 class Component: public ComponentBase,
00123                                  public IComponent
00124 {
00125 public:
00126 //------------------------------------------------------------------------
00128         Component ();
00129 
00130         //---Internal Methods-------
00132         void setControllerClass (const FUID& cid) { controllerClass = cid; }
00133 
00135         tresult removeAudioBusses ();
00136 
00138         tresult removeEventBusses ();
00139 
00140         //---from IComponent--------
00141         tresult PLUGIN_API getControllerClassId (TUID classID);
00142         tresult PLUGIN_API setIoMode (IoMode mode);
00143         int32 PLUGIN_API getBusCount (MediaType type, BusDirection dir);
00144         tresult PLUGIN_API getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& info);
00145         tresult PLUGIN_API getRoutingInfo (RoutingInfo& inInfo, RoutingInfo& outInfo);
00146         tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, int32 index, TBool state);
00147         tresult PLUGIN_API setActive (TBool state);
00148         tresult PLUGIN_API setState (IBStream* state);
00149         tresult PLUGIN_API getState (IBStream* state);
00150 
00151         //---from ComponentBase------
00152         DELEGATE_REFCOUNT (ComponentBase)
00153         tresult PLUGIN_API queryInterface (const char* iid, void** obj);
00154         tresult PLUGIN_API initialize (FUnknown* context);
00155         tresult PLUGIN_API terminate ();
00156 
00157 //------------------------------------------------------------------------
00158 protected:
00159         FUID controllerClass;
00160         BusList audioInputs;
00161         BusList audioOutputs;
00162         BusList eventInputs;
00163         BusList eventOutputs;
00164 
00165         BusList* getBusList (MediaType type, BusDirection dir);
00166         tresult removeAllBusses ();
00167 };
00168 
00169 //------------------------------------------------------------------------
00170 } // namespace Vst
00171 } // namespace Steinberg
00172 
00173 #endif  // __vstcomponent__
Empty

Copyright ©2008 Steinberg Media Technologies. All Rights Reserved.