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 {
147 exception(
const std::string & text ) noexcept;
153 virtual const char * what()
const noexcept;
155 #if defined(_MSC_VER) 179 LIBOPENMPT_DEPRECATED static const char library_features LIBOPENMPT_ATTR_DEPRECATED [] =
"library_features";
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 );
331 LIBOPENMPT_CXX_API
int probe_file_header( std::uint64_t flags, std::istream & stream );
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() );
498 void select_subsong( std::int32_t subsong );
505 std::int32_t get_selected_subsong()
const;
514 void set_repeat_count( std::int32_t repeat_count );
523 std::int32_t get_repeat_count()
const;
529 double get_duration_seconds()
const;
537 double set_position_seconds(
double seconds );
543 double get_position_seconds()
const;
554 double set_position_order_row( std::int32_t order, std::int32_t row );
564 std::int32_t get_render_param(
int param )
const;
573 void set_render_param(
int param, std::int32_t value );
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 );
674 std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_stereo );
687 std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_quad );
700 std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count,
float * interleaved_stereo );
713 std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count,
float * interleaved_quad );
721 std::vector<std::string> get_metadata_keys()
const;
740 std::string get_metadata(
const std::string & key )
const;
746 std::int32_t get_current_speed()
const;
751 std::int32_t get_current_tempo()
const;
756 std::int32_t get_current_order()
const;
761 std::int32_t get_current_pattern()
const;
766 std::int32_t get_current_row()
const;
771 std::int32_t get_current_playing_channels()
const;
779 float get_current_channel_vu_mono( std::int32_t channel )
const;
786 float get_current_channel_vu_left( std::int32_t channel )
const;
793 float get_current_channel_vu_right( std::int32_t channel )
const;
800 float get_current_channel_vu_rear_left( std::int32_t channel )
const;
807 float get_current_channel_vu_rear_right( std::int32_t channel )
const;
814 std::int32_t get_num_subsongs()
const;
820 std::int32_t get_num_channels()
const;
825 std::int32_t get_num_orders()
const;
830 std::int32_t get_num_patterns()
const;
835 std::int32_t get_num_instruments()
const;
840 std::int32_t get_num_samples()
const;
847 std::vector<std::string> get_subsong_names()
const;
853 std::vector<std::string> get_channel_names()
const;
859 std::vector<std::string> get_order_names()
const;
865 std::vector<std::string> get_pattern_names()
const;
871 std::vector<std::string> get_instrument_names()
const;
877 std::vector<std::string> get_sample_names()
const;
884 std::int32_t get_order_pattern( std::int32_t order )
const;
891 std::int32_t get_pattern_num_rows( std::int32_t pattern )
const;
901 std::uint8_t get_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
912 std::string format_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
934 std::string highlight_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
946 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;
957 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;
980 std::vector<std::string> get_ctls()
const;
988 std::string ctl_get(
const std::string & ctl )
const;
996 void ctl_set(
const std::string & ctl,
const std::string & value );
1008 #endif // LIBOPENMPT_HPP #define LIBOPENMPT_DEPRECATED
Definition: libopenmpt_config.h:149
command_index
Parameter index to use with openmpt::module::get_pattern_row_channel_command, openmpt::module::format...
Definition: libopenmpt.hpp:390
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:281
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
libopenmpt exception base class
Definition: libopenmpt.hpp:143
LIBOPENMPT_CXX_API std::size_t probe_file_header_get_recommended_size()
Get recommended header size for successfull format probing.
LIBOPENMPT_CXX_API std::uint32_t get_core_version()
Get the core version number.
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
Definition: libopenmpt.hpp:132
LIBOPENMPT_CXX_API std::uint32_t get_library_version()
Get the libopenmpt 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...
LIBOPENMPT_CXX_API bool is_extension_supported(const std::string &extension)
Query whether a file extension is supported.
probe_file_header_result
Possible return values for openmpt::probe_file_header().
Definition: libopenmpt.hpp:278
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...
Definition: libopenmpt.hpp:279
render_param
Parameter index to use with openmpt::module::get_render_param and openmpt::module::set_render_param.
Definition: libopenmpt.hpp:350
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...
Definition: libopenmpt_ext.hpp:37
static const std::uint64_t probe_file_header_flags_none
Probe for no formats in openmpt::probe_file_header().
Definition: libopenmpt.hpp:275
Definition: libopenmpt.hpp:343
Definition: libopenmpt.hpp:280
LIBOPENMPT_CXX_API std::vector< std::string > get_supported_extensions()
Get a list of supported file extensions.