[MPlayer-cvslog] r37475 - in trunk: Changelog DOCS/xml/de/skin.xml DOCS/xml/en/skin.xml etc/mplayer.desktop gui/app/app.c gui/app/app.h gui/dialog/dialog.c gui/dialog/fileselect.c gui/dialog/fileselect.h gui/dialog...

ib subversion at mplayerhq.hu
Fri Sep 4 11:43:54 CEST 2015


Author: ib
Date: Fri Sep  4 11:43:54 2015
New Revision: 37475

Log:
Add support for CD/(S)VCD/DVD image and DVD copy playback to the GUI.

Extend the file selector and the menu to load such files and utilize the
respective scheme (cd://, vcd://, dvd://) for the playback so that it
plays as if it were a real disc.

For CD/(S)VCD, libcdio is necessary in order to load the cue files.

For DVD, utilize the existing option to play files copied from a DVD or
DVD images.

Additionally, update the documentation.

Added:
   trunk/gui/dialog/pixmaps/playimage.xpm   (contents, props changed)
Modified:
   trunk/Changelog
   trunk/etc/mplayer.desktop
   trunk/gui/app/app.c
   trunk/gui/app/app.h
   trunk/gui/dialog/dialog.c
   trunk/gui/dialog/fileselect.c
   trunk/gui/dialog/fileselect.h
   trunk/gui/dialog/menu.c
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/actions.c
   trunk/gui/win32/skinload.c
   trunk/gui/win32/skinload.h

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/xml/de/skin.xml
   trunk/DOCS/xml/en/skin.xml
   trunk/help/help_mp-de.h
   trunk/help/help_mp-en.h

Modified: trunk/Changelog
==============================================================================
--- trunk/Changelog	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/Changelog	Fri Sep  4 11:43:54 2015	(r37475)
@@ -56,6 +56,8 @@ MPlayer
     * GUI now officially needs GTK+ and GLib versions 2 (it hadn't compiled
       with versions 1 for quite some time)
     * Support for audio and video bin/cue image playback
+    * Support for Audio CD / (Super) Video CD / DVD image and DVD copy playback
+      through the respective scheme (cd://, vcd://, dvd://)
 
   1.1: "We gave up on 1.0"
 

Modified: trunk/etc/mplayer.desktop
==============================================================================
--- trunk/etc/mplayer.desktop	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/etc/mplayer.desktop	Fri Sep  4 11:43:54 2015	(r37475)
@@ -29,4 +29,4 @@ TryExec=gmplayer
 Exec=gmplayer %F
 Terminal=false
 Categories=GTK;AudioVideo;Audio;Video;Player;TV;
-MimeType=application/x-cue;application/mxf;application/x-netshow-channel;application/ogg;application/ram;application/vnd.adobe.flash.movie;application/vnd.rn-realmedia;application/x-shockwave-flash;application/smil;audio/aac;audio/ac3;audio/x-adpcm;audio/x-aiff;audio/AMR;audio/AMR-WB;audio/x-ape;audio/basic;audio/flac;audio/x-flac;audio/x-flac+ogg;audio/x-m4b;audio/x-matroska;audio/mp2;audio/mp4;audio/mpeg;audio/x-mpegurl;audio/x-ms-asx;audio/x-ms-wma;audio/x-musepack;audio/ogg;audio/vnd.rn-realaudio;audio/x-scpls;audio/x-voc;audio/x-vorbis+ogg;audio/x-wav;audio/x-wavpack;video/3gpp;video/3gpp2;video/dv;video/x-flic;video/x-flv;video/x-matroska;video/mp2t;video/mp4;video/mpeg;video/vnd.mpegurl;video/x-ms-asf;video/x-ms-wmv;video/x-msvideo;video/x-nsv;video/ogg;video/x-ogm+ogg;video/quicktime;video/vnd.rn-realvideo;video/x-theora+ogg;video/webm;x-content/audio-cdda;x-content/audio-dvd;x-content/video-dvd;x-content/video-svcd;x-content/video-vcd;
+MimeType=application/x-cd-image;application/x-cue;application/mxf;application/x-netshow-channel;application/ogg;application/ram;application/vnd.adobe.flash.movie;application/vnd.rn-realmedia;application/x-shockwave-flash;application/smil;audio/aac;audio/ac3;audio/x-adpcm;audio/x-aiff;audio/AMR;audio/AMR-WB;audio/x-ape;audio/basic;audio/flac;audio/x-flac;audio/x-flac+ogg;audio/x-m4b;audio/x-matroska;audio/mp2;audio/mp4;audio/mpeg;audio/x-mpegurl;audio/x-ms-asx;audio/x-ms-wma;audio/x-musepack;audio/ogg;audio/vnd.rn-realaudio;audio/x-scpls;audio/x-voc;audio/x-vorbis+ogg;audio/x-wav;audio/x-wavpack;video/3gpp;video/3gpp2;video/dv;video/x-flic;video/x-flv;video/x-matroska;video/mp2t;video/mp4;video/mpeg;video/vnd.mpegurl;video/x-ms-asf;video/x-ms-wmv;video/x-msvideo;video/x-nsv;video/ogg;video/x-ogm+ogg;video/quicktime;video/vnd.rn-realvideo;video/x-theora+ogg;video/webm;x-content/audio-cdda;x-content/audio-dvd;x-content/video-dvd;x-content/video-svcd;x-content/video-vcd;

Modified: trunk/gui/app/app.c
==============================================================================
--- trunk/gui/app/app.c	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/app/app.c	Fri Sep  4 11:43:54 2015	(r37475)
@@ -58,6 +58,7 @@ static const evName evNames[] = {
     { evPlayCD,            "evPlayCD"            },
     { evPlayVCD,           "evPlayVCD"           },
     { evPlayDVD,           "evPlayDVD"           },
+    { evPlayImage,         "evPlayImage"         },
     { evLoadURL,           "evSetURL"            }, // legacy
     { evLoadURL,           "evLoadURL"           },
     { evPlayTV,            "evPlayTV"            },

Modified: trunk/gui/app/app.h
==============================================================================
--- trunk/gui/app/app.h	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/app/app.h	Fri Sep  4 11:43:54 2015	(r37475)
@@ -39,6 +39,7 @@ enum {
     evPlayCD,
     evPlayVCD,
     evPlayDVD,
+    evPlayImage,
     evLoadURL,
     evPlayTV,
     evPlaySwitchToPause,

Modified: trunk/gui/dialog/dialog.c
==============================================================================
--- trunk/gui/dialog/dialog.c	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/dialog/dialog.c	Fri Sep  4 11:43:54 2015	(r37475)
@@ -306,6 +306,11 @@ void gtkShow(int type, char *param)
         gtkSetLayer(FileSelector);
         break;
 
+    case evPlayImage:
+        ShowFileSelector(FILESELECT_IMAGE);
+        gtkSetLayer(FileSelector);
+        break;
+
     case evAbout:
         ShowAbout();
         gtkSetLayer(About);

Modified: trunk/gui/dialog/fileselect.c
==============================================================================
--- trunk/gui/dialog/fileselect.c	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/dialog/fileselect.c	Fri Sep  4 11:43:54 2015	(r37475)
@@ -129,6 +129,18 @@ char *fsFontFileNames[][2] = {
 };
 int fsLastFontFilterSelected = -1;
 
+char *fsImageFilterNames[][2] = {
+#ifdef CONFIG_LIBCDIO
+    { MSGTR_GUI_FilterImageCD,  "*.cue"       },
+    { MSGTR_GUI_FilterImageVCD, "*.cue"       },
+#endif
+#ifdef CONFIG_DVDREAD
+    { MSGTR_GUI_FilterImageDVD, "*.ifo,*.iso" },
+#endif
+    { NULL,                     NULL          }
+};
+int fsLastImageFilterSelected = -1;
+
 GtkWidget *fsFileNamesList;
 GtkWidget *fsFNameList;
 GtkWidget *FileSelector;
@@ -349,6 +361,17 @@ static void fs_fsFilterCombo_changed(Gtk
 
         break;
 
+    case FILESELECT_IMAGE:
+
+        for (i = 0; fsImageFilterNames[i][0]; i++)
+            if (!strcmp(str, fsImageFilterNames[i][0])) {
+                fsFilter = fsImageFilterNames[i][1];
+                fsLastImageFilterSelected = i;
+                break;
+            }
+
+        break;
+
     default:
 
         return;
@@ -437,7 +460,7 @@ static void fs_Cancel_released(GtkButton
 static void fs_Ok_released(GtkButton *button, gpointer user_data)
 {
     char *fsSelectedDirectory;
-    int type = STREAMTYPE_FILE;
+    int type = STREAMTYPE_FILE, ev = evPlay;
     struct stat fs;
     gchar *selected;
 
@@ -501,6 +524,28 @@ static void fs_Ok_released(GtkButton *bu
             gtk_entry_set_text(GTK_ENTRY(prEFontName), font_name);
 
         break;
+
+    case FILESELECT_IMAGE:
+
+        if (strcmp(fsImageFilterNames[fsLastImageFilterSelected][0], MSGTR_GUI_FilterImageCD) == 0)
+            ev = evPlayCD;
+        else if (strcmp(fsImageFilterNames[fsLastImageFilterSelected][0], MSGTR_GUI_FilterImageVCD) == 0)
+            ev = evPlayVCD;
+        else if (strcmp(fsImageFilterNames[fsLastImageFilterSelected][0], MSGTR_GUI_FilterImageDVD) == 0)
+            ev = evPlayDVD;
+
+        if (ev == evPlayDVD) {
+            char *ext = strrchr(fsSelectedFile, '.');
+
+            if (ext && (strcmp(ext, ".ifo") == 0))
+                fsSelectedFile = "";
+        }
+
+        uiUnsetFile();
+        setddup(&guiInfo.ImageFilename, fsSelectedDirectory, fsSelectedFile);
+        fs_PersistantHistory(fsSelectedDirectory);
+        uiLoadPlay = True;
+        break;
     }
 
     free(fsSelectedDirectory);
@@ -512,7 +557,7 @@ static void fs_Ok_released(GtkButton *bu
 
     if (uiLoadPlay) {
         uiLoadPlay = False;
-        uiEvent(evPlay, 0);
+        uiEvent(ev, 0);
     } else
         gui(GUI_SET_STATE, (void *)GUI_STOP);
 }
@@ -762,9 +807,23 @@ void ShowFileSelector(int type)
         gtk_entry_set_text(GTK_ENTRY(fsFilterCombo), fsFontFileNames[k >= 0 ? k : i - 2][0]);
         tmp = font_name;
         break;
+
+    case FILESELECT_IMAGE:
+        gtk_window_set_title(GTK_WINDOW(FileSelector), MSGTR_GUI_SelectImage);
+        fsList_items = NULL;
+
+        for (i = 0; fsImageFilterNames[i][0]; i++)
+            fsList_items = g_list_append(fsList_items, fsImageFilterNames[i][0]);
+
+        k = fsLastImageFilterSelected;
+        gtk_combo_set_popdown_strings(GTK_COMBO(List), fsList_items);
+        g_list_free(fsList_items);
+        gtk_entry_set_text(GTK_ENTRY(fsFilterCombo), fsImageFilterNames[k >= 0 ? k : 0][0]);
+        tmp = guiInfo.ImageFilename;
+        break;
     }
 
-    fsMedium = (fsType == FILESELECT_VIDEO_AUDIO || fsType == FILESELECT_SUBTITLE || fsType == FILESELECT_AUDIO);
+    fsMedium = (fsType == FILESELECT_VIDEO_AUDIO || fsType == FILESELECT_SUBTITLE || fsType == FILESELECT_AUDIO || fsType == FILESELECT_IMAGE);
 
     if (tmp && tmp[0] && !strstr(tmp, "://")) {
         dir = strdup(tmp);

Modified: trunk/gui/dialog/fileselect.h
==============================================================================
--- trunk/gui/dialog/fileselect.h	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/dialog/fileselect.h	Fri Sep  4 11:43:54 2015	(r37475)
@@ -26,7 +26,8 @@ enum {
     FILESELECT_VIDEO_AUDIO,
     FILESELECT_SUBTITLE,
     FILESELECT_AUDIO,
-    FILESELECT_FONT
+    FILESELECT_FONT,
+    FILESELECT_IMAGE
 };
 
 extern GtkWidget *FileSelector;

Modified: trunk/gui/dialog/menu.c
==============================================================================
--- trunk/gui/dialog/menu.c	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/dialog/menu.c	Fri Sep  4 11:43:54 2015	(r37475)
@@ -97,6 +97,9 @@
 #ifdef CONFIG_TV
 #include "pixmaps/tv.xpm"
 #endif
+#if defined(CONFIG_LIBCDIO) || defined(CONFIG_DVDREAD)
+#include "pixmaps/playimage.xpm"
+#endif
 #include "pixmaps/empty1px.xpm"
 #include "pixmaps/rotate.xpm"
 #include "pixmaps/rotate0.xpm"
@@ -596,6 +599,9 @@ GtkWidget * CreatePopUpMenu( void )
         gtk_widget_set_sensitive( MenuItem,FALSE );
        }
 #endif
+#if defined(CONFIG_LIBCDIO) || defined(CONFIG_DVDREAD)
+    AddMenuItem( window1, (const char*)playimage_xpm, SubMenu,MSGTR_GUI_Image"...    ", evPlayImage );
+#endif
     AddMenuItem( window1, (const char*)url_xpm, SubMenu,MSGTR_GUI_URL"...", evLoadURL );
 #ifdef CONFIG_TV
     AddMenuItem( window1, (const char*)tv_xpm, SubMenu,MSGTR_GUI_TV, evPlayTV );

Added: trunk/gui/dialog/pixmaps/playimage.xpm
==============================================================================
Binary file. No diff available.

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/interface.c	Fri Sep  4 11:43:54 2015	(r37475)
@@ -513,7 +513,7 @@ int gui(int what, void *data)
         {
             char tmp[512];
 
-            sprintf(tmp, "cdda://%d", guiInfo.Track);
+            snprintf(tmp, sizeof(tmp), "cdda://%d%s%s", guiInfo.Track, guiInfo.ImageFilename ? "/" : "", guiInfo.ImageFilename ? guiInfo.ImageFilename : "");
             uiSetFile(NULL, tmp, SAME_STREAMTYPE);
         }
         break;
@@ -522,7 +522,7 @@ int gui(int what, void *data)
         {
             char tmp[512];
 
-            sprintf(tmp, "vcd://%d", guiInfo.Track);
+            snprintf(tmp, sizeof(tmp), "vcd://%d%s%s", guiInfo.Track, guiInfo.ImageFilename ? "/" : "", guiInfo.ImageFilename ? guiInfo.ImageFilename : "");
             uiSetFile(NULL, tmp, SAME_STREAMTYPE);
         }
         break;
@@ -531,7 +531,7 @@ int gui(int what, void *data)
         {
             char tmp[512];
 
-            sprintf(tmp, "dvd://%d", guiInfo.Track);
+            snprintf(tmp, sizeof(tmp), "dvd://%d%s%s", guiInfo.Track, guiInfo.ImageFilename ? "/" : "", guiInfo.ImageFilename ? guiInfo.ImageFilename : "");
             uiSetFile(NULL, tmp, SAME_STREAMTYPE);
         }
 #ifdef CONFIG_DVDREAD

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/interface.h	Fri Sep  4 11:43:54 2015	(r37475)
@@ -121,6 +121,7 @@ typedef struct {
     char *Filename;           // public, read access by MPlayer
     char *AudioFilename;
     char *SubtitleFilename;
+    char *ImageFilename;
 
     int Tracks;
     int Track;                // public, read access by MPlayer

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/ui/actions.c	Fri Sep  4 11:43:54 2015	(r37475)
@@ -252,6 +252,10 @@ play:
         gtkShow(evLoadAudioFile, NULL);
         break;
 
+    case evPlayImage:
+        gtkShow(evPlayImage, NULL);
+        break;
+
     case evPrev:
         uiPrev();
         break;
@@ -754,6 +758,7 @@ void uiUnsetMedia(int totals)
     nfree(guiInfo.CodecName);
     nfree(guiInfo.AudioFilename);
     nfree(guiInfo.SubtitleFilename);
+    nfree(guiInfo.ImageFilename);
 }
 
 /**

Modified: trunk/gui/win32/skinload.c
==============================================================================
--- trunk/gui/win32/skinload.c	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/win32/skinload.c	Fri Sep  4 11:43:54 2015	(r37475)
@@ -64,6 +64,7 @@ static const evName evNames[] =
     {   evPlayCD,               "evPlayCD"              },
     {   evPlayVCD,              "evPlayVCD"             },
     {   evPlayDVD,              "evPlayDVD"             },
+    {   evPlayImage,            "evPlayImage"           },
     {   evLoadURL,              "evSetURL"              }, // legacy
     {   evLoadURL,              "evLoadURL"             },
     {   evPlayTV,               "evPlayTV"              },

Modified: trunk/gui/win32/skinload.h
==============================================================================
--- trunk/gui/win32/skinload.h	Fri Sep  4 11:00:46 2015	(r37474)
+++ trunk/gui/win32/skinload.h	Fri Sep  4 11:43:54 2015	(r37475)
@@ -152,6 +152,7 @@ enum
   evPlayCD,
   evPlayVCD,
   evPlayDVD,
+  evPlayImage,
   evLoadURL,
   evPlayTV,
   evPlaySwitchToPause,


More information about the MPlayer-cvslog mailing list