1 /*
2  * Copyright (c) 2017 Derelict Developers
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  *   notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  *   notice, this list of conditions and the following disclaimer in the
14  *   documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the names 'Derelict', 'DerelictFmod', nor the names of its contributors
17  *   may be used to endorse or promote products derived from this software
18  *   without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 module derelict.fmodstudio.common;
33 
34 import derelict.util.system;
35 
36 import derelict.fmod.common;
37 
38 align(1):
39 
40 /*
41 	FMOD Studio types.
42 */
43 
44 struct FMOD_STUDIO_SYSTEM {}
45 struct FMOD_STUDIO_EVENTDESCRIPTION {}
46 struct FMOD_STUDIO_EVENTINSTANCE {}
47 struct FMOD_STUDIO_CUEINSTANCE {}
48 struct FMOD_STUDIO_PARAMETERINSTANCE {}
49 struct FMOD_STUDIO_BUS {}
50 struct FMOD_STUDIO_VCA {}
51 struct FMOD_STUDIO_BANK {}
52 struct FMOD_STUDIO_COMMANDREPLAY {}
53 
54 static immutable FMOD_STUDIO_INIT_NORMAL                     = 0x00000000;  /* Initialize normally. */
55 static immutable FMOD_STUDIO_INIT_LIVEUPDATE                 = 0x00000001;  /* Enable live update. */
56 static immutable FMOD_STUDIO_INIT_ALLOW_MISSING_PLUGINS      = 0x00000002;  /* Load banks even if they reference plugins that have not been loaded. */
57 static immutable FMOD_STUDIO_INIT_SYNCHRONOUS_UPDATE         = 0x00000004;  /* Disable asynchronous processing and perform all processing on the calling thread instead. */
58 static immutable FMOD_STUDIO_INIT_DEFERRED_CALLBACKS         = 0x00000008;  /* Defer timeline callbacks until the main update. See Studio::EventInstance::setCallback for more information. */
59 static immutable FMOD_STUDIO_INIT_LOAD_FROM_UPDATE           = 0x00000010;  /* No additional threads are created for bank and resource loading.  Loading is driven from Studio::System::update.  Mainly used in non-realtime situations. */
60 
61 alias FMOD_STUDIO_INITFLAGS = uint;
62 
63 alias FMOD_STUDIO_LOADING_STATE = int;
64 enum
65 {
66 	FMOD_STUDIO_LOADING_STATE_UNLOADING,        /* Currently unloading. */
67 	FMOD_STUDIO_LOADING_STATE_UNLOADED,         /* Not loaded. */
68 	FMOD_STUDIO_LOADING_STATE_LOADING,          /* Loading in progress. */
69 	FMOD_STUDIO_LOADING_STATE_LOADED,           /* Loaded and ready to play. */
70 	FMOD_STUDIO_LOADING_STATE_ERROR,            /* Failed to load and is now in error state. */
71 	
72 	FMOD_STUDIO_LOADING_STATE_FORCEINT = 65536  /* Makes sure this enum is signed 32bit. */
73 }
74 
75 alias FMOD_STUDIO_LOAD_MEMORY_MODE = int;
76 enum
77 {
78 	FMOD_STUDIO_LOAD_MEMORY,                    /* When passed to Studio::System::loadBankMemory, FMOD duplicates the memory into its own buffers. Your buffer can be freed after Studio::System::loadBankMemory returns. */
79 	FMOD_STUDIO_LOAD_MEMORY_POINT,              /* This differs from FMOD_STUDIO_LOAD_MEMORY in that FMOD uses the memory as is, without duplicating the memory into its own buffers. Cannot not be freed after load, only after calling Studio::Bank::unload. */
80 	
81 	FMOD_STUDIO_LOAD_MEMORY_FORCEINT = 65536    /* Makes sure this enum is signed 32bit. */
82 }
83 
84 static immutable FMOD_STUDIO_LOAD_MEMORY_ALIGNMENT = 32;
85 
86 alias FMOD_STUDIO_PARAMETER_TYPE = int;
87 enum
88 {
89 	FMOD_STUDIO_PARAMETER_GAME_CONTROLLED,                  /* Controlled via the API using Studio::ParameterInstance::setValue. */
90 	FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE,               /* Distance between the event and the listener. */
91 	FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_CONE_ANGLE,       /* Angle between the event's forward vector and the vector pointing from the event to the listener (0 to 180 degrees). */
92 	FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_ORIENTATION,      /* Horizontal angle between the event's forward vector and listener's forward vector (-180 to 180 degrees). */
93 	FMOD_STUDIO_PARAMETER_AUTOMATIC_DIRECTION,              /* Horizontal angle between the listener's forward vector and the vector pointing from the listener to the event (-180 to 180 degrees). */
94 	FMOD_STUDIO_PARAMETER_AUTOMATIC_ELEVATION,              /* Angle between the listener's XZ plane and the vector pointing from the listener to the event (-90 to 90 degrees). */
95 	FMOD_STUDIO_PARAMETER_AUTOMATIC_LISTENER_ORIENTATION,   /* Horizontal angle between the listener's forward vector and the global positive Z axis (-180 to 180 degrees). */
96 	
97 	FMOD_STUDIO_PARAMETER_MAX,                              /* Maximum number of parameter types supported. */
98 	FMOD_STUDIO_PARAMETER_FORCEINT = 65536                  /* Makes sure this enum is signed 32bit */
99 }
100 
101 struct FMOD_STUDIO_BANK_INFO
102 {
103 	int   size;                                 /* The size of this struct (for binary compatibility) */
104 	void *userData;                             /* User data to be passed to the file callbacks */
105 	int   userDataLength;                       /* If this is non-zero, userData will be copied internally */
106 	FMOD_FILE_OPEN_CALLBACK  openCallback;      /* Callback for opening this file. */
107 	FMOD_FILE_CLOSE_CALLBACK closeCallback;     /* Callback for closing this file. */
108 	FMOD_FILE_READ_CALLBACK  readCallback;      /* Callback for reading from this file. */
109 	FMOD_FILE_SEEK_CALLBACK  seekCallback;      /* Callback for seeking within this file. */
110 }
111 
112 struct FMOD_STUDIO_PARAMETER_DESCRIPTION
113 {
114 	const(char)* name;                           /* Name of the parameter. */
115 	int index;                                  /* Index of parameter */
116 	float minimum;                              /* Minimum parameter value. */
117 	float maximum;                              /* Maximum parameter value. */
118 	float defaultValue;                         /* Default value */
119 	FMOD_STUDIO_PARAMETER_TYPE type;            /* Type of the parameter */
120 }
121 
122 alias FMOD_STUDIO_USER_PROPERTY_TYPE = int;
123 enum
124 {
125 	FMOD_STUDIO_USER_PROPERTY_TYPE_INTEGER,         /* Integer property */
126 	FMOD_STUDIO_USER_PROPERTY_TYPE_BOOLEAN,         /* Boolean property */
127 	FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT,           /* Float property */
128 	FMOD_STUDIO_USER_PROPERTY_TYPE_STRING,          /* String property */
129 	
130 	FMOD_STUDIO_USER_PROPERTY_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
131 }
132 
133 alias FMOD_STUDIO_EVENT_PROPERTY = int;
134 enum
135 {
136 	FMOD_STUDIO_EVENT_PROPERTY_CHANNELPRIORITY,     /* Priority to set on low-level channels created by this event instance (-1 to 256). */
137 	FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY,      /* Schedule delay to synchronized playback for multiple tracks in DSP clocks, or -1 for default. */
138 	FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_LOOKAHEAD,  /* Schedule look-ahead on the timeline in DSP clocks, or -1 for default. */
139 	FMOD_STUDIO_EVENT_PROPERTY_MINIMUM_DISTANCE,    /* Override the event's 3D minimum distance, or -1 for default. */
140 	FMOD_STUDIO_EVENT_PROPERTY_MAXIMUM_DISTANCE,    /* Override the event's 3D maximum distance, or -1 for default. */
141 	FMOD_STUDIO_EVENT_PROPERTY_MAX,                 /* Maximum number of event properties supported. */
142 	
143 	FMOD_STUDIO_EVENT_PROPERTY_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
144 }
145 
146 struct FMOD_STUDIO_USER_PROPERTY
147 {
148 	const(char)* name;                           /* Name of the user property. */
149 	FMOD_STUDIO_USER_PROPERTY_TYPE type;        /* Type of the user property. Use this to select one of the following values. */
150 	
151 	union
152 	{
153 		int intvalue;                           /* Value of the user property. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_INTEGER. */
154 		FMOD_BOOL boolvalue;                    /* Value of the user property. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_BOOLEAN. */
155 		float floatvalue;                       /* Value of the user property. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT. */
156 		const(char)* stringvalue;                /* Value of the user property. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_STRING. */
157 	}
158 }
159 
160 static immutable FMOD_STUDIO_SYSTEM_CALLBACK_PREUPDATE       = 0x00000001;  /* Called at the start of the main Studio update.  For async mode this will be on its own thread. */
161 static immutable FMOD_STUDIO_SYSTEM_CALLBACK_POSTUPDATE      = 0x00000002;  /* Called at the end of the main Studio update.  For async mode this will be on its own thread. */
162 static immutable FMOD_STUDIO_SYSTEM_CALLBACK_BANK_UNLOAD     = 0x00000004;  /* Called when bank has just been unloaded, after all resources are freed. CommandData will be the bank handle.*/
163 static immutable FMOD_STUDIO_SYSTEM_CALLBACK_ALL             = 0xFFFFFFFF;  /* Pass this mask to Studio::System::setCallback to receive all callback types. */
164 
165 alias FMOD_STUDIO_SYSTEM_CALLBACK_TYPE = uint;
166 
167 static immutable FMOD_STUDIO_EVENT_CALLBACK_CREATED                  = 0x00000001;  /* Called when an instance is fully created. Parameters = unused. */
168 static immutable FMOD_STUDIO_EVENT_CALLBACK_DESTROYED                = 0x00000002;  /* Called when an instance is just about to be destroyed. Parameters = unused. */
169 static immutable FMOD_STUDIO_EVENT_CALLBACK_STARTING                 = 0x00000004;  /* Called when an instance is preparing to start. Parameters = unused. */
170 static immutable FMOD_STUDIO_EVENT_CALLBACK_STARTED                  = 0x00000008;  /* Called when an instance starts playing. Parameters = unused. */
171 static immutable FMOD_STUDIO_EVENT_CALLBACK_RESTARTED                = 0x00000010;  /* Called when an instance is restarted. Parameters = unused. */
172 static immutable FMOD_STUDIO_EVENT_CALLBACK_STOPPED                  = 0x00000020;  /* Called when an instance stops. Parameters = unused. */
173 static immutable FMOD_STUDIO_EVENT_CALLBACK_START_FAILED             = 0x00000040;  /* Called when an instance did not start, e.g. due to polyphony. Parameters = unused. */
174 static immutable FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND  = 0x00000080;  /* Called when a programmer sound needs to be created in order to play a programmer instrument. Parameters = FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES. */
175 static immutable FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND = 0x00000100;  /* Called when a programmer sound needs to be destroyed. Parameters = FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES. */
176 static immutable FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_CREATED           = 0x00000200;  /* Called when a DSP plugin instance has just been created. Parameters = FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES. */
177 static immutable FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED         = 0x00000400;  /* Called when a DSP plugin instance is about to be destroyed. Parameters = FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES. */
178 static immutable FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER          = 0x00000800;  /* Called when the timeline passes a named marker.  Parameters = FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES. */
179 static immutable FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT            = 0x00001000;  /* Called when the timeline hits a beat in a tempo section.  Parameters = FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES. */
180 static immutable FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED             = 0x00002000;  /* Called when the event plays a sound.  Parameters = FMOD::Sound. */
181 static immutable FMOD_STUDIO_EVENT_CALLBACK_SOUND_STOPPED            = 0x00004000;  /* Called when the event finishes playing a sound.  Parameters = FMOD::Sound. */
182 static immutable FMOD_STUDIO_EVENT_CALLBACK_ALL                      = 0xFFFFFFFF;  /* Pass this mask to Studio::EventDescription::setCallback or Studio::EventInstance::setCallback to receive all callback types. */
183 
184 alias FMOD_STUDIO_EVENT_CALLBACK_TYPE = uint;
185 
186 struct FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES
187 {
188 	const(char)* name;                           /* The name of the programmer instrument (set in FMOD Studio). */
189 	FMOD_SOUND *sound;                          /* The programmer-created sound. This should be filled in by the create callback, and cleaned up by the destroy callback. This can be cast to/from FMOD::Sound* type. */
190 	int subsoundindex;                          /* The index of the subsound to use, or -1 if the provided sound should be used directly. Defaults to -1. */
191 }
192 
193 struct FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES
194 {
195 	const(char)* name;                           /* The name of the plugin effect or sound (set in FMOD Studio). */
196 	FMOD_DSP *dsp;                              /* The DSP plugin instance. This can be cast to FMOD::DSP* type. */
197 }
198 
199 struct FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES
200 {
201 	const(char)* name;                           /* The marker name */
202 	int position;                               /* The position of the marker on the timeline in milliseconds. */
203 }
204 
205 struct FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES
206 {
207 	int bar;                                    /* The bar number (starting from 1). */
208 	int beat;                                   /* The beat number within the bar (starting from 1). */
209 	int position;                               /* The position of the beat on the timeline in milliseconds. */
210 	float tempo;                                /* The current tempo in beats per minute. */
211 	int timesignatureupper;                     /* The current time signature upper number (beats per bar). */
212 	int timesignaturelower;                     /* The current time signature lower number (beat unit). */
213 }
214 
215 alias FMOD_STUDIO_PLAYBACK_STATE = int;
216 enum
217 {
218 	FMOD_STUDIO_PLAYBACK_PLAYING,               /* Currently playing. */
219 	FMOD_STUDIO_PLAYBACK_SUSTAINING,            /* The timeline cursor is paused on a sustain point. */
220 	FMOD_STUDIO_PLAYBACK_STOPPED,               /* Not playing. */
221 	FMOD_STUDIO_PLAYBACK_STARTING,              /* Start has been called but the instance is not fully started yet. */
222 	FMOD_STUDIO_PLAYBACK_STOPPING,              /* Stop has been called but the instance is not fully stopped yet. */
223 	
224 	FMOD_STUDIO_PLAYBACK_FORCEINT = 65536       /* Makes sure this enum is signed 32bit. */
225 }
226 
227 alias FMOD_STUDIO_STOP_MODE = int;
228 enum
229 {
230 	FMOD_STUDIO_STOP_ALLOWFADEOUT,              /* Allows AHDSR modulators to complete their release, and DSP effect tails to play out. */
231 	FMOD_STUDIO_STOP_IMMEDIATE,                 /* Stops the event instance immediately. */
232 	
233 	FMOD_STUDIO_STOP_FORCEINT = 65536           /* Makes sure this enum is signed 32bit. */
234 }
235 
236 static immutable FMOD_STUDIO_LOAD_BANK_NORMAL                = 0x00000000;         /* Standard behaviour. */
237 static immutable FMOD_STUDIO_LOAD_BANK_NONBLOCKING           = 0x00000001;         /* Bank loading occurs asynchronously rather than occurring immediately. */
238 static immutable FMOD_STUDIO_LOAD_BANK_DECOMPRESS_SAMPLES    = 0x00000002;         /* Force samples to decompress into memory when they are loaded, rather than staying compressed. */
239 
240 alias FMOD_STUDIO_LOAD_BANK_FLAGS = uint;
241 
242 struct FMOD_STUDIO_ADVANCEDSETTINGS
243 {
244 	int                 cbsize;                     /* [w]   Size of this structure.  Use sizeof(FMOD_STUDIO_ADVANCEDSETTINGS)  NOTE: This must be set before calling Studio::System::getAdvancedSettings or Studio::System::setAdvancedSettings! */
245 	uint        commandqueuesize;           /* [r/w] Optional. Specify 0 to ignore. Specify the command queue size for studio async processing.  Default 32kB. */
246 	uint        handleinitialsize;          /* [r/w] Optional. Specify 0 to ignore. Specify the initial size to allocate for handles.  Memory for handles will grow as needed in pages. Default 8192 * sizeof(void*) */
247 	int                 studioupdateperiod;         /* [r/w] Optional. Specify 0 to ignore. Specify the update period of Studio when in async mode, in milliseconds.  Will be quantised to the nearest multiple of mixer duration.  Default is 20ms. */
248 	int                 idlesampledatapoolsize;       /* [r/w] Optional. Specify 0 to ignore. Specify the amount of sample data to keep in memory when no longer used, to avoid repeated disk IO.  Use -1 to disable.  Default is 256kB. */
249 }
250 
251 struct FMOD_STUDIO_CPU_USAGE
252 {
253 	float               dspusage;                           /* Returns the % CPU time taken by DSP processing on the low level mixer thread. */
254 	float               streamusage;                        /* Returns the % CPU time taken by stream processing on the low level stream thread. */
255 	float               geometryusage;                      /* Returns the % CPU time taken by geometry processing on the low level geometry thread. */
256 	float               updateusage;                        /* Returns the % CPU time taken by low level update, called as part of the studio update. */
257 	float               studiousage;                        /* Returns the % CPU time taken by studio update, called from the studio thread. Does not include low level update time. */
258 }
259 
260 struct FMOD_STUDIO_BUFFER_INFO
261 {
262 	int                 currentusage;                       /* Current buffer usage in bytes. */
263 	int                 peakusage;                          /* Peak buffer usage in bytes. */
264 	int                 capacity;                           /* Buffer capacity in bytes. */
265 	int                 stallcount;                         /* Cumulative number of stalls due to buffer overflow. */
266 	float               stalltime;                          /* Cumulative amount of time stalled due to buffer overflow, in seconds. */
267 }
268 
269 struct FMOD_STUDIO_BUFFER_USAGE
270 {
271 	FMOD_STUDIO_BUFFER_INFO studiocommandqueue;             /* Information for the Studio Async Command buffer, controlled by FMOD_STUDIO_ADVANCEDSETTINGS commandQueueSize. */
272 	FMOD_STUDIO_BUFFER_INFO studiohandle;                   /* Information for the Studio handle table, controlled by FMOD_STUDIO_ADVANCEDSETTINGS handleInitialSize. */
273 }
274 
275 struct FMOD_STUDIO_SOUND_INFO
276 {
277 	const(char)* name_or_data;           /* The filename or memory buffer that contains the sound. */
278 	FMOD_MODE mode;                     /* Mode flags required for loading the sound. */
279 	FMOD_CREATESOUNDEXINFO exinfo;      /* Extra information required for loading the sound. */
280 	int subsoundIndex;                  /* Subsound index for loading the sound. */
281 }
282 
283 static immutable FMOD_STUDIO_COMMANDCAPTURE_NORMAL                      = 0x00000000;       /* Standard behaviour. */
284 static immutable FMOD_STUDIO_COMMANDCAPTURE_FILEFLUSH                   = 0x00000001;       /* Call file flush on every command. */
285 static immutable FMOD_STUDIO_COMMANDCAPTURE_SKIP_INITIAL_STATE          = 0x00000002;       /* Normally the initial state of banks and instances is captured, unless this flag is set. */
286 
287 alias FMOD_STUDIO_COMMANDCAPTURE_FLAGS = uint;
288 
289 static immutable FMOD_STUDIO_COMMANDREPLAY_NORMAL               = 0x00000000;       /* Standard behaviour. */
290 static immutable FMOD_STUDIO_COMMANDREPLAY_SKIP_CLEANUP         = 0x00000001;       /* Normally the playback will release any created resources when it stops, unless this flag is set. */
291 static immutable FMOD_STUDIO_COMMANDREPLAY_FAST_FORWARD         = 0x00000002;       /* Play back at maximum speed, ignoring the timing of the original replay. */
292 
293 alias FMOD_STUDIO_COMMANDREPLAY_FLAGS = uint;
294 
295 alias FMOD_STUDIO_INSTANCETYPE = int;
296 enum
297 {
298 	FMOD_STUDIO_INSTANCETYPE_NONE,
299 	FMOD_STUDIO_INSTANCETYPE_SYSTEM,
300 	FMOD_STUDIO_INSTANCETYPE_EVENTDESCRIPTION,
301 	FMOD_STUDIO_INSTANCETYPE_EVENTINSTANCE,
302 	FMOD_STUDIO_INSTANCETYPE_PARAMETERINSTANCE,
303 	FMOD_STUDIO_INSTANCETYPE_BUS,
304 	FMOD_STUDIO_INSTANCETYPE_VCA,
305 	FMOD_STUDIO_INSTANCETYPE_BANK,
306 	FMOD_STUDIO_INSTANCETYPE_COMMANDREPLAY,
307 	
308 	FMOD_STUDIO_INSTANCETYPE_FORCEINT = 65536    /* Makes sure this enum is signed 32bit. */
309 }
310 
311 struct FMOD_STUDIO_COMMAND_INFO
312 {
313 	const(char)* commandname;                                    /* The full name of the API function for this command. */
314 	int parentcommandindex;                                     /* For commands that operate on an instance, this is the command that created the instance. */
315 	int framenumber;                                            /* The frame the command belongs to. */
316 	float frametime;                                            /* The playback time at which this command will be executed. */
317 	FMOD_STUDIO_INSTANCETYPE instancetype;                      /* The type of object that this command uses as an instance. */
318 	FMOD_STUDIO_INSTANCETYPE outputtype;                        /* The type of object that this command outputs, if any. */
319 	uint instancehandle;                                /* The original handle value of the instance.  This will no longer correspond to any actual object in playback. */
320 	uint outputhandle;                                  /* The original handle value of the command output.  This will no longer correspond to any actual object in playback. */
321 }
322 
323 alias FMOD_STUDIO_SYSTEM_CALLBACK = FMOD_RESULT function(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_SYSTEM_CALLBACK_TYPE type, void *commanddata, void *userdata);
324 alias FMOD_STUDIO_EVENT_CALLBACK = FMOD_RESULT function(FMOD_STUDIO_EVENT_CALLBACK_TYPE type, FMOD_STUDIO_EVENTINSTANCE *event, void *parameters);
325 alias FMOD_STUDIO_COMMANDREPLAY_FRAME_CALLBACK = FMOD_RESULT function(FMOD_STUDIO_COMMANDREPLAY *replay, int commandIndex, float currentTime, void *userdata);
326 alias FMOD_STUDIO_COMMANDREPLAY_LOAD_BANK_CALLBACK = FMOD_RESULT function(FMOD_STUDIO_COMMANDREPLAY *replay, int commandIndex, const FMOD_GUID *bankGuid, const char *bankFilename, FMOD_STUDIO_LOAD_BANK_FLAGS flags, FMOD_STUDIO_BANK **bank, void *userdata);
327 alias FMOD_STUDIO_COMMANDREPLAY_CREATE_INSTANCE_CALLBACK = FMOD_RESULT function(FMOD_STUDIO_COMMANDREPLAY *replay, int commandIndex, FMOD_STUDIO_EVENTDESCRIPTION *eventDescription, FMOD_STUDIO_EVENTINSTANCE **instance, void *userdata);