struct SoundDriver
{
+ typedef std::function<void (boost::shared_array<float> arr,int bufferSize)> ProcessBufferType;
+
SoundDriver();
~SoundDriver();
void Render();
- void ProcessBuffer(boost::shared_array<float> arr,int bufferSize);
+ void Start();
+ void Stop();
+ void DefaultProcessBuffer(boost::shared_array<float> arr,int bufferSize);
+ void SetProcessBufferFunc(ProcessBufferType&& v);
+ void ResetProcessBufferFunc();
+ WAVEFORMATEXTENSIBLE& Format();
private:
- IAudioClient2Ptr audioClient_;
- uint32_t bufferSize_;
- REFERENCE_TIME latency_;
- // IAudioClockAdjustmentPtr audioClockAdjustment_;
- IAudioRenderClientPtr audioRenderClient_;
- WAVEFORMATEXTENSIBLE format_;
- sf::handle_holder eventHolder_;
- std::unique_ptr<sf::Synthesizer> synth_;
- std::unique_ptr<sf::Sequencer> sequencer_;
- boost::shared_array<float> buffer_[2];
- int bufferIndex_;
- int bufferByteCount_;
+ struct impl;
+ std::unique_ptr<impl> impl_;
};
}