PipeWireInterface.hpp
1 #pragma once
2 #include <Audio/AudioInterface.hpp>
3 
4 #include <score/command/Dispatchers/SettingsCommandDispatcher.hpp>
5 
6 #include <ossia/audio/pipewire_protocol.hpp>
7 
8 class QFormLayout;
9 #if defined(OSSIA_AUDIO_PIPEWIRE)
10 namespace ossia
11 {
12 struct pipewire_context;
13 }
14 
15 class QSocketNotifier;
16 namespace Audio
17 {
18 
19 class PipeWireAudioFactory final
20  : public QObject
21  , public AudioFactory
22 {
23  SCORE_CONCRETE("687d49cf-b58d-430f-8358-ec02cb50be36")
24 
25 public:
26  PipeWireAudioFactory();
27  ~PipeWireAudioFactory() override;
28 
29  bool available() const noexcept override;
30  void
31  initialize(Audio::Settings::Model& set, const score::ApplicationContext& ctx) override;
32  void rescan();
33 
34  QString prettyName() const override;
35  std::shared_ptr<ossia::audio_engine> make_engine(
36  const Audio::Settings::Model& set, const score::ApplicationContext& ctx) override;
37 
38  void setupSettingsWidget(
39  QWidget* w, QFormLayout* lay, Audio::Settings::Model& m, Audio::Settings::View& v,
40  score::SettingsCommandDispatcher& m_disp);
41  QWidget* make_settings(
42  Audio::Settings::Model& m, Audio::Settings::View& v,
43  score::SettingsCommandDispatcher& m_disp, QWidget* parent) override;
44 
45 private:
46  std::shared_ptr<ossia::pipewire_context> m_client{};
47  QSocketNotifier* m_fd{};
48 };
49 }
50 #endif
Base toolkit upon which the software is built.
Definition: Application.cpp:90