Struct game_music_emu::GameMusicEmu [−][src]
Provides a wrapper around native functions that take an EmuHandle
Implementations
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>
[src]
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>
[src]
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]
fn clone(&self) -> GameMusicEmu
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for GameMusicEmu
impl Send for GameMusicEmu
impl Sync for GameMusicEmu
impl Unpin for GameMusicEmu
impl UnwindSafe for GameMusicEmu
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,
pub 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,