summaryrefslogtreecommitdiff
path: root/muggle-plugin/vdr_menu.c
diff options
context:
space:
mode:
authorlvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b>2004-09-25 14:17:59 +0000
committerlvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b>2004-09-25 14:17:59 +0000
commitfe06bc593a1f1a70d200c5dfb251e99377d77733 (patch)
treea3b43d05b3921d545f405580109dbe2aa9aa82a1 /muggle-plugin/vdr_menu.c
parentf900a120e50a622d1a0456d1d271854dbbff3723 (diff)
downloadvdr-plugin-muggle-fe06bc593a1f1a70d200c5dfb251e99377d77733.tar.gz
vdr-plugin-muggle-fe06bc593a1f1a70d200c5dfb251e99377d77733.tar.bz2
Avoid crashing by prohibiting playlist deletion while playing
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk@183 e10066b5-e1e2-0310-b819-94efdf66514b
Diffstat (limited to 'muggle-plugin/vdr_menu.c')
-rw-r--r--muggle-plugin/vdr_menu.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/muggle-plugin/vdr_menu.c b/muggle-plugin/vdr_menu.c
index 314e16a..b4b2ab9 100644
--- a/muggle-plugin/vdr_menu.c
+++ b/muggle-plugin/vdr_menu.c
@@ -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) );
}
}