summaryrefslogtreecommitdiff
path: root/playlist.h
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-02-11 20:03:10 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-02-11 20:03:10 +0100
commit06698504cafb9d3b87674c51bbd49dbbb6a54db0 (patch)
tree24934f001c2951e2151411693bec178717686a0d /playlist.h
parent70fc72b7d985394517d3d84c3c160c3476adaf32 (diff)
playlist thread-safety measures
Diffstat (limited to 'playlist.h')
-rw-r--r--playlist.h51
1 files changed, 42 insertions, 9 deletions
diff --git a/playlist.h b/playlist.h
index 5c4210fb..df695662 100644
--- a/playlist.h
+++ b/playlist.h
@@ -65,7 +65,38 @@ typedef struct playlist_s {
struct playlist_s *next;
} playlist_t;
+// global playlist control functions
+int
+pl_init (void);
+
+void
+pl_free (void);
+
+void
+pl_lock (void);
+
+void
+pl_unlock (void);
+
+void
+plt_lock (void);
+
+void
+plt_unlock (void);
+
+void
+pl_global_lock (void);
+
+void
+pl_global_unlock (void);
+
+
// playlist management functions
+
+// it is highly recommended to access that from inside plt_lock/unlock block
+playlist_t *
+plt_get_curr_ptr (void);
+
int
plt_get_count (void);
@@ -84,16 +115,16 @@ plt_set_curr (int plt);
int
plt_get_curr (void);
-const char *
-plt_get_title (int plt);
+int
+plt_get_title (int plt, char *buffer, int bufsize);
-void
+int
plt_set_title (int plt, const char *title);
-playlist_t *
-plt_get_curr_ptr (void);
-
// playlist access functions
+void
+pl_clear (void);
+
int
pl_add_dir (const char *dirname, int (*cb)(playItem_t *it, void *data), void *user_data);
@@ -127,9 +158,6 @@ pl_item_unref (playItem_t *it);
void
pl_item_copy (playItem_t *out, playItem_t *it);
-void
-pl_free (void);
-
int
pl_getcount (int iter);
@@ -154,6 +182,8 @@ pl_insert_cue (playItem_t *after, playItem_t *origin, int numsamples, int sample
void
pl_add_meta (playItem_t *it, const char *key, const char *value);
+// must be used in explicit pl_lock/unlock block
+// that makes it possible to avoid copying metadata on every access
const char *
pl_find_meta (playItem_t *it, const char *key);
@@ -267,4 +297,7 @@ pl_playqueue_getnext (void);
int
pl_playqueue_getcount (void);
+void
+pl_items_copy_junk (struct playItem_s *from, struct playItem_s *first, struct playItem_s *last);
+
#endif // __PLAYLIST_H