libopenmpt  0.4.6+release
cross-platform C++ and C library to decode tracked music files
openmpt::module_ext Class Reference

#include <libopenmpt/libopenmpt_ext.hpp>

Inheritance diagram for openmpt::module_ext:
openmpt::module

Public Member Functions

 module_ext (std::istream &stream, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
 module_ext (const std::vector< char > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
 module_ext (const char *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
 module_ext (const void *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
virtual ~module_ext ()
 
void * get_interface (const std::string &interface_id)
 Retrieve a libopenmpt extension. More...
 
- Public Member Functions inherited from openmpt::module
 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. More...
 
 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 *beg, const std::uint8_t *end, 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())
 
 module (const std::vector< char > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
 module (const char *beg, const char *end, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
 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())
 
 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())
 
virtual ~module ()
 
void select_subsong (std::int32_t subsong)
 Select a sub-song from a multi-song module. More...
 
std::int32_t get_selected_subsong () const
 Get currently selected sub-song from a multi-song module. More...
 
void set_repeat_count (std::int32_t repeat_count)
 Set Repeat Count. More...
 
std::int32_t get_repeat_count () const
 Get Repeat Count. More...
 
double get_duration_seconds () const
 Get approximate song duration. More...
 
double set_position_seconds (double seconds)
 Set approximate current song position. More...
 
double get_position_seconds () const
 Get current song position. More...
 
double set_position_order_row (std::int32_t order, std::int32_t row)
 Set approximate current song position. More...
 
std::int32_t get_render_param (int param) const
 Get render parameter. More...
 
void set_render_param (int param, std::int32_t value)
 Set render parameter. More...
 
std::vector< std::string > get_metadata_keys () const
 Get the list of supported metadata item keys. More...
 
std::string get_metadata (const std::string &key) const
 Get a metadata item value. More...
 
std::int32_t get_current_speed () const
 Get the current speed. More...
 
std::int32_t get_current_tempo () const
 Get the current tempo. More...
 
std::int32_t get_current_order () const
 Get the current order. More...
 
std::int32_t get_current_pattern () const
 Get the current pattern. More...
 
std::int32_t get_current_row () const
 Get the current row. More...
 
std::int32_t get_current_playing_channels () const
 Get the current amount of playing channels. More...
 
float get_current_channel_vu_mono (std::int32_t channel) const
 Get an approximate indication of the channel volume. More...
 
float get_current_channel_vu_left (std::int32_t channel) const
 Get an approximate indication of the channel volume on the front-left speaker. More...
 
float get_current_channel_vu_right (std::int32_t channel) const
 Get an approximate indication of the channel volume on the front-right speaker. More...
 
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. More...
 
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. More...
 
std::int32_t get_num_subsongs () const
 Get the number of sub-songs. More...
 
std::int32_t get_num_channels () const
 Get the number of pattern channels. More...
 
std::int32_t get_num_orders () const
 Get the number of orders. More...
 
std::int32_t get_num_patterns () const
 Get the number of patterns. More...
 
std::int32_t get_num_instruments () const
 Get the number of instruments. More...
 
std::int32_t get_num_samples () const
 Get the number of samples. More...
 
std::vector< std::string > get_subsong_names () const
 Get a list of sub-song names. More...
 
std::vector< std::string > get_channel_names () const
 Get a list of channel names. More...
 
std::vector< std::string > get_order_names () const
 Get a list of order names. More...
 
std::vector< std::string > get_pattern_names () const
 Get a list of pattern names. More...
 
std::vector< std::string > get_instrument_names () const
 Get a list of instrument names. More...
 
std::vector< std::string > get_sample_names () const
 Get a list of sample names. More...
 
std::int32_t get_order_pattern (std::int32_t order) const
 Get pattern at order position. More...
 
std::int32_t get_pattern_num_rows (std::int32_t pattern) const
 Get the number of rows in a pattern. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
std::vector< std::string > get_ctls () const
 Retrieve supported ctl keys. More...
 
std::string ctl_get (const std::string &ctl) const
 Get current ctl value. More...
 
void ctl_set (const std::string &ctl, const std::string &value)
 Set ctl value. More...
 
std::size_t read (std::int32_t samplerate, std::size_t count, std::int16_t *mono)
 Render audio data. More...
 
std::size_t read (std::int32_t samplerate, std::size_t count, std::int16_t *left, std::int16_t *right)
 Render audio data. More...
 
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. More...
 
std::size_t read (std::int32_t samplerate, std::size_t count, float *mono)
 Render audio data. More...
 
std::size_t read (std::int32_t samplerate, std::size_t count, float *left, float *right)
 Render audio data. More...
 
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. More...
 
std::size_t read_interleaved_stereo (std::int32_t samplerate, std::size_t count, std::int16_t *interleaved_stereo)
 Render audio data. More...
 
std::size_t read_interleaved_quad (std::int32_t samplerate, std::size_t count, std::int16_t *interleaved_quad)
 Render audio data. More...
 
std::size_t read_interleaved_stereo (std::int32_t samplerate, std::size_t count, float *interleaved_stereo)
 Render audio data. More...
 
std::size_t read_interleaved_quad (std::int32_t samplerate, std::size_t count, float *interleaved_quad)
 Render audio data. More...
 

Additional Inherited Members

- Public Types inherited from openmpt::module
enum  render_param { RENDER_MASTERGAIN_MILLIBEL = 1, RENDER_STEREOSEPARATION_PERCENT = 2, RENDER_INTERPOLATIONFILTER_LENGTH = 3, RENDER_VOLUMERAMPING_STRENGTH = 4 }
 Parameter index to use with openmpt::module::get_render_param and openmpt::module::set_render_param. More...
 
enum  command_index {
  command_note = 0, command_instrument = 1, command_volumeffect = 2, command_effect = 3,
  command_volume = 4, command_parameter = 5
}
 Parameter index to use with openmpt::module::get_pattern_row_channel_command, openmpt::module::format_pattern_row_channel_command and openmpt::module::highlight_pattern_row_channel_command. More...
 

Constructor & Destructor Documentation

◆ module_ext() [1/4]

openmpt::module_ext::module_ext ( std::istream &  stream,
std::ostream &  log = std::clog,
const std::map< std::string, std::string > &  ctls = detail::initial_ctls_map() 
)

◆ module_ext() [2/4]

openmpt::module_ext::module_ext ( const std::vector< char > &  data,
std::ostream &  log = std::clog,
const std::map< std::string, std::string > &  ctls = detail::initial_ctls_map() 
)

◆ module_ext() [3/4]

openmpt::module_ext::module_ext ( const char *  data,
std::size_t  size,
std::ostream &  log = std::clog,
const std::map< std::string, std::string > &  ctls = detail::initial_ctls_map() 
)

◆ module_ext() [4/4]

openmpt::module_ext::module_ext ( const void *  data,
std::size_t  size,
std::ostream &  log = std::clog,
const std::map< std::string, std::string > &  ctls = detail::initial_ctls_map() 
)

◆ ~module_ext()

virtual openmpt::module_ext::~module_ext ( )
virtual

Member Function Documentation

◆ get_interface()

void* openmpt::module_ext::get_interface ( const std::string &  interface_id)

Retrieve a libopenmpt extension.

Example: Retrieving the interactive extension to change the tempo of a module:

#ifdef LIBOPENMPT_EXT_INTERFACE_INTERACTIVE
openmpt::ext::interactive *interactive = static_cast<openmpt::ext::interactive *>( self->mod->get_interface( openmpt::ext::interactive_id ) );
if ( interactive ) {
interactive->set_tempo_factor( 2.0 ); // play module at double speed
} else {
// interface not available
}
#else
// interfae not available
#endif
Parameters
interface_idThe name of the extension interface to retrieve.
Returns
The interface object. This may be a nullptr if the extension was not found.

The documentation for this class was generated from the following file: