static void add_list (Index * filenames, int at, bool_t to_temp, bool_t play) { if (to_temp) playlist_set_active (playlist_get_temporary ()); int playlist = playlist_get_active (); if (play) { if (get_bool (NULL, "clear_playlist")) playlist_entry_delete (playlist, 0, playlist_entry_count (playlist)); else playlist_queue_delete (playlist, 0, playlist_queue_count (playlist)); } playlist_entry_insert_batch (playlist, at, filenames, NULL, play); }
static void add_list (Index * filenames, int at, bool_t to_temp, bool_t play) { if (to_temp) playlist_set_active (playlist_get_temporary ()); int playlist = playlist_get_active (); /* queue the new entries before deleting the old ones */ /* this is to avoid triggering the --quit-after-play condition */ playlist_entry_insert_batch (playlist, at, filenames, NULL, play); if (play) { if (get_bool (NULL, "clear_playlist")) playlist_entry_delete (playlist, 0, playlist_entry_count (playlist)); else playlist_queue_delete (playlist, 0, playlist_queue_count (playlist)); } }
static void add_list (GList * list, gint at, gboolean to_temp, gboolean play) { if (to_temp) activate_temp (); gint playlist = playlist_get_active (); if (play) { if (get_bool (NULL, "clear_playlist")) playlist_entry_delete (playlist, 0, playlist_entry_count (playlist)); else playlist_queue_delete (playlist, 0, playlist_queue_count (playlist)); } struct index * filenames = index_new (); for (; list != NULL; list = list->next) index_append (filenames, g_strdup (list->data)); playlist_entry_insert_batch (playlist, at, filenames, NULL, play); }
void drct_pl_delete_selected (int list) { int pos = playlist_get_position (list); if (get_bool (NULL, "advance_on_delete") && ! get_bool (NULL, "no_playlist_advance") && playback_get_playing () && list == playlist_get_playing () && pos >= 0 && playlist_entry_get_selected (list, pos)) { playlist_entry_set_selected (list, pos, FALSE); playlist_delete_selected (list); pos = playlist_get_position (list); /* it may have moved */ if (playlist_next_song (list, get_bool (NULL, "repeat")) && playlist_get_position (list) != pos) playback_play (0, FALSE); playlist_entry_delete (list, pos, 1); } else playlist_delete_selected (list); }
void drct_pl_clear (void) { gint playlist = playlist_get_active (); playlist_entry_delete (playlist, 0, playlist_entry_count (playlist)); }
void drct_pl_delete (gint entry) { playlist_entry_delete (playlist_get_active (), entry, 1); }