openmpt::module_ext Class Reference

`#include <libopenmpt/libopenmpt_ext.hpp>`

Inheritance diagram for openmpt::module_ext:

## 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< std::byte > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
| 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 (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 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 (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 (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::byte > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
| 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())
| 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())
| 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::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...
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...
double | get_current_estimated_bpm () const
| Get the current estimated beats per minute (BPM). 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...
LIBOPENMPT_ATTR_DEPRECATED std::string | ctl_get (const std::string &ctl) const
| Get current ctl value. More...
bool | ctl_get_boolean (std::string_view ctl) const
| Get current ctl boolean value. More...
std::int64_t | ctl_get_integer (std::string_view ctl) const
| Get current ctl integer value. More...
double | ctl_get_floatingpoint (std::string_view ctl) const
| Get current ctl floatingpoint value. More...
std::string | ctl_get_text (std::string_view ctl) const
| Get current ctl text value. More...
LIBOPENMPT_ATTR_DEPRECATED void | ctl_set (const std::string &ctl, const std::string &value)
| Set ctl value. More...
void | ctl_set_boolean (std::string_view ctl, bool value)
| Set ctl boolean value. More...
void | ctl_set_integer (std::string_view ctl, std::int64_t value)
| Set ctl integer value. More...
void | ctl_set_floatingpoint (std::string_view ctl, double value)
| Set ctl floatingpoint value. More...
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]

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]

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]

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]

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]

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]

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]

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]

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:

openmpt::module_ext *mod = new openmpt::module_ext( stream );
#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
openmpt::ext::interactive
Definition: libopenmpt_ext.hpp:146
openmpt::ext::interactive::set_tempo_factor
virtual void set_tempo_factor(double factor)=0
Set the current module tempo factor without affecting playback pitch.
openmpt::module_ext
Definition: libopenmpt_ext.hpp:37
openmpt::ext::interactive_id
static const char interactive_id[]
Definition: libopenmpt_ext.hpp:144

Parameters

  interface_id | The 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:

- libopenmpt/libopenmpt_ext.hpp