summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-15 22:11:28 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-15 22:11:28 +0100
commit4fb5eda9835cc04b669aac128b46471deb48a86e (patch)
tree08e786bd0efc27efc0ae2dc2dea63267c8b98fa1 /playlist.c
parentf54ddc6c74f172d500f0ee4c2ae2648599d3b4c3 (diff)
ported most gtk stuff to plugin api
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/playlist.c b/playlist.c
index 4adff541..ed4293da 100644
--- a/playlist.c
+++ b/playlist.c
@@ -762,16 +762,21 @@ pl_getselcount (void) {
}
playItem_t *
-pl_get_for_idx (int idx) {
- playItem_t *it = playlist_head[PL_MAIN];
+pl_get_for_idx_and_iter (int idx, int iter) {
+ playItem_t *it = playlist_head[iter];
while (idx--) {
if (!it)
return NULL;
- it = it->next[PL_MAIN];
+ it = it->next[iter];
}
return it;
}
+playItem_t *
+pl_get_for_idx (int idx) {
+ return pl_get_for_idx_and_iter (idx, PL_MAIN);
+}
+
int
pl_get_idx_of (playItem_t *it) {
playItem_t *c = playlist_head[PL_MAIN];
@@ -1680,11 +1685,26 @@ pl_get_first (int iter) {
}
playItem_t *
-pl_get_next (DB_playItem_t *it, int iter) {
+pl_get_last (int iter) {
+ return playlist_tail[iter];
+}
+
+playItem_t *
+pl_get_next (playItem_t *it, int iter) {
return it ? it->next[iter] : NULL;
}
playItem_t *
-pl_get_prev (DB_playItem_t *it, int iter) {
+pl_get_prev (playItem_t *it, int iter) {
return it ? it->prev[iter] : NULL;
}
+
+int
+pl_get_cursor (int iter) {
+ return playlist_current_row[iter];
+}
+
+void
+pl_set_cursor (int iter, int cursor) {
+ playlist_current_row[iter] = cursor;
+}