void playlist_delete_filenames(GList *filenames) { GList *node, *fnode; gboolean set_info_text = FALSE, restart_playing = FALSE; PL_LOCK(); for (fnode = filenames; fnode; fnode = g_list_next(fnode)) { node = playlist; while (node) { GList *next = g_list_next(node); PlaylistEntry *entry = node->data; if (!strcmp(entry->filename, fnode->data)) playlist_delete_node(node, &set_info_text, &restart_playing); node = next; } } PL_UNLOCK(); playlistwin_update_list(); if (restart_playing) { if (playlist_position) playlist_play(); else mainwin_clear_song_info(); } else if (set_info_text) mainwin_set_info_text(); }
void playlist_delete(gboolean crop) { gboolean restart_playing = FALSE, set_info_text = FALSE; GList *node, *next; PlaylistEntry *entry; PL_LOCK(); node = playlist; while (node) { entry = node->data; next = g_list_next(node); if ((entry->selected && !crop) || (!entry->selected && crop)) playlist_delete_node(node, &set_info_text, &restart_playing); node = next; } PL_UNLOCK(); playlistwin_update_list(); if (restart_playing) { if (playlist_position) playlist_play(); else mainwin_clear_song_info(); } else if (set_info_text) mainwin_set_info_text(); }
void playlist_delete_index(glong index) { gboolean restart_playing = FALSE, set_info_text = FALSE; GList *node; PL_LOCK(); if (!playlist) { PL_UNLOCK(); return; } node = g_list_nth(playlist, index); if(!node) { PL_UNLOCK(); return; } playlist_delete_node(node, &set_info_text, &restart_playing); PL_UNLOCK(); playlistwin_update_list(); if (restart_playing) { if (playlist_position) playlist_play(); else mainwin_clear_song_info(); } else if (set_info_text) mainwin_set_info_text(); }
void playlist_eof_reached(void) { GList *plist_pos_list; input_stop(); PL_LOCK(); plist_pos_list = find_playlist_position_list(); if (cfg.no_playlist_advance) { PL_UNLOCK(); mainwin_clear_song_info(); if (cfg.repeat) playlist_play(); return; } if (queued_list) play_queued(); else if (!g_list_next(plist_pos_list)) { if (cfg.shuffle) { playlist_position = NULL; __playlist_generate_shuffle_list(); } else playlist_position = playlist->data; if (!cfg.repeat) { PL_UNLOCK(); mainwin_clear_song_info(); mainwin_set_info_text(); return; } } else playlist_position = plist_pos_list->next->data; PL_UNLOCK(); playlist_check_pos_current(); playlist_play(); mainwin_set_info_text(); playlistwin_update_list(); }
static void ui_main_evlistener_playback_stop(gpointer hook_data, gpointer user_data) { mainwin_clear_song_info (); }