changeset 35453:c8f3bba6250a

Add an uiSetFile() counterpart. Unset the file being played and clear all guiInfo information associated with the file.
author ib
date Sat, 01 Dec 2012 19:08:53 +0000
parents f42cc2361ee4
children adee37856514
files gui/interface.c gui/ui/actions.c gui/ui/actions.h
diffstat 3 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Sat Dec 01 19:05:24 2012 +0000
+++ b/gui/interface.c	Sat Dec 01 19:08:53 2012 +0000
@@ -798,14 +798,8 @@
             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;
--- a/gui/ui/actions.c	Sat Dec 01 19:05:24 2012 +0000
+++ b/gui/ui/actions.c	Sat Dec 01 19:08:53 2012 +0000
@@ -283,6 +283,22 @@
 }
 
 /**
+ * @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)
--- a/gui/ui/actions.h	Sat Dec 01 19:05:24 2012 +0000
+++ b/gui/ui/actions.h	Sat Dec 01 19:08:53 2012 +0000
@@ -30,5 +30,6 @@
 void uiRelSeek(float percent);
 void uiSetFile(char *dir, char *name, int type);
 void uiState(void);
+void uiUnsetFile(void);
 
 #endif /* MPLAYER_GUI_ACTIONS_H */