10 #ifndef LIBOPENMPT_HPP
11 #define LIBOPENMPT_HPP
22 #ifndef LIBOPENMPT_ANCIENT_COMPILER_STDINT
66 class LIBOPENMPT_CXX_API
exception :
public std::exception {
70 exception(
const std::string & text )
throw();
72 virtual const char * what()
const throw();
98 static const char build [] =
"build";
117 LIBOPENMPT_CXX_API std::string
get(
const std::string & key );
141 LIBOPENMPT_CXX_API
double could_open_propability( std::istream & stream,
double effort = 1.0, std::ostream & log = std::clog );
149 typedef std::map< std::string, std::string > initial_ctls_map;
167 RENDER_MASTERGAIN_MILLIBEL = 1,
174 RENDER_STEREOSEPARATION_PERCENT = 2,
187 RENDER_INTERPOLATIONFILTER_LENGTH = 3,
196 RENDER_VOLUMERAMPING_STRENGTH = 4
202 command_instrument = 1,
203 command_volumeffect = 2,
206 command_parameter = 5
214 void operator = (
const module & );
218 void set_impl( module_impl * i );
228 module( std::istream & stream, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
236 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() );
245 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() );
254 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() );
262 module(
const std::vector<char> & data, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
271 module(
const char * beg,
const char * end, std::ostream & log = std::clog,
const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
280 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() );
289 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() );
299 void select_subsong( std::int32_t subsong );
308 void set_repeat_count( std::int32_t repeat_count );
317 std::int32_t get_repeat_count()
const;
323 double get_duration_seconds()
const;
331 double set_position_seconds(
double seconds );
337 double get_position_seconds()
const;
348 double set_position_order_row( std::int32_t order, std::int32_t row );
358 std::int32_t get_render_param(
int param )
const;
367 void set_render_param(
int param, std::int32_t value );
381 std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * mono );
394 std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * left, std::int16_t * right );
409 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 );
421 std::size_t read( std::int32_t samplerate, std::size_t count,
float * mono );
434 std::size_t read( std::int32_t samplerate, std::size_t count,
float * left,
float * right );
449 std::size_t read( std::int32_t samplerate, std::size_t count,
float * left,
float * right,
float * rear_left,
float * rear_right );
461 std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_stereo );
473 std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_quad );
485 std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count,
float * interleaved_stereo );
497 std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count,
float * interleaved_quad );
505 std::vector<std::string> get_metadata_keys()
const;
524 std::string get_metadata(
const std::string & key )
const;
530 std::int32_t get_current_speed()
const;
535 std::int32_t get_current_tempo()
const;
540 std::int32_t get_current_order()
const;
545 std::int32_t get_current_pattern()
const;
550 std::int32_t get_current_row()
const;
555 std::int32_t get_current_playing_channels()
const;
563 float get_current_channel_vu_mono( std::int32_t channel )
const;
570 float get_current_channel_vu_left( std::int32_t channel )
const;
577 float get_current_channel_vu_right( std::int32_t channel )
const;
584 float get_current_channel_vu_rear_left( std::int32_t channel )
const;
591 float get_current_channel_vu_rear_right( std::int32_t channel )
const;
598 std::int32_t get_num_subsongs()
const;
603 std::int32_t get_num_channels()
const;
608 std::int32_t get_num_orders()
const;
613 std::int32_t get_num_patterns()
const;
618 std::int32_t get_num_instruments()
const;
623 std::int32_t get_num_samples()
const;
630 std::vector<std::string> get_subsong_names()
const;
636 std::vector<std::string> get_channel_names()
const;
642 std::vector<std::string> get_order_names()
const;
648 std::vector<std::string> get_pattern_names()
const;
654 std::vector<std::string> get_instrument_names()
const;
660 std::vector<std::string> get_sample_names()
const;
667 std::int32_t get_order_pattern( std::int32_t order )
const;
674 std::int32_t get_pattern_num_rows( std::int32_t pattern )
const;
684 std::uint8_t get_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
695 std::string format_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
717 std::string highlight_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
729 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;
740 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;
760 std::vector<std::string> get_ctls()
const;
768 std::string ctl_get(
const std::string & ctl )
const;
775 void ctl_set(
const std::string & ctl,
const std::string & value );
787 #endif // LIBOPENMPT_HPP