Compare commits
No commits in common. "f2f6c67383c908e910d63454d419ae44e9bee8b8" and "ea31535bfb7b6b8ecdfa10d295f9ce0dc8434260" have entirely different histories.
f2f6c67383
...
ea31535bfb
4 changed files with 9 additions and 14 deletions
|
@ -103,7 +103,6 @@ impl Handle {
|
||||||
.map(CString::new)
|
.map(CString::new)
|
||||||
.map(Result::unwrap)
|
.map(Result::unwrap)
|
||||||
.collect();
|
.collect();
|
||||||
event!(Level::DEBUG, "sending command to mpv: {:?}", args);
|
|
||||||
let mut args: Vec<*const c_char> = args
|
let mut args: Vec<*const c_char> = args
|
||||||
.iter()
|
.iter()
|
||||||
.map(CString::as_c_str)
|
.map(CString::as_c_str)
|
||||||
|
|
|
@ -89,7 +89,7 @@ mod imp {
|
||||||
|
|
||||||
#[template_callback]
|
#[template_callback]
|
||||||
fn on_row_activated(&self, position: u32) {
|
fn on_row_activated(&self, position: u32) {
|
||||||
self.obj().window().playlist_play_index(position as i64);
|
self.obj().window().play_index(position as i64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ mod imp {
|
||||||
#[template(resource = "/eu/callcc/audrey/play_queue_song.ui")]
|
#[template(resource = "/eu/callcc/audrey/play_queue_song.ui")]
|
||||||
#[properties(wrapper_type = super::Song)]
|
#[properties(wrapper_type = super::Song)]
|
||||||
pub struct Song {
|
pub struct Song {
|
||||||
#[property(type = i64, set = Self::set_playlist_pos)]
|
#[property(get, set = Self::set_playlist_pos)]
|
||||||
_playlist_pos: (),
|
playlist_pos: Cell<i64>,
|
||||||
|
|
||||||
#[property(set, get)]
|
#[property(set, get)]
|
||||||
draggable: Cell<bool>,
|
draggable: Cell<bool>,
|
||||||
|
@ -60,10 +60,13 @@ mod imp {
|
||||||
#[weak(rename_to = self_)]
|
#[weak(rename_to = self_)]
|
||||||
self,
|
self,
|
||||||
move |_, _, _| {
|
move |_, _, _| {
|
||||||
|
/*
|
||||||
self_
|
self_
|
||||||
.obj()
|
.obj()
|
||||||
.window()
|
.window()
|
||||||
.playlist_remove(self_.obj().position() as i64)
|
.playbin()
|
||||||
|
.remove_entry(self_.obj().displayed_position() as usize - 1)*/
|
||||||
|
todo!()
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
.build();
|
.build();
|
||||||
|
@ -164,6 +167,7 @@ mod imp {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_playlist_pos(&self, playlist_pos: i64) {
|
fn set_playlist_pos(&self, playlist_pos: i64) {
|
||||||
|
self.playlist_pos.set(playlist_pos);
|
||||||
self.obj()
|
self.obj()
|
||||||
.set_current(playlist_pos == self.position.get() as i64);
|
.set_current(playlist_pos == self.position.get() as i64);
|
||||||
}
|
}
|
||||||
|
|
|
@ -390,18 +390,10 @@ impl Window {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn playlist_play_index(&self, index: i64) {
|
pub fn play_index(&self, index: i64) {
|
||||||
self.imp()
|
self.imp()
|
||||||
.mpv
|
.mpv
|
||||||
.command(["playlist-play-index", &index.to_string()])
|
.command(["playlist-play-index", &index.to_string()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn playlist_remove(&self, index: i64) {
|
|
||||||
self.imp()
|
|
||||||
.mpv
|
|
||||||
.command(["playlist-remove", &index.to_string()])
|
|
||||||
.unwrap();
|
|
||||||
self.playlist_model().remove(index as u32);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue