00001 //------------------------------------------------------------------------ 00002 // Project : VST SDK 00003 // Version : 3.0 00004 // 00005 // Category : Interfaces 00006 // Filename : ivstunits.h 00007 // Created by : Steinberg, 2005 00008 // Modified : $Date: 2008/01/15 13:47:31 $ 00009 // Description : VST Units 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 __ivstunits__ 00037 #define __ivstunits__ 00038 00039 #include "pluginterfaces/base/funknown.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 00053 #define kRootUnitId 0 00054 #define kNoParentUnitId -1 00055 #define kNoProgramListId -1 00056 00057 //------------------------------------------------------------------------ 00059 //------------------------------------------------------------------------ 00060 struct UnitInfo 00061 { 00062 UnitID id; 00063 UnitID parentUnitId; 00064 String128 name; 00065 ProgramListID programListId; 00066 }; 00067 00068 //------------------------------------------------------------------------ 00070 //------------------------------------------------------------------------ 00071 struct ProgramListInfo 00072 { 00073 ProgramListID id; 00074 String128 name; 00075 int32 programCount; 00076 }; 00077 00078 00079 //------------------------------------------------------------------------ 00080 // IUnitHandler Interface 00081 //------------------------------------------------------------------------ 00082 00084 #define kAllProgramInvalid -1 00085 00086 00093 class IUnitHandler: public FUnknown 00094 { 00095 public: 00096 //------------------------------------------------------------------------ 00098 virtual tresult PLUGIN_API notifyUnitSelection (UnitID unitId) = 0; 00099 00102 virtual tresult PLUGIN_API notifyProgramListChange (ProgramListID listId, int32 programIndex) = 0; 00103 00104 //------------------------------------------------------------------------ 00105 static const FUID iid; 00106 }; 00107 00108 DECLARE_CLASS_IID (IUnitHandler, 0x4B5147F8, 0x4654486B, 0x8DAB30BA, 0x163A3C56) 00109 00110 00111 //------------------------------------------------------------------------ 00112 // IUnitInfo Interface 00113 //------------------------------------------------------------------------ 00125 class IUnitInfo: public FUnknown 00126 { 00127 public: 00128 //------------------------------------------------------------------------ 00130 virtual int32 PLUGIN_API getUnitCount () = 0; 00131 00133 virtual tresult PLUGIN_API getUnitInfo (int32 unitIndex, UnitInfo& info /*out*/) = 0; 00134 00137 virtual int32 PLUGIN_API getProgramListCount () = 0; 00138 00140 virtual tresult PLUGIN_API getProgramListInfo (int32 listIndex, ProgramListInfo& info /*out*/) = 0; 00141 00143 virtual tresult PLUGIN_API getProgramName (ProgramListID listId, int32 programIndex, String128 name /*out*/) = 0; 00144 00146 virtual tresult PLUGIN_API getProgramInfo (ProgramListID listId, int32 programIndex, 00147 CString attributeId /*in*/, String128 attributeValue /*out*/) = 0; 00148 00150 virtual tresult PLUGIN_API hasProgramPitchNames (ProgramListID listId, int32 programIndex) = 0; 00151 00153 virtual tresult PLUGIN_API getProgramPitchName (ProgramListID listId, int32 programIndex, 00154 int16 midiPitch, String128 name /*out*/) = 0; 00155 00156 // units selection -------------------- 00158 virtual UnitID PLUGIN_API getSelectedUnit () = 0; 00159 00161 virtual tresult PLUGIN_API selectUnit (UnitID unitId) = 0; 00162 00164 virtual tresult PLUGIN_API getUnitByBus (MediaType type, BusDirection dir, int32 busIndex, 00165 int32 channel, UnitID& unitId /*out*/) = 0; 00166 00168 virtual tresult PLUGIN_API setUnitProgramData (ProgramListID listId, int32 programIndex, IBStream* data) = 0; 00169 00170 //------------------------------------------------------------------------ 00171 static const FUID iid; 00172 }; 00173 00174 DECLARE_CLASS_IID (IUnitInfo, 0x3D4BD6B5, 0x913A4FD2, 0xA886E768, 0xA5EB92C1) 00175 00176 00177 //------------------------------------------------------------------------ 00178 // IUnitData Interface 00179 //------------------------------------------------------------------------ 00184 class IUnitData: public FUnknown 00185 { 00186 public: 00187 //------------------------------------------------------------------------ 00189 virtual tresult PLUGIN_API programDataSupported (ProgramListID listId) = 0; 00190 00192 virtual tresult PLUGIN_API getProgramData (ProgramListID listId, int32 programIndex, IBStream* data) = 0; 00193 00195 virtual tresult PLUGIN_API setProgramData (ProgramListID listId, int32 programIndex, IBStream* data) = 0; 00196 00197 //------------------------------------------------------------------------ 00198 static const FUID iid; 00199 }; 00200 00201 DECLARE_CLASS_IID (IUnitData, 0x8683B01F, 0x7B354F70, 0xA2651DEC, 0x353AF4FF) 00202 00203 //------------------------------------------------------------------------ 00204 } // namespace Vst 00205 } // namespace Steinberg 00206 00207 //------------------------------------------------------------------------ 00208 #include "pluginterfaces/base/falignpop.h" 00209 //------------------------------------------------------------------------ 00210 00211 #endif // __ivstunits__