changeset 35430:2d55540614a9

Move uiProcessNextInPlaylist to the guiInfo structure. It's an information for GUI control and need not be a separate global variable. Additionally, rename it PlaylistNext to shorten the name.
author ib
date Fri, 30 Nov 2012 11:40:35 +0000
parents 3a9048421524
children 20c90da2ba0d
files gui/interface.c gui/interface.h gui/ui/actions.c gui/ui/actions.h gui/win32/interface.c
diffstat 5 files changed, 16 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Fri Nov 30 11:14:30 2012 +0000
+++ b/gui/interface.c	Fri Nov 30 11:40:35 2012 +0000
@@ -58,8 +58,9 @@
 #endif
 
 guiInterface_t guiInfo = {
-    .StreamType = STREAMTYPE_DUMMY,
-    .Balance    = 50.0f
+    .StreamType   = STREAMTYPE_DUMMY,
+    .Balance      = 50.0f,
+    .PlaylistNext = 1
 };
 
 static int initialized;
@@ -766,8 +767,8 @@
 
         uiEventHandling(ivRedraw, 1);
 
-        if (!uiProcessNextInPlaylist && guiInfo.Playing) {
-            uiProcessNextInPlaylist = 1;
+        if (!guiInfo.PlaylistNext && guiInfo.Playing) {
+            guiInfo.PlaylistNext = 1;
             break;
         }
 
@@ -866,7 +867,7 @@
     }
 
     uiCurr();   // update filename
-    uiProcessNextInPlaylist = 1;
+    guiInfo.PlaylistNext = 1;
 
     if (enqueue)
         filename = NULL;            // don't start playing
--- a/gui/interface.h	Fri Nov 30 11:14:30 2012 +0000
+++ b/gui/interface.h	Fri Nov 30 11:40:35 2012 +0000
@@ -129,6 +129,7 @@
     float Balance;
 
     int NewPlay;              // public, read access by MPlayer
+    int PlaylistNext;
 } guiInterface_t;
 
 extern guiInterface_t guiInfo;
--- a/gui/ui/actions.c	Fri Nov 30 11:14:30 2012 +0000
+++ b/gui/ui/actions.c	Fri Nov 30 11:40:35 2012 +0000
@@ -39,8 +39,6 @@
 #include "libvo/video_out.h"
 #include "mp_core.h"
 
-int uiProcessNextInPlaylist = 1;
-
 void uiFullScreen(void)
 {
     if (!guiInfo.VideoWindow)
@@ -255,7 +253,7 @@
 
         if (curr) {
             uiSetFileName(curr->path, curr->name, STREAMTYPE_FILE);
-            uiProcessNextInPlaylist = 0;
+            guiInfo.PlaylistNext = 0;
             break;
         }
 
@@ -312,7 +310,7 @@
 
         if (prev) {
             uiSetFileName(prev->path, prev->name, STREAMTYPE_FILE);
-            uiProcessNextInPlaylist = (guiInfo.Playing ? 0 : 1);
+            guiInfo.PlaylistNext = (guiInfo.Playing ? 0 : 1);
             guiInfo.Track--;
             break;
         }
@@ -365,7 +363,7 @@
 
         if (next) {
             uiSetFileName(next->path, next->name, STREAMTYPE_FILE);
-            uiProcessNextInPlaylist = (guiInfo.Playing ? 0 : 1);
+            guiInfo.PlaylistNext = (guiInfo.Playing ? 0 : 1);
             guiInfo.Track++;
             break;
         }
--- a/gui/ui/actions.h	Fri Nov 30 11:14:30 2012 +0000
+++ b/gui/ui/actions.h	Fri Nov 30 11:40:35 2012 +0000
@@ -19,8 +19,6 @@
 #ifndef MPLAYER_GUI_ACTIONS_H
 #define MPLAYER_GUI_ACTIONS_H
 
-extern int uiProcessNextInPlaylist;
-
 void uiAbsSeek(float sec);
 void uiChangeSkin(char *name);
 void uiCurr(void);
--- a/gui/win32/interface.c	Fri Nov 30 11:14:30 2012 +0000
+++ b/gui/win32/interface.c	Fri Nov 30 11:40:35 2012 +0000
@@ -77,7 +77,6 @@
 
 char *skinName = NULL;
 char *codecname = NULL;
-int uiProcessNextInPlaylist = 1;
 static gui_t *mygui = NULL;
 static int update_videowindow(void);
 static RECT old_rect;
@@ -364,7 +363,7 @@
                 {
                     guiInfo.NewPlay = GUI_FILE_NEW;
                     update_playlistwindow();
-                    uiProcessNextInPlaylist = guiInfo.Playing? 0 : 1;
+                    guiInfo.PlaylistNext = guiInfo.Playing? 0 : 1;
                     gui(GUI_SET_STATE, (void *) GUI_STOP);
                     gui(GUI_SET_STATE, (void *) GUI_PLAY);
                     break;
@@ -766,13 +765,13 @@
         {
           guiInfo.sh_video = NULL;
 
-          if(!uiProcessNextInPlaylist && guiInfo.Playing)
+          if(!guiInfo.PlaylistNext && guiInfo.Playing)
           {
-              uiProcessNextInPlaylist = 1;
+              guiInfo.PlaylistNext = 1;
               break;
           }
 
-          if(uiProcessNextInPlaylist && guiInfo.Playing &&
+          if(guiInfo.PlaylistNext && guiInfo.Playing &&
             (mygui->playlist->current < (mygui->playlist->trackcount - 1)) &&
             guiInfo.StreamType != STREAMTYPE_DVD &&
             guiInfo.StreamType != STREAMTYPE_DVDNAV)
@@ -781,7 +780,7 @@
               if(movie_aspect >= 0)
                   movie_aspect = -1;
 
-              uiProcessNextInPlaylist = 1;
+              guiInfo.PlaylistNext = 1;
               guiInfo.NewPlay = GUI_FILE_NEW;
               uiSetFileName(NULL, mygui->playlist->tracks[(mygui->playlist->current)++]->filename, STREAMTYPE_FILE);
               //sprintf(guiInfo.Filename, mygui->playlist->tracks[(mygui->playlist->current)++]->filename);
@@ -864,7 +863,7 @@
                 result = 1;
         }
     }
-    uiProcessNextInPlaylist = 1;
+    guiInfo.PlaylistNext = 1;
 
     if (result)
     {