00001 //----------------------------------------------------------------------------- 00002 // Project : VST SDK 00003 // Version : 3.0 00004 // 00005 // Category : Helpers 00006 // Filename : vstcomponentbase.h 00007 // Created by : Steinberg, 05/2005 00008 // Modified : $Date: 2008/01/09 12:51:07 $ 00009 // Description : Base class for Component and Edit Controller 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 __vstcomponentbase__ 00037 #define __vstcomponentbase__ 00038 00039 #include "pluginterfaces/base/ipluginbase.h" 00040 #include "pluginterfaces/vst/ivstmessage.h" 00041 #include "pluginterfaces/vst/ivsthostapplication.h" 00042 00043 //------------------------------------------------------------------------ 00044 namespace Steinberg { 00045 namespace Vst { 00046 00047 //------------------------------------------------------------------------ 00048 // ComponentBase 00049 //------------------------------------------------------------------------ 00051 class ComponentBase: public IPluginBase, 00052 public IConnectionPoint 00053 { 00054 public: 00055 //------------------------------------------------------------------------ 00056 ComponentBase (); 00057 virtual ~ComponentBase (); 00058 00059 //--- Internal Methods------ 00061 FUnknown* getHostContext () { return hostContext; } 00062 00064 IConnectionPoint* getPeer () { return peerConnection; } 00065 00067 IMessage* allocateMessage (); 00069 tresult sendMessage (IMessage* message); 00071 tresult sendTextMessage (const char* text); 00073 virtual tresult receiveText (const char* text); 00074 00075 //---from FUnknown------ 00076 DECLARE_FUNKNOWN_METHODS 00077 00078 //---from IPluginBase------ 00079 tresult PLUGIN_API initialize (FUnknown* context); 00080 tresult PLUGIN_API terminate (); 00081 00082 //---from IConnectionPoint----------- 00083 tresult PLUGIN_API connect (IConnectionPoint* other); 00084 tresult PLUGIN_API disconnect (IConnectionPoint* other); 00085 tresult PLUGIN_API notify (IMessage* message); 00086 //------------------------------------------------------------------------ 00087 protected: 00088 FUnknown* hostContext; 00089 IConnectionPoint* peerConnection; 00090 }; 00091 00092 //------------------------------------------------------------------------ 00093 } // namespace Vst 00094 } // namespace Steinberg 00095 00096 #endif // __vstcomponentbase__