[MPlayer-cvslog] r35554 - in trunk/gui/util: list.c list.h

ib subversion at mplayerhq.hu
Sun Dec 2 01:42:13 CET 2012


Author: ib
Date: Sun Dec  2 01:42:13 2012
New Revision: 35554

Log:
Add listMgr command PLAYLIST_ITEM_FIND.

Search for a specific entry in the list.

Modified:
   trunk/gui/util/list.c
   trunk/gui/util/list.h

Modified: trunk/gui/util/list.c
==============================================================================
--- trunk/gui/util/list.c	Sun Dec  2 01:38:14 2012	(r35553)
+++ trunk/gui/util/list.c	Sun Dec  2 01:42:13 2012	(r35554)
@@ -96,6 +96,21 @@ void *listMgr(int cmd, void *data)
         } else
             return listMgr(PLAYLIST_ITEM_APPEND, pdat);
 
+    case PLAYLIST_ITEM_FIND:
+
+        if (plList) {
+            plItem *item = plList;
+
+            do {
+                if (gstrcmp(item->path, pdat->path) == 0 && gstrcmp(item->name, pdat->name) == 0)
+                    return item;
+
+                item = item->next;
+            } while (item);
+        }
+
+        return NULL;
+
     case PLAYLIST_ITEM_SET_CURR:
 
         plCurrent = pdat;

Modified: trunk/gui/util/list.h
==============================================================================
--- trunk/gui/util/list.h	Sun Dec  2 01:38:14 2012	(r35553)
+++ trunk/gui/util/list.h	Sun Dec  2 01:42:13 2012	(r35554)
@@ -24,6 +24,7 @@ enum {
     PLAYLIST_GET,
     PLAYLIST_ITEM_APPEND,
     PLAYLIST_ITEM_INSERT,
+    PLAYLIST_ITEM_FIND,
     PLAYLIST_ITEM_SET_CURR,
     PLAYLIST_ITEM_GET_CURR,
     PLAYLIST_ITEM_GET_POS,


More information about the MPlayer-cvslog mailing list