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
impl MocInterface for Moc
fn new(moc_path: String) -> Self
Source§fn info(&self) -> MocInfo
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 fieldSource§fn clear_playlist(&mut self) -> bool
fn clear_playlist(&mut self) -> bool
Clear MoC’s current playlist.
Source§fn play_playlist(&mut self) -> bool
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
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
fn stop_server(&mut self) -> bool
Literally just
game end
MoC.Source§fn start_server(&mut self) -> bool
fn start_server(&mut self) -> bool
Launch the MoC server
Source§fn previous_song(&mut self) -> bool
fn previous_song(&mut self) -> bool
Go back to the previous song.
Source§fn stop_playback(&mut self) -> bool
fn stop_playback(&mut self) -> bool
Stop all playback
Source§fn pause_playback(&mut self) -> bool
fn pause_playback(&mut self) -> bool
Pause playback.
Source§fn resume_playback(&mut self) -> bool
fn resume_playback(&mut self) -> bool
Resume playback.
Source§fn set_volume(&mut self, vol: usize) -> bool
fn set_volume(&mut self, vol: usize) -> bool
Set the volume for MoC.
Source§fn increase_volume_by(&mut self, step: usize) -> bool
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
fn decrease_volume_by(&mut self, step: usize) -> bool
Same as above but for decreasing.
Source§fn append_music(&mut self, path: &Path) -> bool
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
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
forwardsSource§fn enable_control(&mut self, control: MocControl) -> bool
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
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> 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