Skip to content

Commit

Permalink
[core] Some more fixes to livecoding
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Apr 22, 2024
1 parent 0d9e357 commit 5fc5da9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/plugins/score-plugin-faust/Faust/EffectModel.cpp
Expand Up @@ -527,7 +527,7 @@ FaustEffectComponent::FaustEffectComponent(

commands.run_all();
},
Qt::QueuedConnection);
Qt::DirectConnection);

Execution::Transaction commands{ctx};
reload(commands);
Expand Down
Expand Up @@ -363,6 +363,9 @@ void ScenarioApplicationPlugin::on_documentChanged(
// Load cables
auto& model
= score::IDocument::modelDelegate<Scenario::ScenarioDocumentModel>(*newdoc);

// FIXME : this causes problems when we are reloading from a loaded document
// as the commands are executed before the cables are reloaded
model.finishLoading();
// TODO do this on restore

Expand Down
Expand Up @@ -69,7 +69,9 @@ class EditScript : public score::Command
Dataflow::restoreCables(m_oldCables, ctx);
cmt.inletsChanged();
cmt.outletsChanged();
cmt.programChanged();
if constexpr(requires { cmt.isGpu(); })
if(cmt.isGpu())
cmt.programChanged();
}

static void restoreCables(
Expand Down Expand Up @@ -152,7 +154,9 @@ class EditScript : public score::Command

cmt.inletsChanged();
cmt.outletsChanged();
cmt.programChanged();
if constexpr(requires { cmt.isGpu(); })
if(cmt.isGpu())
cmt.programChanged();
// FIXME if we have it only here, then changing cables fails for the exec nodes
// as in the cable loading, in SetupContext::connectCable(Process::Cable& cable)
// auto it = outlets.find(port_src); fails because the new outlet hasn't yet been created by the component
Expand Down
Expand Up @@ -1180,6 +1180,7 @@ void ScenarioDocumentPresenter::setNewSelection(const Selection& old, const Sele
}
else
{
// NOTE: happens when we delete a cable in full nodal view
qDebug() << "Weird case ?? " << (QObject*)s.begin()->data();
if(process)
clearProcessSelection(process);
Expand Down

0 comments on commit 5fc5da9

Please sign in to comment.