AudioPreviewExecutor.hpp
1 #pragma once
2 #include <Process/ExecutionAction.hpp>
3 
4 #include <ossia/dataflow/nodes/media.hpp>
5 #include <ossia/detail/lockfree_queue.hpp>
6 
7 #include <score_plugin_audio_export.h>
8 
9 namespace ossia
10 {
11 class audio_engine;
12 class audio_protocol;
13 }
14 
15 namespace Audio
16 {
17 
18 class SCORE_PLUGIN_AUDIO_EXPORT AudioPreviewExecutor : public Execution::ExecutionAction
19 {
20  static inline AudioPreviewExecutor* m_instance{};
21  SCORE_CONCRETE("333d0fab-a399-40e4-beea-c98ea79c10fa")
22 public:
23  static AudioPreviewExecutor& instance();
24 
25  explicit AudioPreviewExecutor();
26 
27  void endTick(const ossia::audio_tick_state& st) override;
28 
29  struct sound
30  {
31  ossia::audio_handle handle;
32  int channels{};
33  int rate{};
34  };
35 
36  sound current_sound{};
37  int64_t currentPos{};
38  bool playing{};
39  ossia::spsc_queue<sound> queue;
40 };
41 
42 }
Definition: AudioPreviewExecutor.hpp:19
Definition: ExecutionAction.hpp:12
Definition: AudioPreviewExecutor.hpp:30