51#if defined(OSSIA_SCENARIO_DATAFLOW)
52 const std::shared_ptr<ossia::graph_node> node;
55 auto get_date()
const noexcept {
return m_date; }
56 auto get_offset()
const noexcept {
return m_offset; }
57 double get_internal_speed()
const noexcept {
return m_speed; }
59 double get_speed(
time_value date)
const noexcept;
64 double local_time_factor(
const ossia::token_request& parent_request)
const noexcept;
70 advance_for(
ossia::time_value,
const ossia::token_request& parent_request)
const noexcept;
75 int64_t take_backward_step(
80 void set_speed(
double g)
noexcept { m_speed = g; }
82 void set_parent_speed(
double sp)
noexcept { m_parentSpeed = sp; }
83 tick_transport_info current_transport_info()
const noexcept;
86 tick_current(
ossia::time_value offset,
const ossia::token_request& parent_request);
90 ossia::time_value,
const ossia::token_request& parent_request,
double ratio = 1.0);
99 const ossia::token_request& parent_request, int32_t start_sample = -1,
100 int32_t length_sample = -1);
101 void tick_offset_speed_precomputed(
103 const ossia::token_request& parent_request, int32_t start_sample = -1,
104 int32_t length_sample = -1);
124 static std::shared_ptr<time_interval> create(
137 void start_and_tick();
167 const time_value& get_nominal_duration()
const;
204 void add_time_process(std::shared_ptr<time_process>);
212 void reserve_processes(std::size_t sz);
221 bool running() const noexcept {
return m_running; }
225#if defined(OSSIA_SCENARIO_DATAFLOW)
226 void set_tempo_curve(std::optional<tempo_curve> curve);
228 void set_time_signature_map(std::optional<time_signature_map> map);
229 void set_quarter_duration(
double tu);
231#if defined(OSSIA_EXECUTION_LOG)
238 time_interval(
const time_interval&) =
delete;
239 time_interval(time_interval&&) =
delete;
240 time_interval& operator=(
const time_interval&) =
delete;
241 time_interval& operator=(time_interval&&) =
delete;
251 signature(time_value date,
const ossia::token_request& parent_request)
const noexcept;
253 tempo(time_value date,
const ossia::token_request& parent_request)
const noexcept;
254 double tempo(time_value date)
const noexcept;
258 const ossia::token_request& parent_request);
265 int64_t take_step(
double exact)
noexcept;
267 std::vector<std::shared_ptr<time_process>> m_processes;
268 time_interval::exec_callback m_callback;
273 time_value m_nominal{};
278 time_value m_offset{};
280 time_value m_tick_offset{};
284 int32_t m_tick_start_sample{-1};
285 int32_t m_tick_length_sample{-1};
287 double m_current_tempo{};
289 time_signature_map m_timeSignature{};
290#if defined(OSSIA_SCENARIO_DATAFLOW)
291 tempo_curve m_tempoCurve{};
294 ossia::quarter_note m_musical_start_last_signature{};
296 ossia::quarter_note m_musical_start_last_bar{};
297 ossia::quarter_note m_musical_start_position{};
299 ossia::quarter_note m_musical_end_last_bar{};
300 ossia::quarter_note m_musical_end_position{};
303 double m_date_residue{};
304 double m_globalSpeed{1.};
305 double m_parentSpeed{1.};
306 time_signature m_current_signature{};
307 double m_quarter_duration{ossia::quarter_duration<double>};
308 bool m_running{
false};
309 bool m_hasTempo{
false};
310 bool m_hasSignature{
false};
const std::vector< std::shared_ptr< time_process > > & get_time_processes() const
get time processes attached to the time_interval
Definition time_interval.hpp:216
std::optional< smallfun::function< void(bool, ossia::time_value), 32 > > exec_callback
to get the interval execution back
Definition time_interval.hpp:111