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:
@@ -114,6 +114,8 @@ Controller::Controller()
|
|||||||
{
|
{
|
||||||
Settings::Default()->AddListener(&fGlobalSettingsListener);
|
Settings::Default()->AddListener(&fGlobalSettingsListener);
|
||||||
_AdoptGlobalSettings();
|
_AdoptGlobalSettings();
|
||||||
|
|
||||||
|
fAutoplay = fAutoplaySetting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -189,8 +191,10 @@ Controller::SetTo(const entry_ref &ref)
|
|||||||
|
|
||||||
if (fRef == ref) {
|
if (fRef == ref) {
|
||||||
if (InitCheck() == B_OK) {
|
if (InitCheck() == B_OK) {
|
||||||
SetPosition(0.0);
|
if (fAutoplay) {
|
||||||
StartPlaying();
|
SetPosition(0.0);
|
||||||
|
StartPlaying(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -488,6 +492,8 @@ Controller::Stop()
|
|||||||
|
|
||||||
StopPlaying();
|
StopPlaying();
|
||||||
SetPosition(0.0);
|
SetPosition(0.0);
|
||||||
|
|
||||||
|
fAutoplay = fAutoplaySetting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -499,6 +505,7 @@ Controller::Play()
|
|||||||
BAutolock _(this);
|
BAutolock _(this);
|
||||||
|
|
||||||
StartPlaying();
|
StartPlaying();
|
||||||
|
fAutoplay = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -510,6 +517,8 @@ Controller::Pause()
|
|||||||
BAutolock _(this);
|
BAutolock _(this);
|
||||||
|
|
||||||
PausePlaying();
|
PausePlaying();
|
||||||
|
|
||||||
|
fAutoplay = fAutoplaySetting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -520,8 +529,11 @@ Controller::TogglePlaying()
|
|||||||
|
|
||||||
BAutolock _(this);
|
BAutolock _(this);
|
||||||
|
|
||||||
if (InitCheck() == B_OK)
|
if (InitCheck() == B_OK) {
|
||||||
NodeManager::TogglePlaying();
|
NodeManager::TogglePlaying();
|
||||||
|
|
||||||
|
fAutoplay = IsPlaying() || fAutoplaySetting;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -784,7 +796,7 @@ Controller::_AdoptGlobalSettings()
|
|||||||
mpSettings settings = Settings::CurrentSettings();
|
mpSettings settings = Settings::CurrentSettings();
|
||||||
// thread safe
|
// thread safe
|
||||||
|
|
||||||
fAutoplay = settings.autostart;
|
fAutoplaySetting = settings.autostart;
|
||||||
// not yet used:
|
// not yet used:
|
||||||
fLoopMovies = settings.loopMovie;
|
fLoopMovies = settings.loopMovie;
|
||||||
fLoopSounds = settings.loopSound;
|
fLoopSounds = settings.loopSound;
|
||||||
|
|||||||
@@ -183,7 +183,12 @@ private:
|
|||||||
bigtime_t fLastSeekEventTime;
|
bigtime_t fLastSeekEventTime;
|
||||||
|
|
||||||
ListenerAdapter fGlobalSettingsListener;
|
ListenerAdapter fGlobalSettingsListener;
|
||||||
|
|
||||||
|
bool fAutoplaySetting;
|
||||||
|
// maintains the auto-play setting
|
||||||
bool fAutoplay;
|
bool fAutoplay;
|
||||||
|
// is true if the player is already playing
|
||||||
|
// otherwise it's the same as fAutoplaySetting
|
||||||
bool fLoopMovies;
|
bool fLoopMovies;
|
||||||
bool fLoopSounds;
|
bool fLoopSounds;
|
||||||
uint32 fBackgroundMovieVolumeMode;
|
uint32 fBackgroundMovieVolumeMode;
|
||||||
|
|||||||
Reference in New Issue
Block a user