libopenmpt 0.8.0-pre.12+r22603
cross-platform C++ and C library to decode tracked music files
libopenmpt.h
Go to the documentation of this file.
1/*
2 * libopenmpt.h
3 * ------------
4 * Purpose: libopenmpt public c interface
5 * Notes : (currently none)
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_H
11#define LIBOPENMPT_H
12
13#include "libopenmpt_config.h"
14#include <stddef.h>
15#include <stdint.h>
16
173#ifdef __cplusplus
174extern "C" {
175#endif
176
183LIBOPENMPT_API uint32_t openmpt_get_library_version(void);
184
190LIBOPENMPT_API uint32_t openmpt_get_core_version(void);
191
193#define OPENMPT_STRING_LIBRARY_VERSION LIBOPENMPT_DEPRECATED_STRING( "library_version" )
195#define OPENMPT_STRING_LIBRARY_FEATURES LIBOPENMPT_DEPRECATED_STRING( "library_features" )
197#define OPENMPT_STRING_CORE_VERSION LIBOPENMPT_DEPRECATED_STRING( "core_version" )
199#define OPENMPT_STRING_BUILD LIBOPENMPT_DEPRECATED_STRING( "build" )
201#define OPENMPT_STRING_CREDITS LIBOPENMPT_DEPRECATED_STRING( "credits" )
203#define OPENMPT_STRING_CONTACT LIBOPENMPT_DEPRECATED_STRING( "contact" )
205#define OPENMPT_STRING_LICENSE LIBOPENMPT_DEPRECATED_STRING( "license" )
206
211LIBOPENMPT_API void openmpt_free_string( const char * str );
212
237LIBOPENMPT_API const char * openmpt_get_string( const char * key );
238
243LIBOPENMPT_API const char * openmpt_get_supported_extensions(void);
244
250LIBOPENMPT_API int openmpt_is_extension_supported( const char * extension );
251
253#define OPENMPT_STREAM_SEEK_SET 0
255#define OPENMPT_STREAM_SEEK_CUR 1
257#define OPENMPT_STREAM_SEEK_END 2
258
269typedef size_t (*openmpt_stream_read_func)( void * stream, void * dst, size_t bytes );
270
282typedef int (*openmpt_stream_seek_func)( void * stream, int64_t offset, int whence );
283
291typedef int64_t (*openmpt_stream_tell_func)( void * stream );
292
301
307
314
321
323
329typedef void (*openmpt_log_func)( const char * message, void * user );
330
335LIBOPENMPT_API void openmpt_log_func_default( const char * message, void * user );
336
341LIBOPENMPT_API void openmpt_log_func_silent( const char * message, void * user );
342
344#define OPENMPT_ERROR_OK 0
345
347#define OPENMPT_ERROR_BASE 256
348
350#define OPENMPT_ERROR_UNKNOWN ( OPENMPT_ERROR_BASE + 1 )
351
353#define OPENMPT_ERROR_EXCEPTION ( OPENMPT_ERROR_BASE + 11 )
354
356#define OPENMPT_ERROR_OUT_OF_MEMORY ( OPENMPT_ERROR_BASE + 21 )
357
359#define OPENMPT_ERROR_RUNTIME ( OPENMPT_ERROR_BASE + 30 )
361#define OPENMPT_ERROR_RANGE ( OPENMPT_ERROR_BASE + 31 )
363#define OPENMPT_ERROR_OVERFLOW ( OPENMPT_ERROR_BASE + 32 )
365#define OPENMPT_ERROR_UNDERFLOW ( OPENMPT_ERROR_BASE + 33 )
366
368#define OPENMPT_ERROR_LOGIC ( OPENMPT_ERROR_BASE + 40 )
370#define OPENMPT_ERROR_DOMAIN ( OPENMPT_ERROR_BASE + 41 )
372#define OPENMPT_ERROR_LENGTH ( OPENMPT_ERROR_BASE + 42 )
374#define OPENMPT_ERROR_OUT_OF_RANGE ( OPENMPT_ERROR_BASE + 43 )
376#define OPENMPT_ERROR_INVALID_ARGUMENT ( OPENMPT_ERROR_BASE + 44 )
377
379#define OPENMPT_ERROR_GENERAL ( OPENMPT_ERROR_BASE + 101 )
381#define OPENMPT_ERROR_INVALID_MODULE_POINTER ( OPENMPT_ERROR_BASE + 102 )
383#define OPENMPT_ERROR_ARGUMENT_NULL_POINTER ( OPENMPT_ERROR_BASE + 103 )
384
394LIBOPENMPT_API int openmpt_error_is_transient( int error );
395
404LIBOPENMPT_API const char * openmpt_error_string( int error );
405
407#define OPENMPT_ERROR_FUNC_RESULT_NONE 0
409#define OPENMPT_ERROR_FUNC_RESULT_LOG ( 1 << 0 )
411#define OPENMPT_ERROR_FUNC_RESULT_STORE ( 1 << 1 )
413#define OPENMPT_ERROR_FUNC_RESULT_DEFAULT ( OPENMPT_ERROR_FUNC_RESULT_LOG | OPENMPT_ERROR_FUNC_RESULT_STORE )
414
435typedef int (*openmpt_error_func)( int error, void * user );
436
445LIBOPENMPT_API int openmpt_error_func_default( int error, void * user );
446
455LIBOPENMPT_API int openmpt_error_func_log( int error, void * user );
456
465LIBOPENMPT_API int openmpt_error_func_store( int error, void * user );
466
475LIBOPENMPT_API int openmpt_error_func_ignore( int error, void * user );
476
486LIBOPENMPT_API int openmpt_error_func_errno( int error, void * user );
487
495LIBOPENMPT_API void * openmpt_error_func_errno_userdata( int * error );
496
512LIBOPENMPT_API LIBOPENMPT_DEPRECATED double openmpt_could_open_probability( openmpt_stream_callbacks stream_callbacks, void * stream, double effort, openmpt_log_func logfunc, void * user );
513
528LIBOPENMPT_API LIBOPENMPT_DEPRECATED double openmpt_could_open_propability( openmpt_stream_callbacks stream_callbacks, void * stream, double effort, openmpt_log_func logfunc, void * user );
529
551LIBOPENMPT_API 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 );
552
560
562#define OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES 0x1ull
564#define OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS 0x2ull
565
567#define OPENMPT_PROBE_FILE_HEADER_FLAGS_DEFAULT ( OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES | OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS )
569#define OPENMPT_PROBE_FILE_HEADER_FLAGS_NONE 0x0ull
570
572#define OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS 1
574#define OPENMPT_PROBE_FILE_HEADER_RESULT_FAILURE 0
576#define OPENMPT_PROBE_FILE_HEADER_RESULT_WANTMOREDATA (-1)
578#define OPENMPT_PROBE_FILE_HEADER_RESULT_ERROR (-255)
579
604LIBOPENMPT_API 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 );
629LIBOPENMPT_API 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 );
630
655LIBOPENMPT_API 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 );
656
657
661
663 const char * ctl;
664 const char * value;
666
680LIBOPENMPT_API LIBOPENMPT_DEPRECATED openmpt_module * openmpt_module_create( openmpt_stream_callbacks stream_callbacks, void * stream, openmpt_log_func logfunc, void * loguser, const openmpt_module_initial_ctl * ctls );
681
699LIBOPENMPT_API 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 );
700
713LIBOPENMPT_API LIBOPENMPT_DEPRECATED 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 );
714
731LIBOPENMPT_API 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 );
732
737LIBOPENMPT_API void openmpt_module_destroy( openmpt_module * mod );
738
747LIBOPENMPT_API void openmpt_module_set_log_func( openmpt_module * mod, openmpt_log_func logfunc, void * loguser );
748
757LIBOPENMPT_API void openmpt_module_set_error_func( openmpt_module * mod, openmpt_error_func errfunc, void * erruser );
758
770
780LIBOPENMPT_API const char * openmpt_module_error_get_last_message( openmpt_module * mod );
781
791LIBOPENMPT_API void openmpt_module_error_set_last( openmpt_module * mod, int error );
792
801LIBOPENMPT_API void openmpt_module_error_clear( openmpt_module * mod );
802
815#define OPENMPT_MODULE_RENDER_MASTERGAIN_MILLIBEL 1
822#define OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT 2
835#define OPENMPT_MODULE_RENDER_INTERPOLATIONFILTER_LENGTH 3
844#define OPENMPT_MODULE_RENDER_VOLUMERAMPING_STRENGTH 4
853#define OPENMPT_MODULE_COMMAND_NOTE 0
854#define OPENMPT_MODULE_COMMAND_INSTRUMENT 1
855#define OPENMPT_MODULE_COMMAND_VOLUMEEFFECT 2
856#define OPENMPT_MODULE_COMMAND_EFFECT 3
857#define OPENMPT_MODULE_COMMAND_VOLUME 4
858#define OPENMPT_MODULE_COMMAND_PARAMETER 5
869LIBOPENMPT_API int openmpt_module_select_subsong( openmpt_module * mod, int32_t subsong );
878
887LIBOPENMPT_API int32_t openmpt_module_get_restart_order( openmpt_module * mod, int32_t subsong );
896LIBOPENMPT_API int32_t openmpt_module_get_restart_row( openmpt_module * mod, int32_t subsong );
897
908LIBOPENMPT_API int openmpt_module_set_repeat_count( openmpt_module * mod, int32_t repeat_count );
918LIBOPENMPT_API int32_t openmpt_module_get_repeat_count( openmpt_module * mod );
919
927
937LIBOPENMPT_API double openmpt_module_get_time_at_position( openmpt_module * mod, int32_t order, int32_t row );
938
946LIBOPENMPT_API double openmpt_module_set_position_seconds( openmpt_module * mod, double seconds );
954
965LIBOPENMPT_API double openmpt_module_set_position_order_row( openmpt_module * mod, int32_t order, int32_t row );
966
979LIBOPENMPT_API int openmpt_module_get_render_param( openmpt_module * mod, int param, int32_t * value );
992LIBOPENMPT_API int openmpt_module_set_render_param( openmpt_module * mod, int param, int32_t value );
993
1008LIBOPENMPT_API size_t openmpt_module_read_mono( openmpt_module * mod, int32_t samplerate, size_t count, int16_t * mono );
1023LIBOPENMPT_API size_t openmpt_module_read_stereo( openmpt_module * mod, int32_t samplerate, size_t count, int16_t * left, int16_t * right );
1040LIBOPENMPT_API 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 );
1054LIBOPENMPT_API size_t openmpt_module_read_float_mono( openmpt_module * mod, int32_t samplerate, size_t count, float * mono );
1069LIBOPENMPT_API size_t openmpt_module_read_float_stereo( openmpt_module * mod, int32_t samplerate, size_t count, float * left, float * right );
1086LIBOPENMPT_API 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 );
1100LIBOPENMPT_API size_t openmpt_module_read_interleaved_stereo( openmpt_module * mod, int32_t samplerate, size_t count, int16_t * interleaved_stereo );
1114LIBOPENMPT_API size_t openmpt_module_read_interleaved_quad( openmpt_module * mod, int32_t samplerate, size_t count, int16_t * interleaved_quad );
1128LIBOPENMPT_API size_t openmpt_module_read_interleaved_float_stereo( openmpt_module * mod, int32_t samplerate, size_t count, float * interleaved_stereo );
1142LIBOPENMPT_API size_t openmpt_module_read_interleaved_float_quad( openmpt_module * mod, int32_t samplerate, size_t count, float * interleaved_quad );
1151LIBOPENMPT_API const char * openmpt_module_get_metadata_keys( openmpt_module * mod );
1173LIBOPENMPT_API const char * openmpt_module_get_metadata( openmpt_module * mod, const char * key );
1174
1188LIBOPENMPT_API int32_t openmpt_module_get_current_speed( openmpt_module * mod );
1208LIBOPENMPT_API int32_t openmpt_module_get_current_order( openmpt_module * mod );
1220LIBOPENMPT_API int32_t openmpt_module_get_current_row( openmpt_module * mod );
1227
1235LIBOPENMPT_API float openmpt_module_get_current_channel_vu_mono( openmpt_module * mod, int32_t channel );
1243LIBOPENMPT_API float openmpt_module_get_current_channel_vu_left( openmpt_module * mod, int32_t channel );
1251LIBOPENMPT_API float openmpt_module_get_current_channel_vu_right( openmpt_module * mod, int32_t channel );
1259LIBOPENMPT_API float openmpt_module_get_current_channel_vu_rear_left( openmpt_module * mod, int32_t channel );
1267LIBOPENMPT_API float openmpt_module_get_current_channel_vu_rear_right( openmpt_module * mod, int32_t channel );
1268
1275LIBOPENMPT_API int32_t openmpt_module_get_num_subsongs( openmpt_module * mod );
1282LIBOPENMPT_API int32_t openmpt_module_get_num_channels( openmpt_module * mod );
1288LIBOPENMPT_API int32_t openmpt_module_get_num_orders( openmpt_module * mod );
1294LIBOPENMPT_API int32_t openmpt_module_get_num_patterns( openmpt_module * mod );
1306LIBOPENMPT_API int32_t openmpt_module_get_num_samples( openmpt_module * mod );
1307
1315LIBOPENMPT_API const char * openmpt_module_get_subsong_name( openmpt_module * mod, int32_t index );
1323LIBOPENMPT_API const char * openmpt_module_get_channel_name( openmpt_module * mod, int32_t index );
1331LIBOPENMPT_API const char * openmpt_module_get_order_name( openmpt_module * mod, int32_t index );
1339LIBOPENMPT_API const char * openmpt_module_get_pattern_name( openmpt_module * mod, int32_t index );
1347LIBOPENMPT_API const char * openmpt_module_get_instrument_name( openmpt_module * mod, int32_t index );
1355LIBOPENMPT_API const char * openmpt_module_get_sample_name( openmpt_module * mod, int32_t index );
1356
1363LIBOPENMPT_API int32_t openmpt_module_get_order_pattern( openmpt_module * mod, int32_t order );
1364
1373LIBOPENMPT_API int openmpt_module_is_order_skip_entry( openmpt_module * mod, int32_t order );
1382LIBOPENMPT_API int openmpt_module_is_pattern_skip_item( openmpt_module * mod, int32_t pattern );
1391LIBOPENMPT_API int openmpt_module_is_order_stop_entry( openmpt_module * mod, int32_t order );
1400LIBOPENMPT_API int openmpt_module_is_pattern_stop_item( openmpt_module * mod, int32_t pattern );
1401
1408LIBOPENMPT_API int32_t openmpt_module_get_pattern_num_rows( openmpt_module * mod, int32_t pattern );
1409
1418LIBOPENMPT_API int32_t openmpt_module_get_pattern_rows_per_beat( openmpt_module * mod, int32_t pattern );
1419
1427LIBOPENMPT_API int32_t openmpt_module_get_pattern_rows_per_measure( openmpt_module * mod, int32_t pattern );
1428
1438LIBOPENMPT_API uint8_t openmpt_module_get_pattern_row_channel_command( openmpt_module * mod, int32_t pattern, int32_t row, int32_t channel, int command );
1439
1450LIBOPENMPT_API const char * openmpt_module_format_pattern_row_channel_command( openmpt_module * mod, int32_t pattern, int32_t row, int32_t channel, int command );
1472LIBOPENMPT_API const char * openmpt_module_highlight_pattern_row_channel_command( openmpt_module * mod, int32_t pattern, int32_t row, int32_t channel, int command );
1473
1485LIBOPENMPT_API 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 );
1497LIBOPENMPT_API 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 );
1498
1529LIBOPENMPT_API const char * openmpt_module_get_ctls( openmpt_module * mod );
1530
1539LIBOPENMPT_API LIBOPENMPT_DEPRECATED const char * openmpt_module_ctl_get( openmpt_module * mod, const char * ctl );
1548LIBOPENMPT_API int openmpt_module_ctl_get_boolean( openmpt_module * mod, const char * ctl );
1557LIBOPENMPT_API int64_t openmpt_module_ctl_get_integer( openmpt_module * mod, const char * ctl );
1566LIBOPENMPT_API double openmpt_module_ctl_get_floatingpoint( openmpt_module * mod, const char * ctl );
1575LIBOPENMPT_API const char * openmpt_module_ctl_get_text( openmpt_module * mod, const char * ctl );
1576
1586LIBOPENMPT_API LIBOPENMPT_DEPRECATED int openmpt_module_ctl_set( openmpt_module * mod, const char * ctl, const char * value );
1596LIBOPENMPT_API int openmpt_module_ctl_set_boolean( openmpt_module * mod, const char * ctl, int value );
1606LIBOPENMPT_API int openmpt_module_ctl_set_integer( openmpt_module * mod, const char * ctl, int64_t value );
1616LIBOPENMPT_API int openmpt_module_ctl_set_floatingpoint( openmpt_module * mod, const char * ctl, double value );
1626LIBOPENMPT_API int openmpt_module_ctl_set_text( openmpt_module * mod, const char * ctl, const char * value );
1627
1628/* remember to add new functions to both C and C++ interfaces and to increase OPENMPT_API_VERSION_MINOR */
1629
1630#ifdef __cplusplus
1631}
1632#endif
1633
1638#endif /* LIBOPENMPT_H */
1639
size_t openmpt_module_read_interleaved_float_stereo(openmpt_module *mod, int32_t samplerate, size_t count, float *interleaved_stereo)
Render audio data.
int32_t openmpt_module_get_restart_order(openmpt_module *mod, int32_t subsong)
Get the restart order of the specified sub-song.
const char * openmpt_get_supported_extensions(void)
Get a list of supported file extensions.
const char * openmpt_module_get_subsong_name(openmpt_module *mod, int32_t index)
Get a sub-song name.
int32_t openmpt_module_get_num_instruments(openmpt_module *mod)
Get the number of instruments.
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.
int openmpt_error_func_ignore(int error, void *user)
Ignore error function.
void openmpt_free_string(const char *str)
Free a string returned by libopenmpt.
int32_t openmpt_module_get_current_playing_channels(openmpt_module *mod)
Get the current amount of playing channels.
int32_t openmpt_module_get_current_row(openmpt_module *mod)
Get the current row.
int32_t openmpt_module_get_num_channels(openmpt_module *mod)
Get the number of pattern channels.
int openmpt_error_is_transient(int error)
Check whether the error is transient.
int32_t openmpt_module_get_repeat_count(openmpt_module *mod)
Get Repeat Count.
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.
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.
void openmpt_module_set_log_func(openmpt_module *mod, openmpt_log_func logfunc, void *loguser)
Set logging function.
int openmpt_error_func_errno(int error, void *user)
Errno error function.
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.
const char * openmpt_module_get_metadata_keys(openmpt_module *mod)
Get the list of supported metadata item keys.
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.
int openmpt_module_is_pattern_stop_item(openmpt_module *mod, int32_t pattern)
Check if specified pattern index is a stop ("---") item.
int openmpt_module_ctl_set(openmpt_module *mod, const char *ctl, const char *value)
Set ctl value.
int openmpt_module_is_order_skip_entry(openmpt_module *mod, int32_t order)
Check if specified order is a skip ("+++") item.
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.
double openmpt_module_get_duration_seconds(openmpt_module *mod)
approximate song duration
void openmpt_log_func_silent(const char *message, void *user)
Silent logging function.
int32_t openmpt_module_get_current_speed(openmpt_module *mod)
Get the current speed.
const char * openmpt_module_get_instrument_name(openmpt_module *mod, int32_t index)
Get an instrument name.
void openmpt_module_destroy(openmpt_module *mod)
Unload a previously created openmpt_module from memory.
int32_t openmpt_module_get_num_subsongs(openmpt_module *mod)
Get the number of sub-songs.
double openmpt_module_set_position_seconds(openmpt_module *mod, double seconds)
Set approximate current song position.
const char * openmpt_module_get_sample_name(openmpt_module *mod, int32_t index)
Get a sample name.
const char * openmpt_module_get_ctls(openmpt_module *mod)
Retrieve supported ctl keys.
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.
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.
int32_t openmpt_module_get_order_pattern(openmpt_module *mod, int32_t order)
Get pattern at order position.
int32_t openmpt_module_get_restart_row(openmpt_module *mod, int32_t subsong)
Get the restart row of the specified sub-song.
float openmpt_module_get_current_channel_vu_mono(openmpt_module *mod, int32_t channel)
Get an approximate indication of the channel volume.
size_t openmpt_module_read_interleaved_quad(openmpt_module *mod, int32_t samplerate, size_t count, int16_t *interleaved_quad)
Render audio data.
int openmpt_module_select_subsong(openmpt_module *mod, int32_t subsong)
Select a sub-song from a multi-song module.
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.
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 w...
size_t openmpt_module_read_float_mono(openmpt_module *mod, int32_t samplerate, size_t count, float *mono)
Render audio data.
int openmpt_error_func_default(int error, void *user)
Default error function.
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.
double openmpt_module_get_current_tempo2(openmpt_module *mod)
Get the current tempo.
void openmpt_log_func_default(const char *message, void *user)
Default logging function.
int openmpt_module_ctl_set_integer(openmpt_module *mod, const char *ctl, int64_t value)
Set ctl integer value.
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.
const char * openmpt_module_get_channel_name(openmpt_module *mod, int32_t index)
Get a channel name.
int32_t openmpt_module_get_pattern_rows_per_measure(openmpt_module *mod, int32_t pattern)
Get the rows per measure of a pattern.
double openmpt_module_get_time_at_position(openmpt_module *mod, int32_t order, int32_t row)
Get approximate playback time in seconds at given position.
int openmpt_module_get_render_param(openmpt_module *mod, int param, int32_t *value)
Get render parameter.
int openmpt_module_ctl_get_boolean(openmpt_module *mod, const char *ctl)
Get current ctl boolean value.
void * openmpt_error_func_errno_userdata(int *error)
User pointer for openmpt_error_func_errno.
int openmpt_is_extension_supported(const char *extension)
Query whether a file extension is supported.
int openmpt_module_ctl_set_floatingpoint(openmpt_module *mod, const char *ctl, double value)
Set ctl floatingpoint value.
const char * openmpt_module_get_order_name(openmpt_module *mod, int32_t index)
Get an order name.
size_t openmpt_module_read_interleaved_float_quad(openmpt_module *mod, int32_t samplerate, size_t count, float *interleaved_quad)
Render audio data.
int openmpt_module_error_get_last(openmpt_module *mod)
Get last error.
void openmpt_module_error_set_last(openmpt_module *mod, int error)
Set last error.
const char * openmpt_module_ctl_get(openmpt_module *mod, const char *ctl)
Get current ctl value.
int(* openmpt_stream_seek_func)(void *stream, int64_t offset, int whence)
Seek stream position.
Definition: libopenmpt.h:282
int32_t openmpt_module_get_current_order(openmpt_module *mod)
Get the current order.
const char * openmpt_module_get_pattern_name(openmpt_module *mod, int32_t index)
Get a pattern name.
int openmpt_module_ctl_set_text(openmpt_module *mod, const char *ctl, const char *value)
Set ctl string value.
int32_t openmpt_module_get_num_orders(openmpt_module *mod)
Get the number of orders.
int openmpt_error_func_log(int error, void *user)
Log error function.
int32_t openmpt_module_get_pattern_num_rows(openmpt_module *mod, int32_t pattern)
Get the number of rows in a pattern.
size_t openmpt_module_read_stereo(openmpt_module *mod, int32_t samplerate, size_t count, int16_t *left, int16_t *right)
Render audio data.
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.
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 w...
double openmpt_module_get_position_seconds(openmpt_module *mod)
Get current song position.
int32_t openmpt_module_get_current_pattern(openmpt_module *mod)
Get the current pattern.
int(* openmpt_error_func)(int error, void *user)
Error function.
Definition: libopenmpt.h:435
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 w...
int32_t openmpt_module_get_pattern_rows_per_beat(openmpt_module *mod, int32_t pattern)
Get the rows per beat of a pattern.
int openmpt_module_set_repeat_count(openmpt_module *mod, int32_t repeat_count)
Set Repeat Count.
int32_t openmpt_module_get_num_samples(openmpt_module *mod)
Get the number of samples.
int openmpt_module_is_order_stop_entry(openmpt_module *mod, int32_t order)
Check if specified order is a stop ("---") item.
int32_t openmpt_module_get_current_tempo(openmpt_module *mod)
Get the current tempo.
int openmpt_module_ctl_set_boolean(openmpt_module *mod, const char *ctl, int value)
Set ctl boolean value.
int64_t openmpt_module_ctl_get_integer(openmpt_module *mod, const char *ctl)
Get current ctl integer value.
int openmpt_module_is_pattern_skip_item(openmpt_module *mod, int32_t pattern)
Check if specified pattern index is a skip ("+++") item.
struct openmpt_stream_callbacks openmpt_stream_callbacks
Stream callbacks.
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.
size_t openmpt_module_read_mono(openmpt_module *mod, int32_t samplerate, size_t count, int16_t *mono)
Render audio data.
const char * openmpt_get_string(const char *key)
Get library related metadata.
size_t openmpt_module_read_float_stereo(openmpt_module *mod, int32_t samplerate, size_t count, float *left, float *right)
Render audio data.
double openmpt_module_set_position_order_row(openmpt_module *mod, int32_t order, int32_t row)
Set approximate current song position.
uint32_t openmpt_get_library_version(void)
Get the libopenmpt version number.
struct openmpt_module_initial_ctl openmpt_module_initial_ctl
double openmpt_module_ctl_get_floatingpoint(openmpt_module *mod, const char *ctl)
Get current ctl floatingpoint value.
size_t openmpt_module_read_interleaved_stereo(openmpt_module *mod, int32_t samplerate, size_t count, int16_t *interleaved_stereo)
Render audio data.
void openmpt_module_error_clear(openmpt_module *mod)
Clear last error.
int32_t openmpt_module_get_selected_subsong(openmpt_module *mod)
Get currently selected sub-song from a multi-song module.
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.
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.
struct openmpt_module openmpt_module
Opaque type representing a libopenmpt module.
Definition: libopenmpt.h:660
uint32_t openmpt_get_core_version(void)
Get the core version number.
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.
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.
double openmpt_module_get_current_estimated_bpm(openmpt_module *mod)
const char * openmpt_error_string(int error)
Convert error code to text.
const char * openmpt_module_ctl_get_text(openmpt_module *mod, const char *ctl)
Get current ctl string value.
int32_t openmpt_module_get_num_patterns(openmpt_module *mod)
Get the number of patterns.
size_t(* openmpt_stream_read_func)(void *stream, void *dst, size_t bytes)
Read bytes from stream.
Definition: libopenmpt.h:269
int openmpt_module_set_render_param(openmpt_module *mod, int param, int32_t value)
Set render parameter.
void openmpt_module_set_error_func(openmpt_module *mod, openmpt_error_func errfunc, void *erruser)
Set error function.
void(* openmpt_log_func)(const char *message, void *user)
Logging function.
Definition: libopenmpt.h:329
size_t openmpt_probe_file_header_get_recommended_size(void)
Get recommended header size for successfull format probing.
int64_t(* openmpt_stream_tell_func)(void *stream)
Tell stream position.
Definition: libopenmpt.h:291
const char * openmpt_module_error_get_last_message(openmpt_module *mod)
Get last error message.
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.
const char * openmpt_module_get_metadata(openmpt_module *mod, const char *key)
Get a metadata item value.
int openmpt_error_func_store(int error, void *user)
Store error function.
#define LIBOPENMPT_DEPRECATED
Definition: libopenmpt_config.h:315
Definition: libopenmpt.h:662
const char * ctl
Definition: libopenmpt.h:663
const char * value
Definition: libopenmpt.h:664
Stream callbacks.
Definition: libopenmpt.h:300
openmpt_stream_read_func read
Read callback.
Definition: libopenmpt.h:306
openmpt_stream_seek_func seek
Seek callback.
Definition: libopenmpt.h:313
openmpt_stream_tell_func tell
Tell callback.
Definition: libopenmpt.h:320