libopenmpt  0.2.3566
cross-platform C and C++ library to decode tracked music files
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
openmpt::module Class Reference

#include <libopenmpt/libopenmpt.hpp>

Public Types

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
}

Public Member Functions

 module (std::istream &stream, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
 Contruct a openmpt::module.
 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 subsong from a multi-song module.
void set_repeat_count (std::int32_t repeat_count)
 Set Repeat Count.
std::int32_t get_repeat_count () const
 Get Repeat Count.
double get_duration_seconds () const
 Get approximate song duration.
double set_position_seconds (double seconds)
 Set approximate current song position.
double get_position_seconds () const
 Get approximate current song position.
double set_position_order_row (std::int32_t order, std::int32_t row)
 Set approximate current song position.
std::int32_t get_render_param (int param) const
 Get render parameter.
void set_render_param (int param, std::int32_t value)
 Set render parameter.
std::vector< std::string > get_metadata_keys () const
 Get the list of supported metadata item keys.
std::string get_metadata (const std::string &key) const
 Get a metadata item value.
std::int32_t get_current_speed () const
std::int32_t get_current_tempo () const
std::int32_t get_current_order () const
std::int32_t get_current_pattern () const
std::int32_t get_current_row () const
std::int32_t get_current_playing_channels () const
float get_current_channel_vu_mono (std::int32_t channel) const
float get_current_channel_vu_left (std::int32_t channel) const
float get_current_channel_vu_right (std::int32_t channel) const
float get_current_channel_vu_rear_left (std::int32_t channel) const
float get_current_channel_vu_rear_right (std::int32_t channel) const
std::int32_t get_num_subsongs () const
std::int32_t get_num_channels () const
std::int32_t get_num_orders () const
std::int32_t get_num_patterns () const
std::int32_t get_num_instruments () const
std::int32_t get_num_samples () const
std::vector< std::string > get_subsong_names () const
std::vector< std::string > get_channel_names () const
std::vector< std::string > get_order_names () const
std::vector< std::string > get_pattern_names () const
std::vector< std::string > get_instrument_names () const
std::vector< std::string > get_sample_names () const
std::int32_t get_order_pattern (std::int32_t order) const
std::int32_t get_pattern_num_rows (std::int32_t pattern) const
std::uint8_t get_pattern_row_channel_command (std::int32_t pattern, std::int32_t row, std::int32_t channel, int command) const
std::string format_pattern_row_channel_command (std::int32_t pattern, std::int32_t row, std::int32_t channel, int command) const
std::string highlight_pattern_row_channel_command (std::int32_t pattern, std::int32_t row, std::int32_t channel, int command) const
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
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
std::vector< std::string > get_ctls () const
std::string ctl_get (const std::string &ctl) const
void ctl_set (const std::string &ctl, const std::string &value)
std::size_t read (std::int32_t samplerate, std::size_t count, std::int16_t *mono)
 Render audio data.
std::size_t read (std::int32_t samplerate, std::size_t count, std::int16_t *left, std::int16_t *right)
 Render audio data.
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.
std::size_t read (std::int32_t samplerate, std::size_t count, float *mono)
 Render audio data.
std::size_t read (std::int32_t samplerate, std::size_t count, float *left, float *right)
 Render audio data.
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.
std::size_t read_interleaved_stereo (std::int32_t samplerate, std::size_t count, std::int16_t *interleaved_stereo)
 Render audio data.
std::size_t read_interleaved_quad (std::int32_t samplerate, std::size_t count, std::int16_t *interleaved_quad)
 Render audio data.
std::size_t read_interleaved_stereo (std::int32_t samplerate, std::size_t count, float *interleaved_stereo)
 Render audio data.
std::size_t read_interleaved_quad (std::int32_t samplerate, std::size_t count, float *interleaved_quad)
 Render audio data.

Friends

class module_ext

Member Enumeration Documentation

Enumerator:
command_note 
command_instrument 
command_volumeffect 
command_effect 
command_volume 
command_parameter 

Parameter index to use with openmpt::module::get_render_param and openmpt::module::set_render_param.

Enumerator:
RENDER_MASTERGAIN_MILLIBEL 

Master Gain.

The related value represents a relative gain in milliBel.
The default value is 0.
The supported value range is unlimited.

RENDER_STEREOSEPARATION_PERCENT 

Stereo Separation.

The related value represents the stereo separation generated by the libopenmpt mixer in percent.
The default value is 100.
The supported value range is [0,400].

RENDER_INTERPOLATIONFILTER_LENGTH 

Interpolation Filter.

The related value represents the interpolation filter length used by the libopenmpt mixer.
The default value is 0, which indicates a recommended default value.
The supported value range is [0,inf). Values greater than the implementation limit are clamped to the maximum supported value.
Currently supported values:

  • 0: internal default
  • 1: no interpolation (zero order hold)
  • 2: linear interpolation
  • 4: cubic interpolation
  • 8: windowed sinc with 8 taps
RENDER_VOLUMERAMPING_STRENGTH 

Volume Ramping Strength.

The related value represents the amount of volume ramping done by the libopenmpt mixer.
The default value is -1, which indicates a recommended default value.
The meaningful value range is [-1..10].
A value of 0 completely disables volume ramping. This might cause clicks in sound output.
Higher values imply slower/softer volume ramps.

Constructor & Destructor Documentation

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

Contruct a openmpt::module.

Parameters
streamInput stream from which the module is loaded. After the constructor has finished successfully, the input position of stream is set to the byte after the last byte that has been read. If the constructor fails, the state of the input position of stream is undefined.
logLog where any warnings or errors are printed to. The lifetime of the reference has to be as long as the lifetime of the module instance.
ctlsA map of initial ctl values, see openmpt::modules::get_ctls.
Returns
Throw an exception derived from openmpt::exception in case the provided file cannot be opened.
Remarks
The input data can be discarded after an openmpt::module has succesfullly been constructed.
openmpt::module::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() 
)
Parameters
dataData to load the module from.
logLog where any warnings or errors are printed to. The lifetime of the reference has to be as long as the lifetime of the module instance.
ctlsA map of initial ctl values, see openmpt::modules::get_ctls.
Returns
Throw an exception derived from openmpt::exception in case the provided file cannot be opened.
Remarks
The input data can be discarded after an openmpt::module has succesfullly been constructed.
openmpt::module::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() 
)
Parameters
begBegin of data to load the module from.
endEnd of data to load the module from.
logLog where any warnings or errors are printed to. The lifetime of the reference has to be as long as the lifetime of the module instance.
ctlsA map of initial ctl values, see openmpt::modules::get_ctls.
Returns
Throw an exception derived from openmpt::exception in case the provided file cannot be opened.
Remarks
The input data can be discarded after an openmpt::module has succesfullly been constructed.
openmpt::module::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() 
)
Parameters
dataData to load the module from.
sizeAmount of data available.
logLog where any warnings or errors are printed to. The lifetime of the reference has to be as long as the lifetime of the module instance.
ctlsA map of initial ctl values, see openmpt::modules::get_ctls.
Returns
Throw an exception derived from openmpt::exception in case the provided file cannot be opened.
Remarks
The input data can be discarded after an openmpt::module has succesfullly been constructed.
openmpt::module::module ( const std::vector< char > &  data,
std::ostream &  log = std::clog,
const std::map< std::string, std::string > &  ctls = detail::initial_ctls_map() 
)
Parameters
dataData to load the module from.
logLog where any warnings or errors are printed to. The lifetime of the reference has to be as long as the lifetime of the module instance.
ctlsA map of initial ctl values, see openmpt::modules::get_ctls.
Returns
Throw an exception derived from openmpt::exception in case the provided file cannot be opened.
Remarks
The input data can be discarded after an openmpt::module has succesfullly been constructed.
openmpt::module::module ( const char *  beg,
const char *  end,
std::ostream &  log = std::clog,
const std::map< std::string, std::string > &  ctls = detail::initial_ctls_map() 
)
Parameters
begBegin of data to load the module from.
endEnd of data to load the module from.
logLog where any warnings or errors are printed to. The lifetime of the reference has to be as long as the lifetime of the module instance.
ctlsA map of initial ctl values, see openmpt::modules::get_ctls.
Returns
Throw an exception derived from openmpt::exception in case the provided file cannot be opened.
Remarks
The input data can be discarded after an openmpt::module has succesfullly been constructed.
openmpt::module::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() 
)
Parameters
dataData to load the module from.
sizeAmount of data available.
logLog where any warnings or errors are printed to. The lifetime of the reference has to be as long as the lifetime of the module instance.
ctlsA map of initial ctl values, see openmpt::modules::get_ctls.
Returns
Throw an exception derived from openmpt::exception in case the provided file cannot be opened.
Remarks
The input data can be discarded after an openmpt::module has succesfullly been constructed.
openmpt::module::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() 
)
Parameters
dataData to load the module from.
sizeAmount of data available.
logLog where any warnings or errors are printed to. The lifetime of the reference has to be as long as the lifetime of the module instance.
ctlsA map of initial ctl values, see openmpt::modules::get_ctls.
Returns
Throw an exception derived from openmpt::exception in case the provided file cannot be opened.
Remarks
The input data can be discarded after an openmpt::module has succesfullly been constructed.
virtual openmpt::module::~module ( )
virtual

Member Function Documentation

std::string openmpt::module::ctl_get ( const std::string &  ctl) const
void openmpt::module::ctl_set ( const std::string &  ctl,
const std::string &  value 
)
std::string openmpt::module::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
std::string openmpt::module::format_pattern_row_channel_command ( std::int32_t  pattern,
std::int32_t  row,
std::int32_t  channel,
int  command 
) const
std::vector<std::string> openmpt::module::get_channel_names ( ) const
std::vector<std::string> openmpt::module::get_ctls ( ) const
float openmpt::module::get_current_channel_vu_left ( std::int32_t  channel) const
float openmpt::module::get_current_channel_vu_mono ( std::int32_t  channel) const
float openmpt::module::get_current_channel_vu_rear_left ( std::int32_t  channel) const
float openmpt::module::get_current_channel_vu_rear_right ( std::int32_t  channel) const
float openmpt::module::get_current_channel_vu_right ( std::int32_t  channel) const
std::int32_t openmpt::module::get_current_order ( ) const
std::int32_t openmpt::module::get_current_pattern ( ) const
std::int32_t openmpt::module::get_current_playing_channels ( ) const
std::int32_t openmpt::module::get_current_row ( ) const
std::int32_t openmpt::module::get_current_speed ( ) const
std::int32_t openmpt::module::get_current_tempo ( ) const
double openmpt::module::get_duration_seconds ( ) const

Get approximate song duration.

Returns
Approximate song duration in seconds.
std::vector<std::string> openmpt::module::get_instrument_names ( ) const
std::string openmpt::module::get_metadata ( const std::string &  key) const

Get a metadata item value.

Parameters
keyMetadata item key to query. Use openmpt::module::get_metadata_keys to check for available keys.
Returns
The associated value for key.
See Also
openmpt::module::get_metadata_keys
std::vector<std::string> openmpt::module::get_metadata_keys ( ) const

Get the list of supported metadata item keys.

Returns
Metadata item keys supported by openmpt::module::get_metadata
See Also
openmpt::module::get_metadata
std::int32_t openmpt::module::get_num_channels ( ) const
std::int32_t openmpt::module::get_num_instruments ( ) const
std::int32_t openmpt::module::get_num_orders ( ) const
std::int32_t openmpt::module::get_num_patterns ( ) const
std::int32_t openmpt::module::get_num_samples ( ) const
std::int32_t openmpt::module::get_num_subsongs ( ) const
std::vector<std::string> openmpt::module::get_order_names ( ) const
std::int32_t openmpt::module::get_order_pattern ( std::int32_t  order) const
std::vector<std::string> openmpt::module::get_pattern_names ( ) const
std::int32_t openmpt::module::get_pattern_num_rows ( std::int32_t  pattern) const
std::uint8_t openmpt::module::get_pattern_row_channel_command ( std::int32_t  pattern,
std::int32_t  row,
std::int32_t  channel,
int  command 
) const
double openmpt::module::get_position_seconds ( ) const

Get approximate current song position.

Returns
Approximate current song position in seconds.
See Also
openmpt::module::set_position_seconds
std::int32_t openmpt::module::get_render_param ( int  param) const

Get render parameter.

Parameters
paramParameter to query. See openmpt::module::render_param.
Returns
The current value of the parameter. Throws an exception derived from openmpt::exception if param is invalid.
See Also
openmpt::module::render_param
openmpt::module::set_render_param
std::int32_t openmpt::module::get_repeat_count ( ) const

Get Repeat Count.

Returns
Repeat Count
  • -1: repeat forever
  • 0: play once, repeat zero times (the default)
  • n>0: play once and repeat n times after that
See Also
openmpt::module::set_repeat_count
std::vector<std::string> openmpt::module::get_sample_names ( ) const
std::vector<std::string> openmpt::module::get_subsong_names ( ) const
std::string openmpt::module::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
std::string openmpt::module::highlight_pattern_row_channel_command ( std::int32_t  pattern,
std::int32_t  row,
std::int32_t  channel,
int  command 
) const
std::size_t openmpt::module::read ( std::int32_t  samplerate,
std::size_t  count,
std::int16_t *  mono 
)

Render audio data.

Parameters
samplerateSamplerate to render output. Should be in [8000,192000], but this is not enforced.
countNumber auf audio frames to render per channel.
monoPointer to a buffer of at least count elements that receives the mono/center output.
Returns
The number of frames acutally rendered.
Return values
0The end of song has been reached.
Remarks
The output buffers are only written to up to the returned number of elements.
You can freely switch between any of these function if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.
std::size_t openmpt::module::read ( std::int32_t  samplerate,
std::size_t  count,
std::int16_t *  left,
std::int16_t *  right 
)

Render audio data.

Parameters
samplerateSamplerate to render output. Should be in [8000,192000], but this is not enforced.
countNumber auf audio frames to render per channel.
leftPointer to a buffer of at least count elements that receives the left output.
rightPointer to a buffer of at least count elements that receives the right output.
Returns
The number of frames acutally rendered.
Return values
0The end of song has been reached.
Remarks
The output buffers are only written to up to the returned number of elements.
You can freely switch between any of these function if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.
std::size_t openmpt::module::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.

Parameters
samplerateSamplerate to render output. Should be in [8000,192000], but this is not enforced.
countNumber auf audio frames to render per channel.
leftPointer to a buffer of at least count elements that receives the left output.
rightPointer to a buffer of at least count elements that receives the right output.
rear_leftPointer to a buffer of at least count elements that receives the rear left output.
rear_rightPointer to a buffer of at least count elements that receives the rear right output.
Returns
The number of frames acutally rendered.
Return values
0The end of song has been reached.
Remarks
The output buffers are only written to up to the returned number of elements.
You can freely switch between any of these function if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.
std::size_t openmpt::module::read ( std::int32_t  samplerate,
std::size_t  count,
float *  mono 
)

Render audio data.

Parameters
samplerateSamplerate to render output. Should be in [8000,192000], but this is not enforced.
countNumber auf audio frames to render per channel.
monoPointer to a buffer of at least count elements that receives the mono/center output.
Returns
The number of frames acutally rendered.
Return values
0The end of song has been reached.
Remarks
The output buffers are only written to up to the returned number of elements.
You can freely switch between any of these function if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
Floating point samples are in the [-1.0..1.0] nominal range. They are not clippped to that range though and thus might overshoot.
std::size_t openmpt::module::read ( std::int32_t  samplerate,
std::size_t  count,
float *  left,
float *  right 
)

Render audio data.

Parameters
samplerateSamplerate to render output. Should be in [8000,192000], but this is not enforced.
countNumber auf audio frames to render per channel.
leftPointer to a buffer of at least count elements that receives the left output.
rightPointer to a buffer of at least count elements that receives the right output.
Returns
The number of frames acutally rendered.
Return values
0The end of song has been reached.
Remarks
The output buffers are only written to up to the returned number of elements.
You can freely switch between any of these function if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
Floating point samples are in the [-1.0..1.0] nominal range. They are not clippped to that range though and thus might overshoot.
std::size_t openmpt::module::read ( std::int32_t  samplerate,
std::size_t  count,
float *  left,
float *  right,
float *  rear_left,
float *  rear_right 
)

Render audio data.

Parameters
samplerateSamplerate to render output. Should be in [8000,192000], but this is not enforced.
countNumber auf audio frames to render per channel.
leftPointer to a buffer of at least count elements that receives the left output.
rightPointer to a buffer of at least count elements that receives the right output.
rear_leftPointer to a buffer of at least count elements that receives the rear left output.
rear_rightPointer to a buffer of at least count elements that receives the rear right output.
Returns
The number of frames acutally rendered.
Return values
0The end of song has been reached.
Remarks
The output buffers are only written to up to the returned number of elements.
You can freely switch between any of these function if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
Floating point samples are in the [-1.0..1.0] nominal range. They are not clippped to that range though and thus might overshoot.
std::size_t openmpt::module::read_interleaved_quad ( std::int32_t  samplerate,
std::size_t  count,
std::int16_t *  interleaved_quad 
)

Render audio data.

Parameters
samplerateSamplerate to render output. Should be in [8000,192000], but this is not enforced.
countNumber auf audio frames to render per channel.
interleaved_quadPointer to a buffer of at least count*4 elements that receives the interleaved suad surround output in the order (L,R,RL,RR).
Returns
The number of frames acutally rendered.
Return values
0The end of song has been reached.
Remarks
The output buffers are only written to up to the returned number of elements.
You can freely switch between any of these function if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.
std::size_t openmpt::module::read_interleaved_quad ( std::int32_t  samplerate,
std::size_t  count,
float *  interleaved_quad 
)

Render audio data.

Parameters
samplerateSamplerate to render output. Should be in [8000,192000], but this is not enforced.
countNumber auf audio frames to render per channel.
interleaved_quadPointer to a buffer of at least count*4 elements that receives the interleaved suad surround output in the order (L,R,RL,RR).
Returns
The number of frames acutally rendered.
Return values
0The end of song has been reached.
Remarks
The output buffers are only written to up to the returned number of elements.
You can freely switch between any of these function if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
Floating point samples are in the [-1.0..1.0] nominal range. They are not clippped to that range though and thus might overshoot.
std::size_t openmpt::module::read_interleaved_stereo ( std::int32_t  samplerate,
std::size_t  count,
std::int16_t *  interleaved_stereo 
)

Render audio data.

Parameters
samplerateSamplerate to render output. Should be in [8000,192000], but this is not enforced.
countNumber auf audio frames to render per channel.
interleaved_stereoPointer to a buffer of at least count*2 elements that receives the interleaved stereo output in the order (L,R).
Returns
The number of frames acutally rendered.
Return values
0The end of song has been reached.
Remarks
The output buffers are only written to up to the returned number of elements.
You can freely switch between any of these function if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.
std::size_t openmpt::module::read_interleaved_stereo ( std::int32_t  samplerate,
std::size_t  count,
float *  interleaved_stereo 
)

Render audio data.

Parameters
samplerateSamplerate to render output. Should be in [8000,192000], but this is not enforced.
countNumber auf audio frames to render per channel.
interleaved_stereoPointer to a buffer of at least count*2 elements that receives the interleaved stereo output in the order (L,R).
Returns
The number of frames acutally rendered.
Return values
0The end of song has been reached.
Remarks
The output buffers are only written to up to the returned number of elements.
You can freely switch between any of these function if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
Floating point samples are in the [-1.0..1.0] nominal range. They are not clippped to that range though and thus might overshoot.
void openmpt::module::select_subsong ( std::int32_t  subsong)

Select a subsong from a multi-song module.

Parameters
subsongIndex of the subsong.
Returns
Throws an exception derived from openmpt::exception if subsong is not in range [0,openmpt::module::get_num_subsongs()]
double openmpt::module::set_position_order_row ( std::int32_t  order,
std::int32_t  row 
)

Set approximate current song position.

If order or row are out of range, to position is not modified and the current position is returned.

Parameters
orderPattern order number to seek to.
rowPattern row number to seek to.
Returns
Approximate new song position in seconds.
See Also
openmpt::module::set_position_seconds
openmpt::module::get_position_seconds
double openmpt::module::set_position_seconds ( double  seconds)

Set approximate current song position.

Parameters
secondsSeconds to seek to. If seconds is out of range, the position gets set to song start or end respectively.
Returns
Approximate new song position in seconds.
See Also
openmpt::module::get_position_seconds
void openmpt::module::set_render_param ( int  param,
std::int32_t  value 
)

Set render parameter.

Parameters
paramParameter to set. See openmpt::module::render_param.
valueThe value to set param to.
Returns
Throws an exception derived from openmpt::exception if param is invalid or value is out of range.
See Also
openmpt::module::render_param
openmpt::module::get_render_param
void openmpt::module::set_repeat_count ( std::int32_t  repeat_count)

Set Repeat Count.

Parameters
repeat_countRepeat Count
  • -1: repeat forever
  • 0: play once, repeat zero times (the default)
  • n>0: play once and repeat n times after that
See Also
openmpt::module::get_repeat_count

Friends And Related Function Documentation

friend class module_ext
friend

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