Ticket #9258: music-pbox-null.diff
File music-pbox-null.diff, 3.9 KB (added by , 14 years ago) |
---|
-
mythplugins/mythmusic/mythmusic/playbackbox.cpp
468 468 160, 160); 469 469 mainvisual->setVisual(visual_modes[current_visual]); 470 470 bannerDisable(); 471 updateTrackInfo(curMeta); 471 if (curMeta) 472 updateTrackInfo(curMeta); 472 473 473 474 if (!m_parent->IsExitingToMain()) 474 475 handled = true; … … 970 971 971 972 void PlaybackBoxMusic::occasionallyCheckCD() 972 973 { 973 if (!cd_reader_thread ->getLock()->tryLock())974 if (!cd_reader_thread || !cd_reader_thread->getLock()->tryLock()) 974 975 return; 975 976 cd_reader_thread->getLock()->unlock(); 976 977 … … 1068 1069 1069 1070 GenericTree *node = music_tree_list->getCurrentNode(); 1070 1071 curMeta = gMusicData->all_music->getMetadata(node->getInt()); 1071 updateTrackInfo(curMeta); 1072 if (curMeta) 1073 updateTrackInfo(curMeta); 1072 1074 1073 1075 setShuffleMode(gPlayer->getShuffleMode()); 1074 1076 … … 1357 1364 gPlayer->getOutput()->SetTimecode(0); 1358 1365 } 1359 1366 1360 bannerEnable(curMeta, show_album_art); 1367 if (curMeta) 1368 bannerEnable(curMeta, show_album_art); 1361 1369 } 1362 1370 1363 1371 void PlaybackBoxMusic::visEnable() … … 1388 1396 { 1389 1397 if (mainvisual->bannerIsShowing()) 1390 1398 bannerDisable(); 1391 else 1399 else if (mdata) 1392 1400 bannerEnable(mdata, false); 1393 1401 } 1394 1402 … … 1801 1809 if (node) 1802 1810 { 1803 1811 curMeta = gMusicData->all_music->getMetadata(node->getInt()); 1804 updateTrackInfo(curMeta); 1812 if (curMeta) 1813 updateTrackInfo(curMeta); 1805 1814 1806 1815 maxTime = curMeta->Length() / 1000; 1807 1816 … … 1827 1836 if (node) 1828 1837 { 1829 1838 curMeta = gMusicData->all_music->getMetadata(node->getInt()); 1830 updateTrackInfo(curMeta); 1839 if (curMeta) 1840 updateTrackInfo(curMeta); 1831 1841 1832 1842 maxTime = curMeta->Length() / 1000; 1833 1843 … … 2069 2079 2070 2080 void PlaybackBoxMusic::updateTrackInfo(Metadata *mdata) 2071 2081 { 2072 if ( visualizer_status != 2)2082 if (mdata) 2073 2083 { 2074 if (title_text) 2075 title_text->SetText(mdata->FormatTitle()); 2076 if (artist_text) 2077 artist_text->SetText(mdata->FormatArtist()); 2078 if (album_text) 2079 album_text->SetText(mdata->Album()); 2080 if (albumart_image) 2081 showAlbumArtImage(mdata); 2084 if (visualizer_status != 2) 2085 { 2086 if (title_text) 2087 title_text->SetText(mdata->FormatTitle()); 2088 if (artist_text) 2089 artist_text->SetText(mdata->FormatArtist()); 2090 if (album_text) 2091 album_text->SetText(mdata->Album()); 2092 if (albumart_image) 2093 showAlbumArtImage(mdata); 2082 2094 2083 if (showrating) 2084 { 2085 if (ratings_image) 2086 ratings_image->setRepeat(mdata->Rating()); 2095 if (showrating) 2096 { 2097 if (ratings_image) 2098 ratings_image->setRepeat(mdata->Rating()); 2099 } 2087 2100 } 2101 setTrackOnLCD(mdata); 2088 2102 } 2089 setTrackOnLCD(mdata);2090 2103 } 2091 2104 2092 2105 void PlaybackBoxMusic::showAlbumArtImage(Metadata *mdata) … … 2164 2177 } 2165 2178 2166 2179 curMeta = gMusicData->all_music->getMetadata(node_int); 2180 if (curMeta) 2181 updateTrackInfo(curMeta); 2167 2182 2168 updateTrackInfo(curMeta);2169 2170 2183 maxTime = curMeta->Length() / 1000; 2171 2184 2172 2185 QString time_string = getTimeString(maxTime, 0);