[][src]Struct wildmidi::Player

pub struct Player;

Loader for the Midi format.

Methods

impl Player
[src]

pub fn new(rate: u16) -> Result<Player, Box<dyn Error>>
[src]

Create a new Player with the given sample rate, using the default configuration file.

Errors

Will fail if 'rate' is not on the interval [11025,65535], or if neither of the default configuration files exist ('/etc/wildmidi/wildmidi.cfg', '/etc/wildmidi.cfg').

pub fn with_cfg(cfg: &str, rate: u16) -> Result<Player, Box<dyn Error>>
[src]

Create a new Player with the given config path and sample rate.

Errors

Will fail if 'rate' is not on the interval [11025,65535].

pub fn volume(&mut self, volume: u8) -> Result<(), Box<dyn Error>>
[src]

Sets the overall library volume level. The default is 100.

pub fn load(&self, data: &[u8]) -> Result<Midi, Box<dyn Error>>
[src]

Loads a Midi file from memory.

Errors

Will fail if an internal error occurs in WildMidi (such as a parse error).

pub fn load_file(&self, path: &str) -> Result<Midi, Box<dyn Error>>
[src]

Loads a Midi file from disk.

Errors

Will fail if the file does not exist, or if an internal error occurs in WildMidi (such as a parse error).

Trait Implementations

impl Drop for Player
[src]

Auto Trait Implementations

impl Send for Player

impl Sync for Player

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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