commit 68e56ba86261c0b34bd55e7fb467d52ca5d1fa5b
parent 07768eb47acf8355b7c22d10121887d23b2dd64c
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Wed, 6 Nov 2024 03:05:56 +0100
add arrangement dump support
Diffstat:
2 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/doc/changelog.txt b/doc/changelog.txt
@@ -23,6 +23,10 @@ OsTIrus:
- [Fix] Fix duplicated factory presets and lost favourites when switching between
TI2 and Snow mode
+Osirus/OsTIrus:
+
+- [Fix] Add support to load Arrangement Dumps that contain 16 Singles and one Multi
+
1.3.21
DSP:
diff --git a/source/virusJucePlugin/VirusEditor.cpp b/source/virusJucePlugin/VirusEditor.cpp
@@ -370,6 +370,52 @@ namespace genericVirusUI
}
else if(results.size() > 1)
{
+ // check if this is one multi and 16 singles and load them as arrangement dump. Ask user for confirmation first
+ if(results.size() == 17)
+ {
+ uint32_t multiCount = 0;
+
+ pluginLib::patchDB::DataList singles;
+ pluginLib::patchDB::Data multi;
+
+ for (const auto& result : results)
+ {
+ if(result.size() < 256)
+ continue;
+
+ const auto cmd = result[6];
+
+ if(cmd == virusLib::SysexMessageType::DUMP_MULTI)
+ {
+ multi = result;
+ ++multiCount;
+ }
+ else if(cmd == virusLib::SysexMessageType::DUMP_SINGLE)
+ {
+ singles.push_back(result);
+ }
+ }
+
+ if(multiCount == 1 && singles.size() == 16)
+ {
+ const auto title = m_processor.getProductName(true) + " - Load Arrangement Dump?";
+ const auto message = "This file contains an arrangement dump, i.e. one Multi and 16 Singles.\nDo you want to replace the current state by this dump?";
+
+ if(1 == juce::NativeMessageBox::showYesNoBox(juce::MessageBoxIconType::QuestionIcon, title, message, nullptr))
+ {
+ setPlayMode(virusLib::PlayMode::PlayModeMulti);
+ c.sendSysEx(multi);
+
+ for(uint8_t i=0; i<static_cast<uint8_t>(singles.size()); ++i)
+ {
+ const auto& single = singles[i];
+ c.modifySingleDump(single, virusLib::BankNumber::EditBuffer, i);
+ c.activatePatch(single, i);
+ }
+ }
+ return;
+ }
+ }
juce::NativeMessageBox::showMessageBox(juce::AlertWindow::InfoIcon, "Information",
"The selected file contains more than one patch. Please add this file as a data source in the Patch Manager instead.\n\n"
"Go to the Patch Manager, right click the 'Data Sources' node and select 'Add File...' to import it."