gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit 5b4cb60f6506cb907b58cbb3d11ca8c3c45484dd
parent 4b25b632fe3aa23f926756999775fc922127c2ef
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Thu,  6 Mar 2025 23:54:09 +0100

add "Copy to User Wave" for a wave

Diffstat:
Msource/xtJucePlugin/weWaveTreeItem.cpp | 13+++++++++++--
Msource/xtJucePlugin/xtWaveEditor.cpp | 48++++++++++++++++++++++--------------------------
Msource/xtJucePlugin/xtWaveEditor.h | 5+----
3 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/source/xtJucePlugin/weWaveTreeItem.cpp b/source/xtJucePlugin/weWaveTreeItem.cpp @@ -170,10 +170,19 @@ namespace xtJucePlugin if(selectedTableId.isValid()) { - const auto subMenu = m_editor.createCopyToSelectedTableMenu(m_waveIndex); - menu.addSubMenu("Copy to current Control Table", subMenu); + const auto subMenuCT = m_editor.createCopyToSelectedTableMenu(m_waveIndex); + menu.addSubMenu("Copy to current Control Table...", subMenuCT); } + const auto subMenuUW = WaveEditor::createRamWavesPopupMenu([this](const xt::WaveId _dest) + { + if (m_editor.getData().copyWave(_dest, m_waveIndex)) + { + m_editor.getData().sendWaveToDevice(_dest); + m_editor.setSelectedWave(_dest); + } + }); + menu.addSubMenu("Copy to User Wave...", subMenuUW); menu.showMenuAsync({}); } diff --git a/source/xtJucePlugin/xtWaveEditor.cpp b/source/xtJucePlugin/xtWaveEditor.cpp @@ -113,7 +113,7 @@ namespace xtJucePlugin toggleWavePreview(false); } - void WaveEditor::onWaveDataChanged(const xt::WaveData& _data) const + void WaveEditor::onWaveDataChanged(const xt::WaveData&) const { } @@ -133,31 +133,6 @@ namespace xtJucePlugin return true; } - void WaveEditor::saveWavetable() - { - } - - juce::PopupMenu WaveEditor::createRamWavesPopupMenu(const std::function<void(xt::WaveId)>& _callback) - { - juce::PopupMenu subMenu; - - uint16_t count = 0; - for (uint16_t i = xt::wave::g_firstRamWaveIndex; i < xt::wave::g_firstRamWaveIndex + xt::wave::g_ramWaveCount; ++i) - { - const auto id = xt::WaveId(i); - subMenu.addItem(WaveTreeItem::getWaveName(id), true, false, [id, _callback] - { - _callback(id); - }); - - ++count; - if ((count % 25) == 0) - subMenu.addColumnBreak(); - } - - return subMenu; - } - void WaveEditor::onReceiveWave(const pluginLib::MidiPacket::Data& _data, const std::vector<uint8_t>& _msg) { m_data.onReceiveWave(_msg); @@ -218,6 +193,27 @@ namespace xtJucePlugin return controlTableSlotsMenu; } + juce::PopupMenu WaveEditor::createRamWavesPopupMenu(const std::function<void(xt::WaveId)>& _callback) + { + juce::PopupMenu subMenu; + + uint16_t count = 0; + for (uint16_t i = xt::wave::g_firstRamWaveIndex; i < xt::wave::g_firstRamWaveIndex + xt::wave::g_ramWaveCount; ++i) + { + const auto id = xt::WaveId(i); + subMenu.addItem(WaveTreeItem::getWaveName(id), true, false, [id, _callback] + { + _callback(id); + }); + + ++count; + if ((count % 25) == 0) + subMenu.addColumnBreak(); + } + + return subMenu; + } + void WaveEditor::filesDropped(std::map<xt::WaveId, xt::WaveData>& _waves, std::map<xt::TableId, xt::TableData>& _tables, const juce::StringArray& _files) { _waves.clear(); diff --git a/source/xtJucePlugin/xtWaveEditor.h b/source/xtJucePlugin/xtWaveEditor.h @@ -55,6 +55,7 @@ namespace xtJucePlugin xt::TableId getSelectedTable() const { return m_selectedTable; } juce::PopupMenu createCopyToSelectedTableMenu(xt::WaveId _id); + static juce::PopupMenu createRamWavesPopupMenu(const std::function<void(xt::WaveId)>& _callback); void filesDropped(std::map<xt::WaveId, xt::WaveData>& _waves, std::map<xt::TableId, xt::TableData>& _tables, const juce::StringArray& _files); @@ -76,10 +77,6 @@ namespace xtJucePlugin bool saveWaveTo(xt::WaveId _target); - void saveWavetable(); - - static juce::PopupMenu createRamWavesPopupMenu(const std::function<void(xt::WaveId)>& _callback); - Editor& m_editor; std::unique_ptr<WaveTree> m_waveTree;