fActiveVolume should always be set, and only switch volumes if needed

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27666 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2008-09-21 13:01:56 +00:00
parent b34e395eaf
commit 82368346f8
2 changed files with 15 additions and 13 deletions
+3 -1
View File
@@ -35,6 +35,7 @@
#include "AutoDeleter.h" #include "AutoDeleter.h"
#include "ControllerView.h" #include "ControllerView.h"
#include "MainApp.h"
#include "PlaybackState.h" #include "PlaybackState.h"
#include "Settings.h" #include "Settings.h"
#include "VideoView.h" #include "VideoView.h"
@@ -332,11 +333,12 @@ Controller::PlayerActivated(bool active)
{ {
BAutolock _(this); BAutolock _(this);
if (active) { if (active && gMainApp->PlayerCount() > 1) {
if (fActiveVolume != fVolume) if (fActiveVolume != fVolume)
SetVolume(fActiveVolume); SetVolume(fActiveVolume);
} else { } else {
fActiveVolume = fVolume; fActiveVolume = fVolume;
if (gMainApp->PlayerCount() > 1)
switch (fBackgroundMovieVolumeMode) { switch (fBackgroundMovieVolumeMode) {
case mpSettings::BG_MOVIES_MUTED: case mpSettings::BG_MOVIES_MUTED:
SetVolume(0.0); SetVolume(0.0);
+1 -1
View File
@@ -701,7 +701,7 @@ MainWin::WindowActivated(bool active)
MoveBy(diffX, diffY); MoveBy(diffX, diffY);
} }
fController->PlayerActivated(active || gMainApp->PlayerCount() <= 1); fController->PlayerActivated(active);
} }