Included observation ID in PropertyChange event
This commit is contained in:
parent
d5ecc48b1d
commit
b8590c2ae3
|
@ -26,7 +26,7 @@ fn main() -> Result<(), Error> {
|
|||
loop {
|
||||
let event = mpv.event_listen()?;
|
||||
match event {
|
||||
Event::PropertyChange(property) => match property {
|
||||
Event::PropertyChange(_, property) => match property {
|
||||
Property::Path(Some(value)) => println!("\nPlaying: {}[K", value),
|
||||
Property::Path(None) => (),
|
||||
Property::Pause(value) => pause = value,
|
||||
|
@ -52,7 +52,6 @@ fn main() -> Result<(), Error> {
|
|||
Property::Metadata(None) => (),
|
||||
Property::Unknown {
|
||||
name: _,
|
||||
id: _,
|
||||
data: _,
|
||||
} => (),
|
||||
},
|
||||
|
|
|
@ -308,12 +308,11 @@ fn try_convert_property(name: &str, id: isize, data: MpvDataType) -> Event {
|
|||
warn!("Property {} not implemented", name);
|
||||
Property::Unknown {
|
||||
name: name.to_string(),
|
||||
id,
|
||||
data,
|
||||
}
|
||||
}
|
||||
};
|
||||
Event::PropertyChange(property)
|
||||
Event::PropertyChange(id, property)
|
||||
}
|
||||
|
||||
pub fn listen(instance: &mut Mpv) -> Result<Event, Error> {
|
||||
|
|
|
@ -36,7 +36,7 @@ pub enum Event {
|
|||
MetadataUpdate,
|
||||
Seek,
|
||||
PlaybackRestart,
|
||||
PropertyChange(Property),
|
||||
PropertyChange(isize, Property),
|
||||
ChapterChange,
|
||||
Unimplemented,
|
||||
}
|
||||
|
@ -50,7 +50,6 @@ pub enum Property {
|
|||
Metadata(Option<HashMap<String, MpvDataType>>),
|
||||
Unknown {
|
||||
name: String,
|
||||
id: isize,
|
||||
data: MpvDataType,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue