DataflowClock.hpp
1 #pragma once
2 #include <Audio/AudioTick.hpp>
3 #include <Execution/Clock/ClockFactory.hpp>
4 #include <Execution/Clock/DefaultClock.hpp>
5 #include <Execution/DocumentPlugin.hpp>
6 namespace Audio
7 {
8 class ApplicationPlugin;
9 }
10 namespace Process
11 {
12 class Cable;
13 }
14 namespace Dataflow
15 {
16 class DocumentPlugin;
17 class Clock final
18  : public Execution::Clock
19  , public Nano::Observer
20 {
21 public:
22  Clock(const Execution::Context& ctx);
23 
24  ~Clock() override;
25 
26 private:
27  // Clock interface
28  void play_impl(const TimeVal& t) override;
29  void pause_impl() override;
30  void resume_impl() override;
31  void stop_impl() override;
32  bool paused() const override;
33 
34  Execution::DefaultClock m_default;
35  Audio::ApplicationPlugin& m_audio;
37  bool m_paused{};
38 
39  ossia::audio_engine::fun_type m_play_tick{};
40  ossia::audio_engine::fun_type m_pause_tick{};
41 };
42 
44 {
45  SCORE_CONCRETE("e9ae6dec-a10f-414f-9060-b21d15b5d58d")
46 
47 public:
48  QString prettyName() const override;
49  std::unique_ptr<Execution::Clock> make(const Execution::Context& ctx) override;
50 
52  makeTimeFunction(const score::DocumentContext& ctx) const override;
53  Execution::reverse_time_function
54  makeReverseTimeFunction(const score::DocumentContext& ctx) const override;
55 };
56 }
Definition: AudioApplicationPlugin.hpp:19
Definition: DataflowClock.hpp:44
Definition: DataflowClock.hpp:20
Definition: ClockFactory.hpp:63
Definition: ClockFactory.hpp:41
Definition: DefaultClock.hpp:14
Definition: plugins/score-plugin-engine/Execution/DocumentPlugin.hpp:60
smallfun::function< ossia::time_value(const TimeVal &)> time_function
Sets-up and manages the main execution clock.
Definition: ExecutionContext.hpp:66
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Definition: ExecutionContext.hpp:76
Definition: TimeValue.hpp:21
Definition: DocumentContext.hpp:18