mirror of https://github.com/stella-emu/stella.git
changed volume hotkey handling
changing volume also enables sound changing phoshor also enables phosphor mode
This commit is contained in:
parent
fa66711c8a
commit
7215f2bbeb
|
@ -194,23 +194,19 @@ bool SoundSDL2::mute(bool state)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool SoundSDL2::toggleMute()
|
||||
{
|
||||
bool oldstate = SDL_GetAudioDeviceStatus(myDevice) == SDL_AUDIO_PAUSED;
|
||||
if(myIsInitializedFlag)
|
||||
{
|
||||
string message;
|
||||
bool enabled = myAudioSettings.enabled();
|
||||
|
||||
SDL_PauseAudioDevice(myDevice, oldstate ? 0 : 1);
|
||||
setEnabled(!enabled);
|
||||
myOSystem.console().initializeAudio();
|
||||
|
||||
message = "Sound ";
|
||||
message += oldstate ? "unmuted" : "muted";
|
||||
string message = "Sound ";
|
||||
message += !enabled ? "unmuted" : "muted";
|
||||
|
||||
myOSystem.frameBuffer().showMessage(message);
|
||||
}
|
||||
|
||||
return oldstate;
|
||||
return enabled;
|
||||
}
|
||||
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void SoundSDL2::setVolume(uInt32 percent)
|
||||
{
|
||||
|
@ -243,6 +239,15 @@ void SoundSDL2::adjustVolume(Int8 direction)
|
|||
|
||||
setVolume(percent);
|
||||
|
||||
// enabled audio if it is currently disabled
|
||||
bool enabled = myAudioSettings.enabled();
|
||||
|
||||
if (percent > 0 && !enabled)
|
||||
{
|
||||
setEnabled(!enabled);
|
||||
myOSystem.console().initializeAudio();
|
||||
}
|
||||
|
||||
// Now show an onscreen message
|
||||
strval << percent;
|
||||
message = "Volume set to ";
|
||||
|
|
|
@ -562,13 +562,13 @@ void Console::changePhosphor(int direction)
|
|||
{
|
||||
int blend = atoi(myProperties.get(Display_PPBlend).c_str());
|
||||
|
||||
if(myOSystem.frameBuffer().tiaSurface().phosphorEnabled())
|
||||
{
|
||||
|
||||
if(direction == +1) // increase blend
|
||||
{
|
||||
if(blend >= 100)
|
||||
{
|
||||
myOSystem.frameBuffer().showMessage("Phosphor blend at maximum");
|
||||
myOSystem.frameBuffer().tiaSurface().enablePhosphor(true, 100);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -579,6 +579,7 @@ void Console::changePhosphor(int direction)
|
|||
if(blend <= 2)
|
||||
{
|
||||
myOSystem.frameBuffer().showMessage("Phosphor blend at minimum");
|
||||
myOSystem.frameBuffer().tiaSurface().enablePhosphor(true, 0);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -592,9 +593,6 @@ void Console::changePhosphor(int direction)
|
|||
myProperties.set(Display_PPBlend, val.str());
|
||||
myOSystem.frameBuffer().showMessage("Phosphor blend " + val.str());
|
||||
myOSystem.frameBuffer().tiaSurface().enablePhosphor(true, blend);
|
||||
}
|
||||
else
|
||||
myOSystem.frameBuffer().showMessage("Phosphor effect disabled");
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
Loading…
Reference in New Issue