reimplement track deletion
This commit is contained in:
parent
f09a89140d
commit
64744819de
1 changed files with 8 additions and 1 deletions
|
@ -245,7 +245,14 @@ public class Playbin : GLib.Object {
|
|||
public void remove_track (uint position)
|
||||
requires (position < this._play_queue.get_n_items ())
|
||||
{
|
||||
assert (false); // TODO
|
||||
assert (this.mpv.command({"playlist-remove", position.to_string ()}) >= 0);
|
||||
this._play_queue.remove (position);
|
||||
if (this.play_queue_position > position) this.play_queue_position -= 1;
|
||||
if (this.play_queue_position == this._play_queue.get_n_items ()) {
|
||||
// we just killed the last track
|
||||
this.state = PlaybinState.STOPPED;
|
||||
this.stopped ();
|
||||
}
|
||||
}
|
||||
|
||||
public void clear () {
|
||||
|
|
Loading…
Reference in a new issue