Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ TimeSyncComponent::TimeSyncComponent(

con(element, &Scenario::TimeSyncModel::activeChanged, this,
&TimeSyncComponent::updateTrigger);
con(element, &Scenario::TimeSyncModel::autotriggerChanged, this,
[this](bool b) { in_exec([ts = m_ossia_node, b] { ts->set_autotrigger(b); }); });
con(element, &Scenario::TimeSyncModel::autotriggerChanged, this, [this](bool b) {
// cleanup() resets m_ossia_node while destruction is deferred through the
// exec queue, so model edits can still arrive afterwards: ignore them.
if(!m_ossia_node)
return;
in_exec([ts = m_ossia_node, b] { ts->set_autotrigger(b); });
});
con(element, &Scenario::TimeSyncModel::triggerChanged, this,
&TimeSyncComponent::updateTrigger);

Expand Down Expand Up @@ -173,7 +178,8 @@ void TimeSyncComponent::updateTrigger()
start = m_score_node->isStartPoint();
}

SCORE_ASSERT(m_ossia_node);

@jcelerier jcelerier Jul 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this assert removed ? It's a safeguard: if it triggers it means that something else before it is wrong and has to be fixed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can lower the "expectations" but it leads to worsening of the understandability of the codebase since it creates more potential code paths

if(!m_ossia_node)
return;
in_exec([e = m_ossia_node, exp_ptr, autotrigger, start] {
bool was_observing = e->is_observing_expression();
if(was_observing)
Expand All @@ -191,6 +197,8 @@ void TimeSyncComponent::updateTrigger()
void TimeSyncComponent::updateTriggerTime()
{
OSSIA_ENSURE_CURRENT_THREAD_KIND(ossia::thread_type::Ui);
if(!m_ossia_node)
return;
ossia::musical_sync quantRate = m_score_node->musicalSync();
if(quantRate < 0)
{
Expand Down Expand Up @@ -222,6 +230,8 @@ void TimeSyncComponent::updateTriggerTime()
void TimeSyncComponent::on_GUITrigger()
{
OSSIA_ENSURE_CURRENT_THREAD_KIND(ossia::thread_type::Ui);
if(!m_ossia_node)
return;
in_exec([e = m_ossia_node] {
OSSIA_ENSURE_CURRENT_THREAD_KIND(ossia::thread_type::Audio);
e->start_trigger_request();
Expand Down
Loading