Ticket #770: checkplaylist3.diff
File checkplaylist3.diff, 5.1 KB (added by , 18 years ago) |
---|
-
mythmusic/mythmusic/playbackbox.cpp
161 161 waiting_for_playlists_timer = new QTimer(this); 162 162 connect(waiting_for_playlists_timer, SIGNAL(timeout()), this, 163 163 SLOT(checkForPlaylists())); 164 waiting_for_playlists_timer->start( 100);164 waiting_for_playlists_timer->start(50, TRUE); 165 165 166 166 // Warm up the visualizer 167 167 … … 891 891 892 892 void PlaybackBoxMusic::checkForPlaylists() 893 893 { 894 // This is only done off a timer on startup 895 894 896 if (first_playlist_check) 895 897 { 896 898 first_playlist_check = false; 897 899 repaint(); 898 return;899 900 } 900 901 // This is only done off a timer on startup 902 903 if (all_playlists->doneLoading() && 904 all_music->doneLoading()) 901 else 905 902 { 906 if (progress) 903 if (all_playlists->doneLoading() && 904 all_music->doneLoading()) 907 905 { 908 progress->Close(); 909 delete progress; 910 progress = NULL; 911 progress_type = kProgressNone; 912 } 906 if (progress) 907 { 908 progress->Close(); 909 delete progress; 910 progress = NULL; 911 progress_type = kProgressNone; 912 } 913 913 914 if (tree_is_done) 915 { 916 if (scan_for_cd) 917 updatePlaylistFromCD(); 914 if (tree_is_done) 915 { 916 if (scan_for_cd) 917 updatePlaylistFromCD(); 918 919 music_tree_list->showWholeTree(show_whole_tree); 920 QValueList <int> branches_to_current_node; 921 branches_to_current_node.append(0); // Root node 922 branches_to_current_node.append(1); // We're on a playlist (not "My Music") 923 branches_to_current_node.append(0); // Active play Queue 924 music_tree_list->moveToNodesFirstChild(branches_to_current_node); 925 music_tree_list->refresh(); 926 if (show_whole_tree) 927 setContext(1); 928 else 929 setContext(2); 930 updateForeground(); 931 mainvisual->setVisual(visual_mode); 932 933 if (curMeta) 934 updateTrackInfo(curMeta); 918 935 919 music_tree_list->showWholeTree(show_whole_tree); 920 waiting_for_playlists_timer->stop(); 921 QValueList <int> branches_to_current_node; 922 branches_to_current_node.append(0); // Root node 923 branches_to_current_node.append(1); // We're on a playlist (not "My Music") 924 branches_to_current_node.append(0); // Active play Queue 925 music_tree_list->moveToNodesFirstChild(branches_to_current_node); 926 music_tree_list->refresh(); 927 if (show_whole_tree) 928 setContext(1); 936 return; // Do not restart Timer 937 } 929 938 else 930 setContext(2);931 updateForeground();932 mainvisual->setVisual(visual_mode);933 934 if (curMeta)935 updateTrackInfo(curMeta);936 }937 else938 constructPlaylistTree();939 }940 else941 {942 if (!all_music->doneLoading())943 {944 if (all_music->count() < 250) return;945 946 if (!progress)947 939 { 948 progress = new MythProgressDialog( 949 QObject::tr("Loading Music"), all_music->count()); 950 progress_type = kProgressMusic; 940 constructPlaylistTree(); 951 941 } 952 progress->setProgress(all_music->countLoaded()); 953 } 954 else if (progress_type == kProgressMusic) 942 } 943 else 955 944 { 956 if ( progress)945 if (!all_music->doneLoading()) 957 946 { 958 progress->Close(); 959 delete progress; 947 // Only bother with progress dialogue 948 // if we have a reasonable number of tracks 949 if (all_music->count() >= 250) 950 { 951 if (!progress) 952 { 953 progress = new MythProgressDialog( 954 QObject::tr("Loading Music"), all_music->count()); 955 progress_type = kProgressMusic; 956 } 957 progress->setProgress(all_music->countLoaded()); 958 } 959 } 960 else if (progress_type == kProgressMusic) 961 { 962 if (progress) 963 { 964 progress->Close(); 965 delete progress; 966 } 967 progress = NULL; 968 progress_type = kProgressNone; 960 969 } 961 progress = NULL;962 progress_type = kProgressNone;963 970 } 964 971 } 972 973 waiting_for_playlists_timer->start(100, TRUE); // Restart Timer 974 965 975 } 966 976 967 977 void PlaybackBoxMusic::changeVolume(bool up_or_down)