[MPlayer-cvslog] r35524 - in trunk/gui: interface.c interface.h ui/actions.c ui/actions.h win32/interface.c

ib subversion at mplayerhq.hu
Fri Nov 30 12:40:35 CET 2012


Author: ib
Date: Fri Nov 30 12:40:35 2012
New Revision: 35524

Log:
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.

Modified:
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/actions.c
   trunk/gui/ui/actions.h
   trunk/gui/win32/interface.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Fri Nov 30 12:14:30 2012	(r35523)
+++ trunk/gui/interface.c	Fri Nov 30 12:40:35 2012	(r35524)
@@ -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 @@ int gui(int what, void *data)
 
         uiEventHandling(ivRedraw, 1);
 
-        if (!uiProcessNextInPlaylist && guiInfo.Playing) {
-            uiProcessNextInPlaylist = 1;
+        if (!guiInfo.PlaylistNext && guiInfo.Playing) {
+            guiInfo.PlaylistNext = 1;
             break;
         }
 
@@ -866,7 +867,7 @@ int guiPlaylistInitialize(play_tree_t *m
     }
 
     uiCurr();   // update filename
-    uiProcessNextInPlaylist = 1;
+    guiInfo.PlaylistNext = 1;
 
     if (enqueue)
         filename = NULL;            // don't start playing

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Fri Nov 30 12:14:30 2012	(r35523)
+++ trunk/gui/interface.h	Fri Nov 30 12:40:35 2012	(r35524)
@@ -129,6 +129,7 @@ typedef struct {
     float Balance;
 
     int NewPlay;              // public, read access by MPlayer
+    int PlaylistNext;
 } guiInterface_t;
 
 extern guiInterface_t guiInfo;

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Fri Nov 30 12:14:30 2012	(r35523)
+++ trunk/gui/ui/actions.c	Fri Nov 30 12:40:35 2012	(r35524)
@@ -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 @@ void uiCurr(void)
 
         if (curr) {
             uiSetFileName(curr->path, curr->name, STREAMTYPE_FILE);
-            uiProcessNextInPlaylist = 0;
+            guiInfo.PlaylistNext = 0;
             break;
         }
 
@@ -312,7 +310,7 @@ void uiPrev(void)
 
         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 @@ void uiNext(void)
 
         if (next) {
             uiSetFileName(next->path, next->name, STREAMTYPE_FILE);
-            uiProcessNextInPlaylist = (guiInfo.Playing ? 0 : 1);
+            guiInfo.PlaylistNext = (guiInfo.Playing ? 0 : 1);
             guiInfo.Track++;
             break;
         }

Modified: trunk/gui/ui/actions.h
==============================================================================
--- trunk/gui/ui/actions.h	Fri Nov 30 12:14:30 2012	(r35523)
+++ trunk/gui/ui/actions.h	Fri Nov 30 12:40:35 2012	(r35524)
@@ -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);

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Fri Nov 30 12:14:30 2012	(r35523)
+++ trunk/gui/win32/interface.c	Fri Nov 30 12:40:35 2012	(r35524)
@@ -77,7 +77,6 @@ int guiWinID = 0;
 
 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 @@ static void guiSetEvent(int event)
                 {
                     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 @@ int gui(int what, void *data)
         {
           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 @@ int gui(int what, void *data)
               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 @@ int guiPlaylistInitialize(play_tree_t *m
                 result = 1;
         }
     }
-    uiProcessNextInPlaylist = 1;
+    guiInfo.PlaylistNext = 1;
 
     if (result)
     {


More information about the MPlayer-cvslog mailing list