2009-07-28 21:32:10 +00:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2009-01-29 01:53:07 +00:00
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
2009-03-28 08:57:34 +00:00
|
|
|
#ifndef _NULLSOUNDSTREAM_H_
|
|
|
|
#define _NULLSOUNDSTREAM_H_
|
2009-01-29 06:53:31 +00:00
|
|
|
|
2009-01-29 01:53:07 +00:00
|
|
|
#include "SoundStream.h"
|
2009-03-28 23:04:57 +00:00
|
|
|
#include "Mixer.h"
|
|
|
|
|
|
|
|
class NullMixer : public CMixer {
|
|
|
|
public:
|
2009-06-12 14:40:50 +00:00
|
|
|
virtual int Mix(short *sample, int numSamples) {return 0;}
|
2009-03-28 23:04:57 +00:00
|
|
|
virtual void PushSamples(short* samples, int num_stereo_samples,
|
|
|
|
int core_sample_rate) {}
|
|
|
|
};
|
2009-01-29 01:53:07 +00:00
|
|
|
|
|
|
|
class NullSound : public SoundStream
|
2009-01-29 06:53:31 +00:00
|
|
|
{
|
2009-01-29 01:53:07 +00:00
|
|
|
public:
|
2009-03-28 23:04:57 +00:00
|
|
|
NullSound(CMixer *mixer) : SoundStream(mixer)
|
|
|
|
{
|
|
|
|
delete m_mixer;
|
|
|
|
m_mixer = new NullMixer();
|
|
|
|
|
|
|
|
}
|
2009-01-29 06:53:31 +00:00
|
|
|
|
|
|
|
virtual ~NullSound() {}
|
|
|
|
|
2009-01-29 07:37:11 +00:00
|
|
|
static bool isValid() {
|
2009-01-29 06:53:31 +00:00
|
|
|
return true;
|
|
|
|
}
|
2009-01-29 01:53:07 +00:00
|
|
|
|
2009-01-29 06:53:31 +00:00
|
|
|
virtual bool Start() { return true; }
|
2009-02-09 19:50:06 +00:00
|
|
|
|
|
|
|
virtual void Update() {
|
2009-03-26 09:29:14 +00:00
|
|
|
m_mixer->Mix(NULL, 256 >> 2);
|
|
|
|
//(*callback)(NULL, 256 >> 2, 16, sampleRate, 2);
|
2009-02-09 19:50:06 +00:00
|
|
|
}
|
2009-01-29 01:53:07 +00:00
|
|
|
};
|
|
|
|
|
2009-03-28 08:57:34 +00:00
|
|
|
#endif //_NULLSOUNDSTREAM_H_
|