mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Mixer: Support GBA samples mixing
This commit is contained in:
@ -30,11 +30,17 @@ public:
|
||||
void PushStreamingSamples(const short* samples, unsigned int num_samples);
|
||||
void PushWiimoteSpeakerSamples(const short* samples, unsigned int num_samples,
|
||||
unsigned int sample_rate);
|
||||
void PushGBASamples(int device_number, const short* samples, unsigned int num_samples);
|
||||
|
||||
unsigned int GetSampleRate() const { return m_sampleRate; }
|
||||
|
||||
void SetDMAInputSampleRate(unsigned int rate);
|
||||
void SetStreamInputSampleRate(unsigned int rate);
|
||||
void SetGBAInputSampleRates(int device_number, unsigned int rate);
|
||||
|
||||
void SetStreamingVolume(unsigned int lvolume, unsigned int rvolume);
|
||||
void SetWiimoteSpeakerVolume(unsigned int lvolume, unsigned int rvolume);
|
||||
void SetGBAVolume(int device_number, unsigned int lvolume, unsigned int rvolume);
|
||||
|
||||
void StartLogDTKAudio(const std::string& filename);
|
||||
void StopLogDTKAudio();
|
||||
@ -57,7 +63,8 @@ private:
|
||||
class MixerFifo final
|
||||
{
|
||||
public:
|
||||
MixerFifo(Mixer* mixer, unsigned sample_rate) : m_mixer(mixer), m_input_sample_rate(sample_rate)
|
||||
MixerFifo(Mixer* mixer, unsigned sample_rate, bool little_endian)
|
||||
: m_mixer(mixer), m_input_sample_rate(sample_rate), m_little_endian(little_endian)
|
||||
{
|
||||
}
|
||||
void DoState(PointerWrap& p);
|
||||
@ -71,6 +78,7 @@ private:
|
||||
private:
|
||||
Mixer* m_mixer;
|
||||
unsigned m_input_sample_rate;
|
||||
bool m_little_endian;
|
||||
std::array<short, MAX_SAMPLES * 2> m_buffer{};
|
||||
std::atomic<u32> m_indexW{0};
|
||||
std::atomic<u32> m_indexR{0};
|
||||
@ -81,9 +89,11 @@ private:
|
||||
u32 m_frac = 0;
|
||||
};
|
||||
|
||||
MixerFifo m_dma_mixer{this, 32000};
|
||||
MixerFifo m_streaming_mixer{this, 48000};
|
||||
MixerFifo m_wiimote_speaker_mixer{this, 3000};
|
||||
MixerFifo m_dma_mixer{this, 32000, false};
|
||||
MixerFifo m_streaming_mixer{this, 48000, false};
|
||||
MixerFifo m_wiimote_speaker_mixer{this, 3000, true};
|
||||
std::array<MixerFifo, 4> m_gba_mixers{MixerFifo{this, 48000, true}, MixerFifo{this, 48000, true},
|
||||
MixerFifo{this, 48000, true}, MixerFifo{this, 48000, true}};
|
||||
unsigned int m_sampleRate;
|
||||
|
||||
bool m_is_stretching = false;
|
||||
|
Reference in New Issue
Block a user