From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- .../openmpt-trunk/mptrack/WineSoundDeviceStub.h | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 Src/external_dependencies/openmpt-trunk/mptrack/WineSoundDeviceStub.h (limited to 'Src/external_dependencies/openmpt-trunk/mptrack/WineSoundDeviceStub.h') diff --git a/Src/external_dependencies/openmpt-trunk/mptrack/WineSoundDeviceStub.h b/Src/external_dependencies/openmpt-trunk/mptrack/WineSoundDeviceStub.h new file mode 100644 index 00000000..6114fbf8 --- /dev/null +++ b/Src/external_dependencies/openmpt-trunk/mptrack/WineSoundDeviceStub.h @@ -0,0 +1,102 @@ +/* + * WineSoundDeviceStub.h + * --------------------- + * Purpose: Stub sound device driver class connection to WineSupport Wrapper. + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#pragma once + +#include "openmpt/all/BuildSettings.hpp" + +#include "openmpt/sounddevice/SoundDeviceBase.hpp" + +#include "../common/ComponentManager.h" + + +extern "C" { + typedef struct OpenMPT_Wine_Wrapper_SoundDevice OpenMPT_Wine_Wrapper_SoundDevice; +}; + + +OPENMPT_NAMESPACE_BEGIN + + +class ComponentWineWrapper; + + +namespace SoundDevice { + + +class SoundDeviceStub + : public SoundDevice::IBase +{ + +public: + + static std::unique_ptr BackendInitializer() { return std::make_unique< SoundDevice::BackendInitializer>(); } + static std::vector EnumerateDevices(ILogger &logger, SoundDevice::SysInfo sysInfo); + +public: + + SoundDeviceStub(ILogger &logger, SoundDevice::Info info, SoundDevice::SysInfo sysInfo); + + virtual ~SoundDeviceStub(); + +public: + + virtual void SetCallback(SoundDevice::ICallback *callback); + virtual void SetMessageReceiver(SoundDevice::IMessageReceiver *receiver); + + virtual SoundDevice::Info GetDeviceInfo() const; + + virtual SoundDevice::Caps GetDeviceCaps() const; + virtual SoundDevice::DynamicCaps GetDeviceDynamicCaps(const std::vector &baseSampleRates); + + virtual bool Init(const SoundDevice::AppInfo &appInfo); + virtual bool Open(const SoundDevice::Settings &settings); + virtual bool Close(); + virtual bool Start(); + virtual void Stop(); + + virtual FlagSet GetRequestFlags() const; + + virtual bool IsInited() const; + virtual bool IsOpen() const; + virtual bool IsAvailable() const; + virtual bool IsPlaying() const; + + virtual bool IsPlayingSilence() const; + virtual void StopAndAvoidPlayingSilence(); + virtual void EndPlayingSilence(); + + virtual bool OnIdle(); + + virtual SoundDevice::Settings GetSettings() const; + virtual SampleFormat GetActualSampleFormat() const; + virtual SoundDevice::BufferAttributes GetEffectiveBufferAttributes() const; + + virtual SoundDevice::TimeInfo GetTimeInfo() const; + virtual SoundDevice::StreamPosition GetStreamPosition() const; + + virtual bool DebugIsFragileDevice() const; + virtual bool DebugInRealtimeCallback() const; + + virtual SoundDevice::Statistics GetStatistics() const; + + virtual bool OpenDriverSettings(); + +private: + + ComponentHandle w; + OpenMPT_Wine_Wrapper_SoundDevice * impl; + +}; + + +} // namespace SoundDevice + +OPENMPT_NAMESPACE_END -- cgit