mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Improved XTra.KrazzY's Mute-On-Pause a bit, so it won't cost any CPU time when it is not used.
Revert old Zelda-TP hack, though it really shouldn't be there... git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4684 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -19,9 +19,12 @@
|
||||
|
||||
#include "AOSoundStream.h"
|
||||
#include "Mixer.h"
|
||||
#include "../../../PluginSpecs/pluginspecs_dsp.h"
|
||||
|
||||
#if defined(HAVE_AO) && HAVE_AO
|
||||
|
||||
extern DSPInitialize g_dspInitialize;
|
||||
|
||||
void AOSound::SoundLoop()
|
||||
{
|
||||
uint_32 numBytesToRender = 256;
|
||||
@ -85,8 +88,14 @@ void AOSound::Update()
|
||||
|
||||
void AOSound::Clear()
|
||||
{
|
||||
memset(realtimeBuffer, 0, sizeof(realtimeBuffer));
|
||||
|
||||
if(!*g_dspInitialize.pEmulatorState)
|
||||
{
|
||||
g_muted = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_muted = true;
|
||||
}
|
||||
Update();
|
||||
}
|
||||
|
||||
@ -107,11 +116,4 @@ AOSound::~AOSound() {
|
||||
// ao_shutdown();
|
||||
}
|
||||
|
||||
void AOSound::Mute(bool bMute) {
|
||||
if((bMute && g_muted) || (!bMute && !g_muted))
|
||||
return;
|
||||
|
||||
g_muted = bMute;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -64,8 +64,6 @@ public:
|
||||
|
||||
virtual void Update();
|
||||
|
||||
virtual void Mute(bool bMute);
|
||||
|
||||
#else
|
||||
public:
|
||||
AOSound(CMixer *mixer) : SoundStream(mixer) {}
|
||||
|
@ -17,12 +17,14 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "Thread.h"
|
||||
|
||||
#include "../../../PluginSpecs/pluginspecs_dsp.h"
|
||||
#include "AlsaSoundStream.h"
|
||||
|
||||
#define BUFFER_SIZE 4096
|
||||
#define BUFFER_SIZE_BYTES (BUFFER_SIZE*2*2)
|
||||
|
||||
extern DSPInitialize g_dspInitialize;
|
||||
|
||||
AlsaSound::AlsaSound(CMixer *mixer) : SoundStream(mixer), thread_data(0), handle(NULL)
|
||||
{
|
||||
mix_buffer = new u8[BUFFER_SIZE_BYTES];
|
||||
@ -53,6 +55,18 @@ void AlsaSound::Stop()
|
||||
thread = NULL;
|
||||
}
|
||||
|
||||
void AlsaSound::Clear()
|
||||
{
|
||||
if(!*g_dspInitialize.pEmulatorState)
|
||||
{
|
||||
g_muted = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_muted = true;
|
||||
}
|
||||
}
|
||||
|
||||
void AlsaSound::Update()
|
||||
{
|
||||
// don't need to do anything here.
|
||||
@ -180,13 +194,6 @@ bool AlsaSound::AlsaInit()
|
||||
NOTICE_LOG(AUDIO, "ALSA successfully initialized.\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
void AlsaSound::Mute(bool bMute) {
|
||||
if((bMute && g_muted) || (!bMute && !g_muted))
|
||||
return;
|
||||
|
||||
g_muted = bMute;
|
||||
}
|
||||
|
||||
void AlsaSound::AlsaShutdown()
|
||||
{
|
||||
|
@ -37,6 +37,7 @@ public:
|
||||
virtual bool Start();
|
||||
virtual void SoundLoop();
|
||||
virtual void Stop();
|
||||
virtual void Clear();
|
||||
|
||||
static bool isValid() {
|
||||
return true;
|
||||
@ -47,8 +48,6 @@ public:
|
||||
|
||||
virtual void Update();
|
||||
|
||||
virtual void Mute(bool bMute);
|
||||
|
||||
private:
|
||||
bool AlsaInit();
|
||||
void AlsaShutdown();
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <cmath>
|
||||
#include <dxerr.h>
|
||||
#include "DSoundStream.h"
|
||||
|
||||
#include "../../../PluginSpecs/pluginspecs_dsp.h"
|
||||
|
||||
extern DSPInitialize g_dspInitialize;
|
||||
@ -172,9 +171,14 @@ void DSound::Update()
|
||||
|
||||
void DSound::Clear()
|
||||
{
|
||||
memset(realtimeBuffer, 0, sizeof(realtimeBuffer));
|
||||
|
||||
Update();
|
||||
if(!*g_dspInitialize.pEmulatorState)
|
||||
{
|
||||
dsBuffer->Play(0, 0, DSBPLAY_LOOPING);
|
||||
}
|
||||
else
|
||||
{
|
||||
dsBuffer->Stop();
|
||||
}
|
||||
}
|
||||
|
||||
void DSound::Stop()
|
||||
@ -193,15 +197,3 @@ void DSound::Stop()
|
||||
thread = NULL;
|
||||
}
|
||||
|
||||
void DSound::Mute(bool bMute) {
|
||||
if((bMute && g_muted) || (!bMute && !g_muted))
|
||||
return;
|
||||
|
||||
if(bMute)
|
||||
dsBuffer->Stop();
|
||||
else
|
||||
dsBuffer->Play(0, 0, DSBPLAY_LOOPING);
|
||||
|
||||
g_muted = bMute;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,6 @@ public:
|
||||
virtual void SetVolume(int volume);
|
||||
virtual void Stop();
|
||||
virtual void Clear();
|
||||
virtual void Mute(bool bMute);
|
||||
static bool isValid() { return true; }
|
||||
virtual bool usesMixer() const { return true; }
|
||||
virtual void Update();
|
||||
|
@ -17,12 +17,15 @@
|
||||
|
||||
#include "aldlist.h"
|
||||
#include "OpenALStream.h"
|
||||
#include "../../../PluginSpecs/pluginspecs_dsp.h"
|
||||
|
||||
#if defined HAVE_OPENAL && HAVE_OPENAL
|
||||
|
||||
#define AUDIO_NUMBUFFERS (4)
|
||||
//#define AUDIO_SERVICE_UPDATE_PERIOD (20)
|
||||
|
||||
extern DSPInitialize g_dspInitialize;
|
||||
|
||||
bool OpenALStream::Start()
|
||||
{
|
||||
ALDeviceList *pDeviceList = NULL;
|
||||
@ -96,9 +99,14 @@ void OpenALStream::Update()
|
||||
|
||||
void OpenALStream::Clear()
|
||||
{
|
||||
memset(realtimeBuffer, 0, sizeof(realtimeBuffer));
|
||||
|
||||
Update();
|
||||
if(!*g_dspInitialize.pEmulatorState)
|
||||
{
|
||||
alSourcePlay(g_uiSource);
|
||||
}
|
||||
else
|
||||
{
|
||||
alSourceStop(g_uiSource);
|
||||
}
|
||||
}
|
||||
|
||||
THREAD_RETURN OpenALStream::ThreadFunc(void* args)
|
||||
@ -178,17 +186,5 @@ void OpenALStream::SoundLoop()
|
||||
|
||||
}
|
||||
|
||||
void OpenALStream::Mute(bool bMute) {
|
||||
if((bMute && g_muted) || (!bMute && !g_muted))
|
||||
return;
|
||||
|
||||
if(bMute && g_uiSource)
|
||||
alSourceStop(g_uiSource);
|
||||
else if(g_uiSource)
|
||||
alSourcePlay(g_uiSource);
|
||||
|
||||
g_muted = bMute;
|
||||
}
|
||||
|
||||
#endif //HAVE_OPENAL
|
||||
|
||||
|
@ -51,7 +51,6 @@ public:
|
||||
virtual void SoundLoop();
|
||||
virtual void Stop();
|
||||
virtual void Clear();
|
||||
virtual void Mute(bool bMute);
|
||||
static bool isValid() { return true; }
|
||||
virtual bool usesMixer() const { return true; }
|
||||
virtual void Update();
|
||||
|
@ -46,7 +46,6 @@ public:
|
||||
virtual void Stop() {}
|
||||
virtual void Update() {}
|
||||
virtual void Clear() {}
|
||||
virtual void Mute(bool bMute) {}
|
||||
virtual void StartLogAudio(const char *filename) {
|
||||
if (! m_logAudio) {
|
||||
m_logAudio = true;
|
||||
|
Reference in New Issue
Block a user