10 #ifndef LIBOPENMPT_HPP
11 #define LIBOPENMPT_HPP
22 #ifndef LIBOPENMPT_ANCIENT_COMPILER_STDINT
94 class LIBOPENMPT_CXX_API
exception :
public std::exception {
98 exception(
const std::string & text )
throw();
100 virtual const char * what()
const throw();
154 LIBOPENMPT_CXX_API std::string
get(
const std::string & key );
178 LIBOPENMPT_CXX_API
double could_open_propability( std::istream & stream,
double effort = 1.0, std::ostream & log = std::clog );
186 typedef std::map< std::string, std::string > initial_ctls_map;
204 RENDER_MASTERGAIN_MILLIBEL = 1,
211 RENDER_STEREOSEPARATION_PERCENT = 2,
224 RENDER_INTERPOLATIONFILTER_LENGTH = 3,
233 RENDER_VOLUMERAMPING_STRENGTH = 4
239 command_instrument = 1,
240 command_volumeffect = 2,
243 command_parameter = 5
251 void operator = (
const module & );
255 void set_impl( module_impl * i );
265 module( std::istream & stream, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
273 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() );
282 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() );
291 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() );
299 module(
const std::vector<char> & data, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
308 module(
const char * beg,
const char * end, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
317 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() );
326 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() );
336 void select_subsong( std::int32_t subsong );
345 void set_repeat_count( std::int32_t repeat_count );
354 std::int32_t get_repeat_count()
const;
360 double get_duration_seconds()
const;
368 double set_position_seconds(
double seconds );
374 double get_position_seconds()
const;
385 double set_position_order_row( std::int32_t order, std::int32_t row );
395 std::int32_t get_render_param(
int param )
const;
404 void set_render_param(
int param, std::int32_t value );
418 std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * mono );
431 std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * left, std::int16_t * right );
446 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 );
458 std::size_t read( std::int32_t samplerate, std::size_t count,
float * mono );
471 std::size_t read( std::int32_t samplerate, std::size_t count,
float * left,
float * right );
486 std::size_t read( std::int32_t samplerate, std::size_t count,
float * left,
float * right,
float * rear_left,
float * rear_right );
498 std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_stereo );
510 std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_quad );
522 std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count,
float * interleaved_stereo );
534 std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count,
float * interleaved_quad );
542 std::vector<std::string> get_metadata_keys()
const;
561 std::string get_metadata(
const std::string & key )
const;
567 std::int32_t get_current_speed()
const;
572 std::int32_t get_current_tempo()
const;
577 std::int32_t get_current_order()
const;
582 std::int32_t get_current_pattern()
const;
587 std::int32_t get_current_row()
const;
592 std::int32_t get_current_playing_channels()
const;
600 float get_current_channel_vu_mono( std::int32_t channel )
const;
607 float get_current_channel_vu_left( std::int32_t channel )
const;
614 float get_current_channel_vu_right( std::int32_t channel )
const;
621 float get_current_channel_vu_rear_left( std::int32_t channel )
const;
628 float get_current_channel_vu_rear_right( std::int32_t channel )
const;
635 std::int32_t get_num_subsongs()
const;
640 std::int32_t get_num_channels()
const;
645 std::int32_t get_num_orders()
const;
650 std::int32_t get_num_patterns()
const;
655 std::int32_t get_num_instruments()
const;
660 std::int32_t get_num_samples()
const;
667 std::vector<std::string> get_subsong_names()
const;
673 std::vector<std::string> get_channel_names()
const;
679 std::vector<std::string> get_order_names()
const;
685 std::vector<std::string> get_pattern_names()
const;
691 std::vector<std::string> get_instrument_names()
const;
697 std::vector<std::string> get_sample_names()
const;
704 std::int32_t get_order_pattern( std::int32_t order )
const;
711 std::int32_t get_pattern_num_rows( std::int32_t pattern )
const;
721 std::uint8_t get_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
732 std::string format_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
754 std::string highlight_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
766 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;
777 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;
798 std::vector<std::string> get_ctls()
const;
806 std::string ctl_get(
const std::string & ctl )
const;
813 void ctl_set(
const std::string & ctl,
const std::string & value );
825 #endif // LIBOPENMPT_HPP
#define LIBOPENMPT_DEPRECATED
Definition: libopenmpt_config.h:168
static const char library_features[]
Return a verbose library features string from openmpt::string::get().
Definition: libopenmpt.hpp:122
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...
render_param
Parameter index to use with openmpt::module::get_render_param and openmpt::module::set_render_param.
Definition: libopenmpt.hpp:197
static const char build[]
Return information about the current build (e.g. the build date or compiler used) from openmpt::strin...
Definition: libopenmpt.hpp:126
Definition: libopenmpt.hpp:94
static const char core_version[]
Return a verbose OpenMPT core version string from openmpt::string::get().
Definition: libopenmpt.hpp:124
LIBOPENMPT_CXX_API std::uint32_t get_core_version()
Get the core version number.
static const char library_version[]
Return a verbose library version string from openmpt::string::get().
Definition: libopenmpt.hpp:120
static const char license[]
Return the libopenmpt license from openmpt::string::get().
Definition: libopenmpt.hpp:132
Definition: libopenmpt.hpp:92
LIBOPENMPT_CXX_API std::uint32_t get_library_version()
Get the libopenmpt version number.
LIBOPENMPT_CXX_API bool is_extension_supported(const std::string &extension)
Query whether a file extension is supported.
static const char credits[]
Return all contributors from openmpt::string::get().
Definition: libopenmpt.hpp:128
command_index
Parameter index to use with openmpt::module::get_pattern_row_channel_command, openmpt::module::format...
Definition: libopenmpt.hpp:237
Definition: libopenmpt_ext.hpp:59
Definition: libopenmpt.hpp:190
static const char contact[]
Return contact infromation about libopenmpt from openmpt::string::get().
Definition: libopenmpt.hpp:130
LIBOPENMPT_CXX_API std::vector< std::string > get_supported_extensions()
Get a list of supported file extensions.