[MPlayer-cvslog] r37513 - in branches/1.2: . gui/ui/actions.c gui/ui/actions.h

ib subversion at mplayerhq.hu
Tue Sep 8 23:02:22 CEST 2015


Author: ib
Date: Tue Sep  8 23:02:22 2015
New Revision: 37513

Log:
Merge r37497 from trunk:

Add uiSetFileFromPlaylist().

Modified:
   branches/1.2/   (props changed)
   branches/1.2/gui/ui/actions.c
   branches/1.2/gui/ui/actions.h

Modified: branches/1.2/gui/ui/actions.c
==============================================================================
--- branches/1.2/gui/ui/actions.c	Tue Sep  8 23:02:20 2015	(r37512)
+++ branches/1.2/gui/ui/actions.c	Tue Sep  8 23:02:22 2015	(r37513)
@@ -34,7 +34,6 @@
 #include "gui/app/gui.h"
 #include "gui/dialog/dialog.h"
 #include "gui/skin/skin.h"
-#include "gui/util/list.h"
 #include "gui/util/mem.h"
 #include "gui/util/string.h"
 #include "gui/wm/ws.h"
@@ -712,6 +711,24 @@ void uiChangeSkin(char *name)
 }
 
 /**
+ * @brief Set the file to be played from a playlist item.
+ *
+ * @note This allows a file to be played partially (seeking before playback
+ *       and stopping before its end).
+ *
+ * @param item pointer to the playlist item
+ *
+ * @note All #guiInfo members associated with the file will be cleared.
+ */
+void uiSetFileFromPlaylist(plItem *item)
+{
+    uiSetFile(item->path, item->name, STREAMTYPE_FILE);
+    guiInfo.Start = item->start;
+    guiInfo.Stop  = item->stop;
+    guiInfo.Title = gstrdup(item->title);
+}
+
+/**
  * @brief Set the file to be played.
  *
  * @param dir directory (optional, else NULL)

Modified: branches/1.2/gui/ui/actions.h
==============================================================================
--- branches/1.2/gui/ui/actions.h	Tue Sep  8 23:02:20 2015	(r37512)
+++ branches/1.2/gui/ui/actions.h	Tue Sep  8 23:02:22 2015	(r37513)
@@ -19,6 +19,8 @@
 #ifndef MPLAYER_GUI_ACTIONS_H
 #define MPLAYER_GUI_ACTIONS_H
 
+#include "gui/util/list.h"
+
 extern int uiLoadPlay;
 
 void uiAbsSeek(float sec);
@@ -33,6 +35,7 @@ void uiPlay(void);
 void uiPrev(void);
 void uiRelSeek(float sec);
 void uiSetFile(const char *dir, const char *name, int type);
+void uiSetFileFromPlaylist(plItem *item);
 void uiState(void);
 void uiUnsetFile(void);
 void uiUnsetMedia(int totals);


More information about the MPlayer-cvslog mailing list