comparison audacious/playlist.c @ 2121:185db04b815f trunk

[svn] - remove all improper uses of playlist_get()
author nenolod
date Fri, 15 Dec 2006 07:23:19 -0800
parents 1d67cf383e32
children 7177279f9d26
comparison
equal deleted inserted replaced
2120:1d67cf383e32 2121:185db04b815f
868 } 868 }
869 869
870 g_free(decoded); 870 g_free(decoded);
871 871
872 PLAYLIST_LOCK(); 872 PLAYLIST_LOCK();
873 node = g_list_nth(playlist_get(), pos); 873 node = g_list_nth(playlist->entries, pos);
874 PLAYLIST_UNLOCK(); 874 PLAYLIST_UNLOCK();
875 875
876 entries += i; 876 entries += i;
877 877
878 if (first) { 878 if (first) {
2312 if (cfg.use_pl_metadata && 2312 if (cfg.use_pl_metadata &&
2313 cfg.get_info_on_load && 2313 cfg.get_info_on_load &&
2314 playlist_get_info_scan_active) { 2314 playlist_get_info_scan_active) {
2315 2315
2316 PLAYLIST_LOCK(); 2316 PLAYLIST_LOCK();
2317 for (node = playlist_get(); node; node = g_list_next(node)) { 2317 for (node = playlist->entries; node; node = g_list_next(node)) {
2318 entry = node->data; 2318 entry = node->data;
2319 2319
2320 if(entry->tuple && (entry->tuple->length > -1)) { 2320 if(entry->tuple && (entry->tuple->length > -1)) {
2321 update_playlistwin = TRUE; 2321 update_playlistwin = TRUE;
2322 continue; 2322 continue;
2323 } 2323 }
2324 2324
2325 if (!playlist_entry_get_info(entry)) { 2325 if (!playlist_entry_get_info(entry)) {
2326 if (g_list_index(playlist_get(), entry) == -1) 2326 if (g_list_index(playlist->entries, entry) == -1)
2327 /* Entry disappeared while we looked it up. 2327 /* Entry disappeared while we looked it up.
2328 Restart. */ 2328 Restart. */
2329 node = playlist_get(); 2329 node = playlist->entries;
2330 } 2330 }
2331 else if ((entry->tuple != NULL || entry->title != NULL) && entry->length != -1) { 2331 else if ((entry->tuple != NULL || entry->title != NULL) && entry->length != -1) {
2332 update_playlistwin = TRUE; 2332 update_playlistwin = TRUE;
2333 if (entry == playlist->position) 2333 if (entry == playlist->position)
2334 update_mainwin = TRUE; 2334 update_mainwin = TRUE;
2355 playlist_get_info_scan_active = FALSE; 2355 playlist_get_info_scan_active = FALSE;
2356 g_mutex_unlock(mutex_scan); 2356 g_mutex_unlock(mutex_scan);
2357 2357
2358 PLAYLIST_LOCK(); 2358 PLAYLIST_LOCK();
2359 2359
2360 if (!playlist_get()) { 2360 if (!playlist->entries) {
2361 PLAYLIST_UNLOCK(); 2361 PLAYLIST_UNLOCK();
2362 } 2362 }
2363 else { 2363 else {
2364 for (node = g_list_nth(playlist_get(), playlistwin_get_toprow()); 2364 for (node = g_list_nth(playlist->entries, playlistwin_get_toprow());
2365 node && playlistwin_item_visible(g_list_position(playlist_get(), node)); 2365 node && playlistwin_item_visible(g_list_position(playlist->entries, node));
2366 node = g_list_next(node)) { 2366 node = g_list_next(node)) {
2367 2367
2368 entry = node->data; 2368 entry = node->data;
2369 2369
2370 if(entry->tuple && (entry->tuple->length > -1)) { 2370 if(entry->tuple && (entry->tuple->length > -1)) {
2371 update_playlistwin = TRUE; 2371 update_playlistwin = TRUE;
2372 continue; 2372 continue;
2373 } 2373 }
2374 2374
2375 if (!playlist_entry_get_info(entry)) { 2375 if (!playlist_entry_get_info(entry)) {
2376 if (g_list_index(playlist_get(), entry) == -1) 2376 if (g_list_index(playlist->entries, entry) == -1)
2377 /* Entry disapeared while we 2377 /* Entry disapeared while we
2378 looked it up. Restart. */ 2378 looked it up. Restart. */
2379 node = 2379 node =
2380 g_list_nth(playlist_get(), 2380 g_list_nth(playlist->entries,
2381 playlistwin_get_toprow()); 2381 playlistwin_get_toprow());
2382 } 2382 }
2383 else if ((entry->tuple != NULL || entry->title != NULL) && entry->length != -1) { 2383 else if ((entry->tuple != NULL || entry->title != NULL) && entry->length != -1) {
2384 update_playlistwin = TRUE; 2384 update_playlistwin = TRUE;
2385 if (entry == playlist->position) 2385 if (entry == playlist->position)
2771 GList *node; 2771 GList *node;
2772 gboolean retval = FALSE; 2772 gboolean retval = FALSE;
2773 2773
2774 PLAYLIST_LOCK(); 2774 PLAYLIST_LOCK();
2775 2775
2776 for (node = playlist_get(); node; node = g_list_next(node)) { 2776 for (node = playlist->entries; node; node = g_list_next(node)) {
2777 PlaylistEntry *entry = node->data; 2777 PlaylistEntry *entry = node->data;
2778 if (!entry->selected) 2778 if (!entry->selected)
2779 continue; 2779 continue;
2780 2780
2781 retval = TRUE; 2781 retval = TRUE;
2786 /* invalidate mtime to reread */ 2786 /* invalidate mtime to reread */
2787 if (entry->tuple != NULL) 2787 if (entry->tuple != NULL)
2788 entry->tuple->mtime = -1; /* -1 denotes "non-initialized". now 0 is for stream etc. yaz */ 2788 entry->tuple->mtime = -1; /* -1 denotes "non-initialized". now 0 is for stream etc. yaz */
2789 2789
2790 if (!playlist_entry_get_info(entry)) { 2790 if (!playlist_entry_get_info(entry)) {
2791 if (g_list_index(playlist_get(), entry) == -1) 2791 if (g_list_index(playlist->entries, entry) == -1)
2792 /* Entry disappeared while we looked it up. Restart. */ 2792 /* Entry disappeared while we looked it up. Restart. */
2793 node = playlist_get(); 2793 node = playlist->entries;
2794 } 2794 }
2795 } 2795 }
2796 2796
2797 PLAYLIST_UNLOCK(); 2797 PLAYLIST_UNLOCK();
2798 2798
2807 { 2807 {
2808 GList *node; 2808 GList *node;
2809 2809
2810 PLAYLIST_LOCK(); 2810 PLAYLIST_LOCK();
2811 2811
2812 if ((node = g_list_nth(playlist_get(), pos))) { 2812 if ((node = g_list_nth(playlist->entries, pos))) {
2813 PlaylistEntry *entry = node->data; 2813 PlaylistEntry *entry = node->data;
2814 str_replace_in(&entry->title, NULL); 2814 str_replace_in(&entry->title, NULL);
2815 entry->length = -1; 2815 entry->length = -1;
2816 playlist_entry_get_info(entry); 2816 playlist_entry_get_info(entry);
2817 } 2817 }