summaryrefslogtreecommitdiff
path: root/plugins/converter
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-05 19:52:13 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-05 19:52:13 +0100
commite4b82f177f06caa3cc123899bc420627abe022b6 (patch)
tree047ee299f4be5dd83b6f58ddeff87cc7d878b45e /plugins/converter
parentd4132fccbcd079c56b8109ecc15b011e5d1bdee1 (diff)
convgui: action context support
Diffstat (limited to 'plugins/converter')
-rw-r--r--plugins/converter/convgui.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/plugins/converter/convgui.c b/plugins/converter/convgui.c
index e9a22c28..be6795c3 100644
--- a/plugins/converter/convgui.c
+++ b/plugins/converter/convgui.c
@@ -366,8 +366,40 @@ converter_show_cb (void *data) {
break;
}
case DDB_ACTION_CTX_PLAYLIST:
+ {
+ // copy list
+ ddb_playlist_t *plt = deadbeef->plt_get_curr ();
+ if (plt) {
+ conv->convert_items_count = deadbeef->plt_get_item_count (plt, PL_MAIN);
+ if (0 < conv->convert_items_count) {
+ conv->convert_items = malloc (sizeof (DB_playItem_t *) * conv->convert_items_count);
+ if (conv->convert_items) {
+ int n = 0;
+ DB_playItem_t *it = deadbeef->pl_get_first (PL_MAIN);
+ while (it) {
+ deadbeef->pl_item_ref (it);
+ conv->convert_items[n++] = it;
+ DB_playItem_t *next = deadbeef->pl_get_next (it, PL_MAIN);
+ deadbeef->pl_item_unref (it);
+ it = next;
+ }
+ }
+ }
+ deadbeef->plt_unref (plt);
+ }
+ break;
+ }
case DDB_ACTION_CTX_NOWPLAYING:
- // TODO: other contexts
+ {
+ DB_playItem_t *it = deadbeef->streamer_get_playing_track ();
+ if (it) {
+ conv->convert_items_count = 1;
+ conv->convert_items = malloc (sizeof (DB_playItem_t *) * conv->convert_items_count);
+ if (conv->convert_items) {
+ conv->convert_items[1] = it;
+ }
+ }
+ }
break;
}
deadbeef->pl_unlock ();