Ticket #9169: mediamon.diff
| File mediamon.diff, 8.3 KB (added by , 16 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; … … 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 … … 1106 1108 if (scan_for_cd) 1107 1109 updatePlaylistFromCD(); 1108 1110 1111 cd_reader_thread->getLock()->lock(); 1112 1109 1113 music_tree_list->showWholeTree(show_whole_tree); 1110 1114 Q3ValueList <int> branches_to_current_node; 1111 1115 branches_to_current_node.append(0); // Root node … … 1135 1139 if (curMeta) 1136 1140 updateTrackInfo(curMeta); 1137 1141 1142 cd_reader_thread->getLock()->unlock(); 1138 1143 return; // Do not restart Timer 1139 1144 } 1140 1145 else … … 1357 1362 gPlayer->getOutput()->SetTimecode(0); 1358 1363 } 1359 1364 1360 bannerEnable(curMeta, show_album_art); 1365 if (curMeta) 1366 bannerEnable(curMeta, show_album_art); 1361 1367 } 1362 1368 1363 1369 void PlaybackBoxMusic::visEnable() … … 1388 1394 { 1389 1395 if (mainvisual->bannerIsShowing()) 1390 1396 bannerDisable(); 1391 else 1397 else if (mdata) 1392 1398 bannerEnable(mdata, false); 1393 1399 } 1394 1400 … … 1801 1807 if (node) 1802 1808 { 1803 1809 curMeta = gMusicData->all_music->getMetadata(node->getInt()); 1804 updateTrackInfo(curMeta); 1810 if (curMeta) 1811 updateTrackInfo(curMeta); 1805 1812 1806 1813 maxTime = curMeta->Length() / 1000; 1807 1814 … … 1827 1834 if (node) 1828 1835 { 1829 1836 curMeta = gMusicData->all_music->getMetadata(node->getInt()); 1830 updateTrackInfo(curMeta); 1837 if (curMeta) 1838 updateTrackInfo(curMeta); 1831 1839 1832 1840 maxTime = curMeta->Length() / 1000; 1833 1841 … … 2069 2077 2070 2078 void PlaybackBoxMusic::updateTrackInfo(Metadata *mdata) 2071 2079 { 2072 if ( visualizer_status != 2)2080 if (mdata) 2073 2081 { 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); 2082 if (visualizer_status != 2) 2083 { 2084 if (title_text) 2085 title_text->SetText(mdata->FormatTitle()); 2086 if (artist_text) 2087 artist_text->SetText(mdata->FormatArtist()); 2088 if (album_text) 2089 album_text->SetText(mdata->Album()); 2090 if (albumart_image) 2091 showAlbumArtImage(mdata); 2082 2092 2083 if (showrating) 2084 { 2085 if (ratings_image) 2086 ratings_image->setRepeat(mdata->Rating()); 2093 if (showrating) 2094 { 2095 if (ratings_image) 2096 ratings_image->setRepeat(mdata->Rating()); 2097 } 2087 2098 } 2099 setTrackOnLCD(mdata); 2088 2100 } 2089 setTrackOnLCD(mdata);2090 2101 } 2091 2102 2092 2103 void PlaybackBoxMusic::showAlbumArtImage(Metadata *mdata) … … 2164 2175 } 2165 2176 2166 2177 curMeta = gMusicData->all_music->getMetadata(node_int); 2178 if (curMeta) 2179 updateTrackInfo(curMeta); 2167 2180 2168 updateTrackInfo(curMeta);2169 2170 2181 maxTime = curMeta->Length() / 1000; 2171 2182 2172 2183 QString time_string = getTimeString(maxTime, 0); -
mythplugins/mythmusic/mythmusic/main.cpp
472 472 } 473 473 474 474 if (gCoreContext->GetNumSetting("AutoPlayCD", 0)) 475 { 476 // Empty the playlist to ensure CD is played first 477 if (gMusicData->all_music) 478 gMusicData->all_music->clearCDData(); 479 if (gMusicData->all_playlists) 480 gMusicData->all_playlists->clearCDList(); 481 475 482 runMusicPlayback(); 483 } 476 484 else 477 485 mythplugin_run(); 478 486 } -
mythplugins/mythgallery/mythgallery/iconview.cpp
492 492 { 493 493 QDir currentDir(m_currDir); 494 494 QDir rootDir(m_galleryDir); 495 if (currentDir != rootDir) 496 HandleSubDirEscape(m_galleryDir); 497 else 495 if (currentDir == rootDir) 498 496 break; 497 if ( !HandleSubDirEscape(m_galleryDir)) 498 break; 499 499 } 500 500 handled = HandleEscape(); 501 501 } -
mythtv/libs/libmyth/mythmediamonitor.cpp
362 362 { 363 363 if ((*it)->getDevicePath() == dev) 364 364 { 365 // Ensure device gets an unmount 366 (*it)->checkMedia(); 367 365 368 if (m_UseCount[*it] == 0) 366 369 { 367 370 (*it)->deleteLater(); … … 652 655 653 656 654 657 GetMythMainWindow()->JumpTo("Main Menu"); 658 while (GetMythMainWindow()->IsExitingToMain()) 659 qApp->processEvents(); // Ensure jump is executed before calling handler 655 660 handlers.at(selected).callback(pMedia); 656 661 } 657 662 … … 672 677 // This gets called from outside the main thread so we need 673 678 // to post an event back to the main thread. 674 679 // We now send events for all non-error statuses, so plugins get ejects 675 if (m_SendEvent && stat != MEDIASTAT_ERROR && stat != MEDIASTAT_UNKNOWN) 680 if (m_SendEvent && stat != MEDIASTAT_ERROR && stat != MEDIASTAT_UNKNOWN && 681 // Don't send an event for a new device that's not mounted 682 !(oldStatus == MEDIASTAT_UNPLUGGED && stat == MEDIASTAT_NOTMOUNTED)) 676 683 { 677 684 // Should we ValidateAndLock() first? 678 685 QEvent *e = new MediaEvent(stat, pMedia); -
mythtv/libs/libmyth/mythmediamonitor.cpp
362 362 { 363 363 if ((*it)->getDevicePath() == dev) 364 364 { 365 // Ensure device gets an unmount 366 (*it)->checkMedia(); 367 365 368 if (m_UseCount[*it] == 0) 366 369 { 367 370 (*it)->deleteLater(); … … 652 655 653 656 654 657 GetMythMainWindow()->JumpTo("Main Menu"); 658 while (GetMythMainWindow()->IsExitingToMain()) 659 qApp->processEvents(); // Ensure jump is executed before calling handler 655 660 handlers.at(selected).callback(pMedia); 656 661 } 657 662 … … 672 677 // This gets called from outside the main thread so we need 673 678 // to post an event back to the main thread. 674 679 // We now send events for all non-error statuses, so plugins get ejects 675 if (m_SendEvent && stat != MEDIASTAT_ERROR && stat != MEDIASTAT_UNKNOWN) 680 if (m_SendEvent && stat != MEDIASTAT_ERROR && stat != MEDIASTAT_UNKNOWN && 681 // Don't send an event for a new device that's not mounted 682 !(oldStatus == MEDIASTAT_UNPLUGGED && stat == MEDIASTAT_NOTMOUNTED)) 676 683 { 677 684 // Should we ValidateAndLock() first? 678 685 QEvent *e = new MediaEvent(stat, pMedia);
