diff options
author | waker <wakeroid@gmail.com> | 2011-05-10 21:34:49 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-05-10 21:34:49 +0200 |
commit | 9d529eb05995069583ffa3e07670c0ea23b42b15 (patch) | |
tree | 055c27ab1954e8a8493a519bc5de9d27807293a9 /plugins | |
parent | 1a8737e1466a3c17d77ab30e2035472feb7c2773 (diff) |
added several new plt_* functions to work on specific playlists
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ao/eng_dsf/eng_dsf.c | 2 | ||||
-rw-r--r-- | plugins/ao/eng_ssf/eng_ssf.c | 2 | ||||
-rw-r--r-- | plugins/ao/main.c | 2 | ||||
-rw-r--r-- | plugins/gtkui/ddblistview.c | 6 | ||||
-rw-r--r-- | plugins/gtkui/ddblistview.h | 3 | ||||
-rw-r--r-- | plugins/gtkui/ddbtabstrip.c | 6 | ||||
-rw-r--r-- | plugins/gtkui/mainplaylist.c | 9 | ||||
-rw-r--r-- | plugins/gtkui/search.c | 4 |
8 files changed, 23 insertions, 11 deletions
diff --git a/plugins/ao/eng_dsf/eng_dsf.c b/plugins/ao/eng_dsf/eng_dsf.c index af814dc0..0221caf0 100644 --- a/plugins/ao/eng_dsf/eng_dsf.c +++ b/plugins/ao/eng_dsf/eng_dsf.c @@ -44,7 +44,7 @@ void *dsf_start(const char *path, uint8 *buffer, uint32 length) memset (s, 0, sizeof (dsf_synth_t)); uint8 *file = NULL, *lib_decoded = NULL, *lib_raw_file = NULL; - uint32 offset, plength, lengthMS, fadeMS; + uint32 offset, lengthMS, fadeMS; uint64 file_len, lib_len, lib_raw_length; corlett_t *lib; char *libfile; diff --git a/plugins/ao/eng_ssf/eng_ssf.c b/plugins/ao/eng_ssf/eng_ssf.c index f15eb114..d2910fa2 100644 --- a/plugins/ao/eng_ssf/eng_ssf.c +++ b/plugins/ao/eng_ssf/eng_ssf.c @@ -91,7 +91,7 @@ void *ssf_start(const char *path, uint8 *buffer, uint32 length) ssf_synth_t *s = malloc (sizeof (ssf_synth_t)); memset (s, 0, sizeof (ssf_synth_t)); uint8 *file, *lib_decoded, *lib_raw_file; - uint32 offset, plength, lengthMS, fadeMS; + uint32 offset, lengthMS, fadeMS; uint64 file_len, lib_len, lib_raw_length; corlett_t *lib; char *libfile; diff --git a/plugins/ao/main.c b/plugins/ao/main.c index 18067410..a4da36d0 100644 --- a/plugins/ao/main.c +++ b/plugins/ao/main.c @@ -27,7 +27,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <deadbeef/deadbeef.h> +#include "../../deadbeef.h" #include "ao.h" #include "eng_protos.h" diff --git a/plugins/gtkui/ddblistview.c b/plugins/gtkui/ddblistview.c index 14dd9a70..c1203364 100644 --- a/plugins/gtkui/ddblistview.c +++ b/plugins/gtkui/ddblistview.c @@ -963,7 +963,11 @@ ddb_listview_list_drag_data_received (GtkWidget *widget, UNREF (drop_before); drop_before = next; } - ps->binding->drag_n_drop (drop_before, plt, d, length, drag_context->action == GDK_ACTION_COPY ? 1 : 0); + ddb_playlist_t *p = deadbeef->plt_get_for_idx (plt); + if (p) { + ps->binding->drag_n_drop (drop_before, p, d, length, drag_context->action == GDK_ACTION_COPY ? 1 : 0); + deadbeef->plt_unref (p); + } if (drop_before) { UNREF (drop_before); } diff --git a/plugins/gtkui/ddblistview.h b/plugins/gtkui/ddblistview.h index 33677205..b22469ed 100644 --- a/plugins/gtkui/ddblistview.h +++ b/plugins/gtkui/ddblistview.h @@ -41,6 +41,7 @@ typedef struct _DdbListview DdbListview; typedef struct _DdbListviewClass DdbListviewClass; typedef void * DdbListviewIter; +typedef void * DdbPlaylistHandle; //typedef void * DdbListviewColIter; typedef struct { @@ -68,7 +69,7 @@ typedef struct { int (*get_group) (DdbListviewIter it, char *str, int size); // drag-n-drop - void (*drag_n_drop) (DdbListviewIter before, int playlist, uint32_t *indices, int length, int copy); + void (*drag_n_drop) (DdbListviewIter before, DdbPlaylistHandle playlist_from, uint32_t *indices, int length, int copy); void (*external_drag_n_drop) (DdbListviewIter before, char *mem, int length); // callbacks diff --git a/plugins/gtkui/ddbtabstrip.c b/plugins/gtkui/ddbtabstrip.c index 8539a10d..f40c1ade 100644 --- a/plugins/gtkui/ddbtabstrip.c +++ b/plugins/gtkui/ddbtabstrip.c @@ -270,7 +270,11 @@ on_tabstrip_drag_data_received (GtkWidget *widget, int plt = *d; d++; int length = (data->length/4)-1; - ps->binding->drag_n_drop (NULL, plt, d, length, drag_context->action == GDK_ACTION_COPY ? 1 : 0); + ddb_playlist_t *p = deadbeef->plt_get_for_idx (plt); + if (p) { + ps->binding->drag_n_drop (NULL, p, d, length, drag_context->action == GDK_ACTION_COPY ? 1 : 0); + deadbeef->plt_unref (p); + } } gtk_drag_finish (drag_context, TRUE, FALSE, time); } diff --git a/plugins/gtkui/mainplaylist.c b/plugins/gtkui/mainplaylist.c index 1611f03d..f3cbde3d 100644 --- a/plugins/gtkui/mainplaylist.c +++ b/plugins/gtkui/mainplaylist.c @@ -107,15 +107,16 @@ int main_get_idx (DdbListviewIter it) { } void -main_drag_n_drop (DdbListviewIter before, int from_playlist, uint32_t *indices, int length, int copy) { +main_drag_n_drop (DdbListviewIter before, ddb_playlist_t *from_playlist, uint32_t *indices, int length, int copy) { deadbeef->pl_lock (); -// int curr = deadbeef->plt_get_curr_idx (); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); if (copy) { - deadbeef->pl_copy_items (PL_MAIN, from_playlist, (DB_playItem_t *)before, indices, length); + deadbeef->plt_copy_items (plt, PL_MAIN, from_playlist, (DB_playItem_t *)before, indices, length); } else { - deadbeef->pl_move_items (PL_MAIN, from_playlist, (DB_playItem_t *)before, indices, length); + deadbeef->plt_move_items (plt, PL_MAIN, from_playlist, (DB_playItem_t *)before, indices, length); } + deadbeef->plt_unref (plt); deadbeef->pl_unlock (); } diff --git a/plugins/gtkui/search.c b/plugins/gtkui/search.c index 4c6bd99b..d71b4cef 100644 --- a/plugins/gtkui/search.c +++ b/plugins/gtkui/search.c @@ -62,7 +62,9 @@ search_start (void) { void search_process (const char *text) { - deadbeef->pl_search_process (text); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + deadbeef->plt_search_process (plt, text); + deadbeef->plt_unref (plt); int row = deadbeef->pl_get_cursor (PL_SEARCH); if (row >= deadbeef->pl_getcount (PL_SEARCH)) { |