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 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 );
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;
742 std::string get_metadata(
const std::string & key )
const;
748 std::int32_t get_current_speed()
const;
753 std::int32_t get_current_tempo()
const;
758 std::int32_t get_current_order()
const;
763 std::int32_t get_current_pattern()
const;
768 std::int32_t get_current_row()
const;
773 std::int32_t get_current_playing_channels()
const;
781 float get_current_channel_vu_mono( std::int32_t channel )
const;
788 float get_current_channel_vu_left( std::int32_t channel )
const;
795 float get_current_channel_vu_right( std::int32_t channel )
const;
802 float get_current_channel_vu_rear_left( std::int32_t channel )
const;
809 float get_current_channel_vu_rear_right( std::int32_t channel )
const;
816 std::int32_t get_num_subsongs()
const;
822 std::int32_t get_num_channels()
const;
827 std::int32_t get_num_orders()
const;
832 std::int32_t get_num_patterns()
const;
837 std::int32_t get_num_instruments()
const;
842 std::int32_t get_num_samples()
const;
849 std::vector<std::string> get_subsong_names()
const;
855 std::vector<std::string> get_channel_names()
const;
861 std::vector<std::string> get_order_names()
const;
867 std::vector<std::string> get_pattern_names()
const;
873 std::vector<std::string> get_instrument_names()
const;
879 std::vector<std::string> get_sample_names()
const;
886 std::int32_t get_order_pattern( std::int32_t order )
const;
893 std::int32_t get_pattern_num_rows( std::int32_t pattern )
const;
903 std::uint8_t get_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
914 std::string format_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
936 std::string highlight_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel,
int command )
const;
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;
959 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;
987 std::vector<std::string> get_ctls()
const;
995 std::string ctl_get(
const std::string & ctl )
const;
1003 void ctl_set(
const std::string & ctl,
const std::string & value );
1015 #endif // LIBOPENMPT_HPP