00001 //------------------------------------------------------------------------ 00002 // Project : VST SDK 00003 // Version : 3.0 00004 // 00005 // Category : Interfaces 00006 // Filename : ivstevents.h 00007 // Created by : Steinberg, 11/2005 00008 // Modified : $Date: 2008/01/09 12:51:44 $ 00009 // Description : VST Events (Midi) 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 __ivstevents__ 00037 #define __ivstevents__ 00038 00039 #include "pluginterfaces/vst/ivstprocesscontext.h" 00040 00041 //------------------------------------------------------------------------ 00042 #include "pluginterfaces/base/falignpush.h" 00043 //------------------------------------------------------------------------ 00044 00045 //------------------------------------------------------------------------ 00046 namespace Steinberg { 00047 namespace Vst { 00048 00049 //------------------------------------------------------------------------ 00051 //------------------------------------------------------------------------ 00052 struct Event 00053 { 00054 //------------------------------------------------------------------------ 00055 int32 busIndex; 00056 int32 sampleOffset; 00057 TQuarterNotes ppqPosition; 00058 uint16 flags; 00059 00061 enum EventFlags 00062 { 00063 kIsLive = 1 << 0 00064 }; 00065 00067 enum EventTypes 00068 { 00069 kNoteOnEvent = 0, 00070 kNoteOffEvent, 00071 kDataEvent 00072 }; 00073 00074 uint16 type; 00075 union 00076 { 00077 //---------------------------------------- 00078 //---------------------------------------- 00080 struct 00081 { 00082 int16 channel; 00083 int16 pitch; 00084 float tuning; 00085 float velocity; 00086 int32 length; 00087 int32 noteId; 00088 } noteOn; 00089 //---------------------------------------- 00090 00091 //---------------------------------------- 00092 //---------------------------------------- 00094 struct 00095 { 00096 int16 channel; 00097 int16 pitch; 00098 float velocity; 00099 int32 noteId; 00100 } noteOff; 00101 //---------------------------------------- 00102 00103 //---------------------------------------- 00104 //---------------------------------------- 00106 struct 00107 { 00108 uint32 size; 00109 uint32 type; 00110 const uint8* bytes; 00111 } data; 00112 }; 00113 00115 enum DataTypes 00116 { 00117 kMidiSysEx = 0 00118 }; 00119 //---------------------------------------- 00120 00121 //------------------------------------------------------------------------ 00122 }; 00123 00124 00125 //------------------------------------------------------------------------ 00126 // IEventList Interface 00127 //------------------------------------------------------------------------ 00128 class IEventList: public FUnknown 00129 { 00130 public: 00131 //------------------------------------------------------------------------ 00133 virtual int32 PLUGIN_API getEventCount () = 0; 00134 00136 virtual tresult PLUGIN_API getEvent (int32 index, Event& e /*out*/) = 0; 00137 00139 virtual tresult PLUGIN_API addEvent (Event& e /*in*/) = 0; 00140 00141 //------------------------------------------------------------------------ 00142 static const FUID iid; 00143 }; 00144 00145 DECLARE_CLASS_IID (IEventList, 0x3A2C4214, 0x346349FE, 0xB2C4F397, 0xB9695A44) 00146 00147 //------------------------------------------------------------------------ 00148 } // namespace Vst 00149 } // namespace Steinberg 00150 00151 //------------------------------------------------------------------------ 00152 #include "pluginterfaces/base/falignpop.h" 00153 //------------------------------------------------------------------------ 00154 00155 #endif // __ivstevents__