AudioInterface.hpp
1 #pragma once
2 #include <score/plugins/InterfaceList.hpp>
3 #include <score/plugins/UuidKeySerialization.hpp>
4 
5 #include <score_plugin_audio_export.h>
6 
7 #include <verdigris>
8 class QComboBox;
9 namespace ossia
10 {
11 class audio_engine;
12 }
13 namespace score
14 {
15 struct ApplicationContext;
16 class SettingsCommandDispatcher;
17 }
18 
19 namespace Audio
20 {
21 namespace Settings
22 {
23 class Model;
24 class View;
25 }
26 
27 class SCORE_PLUGIN_AUDIO_EXPORT AudioFactory : public score::InterfaceBase
28 {
29  SCORE_INTERFACE(AudioFactory, "f08e5469-eb29-4c39-9115-1d110cee2369")
30 public:
31  ~AudioFactory() override;
32 
33  virtual bool available() const noexcept = 0;
34  virtual QString prettyName() const = 0;
35  virtual void
36  initialize(Audio::Settings::Model& set, const score::ApplicationContext& ctx)
37  = 0;
38  virtual std::shared_ptr<ossia::audio_engine> make_engine(
39  const Audio::Settings::Model& settings, const score::ApplicationContext& ctx)
40  = 0;
41  virtual QWidget* make_settings(
43  score::SettingsCommandDispatcher&, QWidget* parent)
44  = 0;
45 
46  static QComboBox* addBufferSizeWidget(
47  QWidget& widg, Audio::Settings::Model& m, Audio::Settings::View& v);
48  static QComboBox* addSampleRateWidget(
49  QWidget& widg, Audio::Settings::Model& m, Audio::Settings::View& v);
50 };
51 
52 class AudioFactoryList final : public score::InterfaceList<AudioFactory>
53 {
54 };
55 }
56 
57 Q_DECLARE_METATYPE(UuidKey<Audio::AudioFactory>)
58 W_REGISTER_ARGTYPE(UuidKey<Audio::AudioFactory>)
Definition: AudioInterface.hpp:28
Definition: AudioInterface.hpp:53
Definition: score-plugin-audio/Audio/Settings/Model.hpp:22
Definition: score-plugin-audio/Audio/Settings/View.hpp:19
Definition: UuidKey.hpp:343
Base class for plug-in interfaces.
Definition: Interface.hpp:52
InterfaceList Default implementation of InterfaceListBase.
Definition: InterfaceList.hpp:80
Definition: SettingsCommandDispatcher.hpp:10
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Used to access all the application-wide state and structures.
Definition: ApplicationContext.hpp:24