libopenmpt 0.7.11+release
cross-platform C++ and C library to decode tracked music files
|
Modules | |
Render param indices | |
Parameter index to use with openmpt_module_get_render_param() and openmpt_module_set_render_param() | |
Pattern cell indices | |
Parameter index to use with openmpt_module_get_pattern_row_channel_command(), openmpt_module_format_pattern_row_channel_command() and openmpt_module_highlight_pattern_row_channel_command() | |
Classes | |
struct | openmpt_stream_callbacks |
Stream callbacks. More... | |
struct | openmpt_module_initial_ctl |
struct | openmpt_stream_buffer |
struct | openmpt_stream_buffer2 |
Typedefs | |
typedef size_t(* | openmpt_stream_read_func) (void *stream, void *dst, size_t bytes) |
Read bytes from stream. More... | |
typedef int(* | openmpt_stream_seek_func) (void *stream, int64_t offset, int whence) |
Seek stream position. More... | |
typedef int64_t(* | openmpt_stream_tell_func) (void *stream) |
Tell stream position. More... | |
typedef struct openmpt_stream_callbacks | openmpt_stream_callbacks |
Stream callbacks. More... | |
typedef void(* | openmpt_log_func) (const char *message, void *user) |
Logging function. More... | |
typedef int(* | openmpt_error_func) (int error, void *user) |
Error function. More... | |
typedef struct openmpt_module | openmpt_module |
Opaque type representing a libopenmpt module. More... | |
typedef struct openmpt_module_initial_ctl | openmpt_module_initial_ctl |
typedef struct openmpt_stream_buffer | openmpt_stream_buffer |
typedef struct openmpt_stream_buffer2 | openmpt_stream_buffer2 |
Functions | |
uint32_t | openmpt_get_library_version (void) |
Get the libopenmpt version number. More... | |
uint32_t | openmpt_get_core_version (void) |
Get the core version number. More... | |
void | openmpt_free_string (const char *str) |
Free a string returned by libopenmpt. More... | |
const char * | openmpt_get_string (const char *key) |
Get library related metadata. More... | |
const char * | openmpt_get_supported_extensions (void) |
Get a list of supported file extensions. More... | |
int | openmpt_is_extension_supported (const char *extension) |
Query whether a file extension is supported. More... | |
void | openmpt_log_func_default (const char *message, void *user) |
Default logging function. More... | |
void | openmpt_log_func_silent (const char *message, void *user) |
Silent logging function. More... | |
int | openmpt_error_is_transient (int error) |
Check whether the error is transient. More... | |
const char * | openmpt_error_string (int error) |
Convert error code to text. More... | |
int | openmpt_error_func_default (int error, void *user) |
Default error function. More... | |
int | openmpt_error_func_log (int error, void *user) |
Log error function. More... | |
int | openmpt_error_func_store (int error, void *user) |
Store error function. More... | |
int | openmpt_error_func_ignore (int error, void *user) |
Ignore error function. More... | |
int | openmpt_error_func_errno (int error, void *user) |
Errno error function. More... | |
void * | openmpt_error_func_errno_userdata (int *error) |
User pointer for openmpt_error_func_errno. More... | |
double | openmpt_could_open_probability (openmpt_stream_callbacks stream_callbacks, void *stream, double effort, openmpt_log_func logfunc, void *user) |
Roughly scan the input stream to find out whether libopenmpt might be able to open it. More... | |
double | openmpt_could_open_propability (openmpt_stream_callbacks stream_callbacks, void *stream, double effort, openmpt_log_func logfunc, void *user) |
Roughly scan the input stream to find out whether libopenmpt might be able to open it. More... | |
double | openmpt_could_open_probability2 (openmpt_stream_callbacks stream_callbacks, void *stream, double effort, openmpt_log_func logfunc, void *loguser, openmpt_error_func errfunc, void *erruser, int *error, const char **error_message) |
Roughly scan the input stream to find out whether libopenmpt might be able to open it. More... | |
size_t | openmpt_probe_file_header_get_recommended_size (void) |
Get recommended header size for successfull format probing. More... | |
int | openmpt_probe_file_header (uint64_t flags, const void *data, size_t size, uint64_t filesize, openmpt_log_func logfunc, void *loguser, openmpt_error_func errfunc, void *erruser, int *error, const char **error_message) |
Probe the provided bytes from the beginning of a file for supported file format headers to find out whether libopenmpt might be able to open it. More... | |
int | openmpt_probe_file_header_without_filesize (uint64_t flags, const void *data, size_t size, openmpt_log_func logfunc, void *loguser, openmpt_error_func errfunc, void *erruser, int *error, const char **error_message) |
Probe the provided bytes from the beginning of a file for supported file format headers to find out whether libopenmpt might be able to open it. More... | |
int | openmpt_probe_file_header_from_stream (uint64_t flags, 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) |
Probe the provided bytes from the beginning of a file for supported file format headers to find out whether libopenmpt might be able to open it. More... | |
openmpt_module * | openmpt_module_create (openmpt_stream_callbacks stream_callbacks, void *stream, openmpt_log_func logfunc, void *loguser, const openmpt_module_initial_ctl *ctls) |
Construct an openmpt_module. More... | |
openmpt_module * | openmpt_module_create2 (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. More... | |
openmpt_module * | openmpt_module_create_from_memory (const void *filedata, size_t filesize, openmpt_log_func logfunc, void *loguser, const openmpt_module_initial_ctl *ctls) |
Construct an openmpt_module. More... | |
openmpt_module * | openmpt_module_create_from_memory2 (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. More... | |
void | openmpt_module_destroy (openmpt_module *mod) |
Unload a previously created openmpt_module from memory. More... | |
void | openmpt_module_set_log_func (openmpt_module *mod, openmpt_log_func logfunc, void *loguser) |
Set logging function. More... | |
void | openmpt_module_set_error_func (openmpt_module *mod, openmpt_error_func errfunc, void *erruser) |
Set error function. More... | |
int | openmpt_module_error_get_last (openmpt_module *mod) |
Get last error. More... | |
const char * | openmpt_module_error_get_last_message (openmpt_module *mod) |
Get last error message. More... | |
void | openmpt_module_error_set_last (openmpt_module *mod, int error) |
Set last error. More... | |
void | openmpt_module_error_clear (openmpt_module *mod) |
Clear last error. More... | |
int | openmpt_module_select_subsong (openmpt_module *mod, int32_t subsong) |
Select a sub-song from a multi-song module. More... | |
int32_t | openmpt_module_get_selected_subsong (openmpt_module *mod) |
Get currently selected sub-song from a multi-song module. More... | |
int | openmpt_module_set_repeat_count (openmpt_module *mod, int32_t repeat_count) |
Set Repeat Count. More... | |
int32_t | openmpt_module_get_repeat_count (openmpt_module *mod) |
Get Repeat Count. More... | |
double | openmpt_module_get_duration_seconds (openmpt_module *mod) |
approximate song duration More... | |
double | openmpt_module_set_position_seconds (openmpt_module *mod, double seconds) |
Set approximate current song position. More... | |
double | openmpt_module_get_position_seconds (openmpt_module *mod) |
Get current song position. More... | |
double | openmpt_module_set_position_order_row (openmpt_module *mod, int32_t order, int32_t row) |
Set approximate current song position. More... | |
int | openmpt_module_get_render_param (openmpt_module *mod, int param, int32_t *value) |
Get render parameter. More... | |
int | openmpt_module_set_render_param (openmpt_module *mod, int param, int32_t value) |
Set render parameter. More... | |
size_t | openmpt_module_read_mono (openmpt_module *mod, int32_t samplerate, size_t count, int16_t *mono) |
Render audio data. More... | |
size_t | openmpt_module_read_stereo (openmpt_module *mod, int32_t samplerate, size_t count, int16_t *left, int16_t *right) |
Render audio data. More... | |
size_t | openmpt_module_read_quad (openmpt_module *mod, int32_t samplerate, size_t count, int16_t *left, int16_t *right, int16_t *rear_left, int16_t *rear_right) |
Render audio data. More... | |
size_t | openmpt_module_read_float_mono (openmpt_module *mod, int32_t samplerate, size_t count, float *mono) |
Render audio data. More... | |
size_t | openmpt_module_read_float_stereo (openmpt_module *mod, int32_t samplerate, size_t count, float *left, float *right) |
Render audio data. More... | |
size_t | openmpt_module_read_float_quad (openmpt_module *mod, int32_t samplerate, size_t count, float *left, float *right, float *rear_left, float *rear_right) |
Render audio data. More... | |
size_t | openmpt_module_read_interleaved_stereo (openmpt_module *mod, int32_t samplerate, size_t count, int16_t *interleaved_stereo) |
Render audio data. More... | |
size_t | openmpt_module_read_interleaved_quad (openmpt_module *mod, int32_t samplerate, size_t count, int16_t *interleaved_quad) |
Render audio data. More... | |
size_t | openmpt_module_read_interleaved_float_stereo (openmpt_module *mod, int32_t samplerate, size_t count, float *interleaved_stereo) |
Render audio data. More... | |
size_t | openmpt_module_read_interleaved_float_quad (openmpt_module *mod, int32_t samplerate, size_t count, float *interleaved_quad) |
Render audio data. More... | |
const char * | openmpt_module_get_metadata_keys (openmpt_module *mod) |
Get the list of supported metadata item keys. More... | |
const char * | openmpt_module_get_metadata (openmpt_module *mod, const char *key) |
Get a metadata item value. More... | |
double | openmpt_module_get_current_estimated_bpm (openmpt_module *mod) |
int32_t | openmpt_module_get_current_speed (openmpt_module *mod) |
Get the current speed. More... | |
int32_t | openmpt_module_get_current_tempo (openmpt_module *mod) |
Get the current tempo. More... | |
double | openmpt_module_get_current_tempo2 (openmpt_module *mod) |
Get the current tempo. More... | |
int32_t | openmpt_module_get_current_order (openmpt_module *mod) |
Get the current order. More... | |
int32_t | openmpt_module_get_current_pattern (openmpt_module *mod) |
Get the current pattern. More... | |
int32_t | openmpt_module_get_current_row (openmpt_module *mod) |
Get the current row. More... | |
int32_t | openmpt_module_get_current_playing_channels (openmpt_module *mod) |
Get the current amount of playing channels. More... | |
float | openmpt_module_get_current_channel_vu_mono (openmpt_module *mod, int32_t channel) |
Get an approximate indication of the channel volume. More... | |
float | openmpt_module_get_current_channel_vu_left (openmpt_module *mod, int32_t channel) |
Get an approximate indication of the channel volume on the front-left speaker. More... | |
float | openmpt_module_get_current_channel_vu_right (openmpt_module *mod, int32_t channel) |
Get an approximate indication of the channel volume on the front-right speaker. More... | |
float | openmpt_module_get_current_channel_vu_rear_left (openmpt_module *mod, int32_t channel) |
Get an approximate indication of the channel volume on the rear-left speaker. More... | |
float | openmpt_module_get_current_channel_vu_rear_right (openmpt_module *mod, int32_t channel) |
Get an approximate indication of the channel volume on the rear-right speaker. More... | |
int32_t | openmpt_module_get_num_subsongs (openmpt_module *mod) |
Get the number of sub-songs. More... | |
int32_t | openmpt_module_get_num_channels (openmpt_module *mod) |
Get the number of pattern channels. More... | |
int32_t | openmpt_module_get_num_orders (openmpt_module *mod) |
Get the number of orders. More... | |
int32_t | openmpt_module_get_num_patterns (openmpt_module *mod) |
Get the number of patterns. More... | |
int32_t | openmpt_module_get_num_instruments (openmpt_module *mod) |
Get the number of instruments. More... | |
int32_t | openmpt_module_get_num_samples (openmpt_module *mod) |
Get the number of samples. More... | |
const char * | openmpt_module_get_subsong_name (openmpt_module *mod, int32_t index) |
Get a sub-song name. More... | |
const char * | openmpt_module_get_channel_name (openmpt_module *mod, int32_t index) |
Get a channel name. More... | |
const char * | openmpt_module_get_order_name (openmpt_module *mod, int32_t index) |
Get an order name. More... | |
const char * | openmpt_module_get_pattern_name (openmpt_module *mod, int32_t index) |
Get a pattern name. More... | |
const char * | openmpt_module_get_instrument_name (openmpt_module *mod, int32_t index) |
Get an instrument name. More... | |
const char * | openmpt_module_get_sample_name (openmpt_module *mod, int32_t index) |
Get a sample name. More... | |
int32_t | openmpt_module_get_order_pattern (openmpt_module *mod, int32_t order) |
Get pattern at order position. More... | |
int32_t | openmpt_module_get_pattern_num_rows (openmpt_module *mod, int32_t pattern) |
Get the number of rows in a pattern. More... | |
uint8_t | openmpt_module_get_pattern_row_channel_command (openmpt_module *mod, int32_t pattern, int32_t row, int32_t channel, int command) |
Get raw pattern content. More... | |
const char * | openmpt_module_format_pattern_row_channel_command (openmpt_module *mod, int32_t pattern, int32_t row, int32_t channel, int command) |
Get formatted (human-readable) pattern content. More... | |
const char * | openmpt_module_highlight_pattern_row_channel_command (openmpt_module *mod, int32_t pattern, int32_t row, int32_t channel, int command) |
Get highlighting information for formatted pattern content. More... | |
const char * | openmpt_module_format_pattern_row_channel (openmpt_module *mod, int32_t pattern, int32_t row, int32_t channel, size_t width, int pad) |
Get formatted (human-readable) pattern content. More... | |
const char * | openmpt_module_highlight_pattern_row_channel (openmpt_module *mod, int32_t pattern, int32_t row, int32_t channel, size_t width, int pad) |
Get highlighting information for formatted pattern content. More... | |
const char * | openmpt_module_get_ctls (openmpt_module *mod) |
Retrieve supported ctl keys. More... | |
const char * | openmpt_module_ctl_get (openmpt_module *mod, const char *ctl) |
Get current ctl value. More... | |
int | openmpt_module_ctl_get_boolean (openmpt_module *mod, const char *ctl) |
Get current ctl boolean value. More... | |
int64_t | openmpt_module_ctl_get_integer (openmpt_module *mod, const char *ctl) |
Get current ctl integer value. More... | |
double | openmpt_module_ctl_get_floatingpoint (openmpt_module *mod, const char *ctl) |
Get current ctl floatingpoint value. More... | |
const char * | openmpt_module_ctl_get_text (openmpt_module *mod, const char *ctl) |
Get current ctl string value. More... | |
int | openmpt_module_ctl_set (openmpt_module *mod, const char *ctl, const char *value) |
Set ctl value. More... | |
int | openmpt_module_ctl_set_boolean (openmpt_module *mod, const char *ctl, int value) |
Set ctl boolean value. More... | |
int | openmpt_module_ctl_set_integer (openmpt_module *mod, const char *ctl, int64_t value) |
Set ctl integer value. More... | |
int | openmpt_module_ctl_set_floatingpoint (openmpt_module *mod, const char *ctl, double value) |
Set ctl floatingpoint value. More... | |
int | openmpt_module_ctl_set_text (openmpt_module *mod, const char *ctl, const char *value) |
Set ctl string value. More... | |
static size_t | openmpt_stream_buffer_read_func (void *stream, void *dst, size_t bytes) |
static int | openmpt_stream_buffer_seek_func (void *stream, int64_t offset, int whence) |
static int64_t | openmpt_stream_buffer_tell_func (void *stream) |
static void | openmpt_stream_buffer_init (openmpt_stream_buffer *buffer, const void *file_data, int64_t file_size) |
static openmpt_stream_callbacks | openmpt_stream_get_buffer_callbacks (void) |
Provide openmpt_stream_callbacks for in-memoy buffers. More... | |
static size_t | openmpt_stream_buffer_read_func2 (void *stream, void *dst, size_t bytes) |
static int | openmpt_stream_buffer_seek_func2 (void *stream, int64_t offset, int whence) |
static int64_t | openmpt_stream_buffer_tell_func2 (void *stream) |
static void | openmpt_stream_buffer_init2 (openmpt_stream_buffer2 *buffer, const void *file_data, int64_t file_size) |
static openmpt_stream_callbacks | openmpt_stream_get_buffer_callbacks2 (void) |
Provide openmpt_stream_callbacks for in-memoy buffers. More... | |
static size_t | openmpt_stream_fd_read_func (void *stream, void *dst, size_t bytes) |
static openmpt_stream_callbacks | openmpt_stream_get_fd_callbacks (void) |
Provide openmpt_stream_callbacks for standard POSIX file descriptors. More... | |
static size_t | openmpt_stream_file_read_func (void *stream, void *dst, size_t bytes) |
static int | openmpt_stream_file_seek_func (void *stream, int64_t offset, int whence) |
static int64_t | openmpt_stream_file_tell_func (void *stream) |
static openmpt_stream_callbacks | openmpt_stream_get_file_callbacks (void) |
Provide openmpt_stream_callbacks for standard C FILE objects. More... | |
static openmpt_stream_callbacks | openmpt_stream_get_file_callbacks2 (void) |
Provide openmpt_stream_callbacks for standard C FILE objects. More... | |
static size_t | openmpt_stream_file_mingw_read_func (void *stream, void *dst, size_t bytes) |
static int | openmpt_stream_file_mingw_seek_func (void *stream, int64_t offset, int whence) |
static int64_t | openmpt_stream_file_mingw_tell_func (void *stream) |
static openmpt_stream_callbacks | openmpt_stream_get_file_mingw_callbacks (void) |
Provide openmpt_stream_callbacks for standard C FILE objects. More... | |
static size_t | openmpt_stream_file_msvcrt_read_func (void *stream, void *dst, size_t bytes) |
static int | openmpt_stream_file_msvcrt_seek_func (void *stream, int64_t offset, int whence) |
static int64_t | openmpt_stream_file_msvcrt_tell_func (void *stream) |
static openmpt_stream_callbacks | openmpt_stream_get_file_msvcrt_callbacks (void) |
Provide openmpt_stream_callbacks for standard C FILE objects. More... | |
static size_t | openmpt_stream_file_posix_read_func (void *stream, void *dst, size_t bytes) |
static int | openmpt_stream_file_posix_seek_func (void *stream, int64_t offset, int whence) |
static int64_t | openmpt_stream_file_posix_tell_func (void *stream) |
static openmpt_stream_callbacks | openmpt_stream_get_file_posix_callbacks (void) |
Provide openmpt_stream_callbacks for standard C FILE objects. More... | |
static size_t | openmpt_stream_file_posix_lfs64_read_func (void *stream, void *dst, size_t bytes) |
static int | openmpt_stream_file_posix_lfs64_seek_func (void *stream, int64_t offset, int whence) |
static int64_t | openmpt_stream_file_posix_lfs64_tell_func (void *stream) |
static openmpt_stream_callbacks | openmpt_stream_get_file_posix_lfs64_callbacks (void) |
Provide openmpt_stream_callbacks for standard C FILE objects. More... | |
#define LIBOPENMPT_STREAM_CALLBACKS_BUFFER |
Defined if libopenmpt/libopenmpt_stream_callbacks_buffer.h exists.
#define LIBOPENMPT_STREAM_CALLBACKS_FD |
Defined if libopenmpt/libopenmpt_stream_callbacks_fd.h exists.
#define LIBOPENMPT_STREAM_CALLBACKS_FILE |
Defined if libopenmpt/libopenmpt_stream_callbacks_file.h exists.
#define LIBOPENMPT_STREAM_CALLBACKS_FILE_MINGW |
Defined if libopenmpt/libopenmpt_stream_callbacks_file_mingw.h exists.
#define LIBOPENMPT_STREAM_CALLBACKS_FILE_MSVCRT |
Defined if libopenmpt/libopenmpt_stream_callbacks_file_msvcrt.h exists.
#define LIBOPENMPT_STREAM_CALLBACKS_FILE_POSIX |
Defined if libopenmpt/libopenmpt_stream_callbacks_file_posix.h exists.
#define LIBOPENMPT_STREAM_CALLBACKS_FILE_POSIX_LFS64 |
Defined if libopenmpt/libopenmpt_stream_callbacks_file_posix_lfs64.h exists.
#define OPENMPT_ERROR_ARGUMENT_NULL_POINTER ( OPENMPT_ERROR_BASE + 103 ) |
NULL pointer argument.
#define OPENMPT_ERROR_BASE 256 |
Lowest value libopenmpt will use for any of its own error codes.
#define OPENMPT_ERROR_DOMAIN ( OPENMPT_ERROR_BASE + 41 ) |
Value domain error.
#define OPENMPT_ERROR_EXCEPTION ( OPENMPT_ERROR_BASE + 11 ) |
Unknown internal C++ exception.
#define OPENMPT_ERROR_FUNC_RESULT_DEFAULT ( OPENMPT_ERROR_FUNC_RESULT_LOG | OPENMPT_ERROR_FUNC_RESULT_STORE ) |
Log and store the error.
#define OPENMPT_ERROR_FUNC_RESULT_LOG ( 1 << 0 ) |
Log the error.
#define OPENMPT_ERROR_FUNC_RESULT_NONE 0 |
Do not log or store the error.
#define OPENMPT_ERROR_FUNC_RESULT_STORE ( 1 << 1 ) |
Store the error.
#define OPENMPT_ERROR_GENERAL ( OPENMPT_ERROR_BASE + 101 ) |
General libopenmpt error.
#define OPENMPT_ERROR_INVALID_ARGUMENT ( OPENMPT_ERROR_BASE + 44 ) |
Invalid argument.
#define OPENMPT_ERROR_INVALID_MODULE_POINTER ( OPENMPT_ERROR_BASE + 102 ) |
openmpt_module * is invalid.
#define OPENMPT_ERROR_LENGTH ( OPENMPT_ERROR_BASE + 42 ) |
Maximum supported size exceeded.
#define OPENMPT_ERROR_LOGIC ( OPENMPT_ERROR_BASE + 40 ) |
Logic error.
#define OPENMPT_ERROR_OK 0 |
No error.
#define OPENMPT_ERROR_OUT_OF_MEMORY ( OPENMPT_ERROR_BASE + 21 ) |
Out of memory.
#define OPENMPT_ERROR_OUT_OF_RANGE ( OPENMPT_ERROR_BASE + 43 ) |
Argument out of range.
#define OPENMPT_ERROR_OVERFLOW ( OPENMPT_ERROR_BASE + 32 ) |
Arithmetic overflow.
#define OPENMPT_ERROR_RANGE ( OPENMPT_ERROR_BASE + 31 ) |
Range error.
#define OPENMPT_ERROR_RUNTIME ( OPENMPT_ERROR_BASE + 30 ) |
Runtime error.
#define OPENMPT_ERROR_UNDERFLOW ( OPENMPT_ERROR_BASE + 33 ) |
Arithmetic underflow.
#define OPENMPT_ERROR_UNKNOWN ( OPENMPT_ERROR_BASE + 1 ) |
Unknown internal error.
#define OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS 0x2ull |
Probe for module-specific container formats in openmpt_probe_file_header() or openmpt_probe_file_header_without_filesize().
#define OPENMPT_PROBE_FILE_HEADER_FLAGS_DEFAULT ( OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES | OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS ) |
Probe for the default set of formats in openmpt_probe_file_header() or openmpt_probe_file_header_without_filesize().
#define OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES 0x1ull |
Probe for module formats in openmpt_probe_file_header() or openmpt_probe_file_header_without_filesize().
#define OPENMPT_PROBE_FILE_HEADER_FLAGS_NONE 0x0ull |
Probe for no formats in openmpt_probe_file_header() or openmpt_probe_file_header_without_filesize().
#define OPENMPT_PROBE_FILE_HEADER_RESULT_ERROR (-255) |
Possible return values for openmpt_probe_file_header() and openmpt_probe_file_header_without_filesize(): An internal error occurred.
#define OPENMPT_PROBE_FILE_HEADER_RESULT_FAILURE 0 |
Possible return values for openmpt_probe_file_header() and openmpt_probe_file_header_without_filesize(): The file is not supported by libopenmpt.
#define OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS 1 |
Possible return values for openmpt_probe_file_header() and openmpt_probe_file_header_without_filesize(): The file will most likely be supported by libopenmpt.
#define OPENMPT_PROBE_FILE_HEADER_RESULT_WANTMOREDATA (-1) |
Possible return values for openmpt_probe_file_header() and openmpt_probe_file_header_without_filesize(): An answer could not be determined with the amount of data provided.
#define openmpt_stream_buffer_init_prefix_only | ( | buffer_, | |
prefix_data_, | |||
prefix_size_, | |||
file_size_ | |||
) |
#define openmpt_stream_buffer_overflowed | ( | buffer_ | ) | ( (buffer_)->overflow ) |
#define OPENMPT_STREAM_SEEK_CUR 1 |
Seek to the given offset relative to the current position in the file.
#define OPENMPT_STREAM_SEEK_END 2 |
Seek to the given offset relative to the end of the file.
#define OPENMPT_STREAM_SEEK_SET 0 |
Seek to the given offset relative to the beginning of the file.
#define OPENMPT_STRING_BUILD LIBOPENMPT_DEPRECATED_STRING( "build" ) |
Return information about the current build (e.g. the build date or compiler used) from openmpt_get_string().
"build"
directly. #define OPENMPT_STRING_CONTACT LIBOPENMPT_DEPRECATED_STRING( "contact" ) |
Return contact information about libopenmpt from openmpt_get_string().
"contact"
directly. #define OPENMPT_STRING_CORE_VERSION LIBOPENMPT_DEPRECATED_STRING( "core_version" ) |
Return a verbose OpenMPT core version string from openmpt_get_string().
"core_version"
directly. #define OPENMPT_STRING_CREDITS LIBOPENMPT_DEPRECATED_STRING( "credits" ) |
Return all contributors from openmpt_get_string().
"credits"
directly. #define OPENMPT_STRING_LIBRARY_FEATURES LIBOPENMPT_DEPRECATED_STRING( "library_features" ) |
Return a verbose library features string from openmpt_get_string().
"library_features"
directly. #define OPENMPT_STRING_LIBRARY_VERSION LIBOPENMPT_DEPRECATED_STRING( "library_version" ) |
Return a verbose library version string from openmpt_get_string().
"library_version"
directly. #define OPENMPT_STRING_LICENSE LIBOPENMPT_DEPRECATED_STRING( "license" ) |
Return the libopenmpt license from openmpt_get_string().
"license"
directly. typedef int(* openmpt_error_func) (int error, void *user) |
Error function.
error | Error code. |
user | User context that was passed to openmpt_module_create2(), openmpt_module_create_from_memory2() or openmpt_could_open_probability2(). |
OPENMPT_ERROR_FUNC_RESULT_NONE | Do not log or store the error. |
OPENMPT_ERROR_FUNC_RESULT_LOG | Log the error. |
OPENMPT_ERROR_FUNC_RESULT_STORE | Store the error. |
OPENMPT_ERROR_FUNC_RESULT_DEFAULT | Log and store the error. |
typedef void(* openmpt_log_func) (const char *message, void *user) |
Logging function.
message | UTF-8 encoded log message. |
user | User context that was passed to openmpt_module_create2(), openmpt_module_create_from_memory2() or openmpt_could_open_probability2(). |
typedef struct openmpt_module openmpt_module |
Opaque type representing a libopenmpt module.
typedef struct openmpt_module_initial_ctl openmpt_module_initial_ctl |
typedef struct openmpt_stream_buffer openmpt_stream_buffer |
typedef struct openmpt_stream_buffer2 openmpt_stream_buffer2 |
typedef struct openmpt_stream_callbacks openmpt_stream_callbacks |
Stream callbacks.
Stream callbacks used by libopenmpt for stream operations.
typedef size_t(* openmpt_stream_read_func) (void *stream, void *dst, size_t bytes) |
Read bytes from stream.
Read bytes data from stream to dst.
stream | Stream to read data from |
dst | Target where to copy data. |
bytes | Number of bytes to read. |
0 | End of stream or error. |
typedef int(* openmpt_stream_seek_func) (void *stream, int64_t offset, int whence) |
Seek stream position.
Seek to stream position offset at whence.
stream | Stream to operate on. |
offset | Offset to seek to. |
whence | OPENMPT_STREAM_SEEK_SET, OPENMPT_STREAM_SEEK_CUR, OPENMPT_STREAM_SEEK_END. See C89 documentation. |
0 | Success. |
-1 | Failure. Position does not get updated. |
typedef int64_t(* openmpt_stream_tell_func) (void *stream) |
Tell stream position.
Tell position of stream.
stream | Stream to operate on. |
-1 | Failure. |
double openmpt_could_open_probability | ( | openmpt_stream_callbacks | stream_callbacks, |
void * | stream, | ||
double | effort, | ||
openmpt_log_func | logfunc, | ||
void * | user | ||
) |
Roughly scan the input stream to find out whether libopenmpt might be able to open it.
stream_callbacks | Input stream callback operations. |
stream | Input stream to scan. |
effort | Effort to make when validating stream. Effort 0.0 does not even look at stream at all and effort 1.0 completely loads the file from stream. A lower effort requires less data to be loaded but only gives a rough estimate answer. Use an effort of 0.25 to only verify the header data of the module file. |
logfunc | Logging function where warning and errors are written. May be NULL. |
user | Logging function user context. Used to pass any user-defined data associated with this module to the logging function. |
double openmpt_could_open_probability2 | ( | openmpt_stream_callbacks | stream_callbacks, |
void * | stream, | ||
double | effort, | ||
openmpt_log_func | logfunc, | ||
void * | loguser, | ||
openmpt_error_func | errfunc, | ||
void * | erruser, | ||
int * | error, | ||
const char ** | error_message | ||
) |
Roughly scan the input stream to find out whether libopenmpt might be able to open it.
stream_callbacks | Input stream callback operations. |
stream | Input stream to scan. |
effort | Effort to make when validating stream. Effort 0.0 does not even look at stream at all and effort 1.0 completely loads the file from stream. A lower effort requires less data to be loaded but only gives a rough estimate answer. Use an effort of 0.25 to only verify the header data of the module file. |
logfunc | Logging function where warning and errors are written. May be NULL. |
loguser | Logging function user context. Used to pass any user-defined data associated with this module to the logging function. |
errfunc | Error function to define error behaviour. May be NULL. |
erruser | Error function user context. Used to pass any user-defined data associated with this module to the logging function. |
error | Pointer to an integer where an error may get stored. May be NULL. |
error_message | Pointer to a string pointer where an error message may get stored. May be NULL. |
double openmpt_could_open_propability | ( | openmpt_stream_callbacks | stream_callbacks, |
void * | stream, | ||
double | effort, | ||
openmpt_log_func | logfunc, | ||
void * | user | ||
) |
Roughly scan the input stream to find out whether libopenmpt might be able to open it.
stream_callbacks | Input stream callback operations. |
stream | Input stream to scan. |
effort | Effort to make when validating stream. Effort 0.0 does not even look at stream at all and effort 1.0 completely loads the file from stream. A lower effort requires less data to be loaded but only gives a rough estimate answer. Use an effort of 0.25 to only verify the header data of the module file. |
logfunc | Logging function where warning and errors are written. May be NULL. |
user | Logging function user context. Used to pass any user-defined data associated with this module to the logging function. |
int openmpt_error_func_default | ( | int | error, |
void * | user | ||
) |
Default error function.
Causes all errors to be logged and stored.
error | Error code. |
user | Ignored. |
OPENMPT_ERROR_FUNC_RESULT_DEFAULT | Always. |
int openmpt_error_func_errno | ( | int | error, |
void * | user | ||
) |
Errno error function.
Causes all errors to be stored in the pointer passed in as user.
error | Error code. |
user | Pointer to an int as generated by openmpt_error_func_errno_userdata. |
OPENMPT_ERROR_FUNC_RESULT_NONE | user is not NULL. |
OPENMPT_ERROR_FUNC_RESULT_DEFAULT | user is NULL. |
void * openmpt_error_func_errno_userdata | ( | int * | error | ) |
User pointer for openmpt_error_func_errno.
Provides a suitable user pointer argument for openmpt_error_func_errno.
error | Pointer to an integer value to be used as output by openmpt_error_func_errno. |
(void*)error. |
int openmpt_error_func_ignore | ( | int | error, |
void * | user | ||
) |
Ignore error function.
Causes all errors to be neither logged nor stored.
error | Error code. |
user | Ignored. |
OPENMPT_ERROR_FUNC_RESULT_NONE | Always. |
int openmpt_error_func_log | ( | int | error, |
void * | user | ||
) |
Log error function.
Causes all errors to be logged.
error | Error code. |
user | Ignored. |
OPENMPT_ERROR_FUNC_RESULT_LOG | Always. |
int openmpt_error_func_store | ( | int | error, |
void * | user | ||
) |
Store error function.
Causes all errors to be stored.
error | Error code. |
user | Ignored. |
OPENMPT_ERROR_FUNC_RESULT_STORE | Always. |
int openmpt_error_is_transient | ( | int | error | ) |
Check whether the error is transient.
Checks whether an error code represents a transient error which may not occur again in a later try if for example memory has been freed up after an out-of-memory error.
error | Error code. |
0 | Error is not transient. |
1 | Error is transient. |
const char * openmpt_error_string | ( | int | error | ) |
Convert error code to text.
Converts an error code into a text string describing the error.
error | Error code. |
NULL | Not enough memory to allocate the string. |
void openmpt_free_string | ( | const char * | str | ) |
Free a string returned by libopenmpt.
Frees any string that got returned by libopenmpt.
uint32_t openmpt_get_core_version | ( | void | ) |
Get the core version number.
Return the OpenMPT core version number.
uint32_t openmpt_get_library_version | ( | void | ) |
Get the libopenmpt version number.
Returns the libopenmpt version number.
const char * openmpt_get_string | ( | const char * | key | ) |
Get library related metadata.
key | Key to query. Possible keys are:
|
const char * openmpt_get_supported_extensions | ( | void | ) |
Get a list of supported file extensions.
int openmpt_is_extension_supported | ( | const char * | extension | ) |
Query whether a file extension is supported.
extension | file extension to query without a leading dot. The case is ignored. |
void openmpt_log_func_default | ( | const char * | message, |
void * | user | ||
) |
Default logging function.
Default logging function that logs anything to stderr.
void openmpt_log_func_silent | ( | const char * | message, |
void * | user | ||
) |
Silent logging function.
Silent logging function that throws any log message away.
openmpt_module * openmpt_module_create | ( | openmpt_stream_callbacks | stream_callbacks, |
void * | stream, | ||
openmpt_log_func | logfunc, | ||
void * | loguser, | ||
const openmpt_module_initial_ctl * | ctls | ||
) |
Construct an openmpt_module.
stream_callbacks | Input stream callback operations. |
stream | Input stream to load the module from. |
logfunc | Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module. May be NULL. |
loguser | User-defined data associated with this module. This value will be passed to the logging callback function (logfunc) |
ctls | An array of initial ctl and value pairs stored in openmpt_module_initial_ctl, terminated by a pair of NULL and NULL. See openmpt_module_get_ctls and openmpt_module_ctl_set. |
openmpt_module * openmpt_module_create2 | ( | 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.
stream_callbacks | Input stream callback operations. |
stream | Input stream to load the module from. |
logfunc | Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module. May be NULL. |
loguser | User-defined data associated with this module. This value will be passed to the logging callback function (logfunc) |
errfunc | Error function to define error behaviour. May be NULL. |
erruser | Error function user context. Used to pass any user-defined data associated with this module to the logging function. |
error | Pointer to an integer where an error may get stored. May be NULL. |
error_message | Pointer to a string pointer where an error message may get stored. May be NULL. |
ctls | An array of initial ctl and value pairs stored in openmpt_module_initial_ctl, terminated by a pair of NULL and NULL. See openmpt_module_get_ctls and openmpt_module_ctl_set. |
openmpt_module * openmpt_module_create_from_memory | ( | const void * | filedata, |
size_t | filesize, | ||
openmpt_log_func | logfunc, | ||
void * | loguser, | ||
const openmpt_module_initial_ctl * | ctls | ||
) |
Construct an openmpt_module.
filedata | Data to load the module from. |
filesize | Amount of data available. |
logfunc | Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module. |
loguser | User-defined data associated with this module. This value will be passed to the logging callback function (logfunc) |
ctls | An array of initial ctl and value pairs stored in openmpt_module_initial_ctl, terminated by a pair of NULL and NULL. See openmpt_module_get_ctls and openmpt_module_ctl_set. |
openmpt_module * openmpt_module_create_from_memory2 | ( | 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.
filedata | Data to load the module from. |
filesize | Amount of data available. |
logfunc | Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module. |
loguser | User-defined data associated with this module. This value will be passed to the logging callback function (logfunc) |
errfunc | Error function to define error behaviour. May be NULL. |
erruser | Error function user context. Used to pass any user-defined data associated with this module to the logging function. |
error | Pointer to an integer where an error may get stored. May be NULL. |
error_message | Pointer to a string pointer where an error message may get stored. May be NULL. |
ctls | An array of initial ctl and value pairs stored in openmpt_module_initial_ctl, terminated by a pair of NULL and NULL. See openmpt_module_get_ctls and openmpt_module_ctl_set. |
const char * openmpt_module_ctl_get | ( | openmpt_module * | mod, |
const char * | ctl | ||
) |
Get current ctl value.
mod | The module handle to work on. |
ctl | The ctl key whose value should be retrieved. |
int openmpt_module_ctl_get_boolean | ( | openmpt_module * | mod, |
const char * | ctl | ||
) |
Get current ctl boolean value.
mod | The module handle to work on. |
ctl | The ctl key whose value should be retrieved. |
double openmpt_module_ctl_get_floatingpoint | ( | openmpt_module * | mod, |
const char * | ctl | ||
) |
Get current ctl floatingpoint value.
mod | The module handle to work on. |
ctl | The ctl key whose value should be retrieved. |
int64_t openmpt_module_ctl_get_integer | ( | openmpt_module * | mod, |
const char * | ctl | ||
) |
Get current ctl integer value.
mod | The module handle to work on. |
ctl | The ctl key whose value should be retrieved. |
const char * openmpt_module_ctl_get_text | ( | openmpt_module * | mod, |
const char * | ctl | ||
) |
Get current ctl string value.
mod | The module handle to work on. |
ctl | The ctl key whose value should be retrieved. |
int openmpt_module_ctl_set | ( | openmpt_module * | mod, |
const char * | ctl, | ||
const char * | value | ||
) |
Set ctl value.
mod | The module handle to work on. |
ctl | The ctl key whose value should be set. |
value | The value that should be set. |
int openmpt_module_ctl_set_boolean | ( | openmpt_module * | mod, |
const char * | ctl, | ||
int | value | ||
) |
Set ctl boolean value.
mod | The module handle to work on. |
ctl | The ctl key whose value should be set. |
value | The value that should be set. |
int openmpt_module_ctl_set_floatingpoint | ( | openmpt_module * | mod, |
const char * | ctl, | ||
double | value | ||
) |
Set ctl floatingpoint value.
mod | The module handle to work on. |
ctl | The ctl key whose value should be set. |
value | The value that should be set. |
int openmpt_module_ctl_set_integer | ( | openmpt_module * | mod, |
const char * | ctl, | ||
int64_t | value | ||
) |
Set ctl integer value.
mod | The module handle to work on. |
ctl | The ctl key whose value should be set. |
value | The value that should be set. |
int openmpt_module_ctl_set_text | ( | openmpt_module * | mod, |
const char * | ctl, | ||
const char * | value | ||
) |
Set ctl string value.
mod | The module handle to work on. |
ctl | The ctl key whose value should be set. |
value | The value that should be set. |
void openmpt_module_destroy | ( | openmpt_module * | mod | ) |
Unload a previously created openmpt_module from memory.
mod | The module to unload. |
void openmpt_module_error_clear | ( | openmpt_module * | mod | ) |
Clear last error.
Set the error currently stored in an openmpt_module to OPPENMPT_ERROR_OK.
mod | The module handle to work on. |
int openmpt_module_error_get_last | ( | openmpt_module * | mod | ) |
Get last error.
Return the error currently stored in an openmpt_module. The stored error is not cleared.
mod | The module handle to work on. |
const char * openmpt_module_error_get_last_message | ( | openmpt_module * | mod | ) |
Get last error message.
Return the error message currently stored in an openmpt_module. The stored error is not cleared.
mod | The module handle to work on. |
void openmpt_module_error_set_last | ( | openmpt_module * | mod, |
int | error | ||
) |
Set last error.
Set the error currently stored in an openmpt_module.
mod | The module handle to work on. |
error | Error to be stored. |
const char * openmpt_module_format_pattern_row_channel | ( | openmpt_module * | mod, |
int32_t | pattern, | ||
int32_t | row, | ||
int32_t | channel, | ||
size_t | width, | ||
int | pad | ||
) |
Get formatted (human-readable) pattern content.
mod | The module handle to work on. |
pattern | The pattern whose data should be retrieved. |
row | The row from which the data should be retrieved. |
channel | The channel from which the data should be retrieved. |
width | The maximum number of characters the string should contain. 0 means no limit. |
pad | If true, the string will be resized to the exact length provided in the width parameter. |
const char * openmpt_module_format_pattern_row_channel_command | ( | openmpt_module * | mod, |
int32_t | pattern, | ||
int32_t | row, | ||
int32_t | channel, | ||
int | command | ||
) |
Get formatted (human-readable) pattern content.
mod | The module handle to work on. |
pattern | The pattern whose data should be retrieved. |
row | The row from which the data should be retrieved. |
channel | The channel from which the data should be retrieved. |
command | The cell index at which the data should be retrieved. |
const char * openmpt_module_get_channel_name | ( | openmpt_module * | mod, |
int32_t | index | ||
) |
Get a channel name.
mod | The module handle to work on. |
index | The channel whose name should be retrieved |
const char * openmpt_module_get_ctls | ( | openmpt_module * | mod | ) |
Retrieve supported ctl keys.
mod | The module handle to work on. |
float openmpt_module_get_current_channel_vu_left | ( | openmpt_module * | mod, |
int32_t | channel | ||
) |
Get an approximate indication of the channel volume on the front-left speaker.
mod | The module handle to work on. |
channel | The channel whose volume should be retrieved. |
float openmpt_module_get_current_channel_vu_mono | ( | openmpt_module * | mod, |
int32_t | channel | ||
) |
Get an approximate indication of the channel volume.
mod | The module handle to work on. |
channel | The channel whose volume should be retrieved. |
float openmpt_module_get_current_channel_vu_rear_left | ( | openmpt_module * | mod, |
int32_t | channel | ||
) |
Get an approximate indication of the channel volume on the rear-left speaker.
mod | The module handle to work on. |
channel | The channel whose volume should be retrieved. |
float openmpt_module_get_current_channel_vu_rear_right | ( | openmpt_module * | mod, |
int32_t | channel | ||
) |
Get an approximate indication of the channel volume on the rear-right speaker.
mod | The module handle to work on. |
channel | The channel whose volume should be retrieved. |
float openmpt_module_get_current_channel_vu_right | ( | openmpt_module * | mod, |
int32_t | channel | ||
) |
Get an approximate indication of the channel volume on the front-right speaker.
mod | The module handle to work on. |
channel | The channel whose volume should be retrieved. |
double openmpt_module_get_current_estimated_bpm | ( | openmpt_module * | mod | ) |
Get the current estimated beats per minute (BPM).
mod | The module handle to work on. |
int32_t openmpt_module_get_current_order | ( | openmpt_module * | mod | ) |
Get the current order.
mod | The module handle to work on. |
int32_t openmpt_module_get_current_pattern | ( | openmpt_module * | mod | ) |
Get the current pattern.
mod | The module handle to work on. |
int32_t openmpt_module_get_current_playing_channels | ( | openmpt_module * | mod | ) |
Get the current amount of playing channels.
mod | The module handle to work on. |
int32_t openmpt_module_get_current_row | ( | openmpt_module * | mod | ) |
Get the current row.
mod | The module handle to work on. |
int32_t openmpt_module_get_current_speed | ( | openmpt_module * | mod | ) |
Get the current speed.
mod | The module handle to work on. |
int32_t openmpt_module_get_current_tempo | ( | openmpt_module * | mod | ) |
Get the current tempo.
mod | The module handle to work on. |
double openmpt_module_get_current_tempo2 | ( | openmpt_module * | mod | ) |
Get the current tempo.
mod | The module handle to work on. |
double openmpt_module_get_duration_seconds | ( | openmpt_module * | mod | ) |
approximate song duration
mod | The module handle to work on. |
const char * openmpt_module_get_instrument_name | ( | openmpt_module * | mod, |
int32_t | index | ||
) |
Get an instrument name.
mod | The module handle to work on. |
index | The instrument whose name should be retrieved |
const char * openmpt_module_get_metadata | ( | openmpt_module * | mod, |
const char * | key | ||
) |
Get a metadata item value.
mod | The module handle to work on. |
key | Metadata item key to query. Use openmpt_module_get_metadata_keys to check for available keys. Possible keys are:
|
const char * openmpt_module_get_metadata_keys | ( | openmpt_module * | mod | ) |
Get the list of supported metadata item keys.
mod | The module handle to work on. |
int32_t openmpt_module_get_num_channels | ( | openmpt_module * | mod | ) |
Get the number of pattern channels.
mod | The module handle to work on. |
int32_t openmpt_module_get_num_instruments | ( | openmpt_module * | mod | ) |
Get the number of instruments.
mod | The module handle to work on. |
int32_t openmpt_module_get_num_orders | ( | openmpt_module * | mod | ) |
Get the number of orders.
mod | The module handle to work on. |
int32_t openmpt_module_get_num_patterns | ( | openmpt_module * | mod | ) |
Get the number of patterns.
mod | The module handle to work on. |
int32_t openmpt_module_get_num_samples | ( | openmpt_module * | mod | ) |
Get the number of samples.
mod | The module handle to work on. |
int32_t openmpt_module_get_num_subsongs | ( | openmpt_module * | mod | ) |
Get the number of sub-songs.
mod | The module handle to work on. |
const char * openmpt_module_get_order_name | ( | openmpt_module * | mod, |
int32_t | index | ||
) |
Get an order name.
mod | The module handle to work on. |
index | The order whose name should be retrieved |
int32_t openmpt_module_get_order_pattern | ( | openmpt_module * | mod, |
int32_t | order | ||
) |
Get pattern at order position.
mod | The module handle to work on. |
order | The order item whose pattern index should be retrieved. |
const char * openmpt_module_get_pattern_name | ( | openmpt_module * | mod, |
int32_t | index | ||
) |
Get a pattern name.
mod | The module handle to work on. |
index | The pattern whose name should be retrieved |
int32_t openmpt_module_get_pattern_num_rows | ( | openmpt_module * | mod, |
int32_t | pattern | ||
) |
Get the number of rows in a pattern.
mod | The module handle to work on. |
pattern | The pattern whose row count should be retrieved. |
uint8_t openmpt_module_get_pattern_row_channel_command | ( | openmpt_module * | mod, |
int32_t | pattern, | ||
int32_t | row, | ||
int32_t | channel, | ||
int | command | ||
) |
Get raw pattern content.
mod | The module handle to work on. |
pattern | The pattern whose data should be retrieved. |
row | The row from which the data should be retrieved. |
channel | The channel from which the data should be retrieved. |
command | The cell index at which the data should be retrieved. See Pattern cell indices |
double openmpt_module_get_position_seconds | ( | openmpt_module * | mod | ) |
Get current song position.
mod | The module handle to work on. |
int openmpt_module_get_render_param | ( | openmpt_module * | mod, |
int | param, | ||
int32_t * | value | ||
) |
Get render parameter.
mod | The module handle to work on. |
param | Parameter to query. See Render param indices |
value | Pointer to the variable that receives the current value of the parameter. |
int32_t openmpt_module_get_repeat_count | ( | openmpt_module * | mod | ) |
Get Repeat Count.
mod | The module handle to work on. |
const char * openmpt_module_get_sample_name | ( | openmpt_module * | mod, |
int32_t | index | ||
) |
Get a sample name.
mod | The module handle to work on. |
index | The sample whose name should be retrieved |
int32_t openmpt_module_get_selected_subsong | ( | openmpt_module * | mod | ) |
Get currently selected sub-song from a multi-song module.
mod | The module handle to work on. |
const char * openmpt_module_get_subsong_name | ( | openmpt_module * | mod, |
int32_t | index | ||
) |
Get a sub-song name.
mod | The module handle to work on. |
index | The sub-song whose name should be retrieved |
const char * openmpt_module_highlight_pattern_row_channel | ( | openmpt_module * | mod, |
int32_t | pattern, | ||
int32_t | row, | ||
int32_t | channel, | ||
size_t | width, | ||
int | pad | ||
) |
Get highlighting information for formatted pattern content.
mod | The module handle to work on. |
pattern | The pattern whose data should be retrieved. |
row | The row from which the data should be retrieved. |
channel | The channel from which the data should be retrieved. |
width | The maximum number of characters the string should contain. 0 means no limit. |
pad | If true, the string will be resized to the exact length provided in the width parameter. |
const char * openmpt_module_highlight_pattern_row_channel_command | ( | openmpt_module * | mod, |
int32_t | pattern, | ||
int32_t | row, | ||
int32_t | channel, | ||
int | command | ||
) |
Get highlighting information for formatted pattern content.
mod | The module handle to work on. |
pattern | The pattern whose data should be retrieved. |
row | The row from which the data should be retrieved. |
channel | The channel from which the data should be retrieved. |
command | The cell index at which the data should be retrieved. See Pattern cell indices |
size_t openmpt_module_read_float_mono | ( | openmpt_module * | mod, |
int32_t | samplerate, | ||
size_t | count, | ||
float * | mono | ||
) |
Render audio data.
mod | The module handle to work on. |
samplerate | Sample rate to render output. Should be in [8000,192000], but this is not enforced. |
count | Number of audio frames to render per channel. |
mono | Pointer to a buffer of at least count elements that receives the mono/center output. |
0 | The end of song has been reached. |
size_t openmpt_module_read_float_quad | ( | openmpt_module * | mod, |
int32_t | samplerate, | ||
size_t | count, | ||
float * | left, | ||
float * | right, | ||
float * | rear_left, | ||
float * | rear_right | ||
) |
Render audio data.
mod | The module handle to work on. |
samplerate | Sample rate to render output. Should be in [8000,192000], but this is not enforced. |
count | Number of audio frames to render per channel. |
left | Pointer to a buffer of at least count elements that receives the left output. |
right | Pointer to a buffer of at least count elements that receives the right output. |
rear_left | Pointer to a buffer of at least count elements that receives the rear left output. |
rear_right | Pointer to a buffer of at least count elements that receives the rear right output. |
0 | The end of song has been reached. |
size_t openmpt_module_read_float_stereo | ( | openmpt_module * | mod, |
int32_t | samplerate, | ||
size_t | count, | ||
float * | left, | ||
float * | right | ||
) |
Render audio data.
mod | The module handle to work on. |
samplerate | Sample rate to render output. Should be in [8000,192000], but this is not enforced. |
count | Number of audio frames to render per channel. |
left | Pointer to a buffer of at least count elements that receives the left output. |
right | Pointer to a buffer of at least count elements that receives the right output. |
0 | The end of song has been reached. |
size_t openmpt_module_read_interleaved_float_quad | ( | openmpt_module * | mod, |
int32_t | samplerate, | ||
size_t | count, | ||
float * | interleaved_quad | ||
) |
Render audio data.
mod | The module handle to work on. |
samplerate | Sample rate to render output. Should be in [8000,192000], but this is not enforced. |
count | Number of audio frames to render per channel. |
interleaved_quad | Pointer to a buffer of at least count*4 elements that receives the interleaved quad surround output in the order (L,R,RL,RR). |
0 | The end of song has been reached. |
size_t openmpt_module_read_interleaved_float_stereo | ( | openmpt_module * | mod, |
int32_t | samplerate, | ||
size_t | count, | ||
float * | interleaved_stereo | ||
) |
Render audio data.
mod | The module handle to work on. |
samplerate | Sample rate to render output. Should be in [8000,192000], but this is not enforced. |
count | Number of audio frames to render per channel. |
interleaved_stereo | Pointer to a buffer of at least count*2 elements that receives the interleaved stereo output in the order (L,R). |
0 | The end of song has been reached. |
size_t openmpt_module_read_interleaved_quad | ( | openmpt_module * | mod, |
int32_t | samplerate, | ||
size_t | count, | ||
int16_t * | interleaved_quad | ||
) |
Render audio data.
mod | The module handle to work on. |
samplerate | Sample rate to render output. Should be in [8000,192000], but this is not enforced. |
count | Number of audio frames to render per channel. |
interleaved_quad | Pointer to a buffer of at least count*4 elements that receives the interleaved quad surround output in the order (L,R,RL,RR). |
0 | The end of song has been reached. |
size_t openmpt_module_read_interleaved_stereo | ( | openmpt_module * | mod, |
int32_t | samplerate, | ||
size_t | count, | ||
int16_t * | interleaved_stereo | ||
) |
Render audio data.
mod | The module handle to work on. |
samplerate | Sample rate to render output. Should be in [8000,192000], but this is not enforced. |
count | Number of audio frames to render per channel. |
interleaved_stereo | Pointer to a buffer of at least count*2 elements that receives the interleaved stereo output in the order (L,R). |
0 | The end of song has been reached. |
size_t openmpt_module_read_mono | ( | openmpt_module * | mod, |
int32_t | samplerate, | ||
size_t | count, | ||
int16_t * | mono | ||
) |
Render audio data.
mod | The module handle to work on. |
samplerate | Sample rate to render output. Should be in [8000,192000], but this is not enforced. |
count | Number of audio frames to render per channel. |
mono | Pointer to a buffer of at least count elements that receives the mono/center output. |
0 | The end of song has been reached. |
size_t openmpt_module_read_quad | ( | openmpt_module * | mod, |
int32_t | samplerate, | ||
size_t | count, | ||
int16_t * | left, | ||
int16_t * | right, | ||
int16_t * | rear_left, | ||
int16_t * | rear_right | ||
) |
Render audio data.
mod | The module handle to work on. |
samplerate | Sample rate to render output. Should be in [8000,192000], but this is not enforced. |
count | Number of audio frames to render per channel. |
left | Pointer to a buffer of at least count elements that receives the left output. |
right | Pointer to a buffer of at least count elements that receives the right output. |
rear_left | Pointer to a buffer of at least count elements that receives the rear left output. |
rear_right | Pointer to a buffer of at least count elements that receives the rear right output. |
0 | The end of song has been reached. |
size_t openmpt_module_read_stereo | ( | openmpt_module * | mod, |
int32_t | samplerate, | ||
size_t | count, | ||
int16_t * | left, | ||
int16_t * | right | ||
) |
Render audio data.
mod | The module handle to work on. |
samplerate | Sample rate to render output. Should be in [8000,192000], but this is not enforced. |
count | Number of audio frames to render per channel. |
left | Pointer to a buffer of at least count elements that receives the left output. |
right | Pointer to a buffer of at least count elements that receives the right output. |
0 | The end of song has been reached. |
int openmpt_module_select_subsong | ( | openmpt_module * | mod, |
int32_t | subsong | ||
) |
Select a sub-song from a multi-song module.
mod | The module handle to work on. |
subsong | Index of the sub-song. -1 plays all sub-songs consecutively. |
void openmpt_module_set_error_func | ( | openmpt_module * | mod, |
openmpt_error_func | errfunc, | ||
void * | erruser | ||
) |
Set error function.
Set the error function of an already constructed openmpt_module.
mod | The module handle to work on. |
errfunc | Error function to define error behaviour. May be NULL. |
erruser | Error function user context. |
void openmpt_module_set_log_func | ( | openmpt_module * | mod, |
openmpt_log_func | logfunc, | ||
void * | loguser | ||
) |
Set logging function.
Set the logging function of an already constructed openmpt_module.
mod | The module handle to work on. |
logfunc | Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module. |
loguser | User-defined data associated with this module. This value will be passed to the logging callback function (logfunc) |
double openmpt_module_set_position_order_row | ( | openmpt_module * | mod, |
int32_t | order, | ||
int32_t | row | ||
) |
Set approximate current song position.
If order or row are out of range, to position is not modified and the current position is returned.
mod | The module handle to work on. |
order | Pattern order number to seek to. |
row | Pattern row number to seek to. |
double openmpt_module_set_position_seconds | ( | openmpt_module * | mod, |
double | seconds | ||
) |
Set approximate current song position.
mod | The module handle to work on. |
seconds | Seconds to seek to. If seconds is out of range, the position gets set to song start or end respectively. |
int openmpt_module_set_render_param | ( | openmpt_module * | mod, |
int | param, | ||
int32_t | value | ||
) |
Set render parameter.
mod | The module handle to work on. |
param | Parameter to set. See Render param indices |
value | The value to set param to. |
int openmpt_module_set_repeat_count | ( | openmpt_module * | mod, |
int32_t | repeat_count | ||
) |
Set Repeat Count.
mod | The module handle to work on. |
repeat_count | Repeat Count
|
int openmpt_probe_file_header | ( | uint64_t | flags, |
const void * | data, | ||
size_t | size, | ||
uint64_t | filesize, | ||
openmpt_log_func | logfunc, | ||
void * | loguser, | ||
openmpt_error_func | errfunc, | ||
void * | erruser, | ||
int * | error, | ||
const char ** | error_message | ||
) |
Probe the provided bytes from the beginning of a file for supported file format headers to find out whether libopenmpt might be able to open it.
flags | Bit mask of OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES and OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS, or OPENMPT_PROBE_FILE_HEADER_FLAGS_DEFAULT. |
data | Beginning of the file data. |
size | Size of the beginning of the file data. |
filesize | Full size of the file data on disk. |
logfunc | Logging function where warning and errors are written. May be NULL. |
loguser | Logging function user context. Used to pass any user-defined data associated with this module to the logging function. |
errfunc | Error function to define error behaviour. May be NULL. |
erruser | Error function user context. Used to pass any user-defined data associated with this module to the logging function. |
error | Pointer to an integer where an error may get stored. May be NULL. |
error_message | Pointer to a string pointer where an error message may get stored. May be NULL. |
OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS | The file will most likely be supported by libopenmpt. |
OPENMPT_PROBE_FILE_HEADER_RESULT_FAILURE | The file is not supported by libopenmpt. |
OPENMPT_PROBE_FILE_HEADER_RESULT_WANTMOREDATA | An answer could not be determined with the amount of data provided. |
OPENMPT_PROBE_FILE_HEADER_RESULT_ERROR | An internal error occurred. |
int openmpt_probe_file_header_from_stream | ( | uint64_t | flags, |
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 | ||
) |
Probe the provided bytes from the beginning of a file for supported file format headers to find out whether libopenmpt might be able to open it.
flags | Bit mask of OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES and OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS, or OPENMPT_PROBE_FILE_HEADER_FLAGS_DEFAULT. |
stream_callbacks | Input stream callback operations. |
stream | Input stream to scan. |
logfunc | Logging function where warning and errors are written. May be NULL. |
loguser | Logging function user context. Used to pass any user-defined data associated with this module to the logging function. |
errfunc | Error function to define error behaviour. May be NULL. |
erruser | Error function user context. Used to pass any user-defined data associated with this module to the logging function. |
error | Pointer to an integer where an error may get stored. May be NULL. |
error_message | Pointer to a string pointer where an error message may get stored. May be NULL. |
OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS | The file will most likely be supported by libopenmpt. |
OPENMPT_PROBE_FILE_HEADER_RESULT_FAILURE | The file is not supported by libopenmpt. |
OPENMPT_PROBE_FILE_HEADER_RESULT_WANTMOREDATA | An answer could not be determined with the amount of data provided. |
OPENMPT_PROBE_FILE_HEADER_RESULT_ERROR | An internal error occurred. |
size_t openmpt_probe_file_header_get_recommended_size | ( | void | ) |
Get recommended header size for successfull format probing.
int openmpt_probe_file_header_without_filesize | ( | uint64_t | flags, |
const void * | data, | ||
size_t | size, | ||
openmpt_log_func | logfunc, | ||
void * | loguser, | ||
openmpt_error_func | errfunc, | ||
void * | erruser, | ||
int * | error, | ||
const char ** | error_message | ||
) |
Probe the provided bytes from the beginning of a file for supported file format headers to find out whether libopenmpt might be able to open it.
flags | Bit mask of OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES and OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS, or OPENMPT_PROBE_FILE_HEADER_FLAGS_DEFAULT. |
data | Beginning of the file data. |
size | Size of the beginning of the file data. |
logfunc | Logging function where warning and errors are written. May be NULL. |
loguser | Logging function user context. Used to pass any user-defined data associated with this module to the logging function. |
errfunc | Error function to define error behaviour. May be NULL. |
erruser | Error function user context. Used to pass any user-defined data associated with this module to the logging function. |
error | Pointer to an integer where an error may get stored. May be NULL. |
error_message | Pointer to a string pointer where an error message may get stored. May be NULL. |
OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS | The file will most likely be supported by libopenmpt. |
OPENMPT_PROBE_FILE_HEADER_RESULT_FAILURE | The file is not supported by libopenmpt. |
OPENMPT_PROBE_FILE_HEADER_RESULT_WANTMOREDATA | An answer could not be determined with the amount of data provided. |
OPENMPT_PROBE_FILE_HEADER_RESULT_ERROR | An internal error occurred. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Provide openmpt_stream_callbacks for in-memoy buffers.
Fills openmpt_stream_callbacks suitable for passing an in-memory buffer as a stream parameter to functions doing file input/output. A suitable openmpt_stream_buffer object may be initialized with openmpt_stream_buffer_init().
(void*)(openmpt_stream_buffer*)stream_buffer
.
|
static |
Provide openmpt_stream_callbacks for in-memoy buffers.
Fills openmpt_stream_callbacks suitable for passing an in-memory buffer as a stream parameter to functions doing file input/output. A suitable openmpt_stream_buffer2 object can be initialized with openmpt_stream_buffer_init2().
(void*)(openmpt_stream_buffer2*)stream_buffer
.
|
static |
Provide openmpt_stream_callbacks for standard POSIX file descriptors.
Fills openmpt_stream_callbacks suitable for passing a POSIX filer descriptor as a stream parameter to functions doing file input/output.
(void*)(uintptr_t)(int)fd
.
|
static |
Provide openmpt_stream_callbacks for standard C FILE objects.
Fills openmpt_stream_callbacks suitable for passing a standard C FILE object as a stream parameter to functions doing file input/output. Since 0.7.0, it does not try to use platform-specific file seeking any more, but sticks to standard C fseek/ftell only, which means on platforms where long is 32bit, there is no 64bit file access possible any more.
(void*)(FILE*)file
.
|
static |
Provide openmpt_stream_callbacks for standard C FILE objects.
Fills openmpt_stream_callbacks suitable for passing a standard C FILE object as a stream parameter to functions doing file input/output. This function uses the standard C fseek and ftell, thus platform-specific file size limits apply accordingly.
(void*)(FILE*)file
.
|
static |
Provide openmpt_stream_callbacks for standard C FILE objects.
Fills openmpt_stream_callbacks suitable for passing a standard C FILE object as a stream parameter to functions doing file input/output.
(void*)(FILE*)file
.
|
static |
Provide openmpt_stream_callbacks for standard C FILE objects.
Fills openmpt_stream_callbacks suitable for passing a standard C FILE object as a stream parameter to functions doing file input/output.
(void*)(FILE*)file
.
|
static |
Provide openmpt_stream_callbacks for standard C FILE objects.
Fills openmpt_stream_callbacks suitable for passing a standard C FILE object as a stream parameter to functions doing file input/output.
(void*)(FILE*)file
.
|
static |
Provide openmpt_stream_callbacks for standard C FILE objects.
Fills openmpt_stream_callbacks suitable for passing a standard C FILE object as a stream parameter to functions doing file input/output.
(void*)(FILE*)file
.