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

ib subversion at mplayerhq.hu
Sat Dec 1 20:08:54 CET 2012


Author: ib
Date: Sat Dec  1 20:08:53 2012
New Revision: 35547

Log:
Add an uiSetFile() counterpart.

Unset the file being played and clear all guiInfo information
associated with the file.

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

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Sat Dec  1 20:05:24 2012	(r35546)
+++ trunk/gui/interface.c	Sat Dec  1 20:08:53 2012	(r35547)
@@ -798,14 +798,8 @@ int gui(int what, void *data)
             if (guiInfo.Angle)
                 guiInfo.Angle = 1;
 
-            if (isPlaylistStreamtype && !listMgr(PLAYLIST_ITEM_GET_CURR, 0)) {
-                guiInfo.Track         = 0;
-                guiInfo.Chapter       = 0;
-                guiInfo.Angle         = 0;
-                guiInfo.RunningTime   = 0;
-                guiInfo.AudioChannels = 0;
-                uiSetFile(NULL, NULL, STREAMTYPE_DUMMY);
-            }
+            if (isPlaylistStreamtype && !listMgr(PLAYLIST_ITEM_GET_CURR, 0))
+                uiUnsetFile();
 
             guiInfo.ElapsedTime = 0;
             guiInfo.Position    = 0;

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Sat Dec  1 20:05:24 2012	(r35546)
+++ trunk/gui/ui/actions.c	Sat Dec  1 20:08:53 2012	(r35547)
@@ -283,6 +283,22 @@ void uiSetFile(char *dir, char *name, in
 }
 
 /**
+ * @brief Unset the file being played.
+ *
+ * @note Additionally, clear all #guiInfo members associated with the file.
+ */
+void uiUnsetFile(void)
+{
+    uiSetFile(NULL, NULL, STREAMTYPE_DUMMY);
+
+    guiInfo.Track         = 0;
+    guiInfo.Chapter       = 0;
+    guiInfo.Angle         = 0;
+    guiInfo.RunningTime   = 0;
+    guiInfo.AudioChannels = 0;
+}
+
+/**
  * @brief Set file to be played to current playlist entry.
  */
 void uiCurr(void)

Modified: trunk/gui/ui/actions.h
==============================================================================
--- trunk/gui/ui/actions.h	Sat Dec  1 20:05:24 2012	(r35546)
+++ trunk/gui/ui/actions.h	Sat Dec  1 20:08:53 2012	(r35547)
@@ -30,5 +30,6 @@ void uiPrev(void);
 void uiRelSeek(float percent);
 void uiSetFile(char *dir, char *name, int type);
 void uiState(void);
+void uiUnsetFile(void);
 
 #endif /* MPLAYER_GUI_ACTIONS_H */


More information about the MPlayer-cvslog mailing list