[−][src]Struct libxm_soundboard::XMContext
The XM context.
Implementations
impl XMContext
[src]
pub fn new(mod_data: &[u8], rate: u32) -> Result<XMContext, XMError>
[src]
Creates an XM context.
Parameters
mod_data
- The contents of the module.rate
- The play rate in Hz. Recommended value is 48000.
pub fn generate_samples(&mut self, output: &mut [f32])
[src]
Plays the module and puts the sound samples in the specified output buffer. The output is in stereo.
pub fn set_max_loop_count(&mut self, loopcnt: u8)
[src]
Sets the maximum number of times a module can loop.
After the specified number of loops, calls to generate_samples()
will
generate silence.
pub fn loop_count(&self) -> u8
[src]
Gets the loop count of the currently playing module.
This value is 0 when the module is still playing, 1 when the module has looped once, etc.
pub fn module_name(&self) -> &[u8]
[src]
Gets the module name as a byte slice. The string encoding is unknown.
pub fn tracker_name(&self) -> &[u8]
[src]
Gets the tracker name as a byte slice. The string encoding is unknown.
pub fn number_of_channels(&self) -> u16
[src]
Gets the number of channels.
pub fn module_length(&self) -> u16
[src]
Gets the module length (in patterns).
pub fn number_of_patterns(&self) -> u16
[src]
Gets the number of patterns.
pub fn number_of_rows(&self, pattern: u16) -> u16
[src]
Gets the number of rows in a pattern.
Note
Pattern numbers go from 0
to get_number_of_patterns() - 1
pub fn number_of_instruments(&self) -> u16
[src]
Gets the number of instruments.
pub fn number_of_samples(&self, instrument: u16) -> u16
[src]
Gets the number of samples of an instrument.
Note
Instrument numbers go from 1
to get_number_of_instruments()
pub fn playing_speed(&self) -> PlayingSpeed
[src]
Gets the current module speed.
pub fn position(&self) -> Position
[src]
Gets the current position in the module being played.
pub fn latest_trigger_of_instrument(&self, instrument: u16) -> u64
[src]
Gets the latest time (in number of generated samples) when a particular instrument was triggered in any channel.
Note
Instrument numbers go from 1
to get_number_of_instruments()
pub fn latest_trigger_of_sample(&self, instrument: u16, sample: u16) -> u64
[src]
Get the latest time (in number of generated samples) when a particular sample was triggered in any channel.
Note
Instrument numbers go from 1
to get_number_of_instruments()
Sample numbers go from 0
to get_number_of_samples(instrument) - 1
pub fn latest_trigger_of_channel(&self, channel: u16) -> u64
[src]
Get the latest time (in number of generated samples) when any instrument was triggered in a given channel.
Note
Channel numbers go from 1
to get_number_of_channels()
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,