mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-10 19:47:40 +01:00
Fixed Null sound
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2783 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
ec8548dc00
commit
5d9871e85e
@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
#include "../../../PluginSpecs/pluginspecs_dsp.h"
|
#include "../../../PluginSpecs/pluginspecs_dsp.h"
|
||||||
|
|
||||||
//extern bool log_ai;
|
|
||||||
extern DSPInitialize g_dspInitialize;
|
extern DSPInitialize g_dspInitialize;
|
||||||
|
|
||||||
bool DSound::CreateBuffer()
|
bool DSound::CreateBuffer()
|
||||||
@ -66,10 +65,6 @@ bool DSound::WriteDataToBuffer(DWORD dwOffset, // Our own write
|
|||||||
DWORD dwSoundBytes) // Size of block to copy.
|
DWORD dwSoundBytes) // Size of block to copy.
|
||||||
{
|
{
|
||||||
// I want to record the regular audio to, how do I do that?
|
// 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;
|
void *ptr1, *ptr2;
|
||||||
DWORD numBytes1, numBytes2;
|
DWORD numBytes1, numBytes2;
|
||||||
|
@ -64,9 +64,6 @@ void CMixer::Mix(short *samples, int numSamples)
|
|||||||
|
|
||||||
void CMixer::PushSamples(short *samples, int num_stereo_samples, int core_sample_rate)
|
void CMixer::PushSamples(short *samples, int num_stereo_samples, int core_sample_rate)
|
||||||
{
|
{
|
||||||
if (!soundStream)
|
|
||||||
return;
|
|
||||||
|
|
||||||
push_sync.Enter();
|
push_sync.Enter();
|
||||||
if (m_queueSize == 0)
|
if (m_queueSize == 0)
|
||||||
{
|
{
|
||||||
|
@ -31,10 +31,10 @@ public:
|
|||||||
CMixer() : m_sampleRate(48000),m_bits(16),m_channels(2), m_mode(2), m_HLEready(false),m_queueSize(0) {}
|
CMixer() : m_sampleRate(48000),m_bits(16),m_channels(2), m_mode(2), m_HLEready(false),m_queueSize(0) {}
|
||||||
|
|
||||||
// Called from audio threads
|
// Called from audio threads
|
||||||
void Mix(short *sample, int numSamples);
|
virtual void Mix(short *sample, int numSamples);
|
||||||
|
|
||||||
// Called from main thread
|
// 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) {}
|
virtual void Premix(short *samples, int numSamples) {}
|
||||||
|
|
||||||
|
@ -19,11 +19,24 @@
|
|||||||
#define _NULLSOUNDSTREAM_H_
|
#define _NULLSOUNDSTREAM_H_
|
||||||
|
|
||||||
#include "SoundStream.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
|
class NullSound : public SoundStream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NullSound(CMixer *mixer) : SoundStream(mixer) {}
|
NullSound(CMixer *mixer) : SoundStream(mixer)
|
||||||
|
{
|
||||||
|
delete m_mixer;
|
||||||
|
m_mixer = new NullMixer();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~NullSound() {}
|
virtual ~NullSound() {}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ enum {BUF_SIZE = 32*1024};
|
|||||||
|
|
||||||
WaveFileWriter::WaveFileWriter()
|
WaveFileWriter::WaveFileWriter()
|
||||||
{
|
{
|
||||||
|
file = NULL;
|
||||||
conv_buffer = 0;
|
conv_buffer = 0;
|
||||||
skip_silence = false;
|
skip_silence = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user