Fixed Null sound

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2783 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-03-28 23:04:57 +00:00
parent ec8548dc00
commit 5d9871e85e
5 changed files with 17 additions and 11 deletions

View File

@ -21,7 +21,6 @@
#include "../../../PluginSpecs/pluginspecs_dsp.h"
//extern bool log_ai;
extern DSPInitialize g_dspInitialize;
bool DSound::CreateBuffer()
@ -66,10 +65,6 @@ bool DSound::WriteDataToBuffer(DWORD dwOffset, // Our own write
DWORD dwSoundBytes) // Size of block to copy.
{
// I want to record the regular audio to, how do I do that?
// Well, it's gonna be a bit tricky. For future work :)
//std::string Data = ArrayToString((const u8*)soundData, dwSoundBytes);
//Console::Print("Data: %s\n\n", Data.c_str());
//if (log_ai) g_wave_writer.AddStereoSamples((const short*)soundData, dwSoundBytes);
void *ptr1, *ptr2;
DWORD numBytes1, numBytes2;

View File

@ -64,9 +64,6 @@ void CMixer::Mix(short *samples, int numSamples)
void CMixer::PushSamples(short *samples, int num_stereo_samples, int core_sample_rate)
{
if (!soundStream)
return;
push_sync.Enter();
if (m_queueSize == 0)
{

View File

@ -31,10 +31,10 @@ public:
CMixer() : m_sampleRate(48000),m_bits(16),m_channels(2), m_mode(2), m_HLEready(false),m_queueSize(0) {}
// Called from audio threads
void Mix(short *sample, int numSamples);
virtual void Mix(short *sample, int numSamples);
// Called from main thread
void PushSamples(short* samples, int num_stereo_samples, int core_sample_rate);
virtual void PushSamples(short* samples, int num_stereo_samples, int core_sample_rate);
virtual void Premix(short *samples, int numSamples) {}

View File

@ -19,11 +19,24 @@
#define _NULLSOUNDSTREAM_H_
#include "SoundStream.h"
#include "Mixer.h"
class NullMixer : public CMixer {
public:
virtual void Mix(short *sample, int numSamples) {}
virtual void PushSamples(short* samples, int num_stereo_samples,
int core_sample_rate) {}
};
class NullSound : public SoundStream
{
public:
NullSound(CMixer *mixer) : SoundStream(mixer) {}
NullSound(CMixer *mixer) : SoundStream(mixer)
{
delete m_mixer;
m_mixer = new NullMixer();
}
virtual ~NullSound() {}

View File

@ -22,6 +22,7 @@ enum {BUF_SIZE = 32*1024};
WaveFileWriter::WaveFileWriter()
{
file = NULL;
conv_buffer = 0;
skip_silence = false;
}