Skip to content

Commit

Permalink
integrate pull request plugdata-team#1858:added argument 1/0 to metho…
Browse files Browse the repository at this point in the history
…d [;pdpluginmode( in develop branch
  • Loading branch information
jyg committed Sep 26, 2024
1 parent 07f3b89 commit d44ce81
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Source/PluginProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1498,8 +1498,10 @@ void PluginProcessor::receiveSysMessage(String const& selector, std::vector<pd::
// TODO: it would be nicer if we could specifically target the correct editor here, instead of picking the first one and praying
auto editors = getEditors();
if(!patches.isEmpty()) {
float pluginModeFloatArgument = 1.0;
if(list.size())
{
pluginModeFloatArgument = list[0].getFloat();
auto pluginModeThemeOrPath = list[0].toString();
if(pluginModeThemeOrPath.endsWith(".plugdatatheme"))
{
Expand All @@ -1521,10 +1523,17 @@ void PluginProcessor::receiveSysMessage(String const& selector, std::vector<pd::
if (!editors.isEmpty()) {
auto* editor = editors[0];
if (auto* cnv = editor->getCurrentCanvas()) {
editor->getTabComponent().openInPluginMode(cnv->patch);
if(pluginModeFloatArgument)
editor->getTabComponent().openInPluginMode(cnv->patch);
else
if (editor->isInPluginMode())
editor->pluginMode->closePluginMode();
}
} else {
patches[0]->openInPluginMode = true;
if(pluginModeFloatArgument)
patches[0]->openInPluginMode = true;
else
patches[0]->openInPluginMode = false;
}
}
break;
Expand Down

0 comments on commit d44ce81

Please sign in to comment.