2 * Carla Bridge definitions
3 * Copyright (C) 2013-2023 Filipe Coelho <falktx@falktx.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #ifndef CARLA_BRIDGE_DEFINES_HPP_INCLUDED
19 #define CARLA_BRIDGE_DEFINES_HPP_INCLUDED
21 #include "CarlaDefines.h"
23 // how much backwards compatible we are
24 #define CARLA_PLUGIN_BRIDGE_API_VERSION_MINIMUM 6
26 // current API version, bumped when something is added
27 #define CARLA_PLUGIN_BRIDGE_API_VERSION_CURRENT 10
29 // -------------------------------------------------------------------------------------------------------------------
31 #ifdef CARLA_PROPER_CPP11_SUPPORT
37 // -------------------------------------------------------------------------------------------------------------------
39 // Server sends these to client during RT
40 enum PluginBridgeRtClientOpcode
{
41 kPluginBridgeRtClientNull
= 0,
42 kPluginBridgeRtClientSetAudioPool
, // ulong/ptr
43 kPluginBridgeRtClientSetBufferSize
, // uint
44 kPluginBridgeRtClientSetSampleRate
, // double
45 kPluginBridgeRtClientSetOnline
, // bool
46 kPluginBridgeRtClientControlEventParameter
, // uint/frame, byte/chan, ushort, float
47 kPluginBridgeRtClientControlEventMidiBank
, // uint/frame, byte/chan, ushort
48 kPluginBridgeRtClientControlEventMidiProgram
, // uint/frame, byte/chan, ushort
49 kPluginBridgeRtClientControlEventAllSoundOff
, // uint/frame, byte/chan
50 kPluginBridgeRtClientControlEventAllNotesOff
, // uint/frame, byte/chan
51 kPluginBridgeRtClientMidiEvent
, // uint/frame, byte/port, byte/size, byte[]/data
52 kPluginBridgeRtClientProcess
, // uint/frames
53 kPluginBridgeRtClientQuit
56 // Server sends these to client during non-RT
57 enum PluginBridgeNonRtClientOpcode
{
58 kPluginBridgeNonRtClientNull
= 0,
59 kPluginBridgeNonRtClientVersion
, // uint
60 kPluginBridgeNonRtClientPing
,
61 kPluginBridgeNonRtClientPingOnOff
, // bool
62 kPluginBridgeNonRtClientActivate
,
63 kPluginBridgeNonRtClientDeactivate
,
64 kPluginBridgeNonRtClientInitialSetup
, // uint, double
65 kPluginBridgeNonRtClientSetParameterValue
, // uint, float
66 kPluginBridgeNonRtClientSetParameterMidiChannel
, // uint, byte
67 kPluginBridgeNonRtClientSetParameterMappedControlIndex
, // uint, short
68 kPluginBridgeNonRtClientSetProgram
, // int
69 kPluginBridgeNonRtClientSetMidiProgram
, // int
70 kPluginBridgeNonRtClientSetCustomData
, // uint/size, str[], uint/size, str[], uint/size, str[]
71 kPluginBridgeNonRtClientSetChunkDataFile
, // uint/size, str[] (filename, base64 content)
72 kPluginBridgeNonRtClientSetCtrlChannel
, // short
73 kPluginBridgeNonRtClientSetOption
, // uint/option, bool
74 kPluginBridgeNonRtClientGetParameterText
, // uint
75 kPluginBridgeNonRtClientPrepareForSave
,
76 kPluginBridgeNonRtClientRestoreLV2State
,
77 kPluginBridgeNonRtClientShowUI
,
78 kPluginBridgeNonRtClientHideUI
,
79 kPluginBridgeNonRtClientUiParameterChange
, // uint, float
80 kPluginBridgeNonRtClientUiProgramChange
, // uint
81 kPluginBridgeNonRtClientUiMidiProgramChange
, // uint
82 kPluginBridgeNonRtClientUiNoteOn
, // byte, byte, byte
83 kPluginBridgeNonRtClientUiNoteOff
, // byte, byte
84 kPluginBridgeNonRtClientQuit
,
85 // stuff added in API 7
86 kPluginBridgeNonRtClientSetParameterMappedRange
, // uint, float, float
87 kPluginBridgeNonRtClientSetOptions
, // uint
88 // stuff added in API 8
89 kPluginBridgeNonRtClientSetWindowTitle
, // uint/size, str[]
90 // stuff added in API 9
91 kPluginBridgeNonRtClientEmbedUI
, // ulong
92 // stuff added in API 10
93 kPluginBridgeNonRtClientReload
,
96 // Client sends these to server during non-RT
97 enum PluginBridgeNonRtServerOpcode
{
98 kPluginBridgeNonRtServerNull
= 0,
99 kPluginBridgeNonRtServerPong
,
100 kPluginBridgeNonRtServerPluginInfo1
, // uint/category, uint/hints, uint/optionsAvailable, uint/optionsEnabled, long/uniqueId
101 kPluginBridgeNonRtServerPluginInfo2
, // uint/size, str[] (realName), uint/size, str[] (label), uint/size, str[] (maker), uint/size, str[] (copyright)
102 kPluginBridgeNonRtServerAudioCount
, // uint/ins, uint/outs
103 kPluginBridgeNonRtServerMidiCount
, // uint/ins, uint/outs
104 kPluginBridgeNonRtServerCvCount
, // uint/ins, uint/outs
105 kPluginBridgeNonRtServerParameterCount
, // uint/count
106 kPluginBridgeNonRtServerProgramCount
, // uint/count
107 kPluginBridgeNonRtServerMidiProgramCount
, // uint/count
108 kPluginBridgeNonRtServerPortName
, // byte/type, uint/index, uint/size, str[] (name)
109 kPluginBridgeNonRtServerParameterData1
, // uint/index, int/rindex, uint/type, uint/hints, short/cc
110 kPluginBridgeNonRtServerParameterData2
, // uint/index, uint/size, str[] (name), uint/size, str[] (symbol), uint/size, str[] (unit)
111 kPluginBridgeNonRtServerParameterRanges
, // uint/index, float/def, float/min, float/max, float/step, float/stepSmall, float/stepLarge
112 kPluginBridgeNonRtServerParameterValue
, // uint/index, float/value
113 kPluginBridgeNonRtServerParameterValue2
, // uint/index, float/value (used for init/output parameters only, don't resend values)
114 kPluginBridgeNonRtServerParameterTouch
, // uint/index, bool/touch
115 kPluginBridgeNonRtServerDefaultValue
, // uint/index, float/value
116 kPluginBridgeNonRtServerCurrentProgram
, // int/index
117 kPluginBridgeNonRtServerCurrentMidiProgram
, // int/index
118 kPluginBridgeNonRtServerProgramName
, // uint/index, uint/size, str[] (name)
119 kPluginBridgeNonRtServerMidiProgramData
, // uint/index, uint/bank, uint/program, uint/size, str[] (name)
120 kPluginBridgeNonRtServerSetCustomData
, // uint/size, str[], uint/size, str[], uint/size, str[]
121 kPluginBridgeNonRtServerSetChunkDataFile
, // uint/size, str[] (filename, base64 content)
122 kPluginBridgeNonRtServerSetLatency
, // uint/latency
123 kPluginBridgeNonRtServerSetParameterText
, // uint/index, uint/size, str[] (name)
124 kPluginBridgeNonRtServerReady
,
125 kPluginBridgeNonRtServerSaved
,
126 kPluginBridgeNonRtServerUiClosed
,
127 kPluginBridgeNonRtServerError
, // uint/size, str[]
128 // stuff added in API 7
129 kPluginBridgeNonRtServerVersion
, // uint/version
130 // stuff added in API 9
131 kPluginBridgeNonRtServerRespEmbedUI
, // ulong/window-id
132 kPluginBridgeNonRtServerResizeEmbedUI
, // uint/width, uint/height
135 // used for kPluginBridgeNonRtServerPortName
136 enum PluginBridgePortType
{
137 kPluginBridgePortNull
= 0,
138 kPluginBridgePortAudioInput
,
139 kPluginBridgePortAudioOutput
,
140 kPluginBridgePortCvInput
,
141 kPluginBridgePortCvOutput
,
142 kPluginBridgePortMidiInput
,
143 kPluginBridgePortMidiOutput
,
144 kPluginBridgePortTypeCount
147 enum PluginBridgeTimeInfoFlags
{
148 kPluginBridgeTimeInfoValidBBT
= 0x1
151 // -------------------------------------------------------------------------------------------------------------------
153 struct BridgeSemaphore
{
164 // NOTE: needs to be 64bit aligned
165 struct BridgeTimeInfo
{
173 float beatsPerBar
, beatType
;
174 double tick
, barStartTick
, ticksPerBeat
, beatsPerMinute
;
177 // -------------------------------------------------------------------------------------------------------------------
179 #endif // CARLA_BRIDGE_DEFINES_HPP_INCLUDED