Ticket #8066: musicjump-20101204

File musicjump-20101204, 2.6 KB (added by bg_m@…, 13 years ago)
Line 
1--- ./mythplugins/mythmusic/mythmusic/main.cpp  2010-12-04 21:09:30.000000000 +0100
2+++ ./mythplugins/mythmusic/mythmusic/main.cpp  2010-12-04 21:26:28.344837000 +0100
3@@ -505,13 +505,19 @@
4         "", "", showMiniPlayer, false);
5 
6     REG_KEY("Music", "NEXTTRACK",  QT_TRANSLATE_NOOP("MythControls",
7-        "Move to the next track"),     ">,.,Z,End");
8+        "Move to the next track"),     "Z,End");
9     REG_KEY("Music", "PREVTRACK",  QT_TRANSLATE_NOOP("MythControls",
10-        "Move to the previous track"), ",,<,Q,Home");
11+        "Move to the previous track"), "Q,Home");
12     REG_KEY("Music", "FFWD",       QT_TRANSLATE_NOOP("MythControls",
13-        "Fast forward"),               "PgDown");
14+        "Fast forward"),               ".,>");
15     REG_KEY("Music", "RWND",       QT_TRANSLATE_NOOP("MythControls",
16-        "Rewind"),                     "PgUp");
17+        "Rewind"),                     ",,<");
18+    REG_KEY("Music", "JUMPFFWD",       QT_TRANSLATE_NOOP("MythControls",
19+        "Jump Fast forward"),               "PgDown");
20+    REG_KEY("Music", "JUMPRWND",       QT_TRANSLATE_NOOP("MythControls",
21+        "Jump Rewind"),                     "PgUp");
22+       
23+       
24     REG_KEY("Music", "PAUSE",      QT_TRANSLATE_NOOP("MythControls",
25         "Pause/Start playback"),       "P");
26     REG_KEY("Music", "PLAY",       QT_TRANSLATE_NOOP("MythControls",
27--- ./mythplugins/mythmusic/mythmusic/playbackbox.cpp   2010-12-04 21:09:52.000000000 +0100
28+++ ./mythplugins/mythmusic/mythmusic/playbackbox.cpp   2010-12-04 21:26:28.344837000 +0100
29@@ -292,6 +292,10 @@
30             else
31                 seekback();
32         }
33+        else if (action == "JUMPFFWD")
34+                jumpforward();
35+        else if (action == "JUMPRWND")
36+                jumpback();
37         else if (action == "PAUSE")
38         {
39             if (gPlayer->isPlaying())
40@@ -1568,6 +1572,23 @@
41     seek(nextTime);
42 }
43 
44+void PlaybackBoxMusic::jumpforward()
45+{
46+    int nextTime = currentTime + 60;
47+    if (nextTime > maxTime)
48+        nextTime = maxTime;
49+    seek(nextTime);
50+}
51+
52+void PlaybackBoxMusic::jumpback()
53+{
54+    int nextTime = currentTime - 60;
55+    if (nextTime < 0)
56+        nextTime = 0;
57+    seek(nextTime);
58+}
59+
60+
61 void PlaybackBoxMusic::seek(int pos)
62 {
63     if (gPlayer->getOutput())
64--- ./mythplugins/mythmusic/mythmusic/playbackbox.h     2010-12-04 21:10:08.000000000 +0100
65+++ ./mythplugins/mythmusic/mythmusic/playbackbox.h     2010-12-04 21:26:28.344837000 +0100
66@@ -51,6 +51,8 @@
67     void next();
68     void seekforward();
69     void seekback();
70+    void jumpforward();
71+    void jumpback();
72     void seek(int);
73     void stopAll();
74     void setShuffleMode(MusicPlayer::ShuffleMode mode);