[mythtv] [PATCH] MythVideo patch to allow play directly from gallery

Kevin Kuphal kuphal at dls.net
Sat Sep 25 19:04:13 EDT 2004


This patch binds the PLAYBACK action so you can play a video from the 
gallery rather than pressing SELECT twice.  This is similar to the 
functionality in the Watch Recordings screen.  Upon exiting the video, 
you are returned to the Video Select screen as normal.

Kevin
-------------- next part --------------
Index: mythvideo/mythvideo/main.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/main.cpp,v
retrieving revision 1.35
diff -n -u -r1.35 main.cpp
--- mythvideo/mythvideo/main.cpp	22 Aug 2004 18:16:32 -0000	1.35
+++ mythvideo/mythvideo/main.cpp	25 Sep 2004 22:58:57 -0000
@@ -78,7 +78,7 @@
     REG_KEY("Video","BROWSE","Change browsable in video manager","B");
     REG_KEY("Video","INCPARENT","Increase Parental Level","Right");
     REG_KEY("Video","DECPARENT","Decrease Parental Level","Left");
-
+    REG_KEY("Video", "PLAYBACK", "Play Video", "P"); 
 
 }
 
Index: mythvideo/mythvideo/videogallery.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/videogallery.cpp,v
retrieving revision 1.9
diff -n -u -r1.9 videogallery.cpp
--- mythvideo/mythvideo/videogallery.cpp	10 Sep 2004 20:14:30 -0000	1.9
+++ mythvideo/mythvideo/videogallery.cpp	25 Sep 2004 22:58:58 -0000
@@ -90,6 +90,10 @@
         {
             handled = handleSelect();
         }
+        else if (action == "PLAYBACK")
+        {
+            handleVideoPlay();
+        }
         else if ( (action == "UP")  || (action == "DOWN") ||
                   (action == "LEFT") ||(action == "RIGHT") ||
                   (action == "PAGEUP") || (action == "PAGEDOWN"))
@@ -834,6 +838,18 @@
     }
 }
 
+void VideoGallery::handleVideoPlay()
+{
+    cancelPopup();
+
+    VideoSelected *selected = new VideoSelected(db, gContext->GetMainWindow(),
+                                                "video selected", where_we_are->getInt(), true);
+    qApp->unlock();
+    selected->exec();
+    qApp->lock();
+    delete selected;
+}
+
 void VideoGallery::handleVideoSelect()
 {
     cancelPopup();
Index: mythvideo/mythvideo/videogallery.h
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/videogallery.h,v
retrieving revision 1.4
diff -n -u -r1.4 videogallery.h
--- mythvideo/mythvideo/videogallery.h	17 Aug 2004 21:45:30 -0000	1.4
+++ mythvideo/mythvideo/videogallery.h	25 Sep 2004 22:58:58 -0000
@@ -50,6 +50,7 @@
     void handleVideoSelect();
     
   protected:
+    void handleVideoPlay();
     virtual void parseContainer(QDomElement &element);
     virtual void handleMetaFetch(Metadata*);
     virtual void fetchVideos();
Index: mythvideo/mythvideo/videoselected.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/videoselected.cpp,v
retrieving revision 1.2
diff -n -u -r1.2 videoselected.cpp
--- mythvideo/mythvideo/videoselected.cpp	22 Aug 2004 18:16:32 -0000	1.2
+++ mythvideo/mythvideo/videoselected.cpp	25 Sep 2004 22:58:58 -0000
@@ -33,7 +33,7 @@
 
 
 VideoSelected::VideoSelected(QSqlDatabase *ldb,
-                             MythMainWindow *parent, const char *name, int idnum)
+                             MythMainWindow *parent, const char *name, int idnum, bool startplaying)
             : MythDialog(parent, name)
 {
     db = ldb;
@@ -60,6 +60,8 @@
     updateBackground();
 
     setNoErase();
+    if (startplaying)
+        selected(curitem);
 }
 
 VideoSelected::~VideoSelected()
Index: mythvideo/mythvideo/videoselected.h
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/videoselected.h,v
retrieving revision 1.1
diff -n -u -r1.1 videoselected.h
--- mythvideo/mythvideo/videoselected.h	12 Jun 2004 17:35:13 -0000	1.1
+++ mythvideo/mythvideo/videoselected.h	25 Sep 2004 22:58:58 -0000
@@ -33,7 +33,7 @@
     Q_OBJECT
   public:
     VideoSelected(QSqlDatabase *ldb, 
-                 MythMainWindow *parent, const char *name = 0, int idnum = 0);
+                 MythMainWindow *parent, const char *name = 0, int idnum = 0, bool startplaying = false);
     ~VideoSelected();
     void VideoSelected::processEvents() { qApp->processEvents(); }
     


More information about the mythtv-dev mailing list