libopenmpt 0.8.0-pre.12+r22603
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

LIBOPENMPT_CXX_API_MEMBER module_ext (std::istream &stream, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
LIBOPENMPT_CXX_API_MEMBER module_ext (const std::vector< std::byte > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
LIBOPENMPT_CXX_API_MEMBER module_ext (const std::vector< std::uint8_t > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
LIBOPENMPT_CXX_API_MEMBER module_ext (const std::vector< char > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
LIBOPENMPT_CXX_API_MEMBER module_ext (const std::byte *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
LIBOPENMPT_CXX_API_MEMBER module_ext (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())
 
LIBOPENMPT_CXX_API_MEMBER 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())
 
LIBOPENMPT_CXX_API_MEMBER 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 LIBOPENMPT_CXX_API_MEMBER ~module_ext ()
 
LIBOPENMPT_CXX_API_MEMBER void * get_interface (const std::string &interface_id)
 Retrieve a libopenmpt extension. More...
 
- Public Member Functions inherited from openmpt::module
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER module (const std::vector< std::byte > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
LIBOPENMPT_CXX_API_MEMBER module (const std::byte *beg, const std::byte *end, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
LIBOPENMPT_CXX_API_MEMBER module (const std::byte *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
LIBOPENMPT_CXX_API_MEMBER 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())
 
LIBOPENMPT_CXX_API_MEMBER 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())
 
LIBOPENMPT_CXX_API_MEMBER 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())
 
LIBOPENMPT_CXX_API_MEMBER module (const std::vector< char > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
LIBOPENMPT_CXX_API_MEMBER module (const char *beg, const char *end, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 
LIBOPENMPT_CXX_API_MEMBER 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())
 
LIBOPENMPT_CXX_API_MEMBER 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 LIBOPENMPT_CXX_API_MEMBER ~module ()
 
LIBOPENMPT_CXX_API_MEMBER void select_subsong (std::int32_t subsong)
 Select a sub-song from a multi-song module. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_selected_subsong () const
 Get currently selected sub-song from a multi-song module. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_restart_order (std::int32_t subsong) const
 Get the restart order of the specified sub-song. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_restart_row (std::int32_t subsong) const
 Get the restart row of the specified sub-song. More...
 
LIBOPENMPT_CXX_API_MEMBER void set_repeat_count (std::int32_t repeat_count)
 Set Repeat Count. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_repeat_count () const
 Get Repeat Count. More...
 
LIBOPENMPT_CXX_API_MEMBER double get_duration_seconds () const
 Get approximate song duration. More...
 
LIBOPENMPT_CXX_API_MEMBER double get_time_at_position (std::int32_t order, std::int32_t row) const
 Get approximate playback time in seconds at given position. More...
 
LIBOPENMPT_CXX_API_MEMBER double set_position_seconds (double seconds)
 Set approximate current song position. More...
 
LIBOPENMPT_CXX_API_MEMBER double get_position_seconds () const
 Get current song position. More...
 
LIBOPENMPT_CXX_API_MEMBER double set_position_order_row (std::int32_t order, std::int32_t row)
 Set approximate current song position. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_render_param (int param) const
 Get render parameter. More...
 
LIBOPENMPT_CXX_API_MEMBER void set_render_param (int param, std::int32_t value)
 Set render parameter. More...
 
LIBOPENMPT_CXX_API_MEMBER std::size_t read (std::int32_t samplerate, std::size_t count, std::int16_t *mono)
 Render audio data. More...
 
LIBOPENMPT_CXX_API_MEMBER std::size_t read (std::int32_t samplerate, std::size_t count, std::int16_t *left, std::int16_t *right)
 Render audio data. More...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER std::size_t read (std::int32_t samplerate, std::size_t count, float *mono)
 Render audio data. More...
 
LIBOPENMPT_CXX_API_MEMBER std::size_t read (std::int32_t samplerate, std::size_t count, float *left, float *right)
 Render audio data. More...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_stereo (std::int32_t samplerate, std::size_t count, std::int16_t *interleaved_stereo)
 Render audio data. More...
 
LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_quad (std::int32_t samplerate, std::size_t count, std::int16_t *interleaved_quad)
 Render audio data. More...
 
LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_stereo (std::int32_t samplerate, std::size_t count, float *interleaved_stereo)
 Render audio data. More...
 
LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_quad (std::int32_t samplerate, std::size_t count, float *interleaved_quad)
 Render audio data. More...
 
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_metadata_keys () const
 Get the list of supported metadata item keys. More...
 
LIBOPENMPT_CXX_API_MEMBER std::string get_metadata (const std::string &key) const
 Get a metadata item value. More...
 
LIBOPENMPT_CXX_API_MEMBER double get_current_estimated_bpm () const
 Get the current estimated beats per minute (BPM). More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_speed () const
 Get the current speed. More...
 
LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_tempo () const
 Get the current tempo. More...
 
LIBOPENMPT_CXX_API_MEMBER double get_current_tempo2 () const
 Get the current tempo. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_order () const
 Get the current order. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_pattern () const
 Get the current pattern. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_row () const
 Get the current row. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_playing_channels () const
 Get the current amount of playing channels. More...
 
LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_mono (std::int32_t channel) const
 Get an approximate indication of the channel volume. More...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_subsongs () const
 Get the number of sub-songs. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_channels () const
 Get the number of pattern channels. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_orders () const
 Get the number of orders. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_patterns () const
 Get the number of patterns. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_instruments () const
 Get the number of instruments. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_samples () const
 Get the number of samples. More...
 
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_subsong_names () const
 Get a list of sub-song names. More...
 
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_channel_names () const
 Get a list of channel names. More...
 
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_order_names () const
 Get a list of order names. More...
 
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_pattern_names () const
 Get a list of pattern names. More...
 
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_instrument_names () const
 Get a list of instrument names. More...
 
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_sample_names () const
 Get a list of sample names. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_order_pattern (std::int32_t order) const
 Get pattern at order position. More...
 
LIBOPENMPT_CXX_API_MEMBER bool is_order_skip_entry (std::int32_t order) const
 Check if specified order is a skip ("+++") item. More...
 
LIBOPENMPT_CXX_API_MEMBER bool is_pattern_skip_item (std::int32_t pattern) const
 Check if specified pattern index is a skip ("+++") item. More...
 
LIBOPENMPT_CXX_API_MEMBER bool is_order_stop_entry (std::int32_t order) const
 Check if specified order is a stop ("---") item. More...
 
LIBOPENMPT_CXX_API_MEMBER bool is_pattern_stop_item (std::int32_t pattern) const
 Check if specified pattern index is a stop ("---") item. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_num_rows (std::int32_t pattern) const
 Get the number of rows in a pattern. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_rows_per_beat (std::int32_t pattern) const
 Get the rows per beat of a pattern. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_rows_per_measure (std::int32_t pattern) const
 Get the rows per measure of a pattern. More...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER 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...
 
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_ctls () const
 Retrieve supported ctl keys. More...
 
LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API_MEMBER std::string ctl_get (const std::string &ctl) const
 Get current ctl value. More...
 
LIBOPENMPT_CXX_API_MEMBER bool ctl_get_boolean (std::string_view ctl) const
 Get current ctl boolean value. More...
 
LIBOPENMPT_CXX_API_MEMBER std::int64_t ctl_get_integer (std::string_view ctl) const
 Get current ctl integer value. More...
 
LIBOPENMPT_CXX_API_MEMBER double ctl_get_floatingpoint (std::string_view ctl) const
 Get current ctl floatingpoint value. More...
 
LIBOPENMPT_CXX_API_MEMBER std::string ctl_get_text (std::string_view ctl) const
 Get current ctl text value. More...
 
LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API_MEMBER void ctl_set (const std::string &ctl, const std::string &value)
 Set ctl value. More...
 
LIBOPENMPT_CXX_API_MEMBER void ctl_set_boolean (std::string_view ctl, bool value)
 Set ctl boolean value. More...
 
LIBOPENMPT_CXX_API_MEMBER void ctl_set_integer (std::string_view ctl, std::int64_t value)
 Set ctl integer value. More...
 
LIBOPENMPT_CXX_API_MEMBER void ctl_set_floatingpoint (std::string_view ctl, double value)
 Set ctl floatingpoint value. More...
 
LIBOPENMPT_CXX_API_MEMBER void ctl_set_text (std::string_view ctl, std::string_view value)
 Set ctl text value. 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/8]

LIBOPENMPT_CXX_API_MEMBER 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/8]

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

◆ module_ext() [3/8]

LIBOPENMPT_CXX_API_MEMBER openmpt::module_ext::module_ext ( 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_ext() [4/8]

LIBOPENMPT_CXX_API_MEMBER 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() [5/8]

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

◆ module_ext() [6/8]

LIBOPENMPT_CXX_API_MEMBER openmpt::module_ext::module_ext ( 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_ext() [7/8]

LIBOPENMPT_CXX_API_MEMBER 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() [8/8]

LIBOPENMPT_CXX_API_MEMBER 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 LIBOPENMPT_CXX_API_MEMBER openmpt::module_ext::~module_ext ( )
virtual

Member Function Documentation

◆ get_interface()

LIBOPENMPT_CXX_API_MEMBER 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
Definition: libopenmpt_ext.hpp:154
virtual void set_tempo_factor(double factor)=0
Set the current module tempo factor without affecting playback pitch.
Definition: libopenmpt_ext.hpp:37
static const char interactive_id[]
Definition: libopenmpt_ext.hpp:152
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: