Loading...
Searching...
No Matches
libopenmpt_ext.h
Go to the documentation of this file.
/*
* libopenmpt_ext.h
* ----------------
* Purpose: libopenmpt public c interface for libopenmpt extensions
* Notes :
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#ifndef LIBOPENMPT_EXT_H
#define LIBOPENMPT_EXT_H
#include "libopenmpt_config.h"
#include "libopenmpt.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct openmpt_module_ext openmpt_module_ext;
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 );
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 );
LIBOPENMPT_API void openmpt_module_ext_destroy( openmpt_module_ext * mod_ext );
LIBOPENMPT_API openmpt_module * openmpt_module_ext_get_module( openmpt_module_ext * mod_ext );
LIBOPENMPT_API int openmpt_module_ext_get_interface( openmpt_module_ext * mod_ext, const char * interface_id, void * interface, size_t interface_size );
#ifndef LIBOPENMPT_EXT_C_INTERFACE_PATTERN_VIS
#define LIBOPENMPT_EXT_C_INTERFACE_PATTERN_VIS "pattern_vis"
#endif
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_UNKNOWN 0
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_GENERAL 1
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_GLOBAL 2
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_VOLUME 3
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_PANNING 4
#define OPENMPT_MODULE_EXT_INTERFACE_PATTERN_VIS_EFFECT_TYPE_PITCH 5
typedef struct openmpt_module_ext_interface_pattern_vis {
int ( * get_pattern_row_channel_volume_effect_type ) ( openmpt_module_ext * mod_ext, int32_t pattern, int32_t row, int32_t channel );
int ( * get_pattern_row_channel_effect_type ) ( openmpt_module_ext * mod_ext, int32_t pattern, int32_t row, int32_t channel );
} openmpt_module_ext_interface_pattern_vis;
#ifndef LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE
#define LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE "interactive"
#endif
typedef struct openmpt_module_ext_interface_interactive {
int ( * set_current_speed ) ( openmpt_module_ext * mod_ext, int32_t speed );
LIBOPENMPT_DEPRECATED int ( * set_current_tempo ) ( openmpt_module_ext * mod_ext, int32_t tempo );
int ( * set_tempo_factor ) ( openmpt_module_ext * mod_ext, double factor );
double ( * get_tempo_factor ) ( openmpt_module_ext * mod_ext );
int ( * set_pitch_factor ) ( openmpt_module_ext * mod_ext, double factor );
double ( * get_pitch_factor ) ( openmpt_module_ext * mod_ext );
int ( * set_global_volume ) ( openmpt_module_ext * mod_ext, double volume );
double ( * get_global_volume ) ( openmpt_module_ext * mod_ext );
int ( * set_channel_volume ) ( openmpt_module_ext * mod_ext, int32_t channel, double volume );
double ( * get_channel_volume ) ( openmpt_module_ext * mod_ext, int32_t channel );
int ( * set_channel_mute_status ) ( openmpt_module_ext * mod_ext, int32_t channel, int mute );
int ( * get_channel_mute_status ) ( openmpt_module_ext * mod_ext, int32_t channel );
int ( * set_instrument_mute_status ) ( openmpt_module_ext * mod_ext, int32_t instrument, int mute );
int ( * get_instrument_mute_status ) ( openmpt_module_ext * mod_ext, int32_t instrument );
int32_t ( * play_note ) ( openmpt_module_ext * mod_ext, int32_t instrument, int32_t note, double volume, double panning );
int ( * stop_note ) ( openmpt_module_ext * mod_ext, int32_t channel );
} openmpt_module_ext_interface_interactive;
#ifndef LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE2
#define LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE2 "interactive2"
#endif
typedef struct openmpt_module_ext_interface_interactive2 {
int ( *note_off ) ( openmpt_module_ext * mod_ext, int32_t channel );
int ( *note_fade ) ( openmpt_module_ext * mod_ext, int32_t channel );
int ( *set_channel_panning) ( openmpt_module_ext * mod_ext, int32_t channel, double panning );
double (*get_channel_panning) ( openmpt_module_ext * mod_ext, int32_t channel );
int ( *set_note_finetune) ( openmpt_module_ext * mod_ext, int32_t channel, double finetune );
double (*get_note_finetune) ( openmpt_module_ext * mod_ext, int32_t channel );
} openmpt_module_ext_interface_interactive2;
#ifndef LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE3
#define LIBOPENMPT_EXT_C_INTERFACE_INTERACTIVE3 "interactive3"
#endif
typedef struct openmpt_module_ext_interface_interactive3 {
int ( * set_current_tempo2 ) ( openmpt_module_ext * mod_ext, double tempo );
} openmpt_module_ext_interface_interactive3;
/* add stuff here */
#ifdef __cplusplus
}
#endif
#endif /* LIBOPENMPT_EXT_H */
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_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_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_destroy
void openmpt_module_ext_destroy(openmpt_module_ext *mod_ext)
Unload a previously created openmpt_module_ext from memory.
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
libopenmpt.h
libopenmpt_config.h
LIBOPENMPT_DEPRECATED
#define LIBOPENMPT_DEPRECATED
Definition libopenmpt_config.h:315
openmpt_module_ext_interface_interactive2
Definition libopenmpt_ext.h:315
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:327
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:362
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:340
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:387
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:352
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:375
openmpt_module_ext_interface_interactive3
Definition libopenmpt_ext.h:397
openmpt_module_ext_interface_interactive3::set_current_tempo2
int(* set_current_tempo2)(openmpt_module_ext *mod_ext, double tempo)
Definition libopenmpt_ext.h:407
openmpt_module_ext_interface_interactive
Definition libopenmpt_ext.h:147
openmpt_module_ext_interface_interactive::set_tempo_factor
int(* set_tempo_factor)(openmpt_module_ext *mod_ext, double factor)
Definition libopenmpt_ext.h:177
openmpt_module_ext_interface_interactive::set_pitch_factor
int(* set_pitch_factor)(openmpt_module_ext *mod_ext, double factor)
Definition libopenmpt_ext.h:196
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:280
openmpt_module_ext_interface_interactive::stop_note
int(* stop_note)(openmpt_module_ext *mod_ext, int32_t channel)
Definition libopenmpt_ext.h:305
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:261
openmpt_module_ext_interface_interactive::get_pitch_factor
double(* get_pitch_factor)(openmpt_module_ext *mod_ext)
Definition libopenmpt_ext.h:204
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:233
openmpt_module_ext_interface_interactive::get_global_volume
double(* get_global_volume)(openmpt_module_ext *mod_ext)
Definition libopenmpt_ext.h:222
openmpt_module_ext_interface_interactive::get_tempo_factor
double(* get_tempo_factor)(openmpt_module_ext *mod_ext)
Definition libopenmpt_ext.h:185
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:271
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:294
openmpt_module_ext_interface_interactive::set_global_volume
int(* set_global_volume)(openmpt_module_ext *mod_ext, double volume)
Definition libopenmpt_ext.h:214
openmpt_module_ext_interface_interactive::get_channel_volume
double(* get_channel_volume)(openmpt_module_ext *mod_ext, int32_t channel)
Definition libopenmpt_ext.h:242
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:252
openmpt_module_ext_interface_interactive::set_current_tempo
int(* set_current_tempo)(openmpt_module_ext *mod_ext, int32_t tempo)
Definition libopenmpt_ext.h:167
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_pattern_vis
Definition libopenmpt_ext.h:117
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_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_initial_ctl
Definition libopenmpt.h:662
openmpt_stream_callbacks
Stream callbacks.
Definition libopenmpt.h:300