Skip to content

Commit

Permalink
Prevent incrementing preset changing current full expansion (#449)
Browse files Browse the repository at this point in the history
* Prevent incrementing preset changing current full expansion

* Use FullInstrumentExpansion::isEnabled
  • Loading branch information
davidhealey authored Oct 20, 2024
1 parent ae7bca0 commit 8721d51
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions hi_core/hi_core/UserPresetHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ void MainController::UserPresetHandler::incPreset(bool next, bool stayInSameDire
PresetBrowser::DataBaseHelpers::cleanFileList(mc, allPresets);
allPresets.sort();
}
else if(mc->getExpansionHandler().getNumExpansions() > 0)
else if(!FullInstrumentExpansion::isEnabled(mc) && mc->getExpansionHandler().getNumExpansions() > 0)
{
for(int i = 0; i < mc->getExpansionHandler().getNumExpansions(); i++)
{
Expand Down Expand Up @@ -739,24 +739,26 @@ void MainController::UserPresetHandler::incPreset(bool next, bool stayInSameDire
}
}

if(currentlyLoadedFile.isAChildOf(expFolder))
if (!FullInstrumentExpansion::isEnabled(mc))
{
for(int i = 0; i < mc->getExpansionHandler().getNumExpansions(); i++)
if(currentlyLoadedFile.isAChildOf(expFolder))
{
auto e = mc->getExpansionHandler().getExpansion(i);

if(currentlyLoadedFile.isAChildOf(e->getRootFolder()))
for(int i = 0; i < mc->getExpansionHandler().getNumExpansions(); i++)
{
mc->getExpansionHandler().setCurrentExpansion(e, sendNotificationAsync);
break;
auto e = mc->getExpansionHandler().getExpansion(i);

if(currentlyLoadedFile.isAChildOf(e->getRootFolder()))
{
mc->getExpansionHandler().setCurrentExpansion(e, sendNotificationAsync);
break;
}
}
}
else if (wasExpansionPreset)
{
mc->getExpansionHandler().setCurrentExpansion(nullptr, sendNotificationAsync);
}
}
else if (wasExpansionPreset)
{
mc->getExpansionHandler().setCurrentExpansion(nullptr, sendNotificationAsync);
}


loadUserPreset(currentlyLoadedFile);
}
Expand Down

0 comments on commit 8721d51

Please sign in to comment.