#pragma once #include "./frame_stream2.hpp" #include "./audio_stream.hpp" #include #include #include #include #include // we dont have to multiplex ourself, because sdl streams and virtual devices already do this, but we do it anyway using SDLAudioInputFrameStream2Multiplexer = QueuedFrameStream2Multiplexer; using SDLAudioInputFrameStream2 = SDLAudioInputFrameStream2Multiplexer::reader_type_t; // just use the default for now // object components? struct SDLAudioInputDevice : protected SDLAudioInputFrameStream2Multiplexer { std::unique_ptr _stream; std::atomic _thread_should_quit {false}; std::thread _thread; // construct source and start thread // TODO: optimize so the thread is not always running SDLAudioInputDevice(void); // stops the thread and closes the device? ~SDLAudioInputDevice(void); using SDLAudioInputFrameStream2Multiplexer::aquireReader; using SDLAudioInputFrameStream2Multiplexer::releaseReader; }; struct SDLAudioOutputDevice { };