From d0cb38691ee6081b0070019c0eea0b0276bfdd4d Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 20 Mar 2009 03:05:56 +1100 Subject: [PATCH] Add :player{play,pause,next,prev,stop} commands. --- xulmus/content/player.js | 33 +++++++++--- xulmus/locale/en-US/player.txt | 99 ++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 xulmus/locale/en-US/player.txt diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 246ba040..30e3b29f 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -29,23 +29,23 @@ function Player() // {{{ /////////////////////////////////////////////////////////////////////////////{{{ mappings.add([modes.PLAYER], - ["x"], "Play Track", + ["x"], "Play track", function () { player.play(); }); mappings.add([modes.PLAYER], - ["z"], "Previous Track", + ["z"], "Previous track", function () { player.previous(); }); mappings.add([modes.PLAYER], - ["c"], "Pause/Unpause Track", + ["c"], "Pause/Unpause track", function () { player.togglePlayPause(); }); mappings.add([modes.PLAYER], - ["b"], "Next Track", + ["b"], "Next track", function () { player.next(); }); mappings.add([modes.PLAYER], - ["v"], "Stop Track", + ["v"], "Stop track", function () { player.stop(); }); mappings.add([modes.PLAYER], @@ -81,7 +81,7 @@ function Player() // {{{ /////////////////////////////////////////////////////////////////////////////{{{ commands.add(["f[ilter]"], - "Filter Tracks", + "Filter and play tracks", function (args) { //Store the old view @@ -113,6 +113,27 @@ function Player() // {{{ completer: function (context, args) completion.song(context, args) }); + // TODO: better of as a single command, or cmus compatible E.g. :player-next? --djk + commands.add(["playern[ext]"], + "Play next track", + function () { player.next(); }); + + commands.add(["playerpr[ev]"], + "Play previous track", + function () { player.previous(); }); + + commands.add(["players[top]"], + "Stop track", + function () { player.stop(); }); + + commands.add(["playerp[lay]"], + "Play track", + function () { player.play(); }); + + commands.add(["playerpa[use]"], + "Pause/unpause track", + function () { player.togglePlayPause(); }); + /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ diff --git a/xulmus/locale/en-US/player.txt b/xulmus/locale/en-US/player.txt new file mode 100644 index 00000000..57b9f43e --- /dev/null +++ b/xulmus/locale/en-US/player.txt @@ -0,0 +1,99 @@ +HEADER + +|player-mode| |player| + + +The following features apply to Player mode which is activated when the media +tab has focus. + +|x| |:playerp| |:playerplay| +||:playerp[lay]|| + +||x|| +________________________________________________________________________________ +Play the current track. +________________________________________________________________________________ + +|z| |:playerpr| |:playerprev| +||:playerpr[ev]|| + +||z|| +________________________________________________________________________________ +Play the previous track. +________________________________________________________________________________ + + +|b| |:playern| |:playernext| +||:playern[ext]|| + +||b|| +________________________________________________________________________________ +Play the next track. +________________________________________________________________________________ + + +|c| |:playerpa| |:playerpause| +||:playerpa[use]|| + +||c|| +________________________________________________________________________________ +Pause/unpause the current track. +________________________________________________________________________________ + + +|v| |:players| |:playerstop| +||:players[top]|| + +||v|| +________________________________________________________________________________ +Stop playing the current track. +________________________________________________________________________________ + + +|x| +||x|| +________________________________________________________________________________ +Toggle shuffle mode. +________________________________________________________________________________ + + +|r| +||r|| +________________________________________________________________________________ +Toggle repeat mode. +________________________________________________________________________________ + + +|h| +||h|| +________________________________________________________________________________ +Seek +10s. +________________________________________________________________________________ + + +|l| +||l|| +________________________________________________________________________________ +Seek -10s. +________________________________________________________________________________ + + +|H| +||H|| +________________________________________________________________________________ +Seek +1m. +________________________________________________________________________________ + + +|L| +||L|| +________________________________________________________________________________ +Seek -1m. +________________________________________________________________________________ + + +|f| |:f| |:filter| +||:f[ilter] [a][artist][a] [a]{album}[a] [a]{track}[a]|| + +||f|| +________________________________________________________________________________ +Filter and play tracks. If only [a][artist][a] is specified then all tracks for +that artist are played in album order. If {album} is also specified then all +tracks for that album are played. A specific track can be specified with +{track}. +________________________________________________________________________________ + +// vim: set filetype=asciidoc: