pub struct Music { /* private fields */ }Expand description
Music object built from an MML script.
Implementations§
Source§impl Music
impl Music
Sourcepub fn new(script: &str) -> Result<Self, ParseMusicError>
pub fn new(script: &str) -> Result<Self, ParseMusicError>
Parses the given MML script and creates a Music instance.
This is equivalent with script.parse::<Music>().
Sourcepub fn composer(&self) -> Option<&str>
pub fn composer(&self) -> Option<&str>
Name of the composer of this music defined by #COMPOSER <VALUE> in the script.
Sourcepub fn programer(&self) -> Option<&str>
pub fn programer(&self) -> Option<&str>
Name of the programmer who wrote this music script defined by #PROGRAMER <VALUE> in the script.
Note that the typo is intentional.
Sourcepub fn play(&self, sample_rate: u16) -> MusicPlayer ⓘ
pub fn play(&self, sample_rate: u16) -> MusicPlayer ⓘ
Returns a MusicPlayer instance that generates audio samples.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Music
impl RefUnwindSafe for Music
impl Send for Music
impl Sync for Music
impl Unpin for Music
impl UnsafeUnpin for Music
impl UnwindSafe for Music
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more