comparison src/audacious/playlist.c @ 3165:8775dfc57ead trunk

Remove mainwin_set_info_text() craq. Still some work to do.
author William Pitcock <nenolod@atheme-project.org>
date Wed, 25 Jul 2007 15:46:00 -0500
parents a2d552ea48f0
children 5dd8bc77a590
comparison
equal deleted inserted replaced
3160:03ff51c6412f 3165:8775dfc57ead
524 } 524 }
525 else { 525 else {
526 mainwin_clear_song_info(); 526 mainwin_clear_song_info();
527 } 527 }
528 } 528 }
529 else if (set_info_text) {
530 mainwin_set_info_text();
531 }
532 529
533 playlist_manager_update(); 530 playlist_manager_update();
534 } 531 }
535 532
536 void 533 void
566 } 563 }
567 else { 564 else {
568 mainwin_clear_song_info(); 565 mainwin_clear_song_info();
569 } 566 }
570 } 567 }
571 else if (set_info_text) {
572 mainwin_set_info_text();
573 }
574 568
575 playlist_manager_update(); 569 playlist_manager_update();
576 } 570 }
577 571
578 void 572 void
601 } 595 }
602 596
603 PLAYLIST_UNLOCK(playlist->mutex); 597 PLAYLIST_UNLOCK(playlist->mutex);
604 598
605 playlist_recalc_total_time(playlist); 599 playlist_recalc_total_time(playlist);
606
607 if (set_info_text) {
608 mainwin_set_info_text();
609 }
610 600
611 if (restart_playing) { 601 if (restart_playing) {
612 if (playlist->position) { 602 if (playlist->position) {
613 playback_initiate(); 603 playback_initiate();
614 } 604 }
1043 playlist_set_info_old_abi(const gchar * title, gint length, gint rate, 1033 playlist_set_info_old_abi(const gchar * title, gint length, gint rate,
1044 gint freq, gint nch) 1034 gint freq, gint nch)
1045 { 1035 {
1046 Playlist *playlist = playlist_get_active(); 1036 Playlist *playlist = playlist_get_active();
1047 PlaylistEventInfoChange *msg; 1037 PlaylistEventInfoChange *msg;
1038 gchar *text;
1048 1039
1049 g_return_if_fail(playlist != NULL); 1040 g_return_if_fail(playlist != NULL);
1050 1041
1051 if (playlist->position) { 1042 if (playlist->position) {
1052 g_free(playlist->position->title); 1043 g_free(playlist->position->title);
1069 msg->bitrate = rate; 1060 msg->bitrate = rate;
1070 msg->samplerate = freq; 1061 msg->samplerate = freq;
1071 msg->channels = nch; 1062 msg->channels = nch;
1072 1063
1073 event_queue("playlist info change", msg); 1064 event_queue("playlist info change", msg);
1065
1066 text = playlist_get_info_text(playlist);
1067 event_queue("title change", text);
1074 1068
1075 if ( playlist->position ) 1069 if ( playlist->position )
1076 hook_call( "playlist set info" , playlist->position ); 1070 hook_call( "playlist set info" , playlist->position );
1077 } 1071 }
1078 1072
1175 playlist_check_pos_current(playlist); 1169 playlist_check_pos_current(playlist);
1176 1170
1177 if (restart_playing) 1171 if (restart_playing)
1178 playback_initiate(); 1172 playback_initiate();
1179 else { 1173 else {
1180 mainwin_set_info_text();
1181 playlistwin_update_list(playlist); 1174 playlistwin_update_list(playlist);
1182 } 1175 }
1183 } 1176 }
1184 1177
1185 void 1178 void
1237 playlist_check_pos_current(playlist); 1230 playlist_check_pos_current(playlist);
1238 1231
1239 if (restart_playing) 1232 if (restart_playing)
1240 playback_initiate(); 1233 playback_initiate();
1241 else { 1234 else {
1242 mainwin_set_info_text();
1243 playlistwin_update_list(playlist); 1235 playlistwin_update_list(playlist);
1244 } 1236 }
1245 } 1237 }
1246 1238
1247 void 1239 void
1420 playlist_check_pos_current(playlist); 1412 playlist_check_pos_current(playlist);
1421 1413
1422 if (restart_playing) 1414 if (restart_playing)
1423 playback_initiate(); 1415 playback_initiate();
1424 else { 1416 else {
1425 mainwin_set_info_text();
1426 playlistwin_update_list(playlist); 1417 playlistwin_update_list(playlist);
1427 } 1418 }
1428 } 1419 }
1429 1420
1430 void 1421 void
1478 1469
1479 if (!cfg.repeat) { 1470 if (!cfg.repeat) {
1480 PLAYLIST_UNLOCK(playlist->mutex); 1471 PLAYLIST_UNLOCK(playlist->mutex);
1481 hook_call("playlist end reached", playlist->position); 1472 hook_call("playlist end reached", playlist->position);
1482 mainwin_clear_song_info(); 1473 mainwin_clear_song_info();
1483 mainwin_set_info_text();
1484 return; 1474 return;
1485 } 1475 }
1486 } 1476 }
1487 else 1477 else
1488 playlist->position = g_list_next(plist_pos_list)->data; 1478 playlist->position = g_list_next(plist_pos_list)->data;
1489 1479
1490 PLAYLIST_UNLOCK(playlist->mutex); 1480 PLAYLIST_UNLOCK(playlist->mutex);
1491 1481
1492 playlist_check_pos_current(playlist); 1482 playlist_check_pos_current(playlist);
1493 playback_initiate(); 1483 playback_initiate();
1494 mainwin_set_info_text();
1495 playlistwin_update_list(playlist); 1484 playlistwin_update_list(playlist);
1496 } 1485 }
1497 1486
1498 gint 1487 gint
1499 playlist_queue_get_length(Playlist *playlist) 1488 playlist_queue_get_length(Playlist *playlist)
2488 static gpointer 2477 static gpointer
2489 playlist_get_info_func(gpointer arg) 2478 playlist_get_info_func(gpointer arg)
2490 { 2479 {
2491 GList *node; 2480 GList *node;
2492 gboolean update_playlistwin = FALSE; 2481 gboolean update_playlistwin = FALSE;
2493 gboolean update_mainwin = FALSE;
2494 2482
2495 while (playlist_get_info_is_going()) { 2483 while (playlist_get_info_is_going()) {
2496 PlaylistEntry *entry; 2484 PlaylistEntry *entry;
2497 Playlist *playlist = playlist_get_active(); 2485 Playlist *playlist = playlist_get_active();
2498 2486
2516 Restart. */ 2504 Restart. */
2517 node = playlist->entries; 2505 node = playlist->entries;
2518 } 2506 }
2519 else if ((entry->tuple != NULL || entry->title != NULL) && entry->length != -1) { 2507 else if ((entry->tuple != NULL || entry->title != NULL) && entry->length != -1) {
2520 update_playlistwin = TRUE; 2508 update_playlistwin = TRUE;
2521 if (entry == playlist->position)
2522 update_mainwin = TRUE;
2523 break; 2509 break;
2524 } 2510 }
2525 } 2511 }
2526 2512
2527 if (!node) { 2513 if (!node) {
2561 node = g_list_nth(playlist->entries, 2547 node = g_list_nth(playlist->entries,
2562 playlistwin_get_toprow()); 2548 playlistwin_get_toprow());
2563 } 2549 }
2564 else if ((entry->tuple != NULL || entry->title != NULL) && entry->length != -1) { 2550 else if ((entry->tuple != NULL || entry->title != NULL) && entry->length != -1) {
2565 update_playlistwin = TRUE; 2551 update_playlistwin = TRUE;
2566 if (entry == playlist->position)
2567 update_mainwin = TRUE;
2568 // no need for break here since this iteration is very short. 2552 // no need for break here since this iteration is very short.
2569 } 2553 }
2570 } 2554 }
2571 } // on_demand 2555 } // on_demand
2572 else if (cfg.get_info_on_demand && 2556 else if (cfg.get_info_on_demand &&
2586 } 2570 }
2587 2571
2588 if (update_playlistwin) { 2572 if (update_playlistwin) {
2589 playlistwin_update_list(playlist); 2573 playlistwin_update_list(playlist);
2590 update_playlistwin = FALSE; 2574 update_playlistwin = FALSE;
2591 }
2592
2593 if (update_mainwin) {
2594 mainwin_set_info_text();
2595 update_mainwin = FALSE;
2596 } 2575 }
2597 2576
2598 if (playlist_get_info_scan_active) { 2577 if (playlist_get_info_scan_active) {
2599 continue; 2578 continue;
2600 } 2579 }