some playlist controls

This commit is contained in:
2025-09-05 16:18:02 +02:00
parent e9fafe278f
commit 4cb9c8c46f
4 changed files with 104 additions and 15 deletions

View File

@@ -23,8 +23,11 @@ mpv_playlist_position() {
}
mpv_playlist_move() {
debug "moving $1 -> $2"
__mpv_command_with_args2 "playlist-move" "$1" "$2" >>/tmp/foo 2>/dev/stdout
__mpv_command_with_args2 "playlist-move" "$1" "$2" >>/tmp/foo
}
mpv_playlist_clear() {
__mpv_command "playlist-clear"
}
mpv_quit() {
@@ -37,10 +40,17 @@ mpv_start() {
$MPV --no-config --no-terminal --input-ipc-server="$MPV_SOCKET" --idle --no-osc --no-input-default-bindings &
}
mpv_play_index() {
__mpv_command_with_arg "playlist-play-index" "$1"
}
mpv_rm_index() {
__mpv_command_with_arg "playlist-remove" "$1"
}
mpv_play_list() {
t=$(mktemp)
cat >"$t"
debug "Playing $(cat "$t")"
__mpv_command_with_arg "loadlist" "$t"
rm -f "$t"
}