commit 830390980ec6f060a009d9efd73e995e7775724c
parent cb7df7ce21a076783e8668364e7462cbe006e3f8
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Mon, 10 Mar 2025 20:08:52 +0100
support d&d export to .syx via shift key
Diffstat:
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/doc/changelog.txt b/doc/changelog.txt
@@ -5,6 +5,8 @@ Release Notes
Xenia:
- [Imp] Add support to load MW1 user waves & tables
+- [Imp] Add ability to export to .syx instead of .mid via drag & drop by
+ holding shift while dragging
1.4.4
diff --git a/source/xtJucePlugin/weWaveDesc.cpp b/source/xtJucePlugin/weWaveDesc.cpp
@@ -3,6 +3,8 @@
#include "weWaveTreeItem.h"
#include "xtWaveEditor.h"
+#include "baseLib/filesystem.h"
+
#include "synthLib/sysexToMidi.h"
namespace xtJucePlugin
@@ -28,6 +30,13 @@ namespace xtJucePlugin
if(sysex.empty())
return false;
+ if (_file.getFullPathName().endsWithIgnoreCase(".syx"))
+ {
+ std::vector<uint8_t> data;
+ for (const auto& s : sysex)
+ data.insert(data.end(), s.begin(), s.end());
+ return baseLib::filesystem::writeFile(_file.getFullPathName().toStdString(), data);
+ }
return synthLib::SysexToMidi::write(_file.getFullPathName().toStdString().c_str(), sysex);
}
@@ -52,7 +61,10 @@ namespace xtJucePlugin
else
return DragAndDropObject::getExportFileName(_processor);
- name << ".mid";
+ if (juce::ModifierKeys::getCurrentModifiers().isShiftDown())
+ name << ".syx";
+ else
+ name << ".mid";
return name.str();
}