changeset 33661:b2071e60b20b

Rename guiGetEvent type guiSetAudioOnly guiSetAudio. (All audio related guiGetEvent() code will be moved here later.) Additionally, set variable guiInfo.AudioChannels in guiGetEvent() rather than in mplayer.c. In order to do this, guiSetVideo must come first, then audio.
author ib
date Tue, 28 Jun 2011 08:52:02 +0000
parents 40a5f2faa22c
children 03117468ae0e
files gui/interface.c gui/interface.h gui/win32/interface.c mplayer.c
diffstat 4 files changed, 9 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Tue Jun 28 07:31:35 2011 +0000
+++ b/gui/interface.c	Tue Jun 28 08:52:02 2011 +0000
@@ -591,11 +591,11 @@
             guiSetFilename(guiInfo.Filename, arg);
         break;
 
-    case guiSetAudioOnly:
+    case guiSetAudio:
 
-        guiInfo.AudioOnly = (int)arg;
+        guiInfo.AudioChannels = arg ? ((sh_audio_t *)arg)->channels : 0;
 
-        if (guiInfo.AudioOnly) {
+        if (!guiInfo.MovieWindow || (arg && !guiInfo.sh_video)) {
             guiInfo.MovieWindow = False;
             wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
         } else
@@ -715,9 +715,6 @@
             guiInfo.FPS = sh->fps;
         }
 
-        if (!guiInfo.MovieWindow)
-            wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
-
         if (guiInfo.StreamType == STREAMTYPE_STREAM)
             btnSet(evSetMoviePosition, btnDisabled);
         else
--- a/gui/interface.h	Tue Jun 28 07:31:35 2011 +0000
+++ b/gui/interface.h	Tue Jun 28 08:52:02 2011 +0000
@@ -41,7 +41,7 @@
 #define guiRunCommand      2
 #define guiSetDVD          3
 #define guiSetFileName     4
-#define guiSetAudioOnly    6
+#define guiSetAudio        6
 #define guiReDrawSubWindow 7
 #define guiSetVideoWindow  8
 #define guiSetStream       9
@@ -177,7 +177,6 @@
     int Track;
     int AudioChannels;
     int StreamType;
-    int AudioOnly;
     int TimeSec;
     int LengthInSec;
     int FrameDrop;
--- a/gui/win32/interface.c	Tue Jun 28 07:31:35 2011 +0000
+++ b/gui/win32/interface.c	Tue Jun 28 08:52:02 2011 +0000
@@ -580,9 +580,11 @@
                 strcpy(guiInfo.Filename, filename);
             break;
         }
-        case guiSetAudioOnly:
+        case guiSetAudio:
         {
-            guiInfo.AudioOnly = (int) arg;
+            // NOTE: This type doesn't mean (and never meant) that we have
+            // *just* audio, so there probably should be a check before
+            // hiding (see gui/interface.c).
             if(IsWindowVisible(mygui->subwindow))
                 ShowWindow(mygui->subwindow, SW_HIDE);
             break;
--- a/mplayer.c	Tue Jun 28 07:31:35 2011 +0000
+++ b/mplayer.c	Tue Jun 28 08:52:02 2011 +0000
@@ -3677,10 +3677,9 @@
 
 #ifdef CONFIG_GUI
         if (use_gui) {
-            guiInfo.AudioChannels = mpctx->sh_audio ? mpctx->sh_audio->channels : 0;
-            guiGetEvent(guiSetAudioOnly, (void *)(mpctx->sh_audio && !mpctx->sh_video));
             if (guiGetEvent(guiSetVideo, mpctx->sh_video))
                 goto goto_next_file;
+            guiGetEvent(guiSetAudio, mpctx->sh_audio);
         }
 #endif