104 friend class ossia::scenario;
107 using container = ossia::small_vector<std::shared_ptr<time_event>, 2>;
108 using iterator = container::iterator;
109 using const_iterator = container::const_iterator;
119 [[nodiscard]]
time_value get_date()
const noexcept;
122 [[nodiscard]]
const expression& get_expression()
const noexcept;
131 time_sync& set_expression(expression_ptr)
noexcept;
141 expression_ptr = expressions::make_expression_true());
142 iterator insert(const_iterator, std::shared_ptr<time_event>);
143 void remove(
const std::shared_ptr<time_event>&);
154 [[nodiscard]]
bool is_observing_expression() const noexcept;
155 [[nodiscard]]
bool is_evaluating() const noexcept;
159 void start_trigger_request() noexcept;
160 void end_trigger_request() noexcept;
169 [[nodiscard]]
bool is_autotrigger() const noexcept;
170 void set_autotrigger(
bool) noexcept;
172 [[nodiscard]]
bool is_start() const noexcept;
173 void set_start(
bool) noexcept;
176 void observe_expression(
bool);
177 void observe_expression(
bool,
ossia::expressions::expression_result_callback cb);
186 [[nodiscard]]
bool muted() const noexcept {
return m_muted; }
194 enum class status : uint8_t
200 [[nodiscard]] status get_status() const noexcept {
return m_status; }
202 void set_sync_rate(
double syncRatio)
noexcept { m_sync_rate = syncRatio; }
203 [[nodiscard]]
double get_sync_rate() const noexcept {
return m_sync_rate; }
204 [[nodiscard]]
bool has_sync_rate() const noexcept {
return m_sync_rate > 0; }
206 void set_trigger_date(time_value v)
noexcept
209 callbacks.trigger_date_fixed(v);
211 [[nodiscard]] time_value get_trigger_date() const noexcept {
return m_trigger_date; }
212 [[nodiscard]]
bool has_trigger_date() const noexcept
214 return !m_trigger_date.infinite();
217 void set_is_being_triggered(
bool v)
noexcept;
218 [[nodiscard]]
bool is_being_triggered() const noexcept {
return m_is_being_triggered; }
221 ossia::expression_ptr m_expression;
222 container m_timeEvents;
224 std::optional<expressions::expression_callback_iterator> m_callback;
226 double m_sync_rate = 0.;
228 std::atomic_bool trigger_request{};
229 time_value m_trigger_date = Infinite;
233 bool m_evaluating : 1;
235 bool m_autotrigger : 1;
236 bool m_is_being_triggered : 1;