libopenmpt: libopenmpt/libopenmpt_ext.h Source File

libopenmpt 0.6.27-pre.0+r25036 cross-platform C++ and C library to decode tracked music files

libopenmpt_ext.h
Go to the documentation of this file.
1 /*
2 * libopenmpt_ext.h
3 * ----------------
4 * Purpose: libopenmpt public c interface for libopenmpt extensions
5 * Notes :
6 * Authors: OpenMPT Devs
7 * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
8 */
9
10 #ifndef LIBOPENMPT_EXT_H
11 #define LIBOPENMPT_EXT_H
12
13 #include "libopenmpt_config.h"
14 #include "libopenmpt.h"
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
39 typedef struct openmpt_module_ext openmpt_module_ext;
40
58 LIBOPENMPT_API openmpt_module_ext * openmpt_module_ext_create( openmpt_stream_callbacks stream_callbacks, void * stream, openmpt_log_func logfunc, void * loguser, openmpt_error_func errfunc, void * erruser, int * error, const char * * error_message, const openmpt_module_initial_ctl * ctls );
59
76 LIBOPENMPT_API openmpt_module_ext * openmpt_module_ext_create_from_memory( const void * filedata, size_t filesize, openmpt_log_func logfunc, void * loguser, openmpt_error_func errfunc, void * erruser, int * error, const char * * error_message, const openmpt_module_initial_ctl * ctls );
77
82 LIBOPENMPT_API void openmpt_module_ext_destroy( openmpt_module_ext * mod_ext );
83
90 LIBOPENMPT_API openmpt_module * openmpt_module_ext_get_module( openmpt_module_ext * mod_ext );
91
101 LIBOPENMPT_API int openmpt_module_ext_get_interface( openmpt_module_ext * mod_ext, const char * interface_id, void * interface, size_t interface_size );
102
103
104
105 #ifndef LIBOPENMPT_EXT_C_INTERFACE_PATTERN_VIS
106 #define LIBOPENMPT_EXT_C_INTERFACE_PATTERN_VIS "pattern_vis"
107 #endif
108
110 #define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_UNKNOWN 0
111 #define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_GENERAL 1
112 #define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_GLOBAL 2
113 #define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_VOLUME 3
114 #define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_PANNING 4
115 #define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_PITCH 5
116
117 typedef struct openmpt_module_ext_interface_pattern_vis {
127 int ( * get_pattern_row_channel_volume_effect_type ) ( openmpt_module_ext * mod_ext, int32_t pattern, int32_t row, int32_t channel );
128
138 int ( * get_pattern_row_channel_effect_type ) ( openmpt_module_ext * mod_ext, int32_t pattern, int32_t row, int32_t channel );
139 } openmpt_module_ext_interface_pattern_vis;
140
141
142
143 #ifndef LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE
144 #define LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE "interactive"
145 #endif
146
147 typedef struct openmpt_module_ext_interface_interactive {
156 int ( * set_current_speed ) ( openmpt_module_ext * mod_ext, int32_t speed );
157
166 int ( * set_current_tempo ) ( openmpt_module_ext * mod_ext, int32_t tempo );
167
176 int ( * set_tempo_factor ) ( openmpt_module_ext * mod_ext, double factor );
177
184 double ( * get_tempo_factor ) ( openmpt_module_ext * mod_ext );
185
195 int ( * set_pitch_factor ) ( openmpt_module_ext * mod_ext, double factor );
196
203 double ( * get_pitch_factor ) ( openmpt_module_ext * mod_ext );
204
213 int ( * set_global_volume ) ( openmpt_module_ext * mod_ext, double volume );
214
221 double ( * get_global_volume ) ( openmpt_module_ext * mod_ext );
222
232 int ( * set_channel_volume ) ( openmpt_module_ext * mod_ext, int32_t channel, double volume );
233
241 double ( * get_channel_volume ) ( openmpt_module_ext * mod_ext, int32_t channel );
242
251 int ( * set_channel_mute_status ) ( openmpt_module_ext * mod_ext, int32_t channel, int mute );
252
260 int ( * get_channel_mute_status ) ( openmpt_module_ext * mod_ext, int32_t channel );
261
270 int ( * set_instrument_mute_status ) ( openmpt_module_ext * mod_ext, int32_t instrument, int mute );
271
279 int ( * get_instrument_mute_status ) ( openmpt_module_ext * mod_ext, int32_t instrument );
280
293 int32_t ( * play_note ) ( openmpt_module_ext * mod_ext, int32_t instrument, int32_t note, double volume, double panning );
294
304 int ( * stop_note ) ( openmpt_module_ext * mod_ext, int32_t channel );
305
306 } openmpt_module_ext_interface_interactive;
307
308
309
310 #ifndef LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE2
311 #define LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE2 "interactive2"
312 #endif
313
314 typedef struct openmpt_module_ext_interface_interactive2 {
316
326 int ( *note_off ) ( openmpt_module_ext * mod_ext, int32_t channel );
327
329
339 int ( *note_fade ) ( openmpt_module_ext * mod_ext, int32_t channel );
340
342
351 int ( *set_channel_panning) ( openmpt_module_ext * mod_ext, int32_t channel, double panning );
352
354
361 double (*get_channel_panning) ( openmpt_module_ext * mod_ext, int32_t channel );
362
364
374 int ( *set_note_finetune) ( openmpt_module_ext * mod_ext, int32_t channel, double finetune );
375
377
386 double (*get_note_finetune) ( openmpt_module_ext * mod_ext, int32_t channel );
387
388 } openmpt_module_ext_interface_interactive2;
389
390
391
392 /* add stuff here */
393
394
395
396 #ifdef __cplusplus
397 }
398 #endif
399
404 #endif /* LIBOPENMPT_EXT_H */
405
openmpt_error_func
int(* openmpt_error_func)(int error, void *user)
Error function.
Definition: libopenmpt.h:435
openmpt_module
struct openmpt_module openmpt_module
Opaque type representing a libopenmpt module.
Definition: libopenmpt.h:660
openmpt_log_func
void(* openmpt_log_func)(const char *message, void *user)
Logging function.
Definition: libopenmpt.h:329
openmpt_module_ext_interface_pattern_vis
struct openmpt_module_ext_interface_pattern_vis openmpt_module_ext_interface_pattern_vis
openmpt_module_ext_get_interface
int openmpt_module_ext_get_interface(openmpt_module_ext *mod_ext, const char *interface_id, void *interface, size_t interface_size)
openmpt_module_ext_interface_interactive2
struct openmpt_module_ext_interface_interactive2 openmpt_module_ext_interface_interactive2
openmpt_module_ext_destroy
void openmpt_module_ext_destroy(openmpt_module_ext *mod_ext)
Unload a previously created openmpt_module_ext from memory.
openmpt_module_ext_create_from_memory
openmpt_module_ext * openmpt_module_ext_create_from_memory(const void *filedata, size_t filesize, openmpt_log_func logfunc, void *loguser, openmpt_error_func errfunc, void *erruser, int *error, const char **error_message, const openmpt_module_initial_ctl *ctls)
Construct an openmpt_module_ext.
openmpt_module_ext_get_module
openmpt_module * openmpt_module_ext_get_module(openmpt_module_ext *mod_ext)
Retrieve the openmpt_module handle from an openmpt_module_ext handle.
openmpt_module_ext_create
openmpt_module_ext * openmpt_module_ext_create(openmpt_stream_callbacks stream_callbacks, void *stream, openmpt_log_func logfunc, void *loguser, openmpt_error_func errfunc, void *erruser, int *error, const char **error_message, const openmpt_module_initial_ctl *ctls)
Construct an openmpt_module_ext.
openmpt_module_ext
struct openmpt_module_ext openmpt_module_ext
Opaque type representing a libopenmpt extension module.
Definition: libopenmpt_ext.h:39
openmpt_module_ext_interface_interactive
struct openmpt_module_ext_interface_interactive openmpt_module_ext_interface_interactive
libopenmpt.h
libopenmpt_config.h
openmpt_module_ext_interface_interactive2
Definition: libopenmpt_ext.h:314
openmpt_module_ext_interface_interactive2::set_channel_panning
int(* set_channel_panning)(openmpt_module_ext *mod_ext, int32_t channel, double panning)
Set the current panning for a channel.
Definition: libopenmpt_ext.h:351
openmpt_module_ext_interface_interactive2::note_fade
int(* note_fade)(openmpt_module_ext *mod_ext, int32_t channel)
Sends a note fade command for the note playing on the specified channel.
Definition: libopenmpt_ext.h:339
openmpt_module_ext_interface_interactive2::get_channel_panning
double(* get_channel_panning)(openmpt_module_ext *mod_ext, int32_t channel)
Get the current panning position for a channel.
Definition: libopenmpt_ext.h:361
openmpt_module_ext_interface_interactive2::note_off
int(* note_off)(openmpt_module_ext *mod_ext, int32_t channel)
Sends a key-off command for the note playing on the specified channel.
Definition: libopenmpt_ext.h:326
openmpt_module_ext_interface_interactive2::get_note_finetune
double(* get_note_finetune)(openmpt_module_ext *mod_ext, int32_t channel)
Get the finetune for the currently playing note on a channel.
Definition: libopenmpt_ext.h:386
openmpt_module_ext_interface_interactive2::set_note_finetune
int(* set_note_finetune)(openmpt_module_ext *mod_ext, int32_t channel, double finetune)
Set the finetune for the currently playing note on a channel.
Definition: libopenmpt_ext.h:374
openmpt_module_ext_interface_interactive
Definition: libopenmpt_ext.h:147
openmpt_module_ext_interface_interactive::get_tempo_factor
double(* get_tempo_factor)(openmpt_module_ext *mod_ext)
Definition: libopenmpt_ext.h:184
openmpt_module_ext_interface_interactive::set_channel_mute_status
int(* set_channel_mute_status)(openmpt_module_ext *mod_ext, int32_t channel, int mute)
Definition: libopenmpt_ext.h:251
openmpt_module_ext_interface_interactive::play_note
int32_t(* play_note)(openmpt_module_ext *mod_ext, int32_t instrument, int32_t note, double volume, double panning)
Definition: libopenmpt_ext.h:293
openmpt_module_ext_interface_interactive::get_channel_mute_status
int(* get_channel_mute_status)(openmpt_module_ext *mod_ext, int32_t channel)
Definition: libopenmpt_ext.h:260
openmpt_module_ext_interface_interactive::set_tempo_factor
int(* set_tempo_factor)(openmpt_module_ext *mod_ext, double factor)
Definition: libopenmpt_ext.h:176
openmpt_module_ext_interface_interactive::set_current_speed
int(* set_current_speed)(openmpt_module_ext *mod_ext, int32_t speed)
Definition: libopenmpt_ext.h:156
openmpt_module_ext_interface_interactive::set_global_volume
int(* set_global_volume)(openmpt_module_ext *mod_ext, double volume)
Definition: libopenmpt_ext.h:213
openmpt_module_ext_interface_interactive::get_channel_volume
double(* get_channel_volume)(openmpt_module_ext *mod_ext, int32_t channel)
Definition: libopenmpt_ext.h:241
openmpt_module_ext_interface_interactive::set_channel_volume
int(* set_channel_volume)(openmpt_module_ext *mod_ext, int32_t channel, double volume)
Definition: libopenmpt_ext.h:232
openmpt_module_ext_interface_interactive::get_global_volume
double(* get_global_volume)(openmpt_module_ext *mod_ext)
Definition: libopenmpt_ext.h:221
openmpt_module_ext_interface_interactive::set_current_tempo
int(* set_current_tempo)(openmpt_module_ext *mod_ext, int32_t tempo)
Definition: libopenmpt_ext.h:166
openmpt_module_ext_interface_interactive::get_pitch_factor
double(* get_pitch_factor)(openmpt_module_ext *mod_ext)
Definition: libopenmpt_ext.h:203
openmpt_module_ext_interface_interactive::stop_note
int(* stop_note)(openmpt_module_ext *mod_ext, int32_t channel)
Definition: libopenmpt_ext.h:304
openmpt_module_ext_interface_interactive::set_pitch_factor
int(* set_pitch_factor)(openmpt_module_ext *mod_ext, double factor)
Definition: libopenmpt_ext.h:195
openmpt_module_ext_interface_interactive::get_instrument_mute_status
int(* get_instrument_mute_status)(openmpt_module_ext *mod_ext, int32_t instrument)
Definition: libopenmpt_ext.h:279
openmpt_module_ext_interface_interactive::set_instrument_mute_status
int(* set_instrument_mute_status)(openmpt_module_ext *mod_ext, int32_t instrument, int mute)
Definition: libopenmpt_ext.h:270
openmpt_module_ext_interface_pattern_vis
Definition: libopenmpt_ext.h:117
openmpt_module_ext_interface_pattern_vis::get_pattern_row_channel_volume_effect_type
int(* get_pattern_row_channel_volume_effect_type)(openmpt_module_ext *mod_ext, int32_t pattern, int32_t row, int32_t channel)
Definition: libopenmpt_ext.h:127
openmpt_module_ext_interface_pattern_vis::get_pattern_row_channel_effect_type
int(* get_pattern_row_channel_effect_type)(openmpt_module_ext *mod_ext, int32_t pattern, int32_t row, int32_t channel)
Definition: libopenmpt_ext.h:138
openmpt_module_initial_ctl
Definition: libopenmpt.h:662
openmpt_stream_callbacks
Stream callbacks.
Definition: libopenmpt.h:300