10 #ifndef LIBOPENMPT_HPP
11 #define LIBOPENMPT_HPP
134 #if defined(_MSC_VER)
135 #pragma warning(push)
136 #pragma warning(disable:4275)
143 class LIBOPENMPT_CXX_API
exception :
public std::exception {
153 const
char * what() const noexcept override;
155 #if defined(_MSC_VER)
220 LIBOPENMPT_CXX_API std::string
get(
const std::string & key );
250 LIBOPENMPT_CXX_API
double could_open_probability( std::istream & stream,
double effort = 1.0, std::ostream & log = std::clog );
299 LIBOPENMPT_CXX_API
int probe_file_header( std::uint64_t flags,
const std::uint8_t * data, std::size_t size, std::uint64_t filesize );
316 LIBOPENMPT_CXX_API
int probe_file_header( std::uint64_t flags,
const std::uint8_t * data, std::size_t size );
339 typedef std::map< std::string, std::string > initial_ctls_map;
357 RENDER_MASTERGAIN_MILLIBEL = 1,
364 RENDER_STEREOSEPARATION_PERCENT = 2,
377 RENDER_INTERPOLATIONFILTER_LENGTH = 3,
386 RENDER_VOLUMERAMPING_STRENGTH = 4
392 command_instrument = 1,
393 command_volumeffect = 2,
396 command_parameter = 5
404 void operator = (
const module & );
408 void set_impl( module_impl * i );
419 module( std::istream & stream, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
428 module(
const std::vector<std::uint8_t> & data, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
438 module(
const std::uint8_t * beg,
const std::uint8_t * end, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
448 module(
const std::uint8_t * data, std::size_t size, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
457 module(
const std::vector<char> & data, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
467 module(
const char * beg,
const char * end, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
477 module(
const char * data, std::size_t size, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
487 module(
const void * data, std::size_t size, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
588 std::size_t
read( std::int32_t samplerate, std::size_t count, std::int16_t * mono );
602 std::size_t
read( std::int32_t samplerate, std::size_t count, std::int16_t * left, std::int16_t * right );
618 std::size_t
read( std::int32_t samplerate, std::size_t count, std::int16_t * left, std::int16_t * right, std::int16_t * rear_left, std::int16_t * rear_right );
631 std::size_t
read( std::int32_t samplerate, std::size_t count,
float * mono );
645 std::size_t
read( std::int32_t samplerate, std::size_t count,
float * left,
float * right );
661 std::size_t
read( std::int32_t samplerate, std::size_t count,
float * left,
float * right,
float * rear_left,
float * rear_right );
948 std::string
format_pattern_row_channel( std::int32_t pattern, std::int32_t row, std::int32_t channel, std::size_t width = 0,
bool pad =
true )
const;
995 std::string
ctl_get(
const std::string & ctl )
const;
1003 void ctl_set(
const std::string & ctl,
const std::string & value );
libopenmpt exception base class
Definition: libopenmpt.hpp:143
exception(exception &&other) noexcept
exception(const std::string &text) noexcept
exception(const exception &other) noexcept
virtual ~exception() noexcept
Definition: libopenmpt_ext.hpp:37
Definition: libopenmpt.hpp:343
void set_repeat_count(std::int32_t repeat_count)
Set Repeat Count.
std::vector< std::string > get_subsong_names() const
Get a list of sub-song names.
std::int32_t get_current_row() const
Get the current row.
std::string format_pattern_row_channel(std::int32_t pattern, std::int32_t row, std::int32_t channel, std::size_t width=0, bool pad=true) const
Get formatted (human-readable) pattern content.
double set_position_seconds(double seconds)
Set approximate current song position.
std::int32_t get_repeat_count() const
Get Repeat Count.
double get_position_seconds() const
Get current song position.
std::string format_pattern_row_channel_command(std::int32_t pattern, std::int32_t row, std::int32_t channel, int command) const
Get formatted (human-readable) pattern content.
module(const std::uint8_t *beg, const std::uint8_t *end, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
std::size_t read(std::int32_t samplerate, std::size_t count, std::int16_t *left, std::int16_t *right)
Render audio data.
std::size_t read(std::int32_t samplerate, std::size_t count, std::int16_t *left, std::int16_t *right, std::int16_t *rear_left, std::int16_t *rear_right)
Render audio data.
std::size_t read(std::int32_t samplerate, std::size_t count, std::int16_t *mono)
Render audio data.
std::string highlight_pattern_row_channel_command(std::int32_t pattern, std::int32_t row, std::int32_t channel, int command) const
Get highlighting information for formatted pattern content.
std::int32_t get_current_speed() const
Get the current speed.
float get_current_channel_vu_rear_left(std::int32_t channel) const
Get an approximate indication of the channel volume on the rear-left speaker.
module(const char *beg, const char *end, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
std::vector< std::string > get_pattern_names() const
Get a list of pattern names.
std::size_t read_interleaved_quad(std::int32_t samplerate, std::size_t count, float *interleaved_quad)
Render audio data.
std::vector< std::string > get_order_names() const
Get a list of order names.
std::size_t read_interleaved_stereo(std::int32_t samplerate, std::size_t count, float *interleaved_stereo)
Render audio data.
std::int32_t get_num_subsongs() const
Get the number of sub-songs.
std::int32_t get_num_orders() const
Get the number of orders.
std::int32_t get_num_samples() const
Get the number of samples.
module(const std::vector< char > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
float get_current_channel_vu_rear_right(std::int32_t channel) const
Get an approximate indication of the channel volume on the rear-right speaker.
std::size_t read(std::int32_t samplerate, std::size_t count, float *left, float *right, float *rear_left, float *rear_right)
Render audio data.
std::int32_t get_current_playing_channels() const
Get the current amount of playing channels.
std::int32_t get_current_order() const
Get the current order.
float get_current_channel_vu_mono(std::int32_t channel) const
Get an approximate indication of the channel volume.
float get_current_channel_vu_right(std::int32_t channel) const
Get an approximate indication of the channel volume on the front-right speaker.
std::int32_t get_current_pattern() const
Get the current pattern.
std::string ctl_get(const std::string &ctl) const
Get current ctl value.
float get_current_channel_vu_left(std::int32_t channel) const
Get an approximate indication of the channel volume on the front-left speaker.
std::int32_t get_order_pattern(std::int32_t order) const
Get pattern at order position.
void ctl_set(const std::string &ctl, const std::string &value)
Set ctl value.
module(std::istream &stream, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
Construct an openmpt::module.
std::int32_t get_selected_subsong() const
Get currently selected sub-song from a multi-song module.
std::size_t read(std::int32_t samplerate, std::size_t count, float *mono)
Render audio data.
std::int32_t get_pattern_num_rows(std::int32_t pattern) const
Get the number of rows in a pattern.
module(const void *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
std::int32_t get_num_instruments() const
Get the number of instruments.
void set_render_param(int param, std::int32_t value)
Set render parameter.
std::int32_t get_num_patterns() const
Get the number of patterns.
render_param
Parameter index to use with openmpt::module::get_render_param and openmpt::module::set_render_param.
Definition: libopenmpt.hpp:350
module(const char *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
std::int32_t get_num_channels() const
Get the number of pattern channels.
std::size_t read_interleaved_quad(std::int32_t samplerate, std::size_t count, std::int16_t *interleaved_quad)
Render audio data.
command_index
Parameter index to use with openmpt::module::get_pattern_row_channel_command, openmpt::module::format...
Definition: libopenmpt.hpp:390
std::size_t read(std::int32_t samplerate, std::size_t count, float *left, float *right)
Render audio data.
std::uint8_t get_pattern_row_channel_command(std::int32_t pattern, std::int32_t row, std::int32_t channel, int command) const
Get raw pattern content.
double get_duration_seconds() const
Get approximate song duration.
module(const std::vector< std::uint8_t > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
module(const std::uint8_t *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
std::int32_t get_current_tempo() const
Get the current tempo.
std::size_t read_interleaved_stereo(std::int32_t samplerate, std::size_t count, std::int16_t *interleaved_stereo)
Render audio data.
std::vector< std::string > get_sample_names() const
Get a list of sample names.
std::vector< std::string > get_metadata_keys() const
Get the list of supported metadata item keys.
double set_position_order_row(std::int32_t order, std::int32_t row)
Set approximate current song position.
std::int32_t get_render_param(int param) const
Get render parameter.
std::vector< std::string > get_instrument_names() const
Get a list of instrument names.
std::vector< std::string > get_ctls() const
Retrieve supported ctl keys.
std::vector< std::string > get_channel_names() const
Get a list of channel names.
std::string get_metadata(const std::string &key) const
Get a metadata item value.
void select_subsong(std::int32_t subsong)
Select a sub-song from a multi-song module.
std::string highlight_pattern_row_channel(std::int32_t pattern, std::int32_t row, std::int32_t channel, std::size_t width=0, bool pad=true) const
Get highlighting information for formatted pattern content.
#define LIBOPENMPT_DEPRECATED
Definition: libopenmpt_config.h:149
LIBOPENMPT_CXX_API std::string get(const std::string &key)
Get library related metadata.
static const char library_version LIBOPENMPT_ATTR_DEPRECATED[]
Return a verbose library version string from openmpt::string::get().
Definition: libopenmpt.hpp:177
Definition: libopenmpt.hpp:132
probe_file_header_result
Possible return values for openmpt::probe_file_header().
Definition: libopenmpt.hpp:278
@ probe_file_header_result_success
Definition: libopenmpt.hpp:279
@ probe_file_header_result_failure
Definition: libopenmpt.hpp:280
@ probe_file_header_result_wantmoredata
Definition: libopenmpt.hpp:281
static const std::uint64_t probe_file_header_flags_none
Probe for no formats in openmpt::probe_file_header().
Definition: libopenmpt.hpp:275
static const std::uint64_t probe_file_header_flags_modules
Probe for module formats in openmpt::probe_file_header().
Definition: libopenmpt.hpp:266
LIBOPENMPT_CXX_API double could_open_probability(std::istream &stream, double effort=1.0, std::ostream &log=std::clog)
Roughly scan the input stream to find out whether libopenmpt might be able to open it.
LIBOPENMPT_CXX_API std::vector< std::string > get_supported_extensions()
Get a list of supported file extensions.
LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API double could_open_propability(std::istream &stream, double effort=1.0, std::ostream &log=std::clog)
Roughly scan the input stream to find out whether libopenmpt might be able to open it.
LIBOPENMPT_CXX_API bool is_extension_supported(const std::string &extension)
Query whether a file extension is supported.
LIBOPENMPT_CXX_API std::uint32_t get_core_version()
Get the core version number.
LIBOPENMPT_CXX_API int probe_file_header(std::uint64_t flags, const std::uint8_t *data, std::size_t size, std::uint64_t filesize)
Probe the provided bytes from the beginning of a file for supported file format headers to find out w...
static const std::uint64_t probe_file_header_flags_containers
Probe for module-specific container formats in openmpt::probe_file_header().
Definition: libopenmpt.hpp:269
static const std::uint64_t probe_file_header_flags_default
Probe for the default set of formats in openmpt::probe_file_header().
Definition: libopenmpt.hpp:272
LIBOPENMPT_CXX_API std::uint32_t get_library_version()
Get the libopenmpt version number.
LIBOPENMPT_CXX_API std::size_t probe_file_header_get_recommended_size()
Get recommended header size for successfull format probing.