Struct game_music_emu::GameMusicEmu[][src]

pub struct GameMusicEmu { /* fields omitted */ }

Provides a wrapper around native functions that take an EmuHandle


impl GameMusicEmu[src]

pub fn new(emu_type: EmuType, sample_rate: u32) -> Self[src]

Create an instance for the specified crate::EmuType

pub fn from_file(
    path: impl AsRef<Path>,
    sample_rate: u32
) -> Result<GameMusicEmu, GmeOrIoError>

Creates a new instance by loading a file at the specified path

pub fn from_data(
    data: impl AsRef<[u8]>,
    sample_rate: u32
) -> Result<GameMusicEmu, GmeError>

Creates a new instance by loading data at the specified path

pub fn load_data(&self, data: impl AsRef<[u8]>) -> Result<(), GmeError>[src]

Load music file from memory into emulator. Makes a copy of data passed.

pub fn load_file(&self, path: impl AsRef<Path>) -> Result<(), GmeOrIoError>[src]

Load music file into emulator

pub fn play(&self, count: usize, buffer: &mut [i16]) -> Result<(), GmeError>[src]

Generate count 16-bit signed samples into buffer. Output is in stereo.

pub fn start_track(&self, index: usize) -> Result<(), GmeError>[src]

Start a track, where 0 is the first track

pub fn tell(&self) -> u32[src]

Number of milliseconds played since beginning of track

pub fn track_count(&self) -> usize[src]

Number of tracks available

pub fn track_ended(&self) -> bool[src]

True if track ended

Trait Implementations

impl Clone for GameMusicEmu[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.