Moc

Struct Moc 

Source
pub struct Moc {
    pub moc_path: String,
}
Expand description

A struct holding the path to the MoC executable.

Fields§

§moc_path: String

Trait Implementations§

Source§

impl MocInterface for Moc

Source§

fn new(moc_path: String) -> Self

Source§

fn info(&self) -> MocInfo

Get all the info about what MoC is currently doing, refer to MocInfo’s implementations for the methods to get each field
Source§

fn clear_playlist(&mut self) -> bool

Clear MoC’s current playlist.
Source§

fn play_playlist(&mut self) -> bool

Play MoC’s current playlist starting from the first item.
Source§

fn immediate_play(&mut self, source: MocSource) -> bool

Immediately play the source, it can be a file or stream url but it has to be constructed using MocSource.
Source§

fn stop_server(&mut self) -> bool

Literally just game end MoC.
Source§

fn start_server(&mut self) -> bool

Launch the MoC server
Source§

fn next_song(&mut self) -> bool

Skip to the next song.
Source§

fn previous_song(&mut self) -> bool

Go back to the previous song.
Source§

fn stop_playback(&mut self) -> bool

Stop all playback
Source§

fn pause_playback(&mut self) -> bool

Pause playback.
Source§

fn resume_playback(&mut self) -> bool

Resume playback.
Source§

fn set_volume(&mut self, vol: usize) -> bool

Set the volume for MoC.
Source§

fn increase_volume_by(&mut self, step: usize) -> bool

Instead of setting the volume, increase the volume by the step.
Source§

fn decrease_volume_by(&mut self, step: usize) -> bool

Same as above but for decreasing.
Source§

fn append_music(&mut self, path: &Path) -> bool

Append a music file to the playlist, doesn’t support streams… Read more
Source§

fn seek(&mut self, step: isize) -> bool

Seek forwards and backwards on the currently playing track, this doesn’t jump to that duration, it seeks, therefore if you give the step the value of -10 it seeks ten seconds back, for the value of 10 it seeks ten seconds forwards
Source§

fn jump_to(&mut self, time: Duration) -> bool

Jump to a location in the current track.
Source§

fn enable_control(&mut self, control: MocControl) -> bool

Enable one of the flags, refer to MocControl
Source§

fn disable_control(&mut self, control: MocControl) -> bool

Disable one of the flags, refer to MocControl

Auto Trait Implementations§

§

impl Freeze for Moc

§

impl RefUnwindSafe for Moc

§

impl Send for Moc

§

impl Sync for Moc

§

impl Unpin for Moc

§

impl UnwindSafe for Moc

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.