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

View File

@ -35,6 +35,7 @@
#include "AutoDeleter.h"
#include "ControllerView.h"
#include "MainApp.h"
#include "PlaybackState.h"
#include "Settings.h"
#include "VideoView.h"
@ -332,22 +333,23 @@ Controller::PlayerActivated(bool active)
{
BAutolock _(this);
if (active) {
if (active && gMainApp->PlayerCount() > 1) {
if (fActiveVolume != fVolume)
SetVolume(fActiveVolume);
} else {
fActiveVolume = fVolume;
switch (fBackgroundMovieVolumeMode) {
case mpSettings::BG_MOVIES_MUTED:
SetVolume(0.0);
break;
case mpSettings::BG_MOVIES_HALF_VLUME:
SetVolume(fVolume * 0.25);
break;
case mpSettings::BG_MOVIES_FULL_VOLUME:
default:
break;
}
if (gMainApp->PlayerCount() > 1)
switch (fBackgroundMovieVolumeMode) {
case mpSettings::BG_MOVIES_MUTED:
SetVolume(0.0);
break;
case mpSettings::BG_MOVIES_HALF_VLUME:
SetVolume(fVolume * 0.25);
break;
case mpSettings::BG_MOVIES_FULL_VOLUME:
default:
break;
}
}
}

View File

@ -701,7 +701,7 @@ MainWin::WindowActivated(bool active)
MoveBy(diffX, diffY);
}
fController->PlayerActivated(active || gMainApp->PlayerCount() <= 1);
fController->PlayerActivated(active);
}