1
0

WineSoundDeviceStub.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * WineSoundDeviceStub.h
  3. * ---------------------
  4. * Purpose: Stub sound device driver class connection to WineSupport Wrapper.
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "openmpt/all/BuildSettings.hpp"
  11. #include "openmpt/sounddevice/SoundDeviceBase.hpp"
  12. #include "../common/ComponentManager.h"
  13. extern "C" {
  14. typedef struct OpenMPT_Wine_Wrapper_SoundDevice OpenMPT_Wine_Wrapper_SoundDevice;
  15. };
  16. OPENMPT_NAMESPACE_BEGIN
  17. class ComponentWineWrapper;
  18. namespace SoundDevice {
  19. class SoundDeviceStub
  20. : public SoundDevice::IBase
  21. {
  22. public:
  23. static std::unique_ptr<SoundDevice::BackendInitializer> BackendInitializer() { return std::make_unique< SoundDevice::BackendInitializer>(); }
  24. static std::vector<SoundDevice::Info> EnumerateDevices(ILogger &logger, SoundDevice::SysInfo sysInfo);
  25. public:
  26. SoundDeviceStub(ILogger &logger, SoundDevice::Info info, SoundDevice::SysInfo sysInfo);
  27. virtual ~SoundDeviceStub();
  28. public:
  29. virtual void SetCallback(SoundDevice::ICallback *callback);
  30. virtual void SetMessageReceiver(SoundDevice::IMessageReceiver *receiver);
  31. virtual SoundDevice::Info GetDeviceInfo() const;
  32. virtual SoundDevice::Caps GetDeviceCaps() const;
  33. virtual SoundDevice::DynamicCaps GetDeviceDynamicCaps(const std::vector<uint32> &baseSampleRates);
  34. virtual bool Init(const SoundDevice::AppInfo &appInfo);
  35. virtual bool Open(const SoundDevice::Settings &settings);
  36. virtual bool Close();
  37. virtual bool Start();
  38. virtual void Stop();
  39. virtual FlagSet<RequestFlags> GetRequestFlags() const;
  40. virtual bool IsInited() const;
  41. virtual bool IsOpen() const;
  42. virtual bool IsAvailable() const;
  43. virtual bool IsPlaying() const;
  44. virtual bool IsPlayingSilence() const;
  45. virtual void StopAndAvoidPlayingSilence();
  46. virtual void EndPlayingSilence();
  47. virtual bool OnIdle();
  48. virtual SoundDevice::Settings GetSettings() const;
  49. virtual SampleFormat GetActualSampleFormat() const;
  50. virtual SoundDevice::BufferAttributes GetEffectiveBufferAttributes() const;
  51. virtual SoundDevice::TimeInfo GetTimeInfo() const;
  52. virtual SoundDevice::StreamPosition GetStreamPosition() const;
  53. virtual bool DebugIsFragileDevice() const;
  54. virtual bool DebugInRealtimeCallback() const;
  55. virtual SoundDevice::Statistics GetStatistics() const;
  56. virtual bool OpenDriverSettings();
  57. private:
  58. ComponentHandle<ComponentWineWrapper> w;
  59. OpenMPT_Wine_Wrapper_SoundDevice * impl;
  60. };
  61. } // namespace SoundDevice
  62. OPENMPT_NAMESPACE_END