Fix playback of playlists when "auto play files" is off. The playback stopped

after every new file of a playlist.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28005 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-10-12 21:12:07 +00:00
parent 4a4abaf25f
commit 7060b0a220
2 changed files with 21 additions and 4 deletions

View File

@ -114,6 +114,8 @@ Controller::Controller()
{
Settings::Default()->AddListener(&fGlobalSettingsListener);
_AdoptGlobalSettings();
fAutoplay = fAutoplaySetting;
}
@ -189,8 +191,10 @@ Controller::SetTo(const entry_ref &ref)
if (fRef == ref) {
if (InitCheck() == B_OK) {
SetPosition(0.0);
StartPlaying();
if (fAutoplay) {
SetPosition(0.0);
StartPlaying(true);
}
}
return B_OK;
}
@ -488,6 +492,8 @@ Controller::Stop()
StopPlaying();
SetPosition(0.0);
fAutoplay = fAutoplaySetting;
}
@ -499,6 +505,7 @@ Controller::Play()
BAutolock _(this);
StartPlaying();
fAutoplay = true;
}
@ -510,6 +517,8 @@ Controller::Pause()
BAutolock _(this);
PausePlaying();
fAutoplay = fAutoplaySetting;
}
@ -520,8 +529,11 @@ Controller::TogglePlaying()
BAutolock _(this);
if (InitCheck() == B_OK)
if (InitCheck() == B_OK) {
NodeManager::TogglePlaying();
fAutoplay = IsPlaying() || fAutoplaySetting;
}
}
@ -784,7 +796,7 @@ Controller::_AdoptGlobalSettings()
mpSettings settings = Settings::CurrentSettings();
// thread safe
fAutoplay = settings.autostart;
fAutoplaySetting = settings.autostart;
// not yet used:
fLoopMovies = settings.loopMovie;
fLoopSounds = settings.loopSound;

View File

@ -183,7 +183,12 @@ private:
bigtime_t fLastSeekEventTime;
ListenerAdapter fGlobalSettingsListener;
bool fAutoplaySetting;
// maintains the auto-play setting
bool fAutoplay;
// is true if the player is already playing
// otherwise it's the same as fAutoplaySetting
bool fLoopMovies;
bool fLoopSounds;
uint32 fBackgroundMovieVolumeMode;