mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-27 10:33:31 +01:00
Add cheap count support to :playernext and :playerprev.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
0.1a1pre:
|
0.1a1pre:
|
||||||
|
* :playerprev and :playernext and equivalent mappings now accept a count.
|
||||||
* :displaypane arguments changed to "leftservice", "bottomservice",
|
* :displaypane arguments changed to "leftservice", "bottomservice",
|
||||||
"bottomcontent" or "rightsidebar"
|
"bottomcontent" or "rightsidebar"
|
||||||
* asciidoc is no longer required to build Melodactyl
|
* asciidoc is no longer required to build Melodactyl
|
||||||
|
|||||||
@@ -122,17 +122,25 @@ const Player = Module("player", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plays the next media item in the current media view.
|
* Plays the *count*th next media item in the current media view.
|
||||||
|
*
|
||||||
|
* @param {number} count
|
||||||
*/
|
*/
|
||||||
next: function next() {
|
next: function next(count) {
|
||||||
["cmd_control_next", "cmd_find_current_track"].forEach(gSongbirdWindowController.doCommand);
|
for (let i = 0; i < count; i++)
|
||||||
|
gSongbirdWindowController.doCommand("cmd_control_next");
|
||||||
|
gSongbirdWindowController.doCommand("cmd_find_current_track");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plays the previous media item in the current media view.
|
* Plays the *count*th previous media item in the current media view.
|
||||||
|
*
|
||||||
|
* @param {number} count
|
||||||
*/
|
*/
|
||||||
previous: function previous() {
|
previous: function previous(count) {
|
||||||
["cmd_control_previous", "cmd_find_current_track"].forEach(gSongbirdWindowController.doCommand);
|
for (let i = 0; i < count; i++)
|
||||||
|
gSongbirdWindowController.doCommand("cmd_control_previous");
|
||||||
|
gSongbirdWindowController.doCommand("cmd_find_current_track");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -494,11 +502,13 @@ const Player = Module("player", {
|
|||||||
|
|
||||||
commands.add(["playern[ext]"],
|
commands.add(["playern[ext]"],
|
||||||
"Play next track",
|
"Play next track",
|
||||||
function () { player.next(); });
|
function (args) { player.next(Math.max(args.count, 1)); },
|
||||||
|
{ count: true });
|
||||||
|
|
||||||
commands.add(["playerpr[ev]"],
|
commands.add(["playerpr[ev]"],
|
||||||
"Play previous track",
|
"Play previous track",
|
||||||
function () { player.previous(); });
|
function (args) { player.previous(Math.max(args.count, 1)); },
|
||||||
|
{ count: true });
|
||||||
|
|
||||||
commands.add(["players[top]"],
|
commands.add(["players[top]"],
|
||||||
"Stop track",
|
"Stop track",
|
||||||
@@ -671,23 +681,25 @@ const Player = Module("player", {
|
|||||||
mappings: function () {
|
mappings: function () {
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["x"], "Play track",
|
["x"], "Play track",
|
||||||
function () { player.play(); });
|
function () { ex.playerplay(); });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["z"], "Previous track",
|
["z"], "Previous track",
|
||||||
function () { player.previous(); });
|
function (count) { ex.playerprev({ "#": count }); },
|
||||||
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["c"], "Pause/unpause track",
|
["c"], "Pause/unpause track",
|
||||||
function () { player.togglePlayPause(); });
|
function () { ex.playerpause(); });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["b"], "Next track",
|
["b"], "Next track",
|
||||||
function () { player.next(); });
|
function (count) { ex.playernext({ "#": count }); },
|
||||||
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["v"], "Stop track",
|
["v"], "Stop track",
|
||||||
function () { player.stop(); });
|
function () { ex.playerstop(); });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["Q"], "Queue tracks by artist/album/track",
|
["Q"], "Queue tracks by artist/album/track",
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>p_x :playerp :playerplay</tags>
|
<tags>p_x :playerp :playerplay</tags>
|
||||||
<spec>:playerp<oa>lay</oa></spec>
|
<spec>:<oa>count</oa>playerp<oa>lay</oa></spec>
|
||||||
<spec>x</spec>
|
<spec><oa>count</oa>x</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Play the current track.
|
Play the current track.
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>p_z :playerpr :playerprev</tags>
|
<tags>p_z :playerpr :playerprev</tags>
|
||||||
<spec>:playerpr<oa>ev</oa></spec>
|
<spec>:<oa>count</oa>playerpr<oa>ev</oa></spec>
|
||||||
<spec>z</spec>
|
<spec><oa>count</oa>z</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Play the previous track.
|
Play the previous track.
|
||||||
|
|||||||
Reference in New Issue
Block a user