[mythtv] Patch: Mythmusic pageup/down in playback

henri henri at qais.com
Tue Jun 15 23:23:54 EDT 2004


added callbacks for pageUp and pageDown in the playbackbox

Issues:

- my keybindings are very different than the stock ones, so
i didn't know what to put in the defaults in main.cpp
(pageUp / pageDown makes sense to me, but they are bound to
something else already)

- not sure if it's possible to change this, but when i page
up or down it centers the current selection, rather than at
the top or the bottom of the visible items (like in the
playlist selection windows)

henri


-------------- next part --------------
Index: mythmusic/main.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/mythmusic/main.cpp,v
retrieving revision 1.49
diff -u -r1.49 main.cpp
--- mythmusic/main.cpp	21 Mar 2004 06:22:42 -0000	1.49
+++ mythmusic/main.cpp	16 Jun 2004 03:18:05 -0000
@@ -371,6 +371,8 @@
     REG_KEY("Music", "DELETE", "Delete track from playlist", "D");
     REG_KEY("Music", "NEXTTRACK", "Move to the next track", ">,.,Z,End");
     REG_KEY("Music", "PREVTRACK", "Move to the previous track", ",,<,Q,Home");
+    REG_KEY("Music", "PAGEUP", "Page Up", "");
+    REG_KEY("Music", "PAGEDOWN", "Page Down", "");
     REG_KEY("Music", "FFWD", "Fast forward", "PgDown");
     REG_KEY("Music", "RWND", "Rewind", "PgUp");
     REG_KEY("Music", "PAUSE", "Pause/Start playback", "P");
Index: mythmusic/playbackbox.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/mythmusic/playbackbox.cpp,v
retrieving revision 1.72
diff -u -r1.72 playbackbox.cpp
--- mythmusic/playbackbox.cpp	27 Apr 2004 09:50:22 -0000	1.72
+++ mythmusic/playbackbox.cpp	16 Jun 2004 03:18:06 -0000
@@ -231,6 +231,20 @@
             else
                 previous();
         }
+        else if (action == "PAGEUP")
+        {
+            if (page_up_button)
+                page_up_button->push();
+            else
+                pageUp();
+        }
+        else if (action == "PAGEDOWN")
+        {
+            if (page_down_button)
+                page_down_button->push();
+            else
+                pageDown();
+        }
         else if (action == "FFWD")
         { 
             if (ff_button)
@@ -822,6 +836,17 @@
         CycleVisualizer();
 }
 
+void PlaybackBox::pageUp()
+{
+    music_tree_list->pageUp();
+}
+
+void PlaybackBox::pageDown()
+{
+    music_tree_list->pageDown();
+}
+
+
 void PlaybackBox::nextAuto()
 {
     stopDecoder();
@@ -1405,6 +1430,14 @@
     if (next_button)
         connect(next_button, SIGNAL(pushed()), this, SLOT(next()));
 
+    page_up_button = getUIPushButtonType("page_up_button");
+    if (page_up_button)
+        connect(page_up_button, SIGNAL(pushed()), this, SLOT(pageUp()));
+
+    page_down_button = getUIPushButtonType("page_down_button");
+    if (page_down_button)
+        connect(page_down_button, SIGNAL(pushed()), this, SLOT(pageDown()));
+
     shuffle_button = getUITextButtonType("shuffle_button");
     if (shuffle_button)
         connect(shuffle_button, SIGNAL(pushed()), this, SLOT(toggleShuffle()));
Index: mythmusic/playbackbox.h
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/mythmusic/playbackbox.h,v
retrieving revision 1.31
diff -u -r1.31 playbackbox.h
--- mythmusic/playbackbox.h	26 Aug 2003 15:45:18 -0000	1.31
+++ mythmusic/playbackbox.h	16 Jun 2004 03:18:06 -0000
@@ -47,6 +47,8 @@
     void stopDecoder();
     void previous();
     void next();
+    void pageUp();
+    void pageDown();
     void seekforward();
     void seekback();
     void seek(int);
@@ -164,7 +166,9 @@
     UIPushButtonType      *play_button;
     UIPushButtonType      *stop_button;
     UIPushButtonType      *ff_button;
-    UIPushButtonType      *next_button;
+    UIPushButtonType      *next_button;    
+    UIPushButtonType      *page_up_button;
+    UIPushButtonType      *page_down_button;
 
     UITextButtonType      *shuffle_button;
     UITextButtonType      *repeat_button;


More information about the mythtv-dev mailing list