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)); } }