First implementation at the "loop by default" settings.

To make it better, there should be a looping mode per
window, and the settings should serve only as defaults.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38570 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-09-07 14:36:32 +00:00
parent c520f2c9c9
commit c5f8afb944
3 changed files with 16 additions and 5 deletions

View File

@ -604,9 +604,19 @@ MainWin::MessageReceived(BMessage* msg)
bool hadNext = fPlaylist->SetCurrentItemIndex( bool hadNext = fPlaylist->SetCurrentItemIndex(
fPlaylist->CurrentItemIndex() + 1); fPlaylist->CurrentItemIndex() + 1);
if (!hadNext) { if (!hadNext) {
// Reached end of playlist
// Handle "quit when done" settings
if ((fHasVideo && fCloseWhenDonePlayingMovie) if ((fHasVideo && fCloseWhenDonePlayingMovie)
|| (!fHasVideo && fCloseWhenDonePlayingSound)) || (!fHasVideo && fCloseWhenDonePlayingSound))
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
// Handle "loop by default" settings
if ((fHasVideo && fLoopMovies)
|| (!fHasVideo && fLoopSounds)) {
if (fPlaylist->CountItems() > 1)
fPlaylist->SetCurrentItemIndex(0);
else
fController->Play();
}
} }
break; break;
} }
@ -2287,6 +2297,8 @@ MainWin::_AdoptGlobalSettings()
fCloseWhenDonePlayingMovie = settings.closeWhenDonePlayingMovie; fCloseWhenDonePlayingMovie = settings.closeWhenDonePlayingMovie;
fCloseWhenDonePlayingSound = settings.closeWhenDonePlayingSound; fCloseWhenDonePlayingSound = settings.closeWhenDonePlayingSound;
fLoopMovies = settings.loopMovie;
fLoopSounds = settings.loopSound;
} }

View File

@ -186,6 +186,8 @@ private:
ListenerAdapter fGlobalSettingsListener; ListenerAdapter fGlobalSettingsListener;
bool fCloseWhenDonePlayingMovie; bool fCloseWhenDonePlayingMovie;
bool fCloseWhenDonePlayingSound; bool fCloseWhenDonePlayingSound;
bool fLoopMovies;
bool fLoopSounds;
bigtime_t fInitialSeekPosition; bigtime_t fInitialSeekPosition;
static int sNoVideoWidth; static int sNoVideoWidth;

View File

@ -1,9 +1,10 @@
/* /*
* Copyright 2008-2009, Haiku, Inc. All rights reserved. * Copyright 2008-2010, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Fredrik Modéen <fredrik@modeen.se> * Fredrik Modéen <fredrik@modeen.se>
* Stephan Aßmus <superstippi@gmx.de>
*/ */
#include "SettingsWindow.h" #include "SettingsWindow.h"
@ -261,10 +262,6 @@ SettingsWindow::SettingsWindow(BRect frame)
view->AddChild(bbox); view->AddChild(bbox);
AddChild(view); AddChild(view);
#endif #endif
// disable currently unsupported features
fLoopMoviesCB->SetEnabled(false);
fLoopSoundsCB->SetEnabled(false);
} }