libopenmpt 0.5.0-pre.5+r11801 cross-platform C++ and C library to decode tracked music files

Public Member Functions | Protected Member Functions | List of all members
openmpt::ext::interactive Class Referenceabstract

`#include <libopenmpt/libopenmpt_ext.hpp>`

## Public Member Functions
virtual void | set_current_speed (std::int32_t speed)=0
| Set the current ticks per row (speed) More...
virtual void | set_current_tempo (std::int32_t tempo)=0
| Set the current module tempo. More...
virtual void | set_tempo_factor (double factor)=0
| Set the current module tempo factor without affecting playback pitch. More...
virtual double | get_tempo_factor () const =0
| Gets the current module tempo factor. More...
virtual void | set_pitch_factor (double factor)=0
| Set the current module pitch factor without affecting playback speed. More...
virtual double | get_pitch_factor () const =0
| Gets the current module pitch factor. More...
virtual void | set_global_volume (double volume)=0
| Set the current global volume. More...
virtual double | get_global_volume () const =0
| Get the current global volume. More...
virtual void | set_channel_volume (std::int32_t channel, double volume)=0
| Set the current channel volume for a channel. More...
virtual double | get_channel_volume (std::int32_t channel) const =0
| Get the current channel volume for a channel. More...
virtual void | set_channel_mute_status (std::int32_t channel, bool mute)=0
| Set the current mute status for a channel. More...
virtual bool | get_channel_mute_status (std::int32_t channel) const =0
| Get the current mute status for a channel. More...
virtual void | set_instrument_mute_status (std::int32_t instrument, bool mute)=0
| Set the current mute status for an instrument. More...
virtual bool | get_instrument_mute_status (std::int32_t instrument) const =0
| Get the current mute status for an instrument. More...
virtual std::int32_t | play_note (std::int32_t instrument, std::int32_t note, double volume, double panning)=0
| Play a note using the specified instrument. More...
virtual void | stop_note (std::int32_t channel)=0
| Stop the note playing on the specified channel. More...

## Protected Member Functions
| interactive ()
virtual | ~ interactive ()

## Constructor & Destructor Documentation

## ◆ interactive()

openmpt::ext::interactive::interactive | ( |  | ) |
| inline protected

## ◆ ~ interactive()

virtual openmpt::ext::interactive::~ interactive | ( |  | ) |
| inline protected virtual

## Member Function Documentation

## ◆ get_channel_mute_status()

virtual bool openmpt::ext::interactive::get_channel_mute_status | ( | std::int32_t | channel | ) | const
| pure virtual

Get the current mute status for a channel.

Parameters

  channel | The channel whose mute status should be retrieved, in range [0, openmpt::module::get_num_channels()[

Returns
  The current channel mute status. true is muted, false is unmuted.

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the channel is outside the specified range.

See also
  openmpt::ext::interactive::set_channel_mute_status

## ◆ get_channel_volume()

virtual double openmpt::ext::interactive::get_channel_volume | ( | std::int32_t | channel | ) | const
| pure virtual

Get the current channel volume for a channel.

Parameters

  channel | The channel whose volume should be retrieved, in range [0, openmpt::module::get_num_channels()[

Returns
  The current channel volume in range [0.0, 1.0]

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the channel is outside the specified range.

See also
  openmpt::ext::interactive::set_channel_volume

## ◆ get_global_volume()

virtual double openmpt::ext::interactive::get_global_volume | ( |  | ) | const
| pure virtual

Get the current global volume.

Returns
  The current global volume in range [0.0, 1.0]

See also
  openmpt::ext::interactive::set_global_volume

## ◆ get_instrument_mute_status()

virtual bool openmpt::ext::interactive::get_instrument_mute_status | ( | std::int32_t | instrument | ) | const
| pure virtual

Get the current mute status for an instrument.

Parameters

  instrument | The instrument whose mute status should be retrieved, in range [0, openmpt::module::get_num_instruments()[ if openmpt::module::get_num_instruments is not 0, otherwise in [0, openmpt::module::get_num_samples()[

Returns
  The current instrument mute status. true is muted, false is unmuted.

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the instrument is outside the specified range.

See also
  openmpt::ext::interactive::set_instrument_mute_status

## ◆ get_pitch_factor()

virtual double openmpt::ext::interactive::get_pitch_factor | ( |  | ) | const
| pure virtual

Gets the current module pitch factor.

Returns
  The current pitch factor.

See also
  openmpt::ext::interactive::set_pitch_factor

## ◆ get_tempo_factor()

virtual double openmpt::ext::interactive::get_tempo_factor | ( |  | ) | const
| pure virtual

Gets the current module tempo factor.

Returns
  The current tempo factor.

See also
  openmpt::ext::interactive::set_tempo_factor

## ◆ play_note()

virtual std::int32_t openmpt::ext::interactive::play_note | ( | std::int32_t | instrument,
|  | std::int32_t | note,
|  | double | volume,
|  | double | panning
| ) |  |
| pure virtual

Play a note using the specified instrument.

Parameters

  instrument | The instrument that should be played, in range [0, openmpt::module::get_num_instruments()[ if openmpt::module::get_num_instruments is not 0, otherwise in [0, openmpt::module::get_num_samples()[
  note | The note to play, in rage [0, 119]. 60 is the middle C.
  volume | The volume at which the note should be triggered, in range [0.0, 1.0]
  panning | The panning position at which the note should be triggered, in range [-1.0, 1.0], 0.0 is center.

Returns
  The channel on which the note is played. This can pe be passed to openmpt::ext::interactive::stop_note to stop the note.

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the instrument or note is outside the specified range.

See also
  openmpt::ext::interactive::stop_note

## ◆ set_channel_mute_status()

virtual void openmpt::ext::interactive::set_channel_mute_status | ( | std::int32_t | channel,
|  | bool | mute
| ) |  |
| pure virtual

Set the current mute status for a channel.

Parameters

  channel | The channel whose mute status should be set, in range [0, openmpt::module::get_num_channels()[
  mute | The new mute status. true is muted, false is unmuted.

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the channel is outside the specified range.

See also
  openmpt::ext::interactive::get_channel_mute_status

## ◆ set_channel_volume()

virtual void openmpt::ext::interactive::set_channel_volume | ( | std::int32_t | channel,
|  | double | volume
| ) |  |
| pure virtual

Set the current channel volume for a channel.

Parameters

  channel | The channel whose volume should be set, in range [0, openmpt::module::get_num_channels()[
  volume | The new channel volume in range [0.0, 1.0]

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the channel or volume is outside the specified range.

Remarks
  The channel volume may be reset by pattern commands at any time.

See also
  openmpt::ext::interactive::get_channel_volume

## ◆ set_current_speed()

virtual void openmpt::ext::interactive::set_current_speed | ( | std::int32_t | speed | ) |
| pure virtual

Set the current ticks per row (speed)

Parameters

  speed | The new tick count in range [1, 65535].

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the speed is outside the specified range.

Remarks
  The tick count may be reset by pattern commands at any time.

See also
  openmpt::module::get_current_speed

## ◆ set_current_tempo()

virtual void openmpt::ext::interactive::set_current_tempo | ( | std::int32_t | tempo | ) |
| pure virtual

Set the current module tempo.

Parameters

  tempo | The new tempo in range [32, 512]. The exact meaning of the value depends on the tempo mode used by the module.

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the tempo is outside the specified range.

Remarks
  The tempo may be reset by pattern commands at any time. Use openmpt::ext:interactive::set_tempo_factor to apply a tempo factor that is independent of pattern commands.

See also
  openmpt::module::get_current_tempo

## ◆ set_global_volume()

virtual void openmpt::ext::interactive::set_global_volume | ( | double | volume | ) |
| pure virtual

Set the current global volume.

Parameters

  volume | The new global volume in range [0.0, 1.0]

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the volume is outside the specified range.

Remarks
  The global volume may be reset by pattern commands at any time. Use openmpt::module::set_render_param to apply a global overall volume factor that is independent of pattern commands.

See also
  openmpt::ext::interactive::get_global_volume

## ◆ set_instrument_mute_status()

virtual void openmpt::ext::interactive::set_instrument_mute_status | ( | std::int32_t | instrument,
|  | bool | mute
| ) |  |
| pure virtual

Set the current mute status for an instrument.

Parameters

  instrument | The instrument whose mute status should be set, in range [0, openmpt::module::get_num_instruments()[ if openmpt::module::get_num_instruments is not 0, otherwise in [0, openmpt::module::get_num_samples()[
  mute | The new mute status. true is muted, false is unmuted.

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the instrument is outside the specified range.

See also
  openmpt::ext::interactive::get_instrument_mute_status

## ◆ set_pitch_factor()

virtual void openmpt::ext::interactive::set_pitch_factor | ( | double | factor | ) |
| pure virtual

Set the current module pitch factor without affecting playback speed.

Parameters

  factor | The new pitch factor in range ]0.0, 4.0] - 1.0 means unmodified pitch.

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the factor is outside the specified range.

Remarks
  Modifying the pitch without applying the the same tempo factor using openmpt::ext::interactive::set_tempo_factor may cause rhythmic samples (e.g. drum loops) to go out of sync.
  To shift the pich by `n` semitones, the parameter can be calculated as follows: `pow( 2.0, n / 12.0 )`

See also
  openmpt::ext::interactive::get_pitch_factor

## ◆ set_tempo_factor()

virtual void openmpt::ext::interactive::set_tempo_factor | ( | double | factor | ) |
| pure virtual

Set the current module tempo factor without affecting playback pitch.

Parameters

  factor | The new tempo factor in range ]0.0, 4.0] - 1.0 means unmodified tempo.

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the factor is outside the specified range.

Remarks
  Modifying the tempo without applying the same pitch factor using openmpt::ext::interactive::set_pitch_factor may cause rhythmic samples (e.g. drum loops) to go out of sync.

See also
  openmpt::ext::interactive::get_tempo_factor

## ◆ stop_note()

virtual void openmpt::ext::interactive::stop_note | ( | std::int32_t | channel | ) |
| pure virtual

Stop the note playing on the specified channel.

Parameters

  channel | The channel on which the note should be stopped.

Exceptions

  openmpt::exception | Throws an exception derived from openmpt::exception if the channel index is invalid.

See also
  openmpt::ext::interactive::play_note

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

- libopenmpt/libopenmpt_ext.hpp