Compare commits
No commits in common. "daff4e7dbd89113a89bd2e125500772d84d8e262" and "28b7bbdf60545390b7446673f44db14215245745" have entirely different histories.
daff4e7dbd
...
28b7bbdf60
3 changed files with 15 additions and 31 deletions
|
@ -48,7 +48,7 @@ pub struct LogMessageEvent {
|
|||
pub prefix: String,
|
||||
pub level: String,
|
||||
pub text: String,
|
||||
pub log_level: u32,
|
||||
//log_level: i32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
|
|
@ -188,7 +188,6 @@ impl Handle {
|
|||
text: unsafe { CStr::from_ptr(data.text) }
|
||||
.to_string_lossy()
|
||||
.into(),
|
||||
log_level: data.log_level,
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
|
@ -150,6 +150,12 @@ mod imp {
|
|||
Event::StartFile(_) => {
|
||||
window.notify("song");
|
||||
// TODO: load cover art
|
||||
|
||||
// sanity check
|
||||
assert_eq!(
|
||||
window.song().unwrap().stream_url(),
|
||||
window.imp().mpv.get_property::<String>("path").unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
Event::Hook(event) => match event.reply_userdata {
|
||||
|
@ -163,21 +169,6 @@ mod imp {
|
|||
_ => unreachable!(),
|
||||
},
|
||||
|
||||
Event::LogMessage(event) => {
|
||||
// TODO: levels etc
|
||||
if event.log_level < 30 {
|
||||
event!(target: "mpv", Level::ERROR, "[{}] {}", event.prefix, event.text.trim());
|
||||
} else if event.log_level < 40 {
|
||||
event!(target: "mpv", Level::WARN, "[{}] {}", event.prefix, event.text.trim());
|
||||
} else if event.log_level < 50 {
|
||||
event!(target: "mpv", Level::INFO, "[{}] {}", event.prefix, event.text.trim());
|
||||
} else if event.log_level < 70 {
|
||||
event!(target: "mpv", Level::DEBUG, "[{}] {}", event.prefix, event.text.trim());
|
||||
} else {
|
||||
event!(target: "mpv", Level::TRACE, "[{}] {}", event.prefix, event.text.trim());
|
||||
};
|
||||
}
|
||||
|
||||
_ => event!(Level::DEBUG, "unhandled {event:?}"),
|
||||
}
|
||||
}
|
||||
|
@ -326,20 +317,14 @@ mod imp {
|
|||
if self.obj().playlist_pos() < 0 {
|
||||
None
|
||||
} else {
|
||||
let song: PlaybinSong = self
|
||||
.obj()
|
||||
Some(
|
||||
self.obj()
|
||||
.playlist_model()
|
||||
.item(self.obj().playlist_pos() as u32)
|
||||
.unwrap()
|
||||
.dynamic_cast()
|
||||
.unwrap();
|
||||
|
||||
// sanity check
|
||||
assert_eq!(
|
||||
song.stream_url(),
|
||||
self.mpv.get_property::<String>("path").unwrap()
|
||||
);
|
||||
Some(song)
|
||||
.unwrap(),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue