OSDN Git Service

Boost.MSMでメニュー部分を実装
[shooting3/shootinggame.git] / ShootingGame / SoundDriver.h
index 2de3f27..12dc044 100644 (file)
@@ -16,24 +16,21 @@ namespace sf {
 
   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_;
   };
 }