diff options
-rw-r--r-- | deadbeef.h | 2 | ||||
-rw-r--r-- | playlist.c | 2 | ||||
-rw-r--r-- | playlist.h | 2 | ||||
-rw-r--r-- | plugins.c | 2 | ||||
-rw-r--r-- | plugins/gtkui/callbacks.c | 24 | ||||
-rw-r--r-- | plugins/gtkui/mainplaylist.c | 4 | ||||
-rw-r--r-- | plugins/gtkui/search.c | 4 |
7 files changed, 28 insertions, 12 deletions
@@ -563,7 +563,7 @@ typedef struct { float (*pl_get_item_duration) (DB_playItem_t *it); uint32_t (*pl_get_item_flags) (DB_playItem_t *it); void (*pl_set_item_flags) (DB_playItem_t *it, uint32_t flags); - void (*pl_sort) (int iter, int id, const char *format, int ascending); + void (*plt_sort) (ddb_playlist_t *plt, int iter, int id, const char *format, int ascending); void (*pl_items_copy_junk)(DB_playItem_t *from, DB_playItem_t *first, DB_playItem_t *last); // idx is one of DDB_REPLAYGAIN_* constants void (*pl_set_item_replaygain) (DB_playItem_t *it, int idx, float value); @@ -3287,7 +3287,7 @@ qsort_cmp_func (const void *a, const void *b) { } void -pl_sort (int iter, int id, const char *format, int ascending) { +plt_sort (playlist_t *playlist, int iter, int id, const char *format, int ascending) { if (id == DB_COLUMN_FILENUMBER || !playlist->head[iter] || !playlist->head[iter]->next[iter]) { return; } @@ -365,7 +365,7 @@ void pl_search_process (const char *text); void -pl_sort (int iter, int id, const char *format, int ascending); +plt_sort (playlist_t *plt, int iter, int id, const char *format, int ascending); // playqueue support functions int @@ -171,7 +171,7 @@ static DB_functions_t deadbeef_api = { .pl_get_item_duration = (float (*) (DB_playItem_t *it))pl_get_item_duration, .pl_get_item_flags = (uint32_t (*) (DB_playItem_t *it))pl_get_item_flags, .pl_set_item_flags = (void (*) (DB_playItem_t *it, uint32_t flags))pl_set_item_flags, - .pl_sort = pl_sort, + .plt_sort = (void (*) (ddb_playlist_t *plt, int iter, int id, const char *format, int ascending))plt_sort, .pl_items_copy_junk = (void (*)(DB_playItem_t *from, DB_playItem_t *first, DB_playItem_t *last))pl_items_copy_junk, .pl_set_item_replaygain = (void (*)(DB_playItem_t *it, int idx, float value))pl_set_item_replaygain, .pl_get_item_replaygain = (float (*)(DB_playItem_t *it, int idx))pl_get_item_replaygain, diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index 794cd7d3..6e2cc158 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -1128,7 +1128,9 @@ void on_sort_by_title_activate (GtkMenuItem *menuitem, gpointer user_data) { - deadbeef->pl_sort (PL_MAIN, -1, "%t", 1); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + deadbeef->plt_sort (plt, PL_MAIN, -1, "%t", 1); + deadbeef->plt_unref (plt); DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); ddb_listview_clear_sort (pl); @@ -1140,7 +1142,9 @@ void on_sort_by_track_nr_activate (GtkMenuItem *menuitem, gpointer user_data) { - deadbeef->pl_sort (PL_MAIN, -1, "%n", 1); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + deadbeef->plt_sort (plt, PL_MAIN, -1, "%n", 1); + deadbeef->plt_unref (plt); DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); ddb_listview_clear_sort (pl); @@ -1152,7 +1156,9 @@ void on_sort_by_album_activate (GtkMenuItem *menuitem, gpointer user_data) { - deadbeef->pl_sort (PL_MAIN, -1, "%b", 1); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + deadbeef->plt_sort (plt, PL_MAIN, -1, "%b", 1); + deadbeef->plt_unref (plt); DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); ddb_listview_clear_sort (pl); @@ -1164,7 +1170,9 @@ void on_sort_by_artist_activate (GtkMenuItem *menuitem, gpointer user_data) { - deadbeef->pl_sort (PL_MAIN, -1, "%a", 1); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + deadbeef->plt_sort (plt, PL_MAIN, -1, "%a", 1); + deadbeef->plt_unref (plt); DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); ddb_listview_clear_sort (pl); @@ -1176,7 +1184,9 @@ void on_sort_by_date_activate (GtkMenuItem *menuitem, gpointer user_data) { - deadbeef->pl_sort (PL_MAIN, -1, "%y", 1); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + deadbeef->plt_sort (plt, PL_MAIN, -1, "%y", 1); + deadbeef->plt_unref (plt); DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); ddb_listview_clear_sort (pl); @@ -1210,7 +1220,9 @@ on_sort_by_custom_activate (GtkMenuItem *menuitem, deadbeef->conf_set_int ("gtkui.sortby_order", order); deadbeef->conf_set_str ("gtkui.sortby_fmt", fmt); - deadbeef->pl_sort (PL_MAIN, -1, fmt, order == 0 ? 1 : 0); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + deadbeef->plt_sort (plt, PL_MAIN, -1, fmt, order == 0 ? 1 : 0); + deadbeef->plt_unref (plt); DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); ddb_listview_clear_sort (pl); diff --git a/plugins/gtkui/mainplaylist.c b/plugins/gtkui/mainplaylist.c index be4c3353..1611f03d 100644 --- a/plugins/gtkui/mainplaylist.c +++ b/plugins/gtkui/mainplaylist.c @@ -140,7 +140,9 @@ playlist_tooltip_handler (GtkWidget *widget, gint x, gint y, gboolean keyboard_m void main_col_sort (int col, int sort_order, void *user_data) { col_info_t *c = (col_info_t*)user_data; - deadbeef->pl_sort (PL_MAIN, c->id, c->format, sort_order-1); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + deadbeef->plt_sort (plt, PL_MAIN, c->id, c->format, sort_order-1); + deadbeef->plt_unref (plt); } void main_handle_doubleclick (DdbListview *listview, DdbListviewIter iter, int idx) { deadbeef->sendmessage (DB_EV_PLAY_NUM, 0, idx, 0); diff --git a/plugins/gtkui/search.c b/plugins/gtkui/search.c index 4f8eaec8..4c6bd99b 100644 --- a/plugins/gtkui/search.c +++ b/plugins/gtkui/search.c @@ -275,7 +275,9 @@ search_get_group (DdbListviewIter it, char *str, int size) { void search_col_sort (int col, int sort_order, void *user_data) { col_info_t *c = (col_info_t*)user_data; - deadbeef->pl_sort (PL_SEARCH, c->id, c->format, sort_order-1); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + deadbeef->plt_sort (plt, PL_SEARCH, c->id, c->format, sort_order-1); + deadbeef->plt_unref (plt); } static int lock_column_config = 0; |