Manage next/previous track
This commit is contained in:
parent
330399edfd
commit
4dcd3f6d3a
|
@ -48,12 +48,17 @@ EXAMPLES :
|
||||||
- Send default command (${USER_MULTIMEDIA_COMMAND_DEFAULT}) to MPV
|
- Send default command (${USER_MULTIMEDIA_COMMAND_DEFAULT}) to MPV
|
||||||
${PROGNAME}
|
${PROGNAME}
|
||||||
|
|
||||||
|
- Try to play next track (if playing a playlist)
|
||||||
|
${PROGNAME} --command next
|
||||||
|
|
||||||
OPTIONS :
|
OPTIONS :
|
||||||
-c,--command
|
-c,--command
|
||||||
Send a command to running MPV. Available commands :
|
Send a command to running MPV. Available commands :
|
||||||
* toggle play, pause
|
* toggle play, pause
|
||||||
* play
|
* play
|
||||||
* pause
|
* pause
|
||||||
|
* next
|
||||||
|
* prev, previous
|
||||||
|
|
||||||
-d,--debug
|
-d,--debug
|
||||||
Enable debug messages.
|
Enable debug messages.
|
||||||
|
@ -117,6 +122,16 @@ Use ${RED}MPV socket${COLOR_DEBUG} to send ${USER_MULTIMEDIA_COMMAND} command."
|
||||||
Use ${RED}MPV socket${COLOR_DEBUG} to send ${USER_MULTIMEDIA_COMMAND} command."
|
Use ${RED}MPV socket${COLOR_DEBUG} to send ${USER_MULTIMEDIA_COMMAND} command."
|
||||||
MPV_COMMAND=$(echo '{ "command": ["set_property", "pause", true] }' | socat - "${MPV_SOCKET_PATH}")
|
MPV_COMMAND=$(echo '{ "command": ["set_property", "pause", true] }' | socat - "${MPV_SOCKET_PATH}")
|
||||||
;;
|
;;
|
||||||
|
next ) ## Try to play next track (if available)
|
||||||
|
debug_message "define_vars − \
|
||||||
|
Use ${RED}MPV socket${COLOR_DEBUG} to send ${USER_MULTIMEDIA_COMMAND} command."
|
||||||
|
MPV_COMMAND=$(echo 'playlist-next' | socat - "${MPV_SOCKET_PATH}")
|
||||||
|
;;
|
||||||
|
prev|previous ) ## Try to play previous track (if available)
|
||||||
|
debug_message "define_vars − \
|
||||||
|
Use ${RED}MPV socket${COLOR_DEBUG} to send ${USER_MULTIMEDIA_COMMAND} command."
|
||||||
|
MPV_COMMAND=$(echo 'playlist-prev' | socat - "${MPV_SOCKET_PATH}")
|
||||||
|
;;
|
||||||
* ) ## unknow option
|
* ) ## unknow option
|
||||||
printf '%b\n' "${RED}Invalid MPV command: ${USER_MULTIMEDIA_COMMAND}${RESET}"
|
printf '%b\n' "${RED}Invalid MPV command: ${USER_MULTIMEDIA_COMMAND}${RESET}"
|
||||||
printf '%b\n' "---"
|
printf '%b\n' "---"
|
||||||
|
|
Loading…
Reference in New Issue