Added list of supported commands as Enum. Cleaned up comments. Pushed version to 1.1.8

This commit is contained in:
Jonas Frei
2019-06-24 20:11:58 +02:00
parent 456fa2ea4d
commit cb5ad88544
4 changed files with 153 additions and 116 deletions

View File

@@ -26,7 +26,7 @@ fn main() -> Result<(), Error> {
loop {
let event = mpv.event_listen()?;
match event {
Event::PropertyChange(_, property) => match property {
Event::PropertyChange { id: _, property } => match property {
Property::Path(Some(value)) => println!("\nPlaying: {}", value),
Property::Path(None) => (),
Property::Pause(value) => pause = value,
@@ -50,10 +50,7 @@ fn main() -> Result<(), Error> {
}
}
Property::Metadata(None) => (),
Property::Unknown {
name: _,
data: _,
} => (),
Property::Unknown { name: _, data: _ } => (),
},
Event::Shutdown => return Ok(()),
Event::Unimplemented => panic!("Unimplemented event"),