diff options
author | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-09-25 14:17:59 +0000 |
---|---|---|
committer | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-09-25 14:17:59 +0000 |
commit | def6f649cda5f35306edfc7ee0f6c02746711a12 (patch) | |
tree | 83adca495d1c95d8afe710b761b714fb4810ccfa | |
parent | 5879bd13d018fa9074e304507d3eb0f26a27e2a7 (diff) | |
download | vdr-plugin-muggle-def6f649cda5f35306edfc7ee0f6c02746711a12.tar.gz vdr-plugin-muggle-def6f649cda5f35306edfc7ee0f6c02746711a12.tar.bz2 |
Avoid crashing by prohibiting playlist deletion while playing
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@183 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r-- | vdr_menu.c | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -795,14 +795,27 @@ eOSState mgMainMenu::PlaylistSubmenuAction( int n ) } break; case 3: { // clear playlist - m_current_playlist->clear(); + + cControl *control = cControl::Control(); + string buffer; + + if( control && typeid(*control) == typeid(mgPlayerControl) ) + { + buffer = "Cannot clear playlist while playing."; + } + else + { + m_current_playlist->clear(); + + buffer = "Playlist cleared"; + } // confirmation #if VDRVERSNUM >= 10307 - Skins.Message(mtInfo,"Playlist cleared"); + Skins.Message( mtInfo, buffer.c_str() ); Skins.Flush(); #else - Interface->Status( "Playlist cleared" ); + Interface->Status( buffer.c_str() ); Interface->Flush(); #endif @@ -944,12 +957,10 @@ void mgMainMenu::Play(mgPlaylist *plist) if( control && typeid(*control) == typeid(mgPlayerControl) ) { // is there a running MP3 player? - cout << "mgMainMenu::Play: signal new playlist to existing control" << endl; static_cast<mgPlayerControl*>(control)->NewPlaylist(plist); // signal the running player to load the new playlist } else { - cout << "mgMainMenu::Play: starting new control" << endl; cControl::Launch( new mgPlayerControl(plist) ); } } |