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 1c141dd5d4d1b960391eb567b7a54d4fc5049379
parent 69339bea317403bcd3fe4f583a9d7763098233d1
Author: trancy2k5 <63122430+trancy2k5@users.noreply.github.com>
Date:   Sun, 23 Jan 2022 16:54:09 +0100

Fix: Show on startup the last rom bank used
Removed commented out code

Diffstat:
Msource/jucePlugin/VirusController.cpp | 17++++++-----------
Msource/jucePlugin/ui2/VirusEditor.cpp | 2+-
Msource/jucePlugin/ui2/Virus_Panel4_ArpEditor.h | 4----
Msource/jucePlugin/ui2/Virus_Panel5_PatchBrowser.cpp | 21+++++++++------------
Msource/jucePlugin/ui2/Virus_Panel5_PatchBrowser.h | 11+----------
5 files changed, 17 insertions(+), 38 deletions(-)

diff --git a/source/jucePlugin/VirusController.cpp b/source/jucePlugin/VirusController.cpp @@ -27,6 +27,11 @@ namespace Virus const uint8_t prg = isMultiMode() ? 0x0 : 0x40; sendSysEx(constructMessage({MessageType::REQUEST_SINGLE, 0x0, prg})); sendSysEx(constructMessage({MessageType::REQUEST_MULTI, 0x0, prg})); + + if (onMsgDone) + { + onMsgDone(); + } }; sendSysEx(constructMessage({MessageType::REQUEST_TOTAL})); sendSysEx(constructMessage({MessageType::REQUEST_ARRANGEMENT})); @@ -2036,17 +2041,7 @@ namespace Virus } else { - if (msg.sysex[6] == MessageType::DUMP_SINGLE) - { - //only call up when we have received the dump first - if (onMsgDone) { - onMsgDone(); - } - } - parseMessage(msg.sysex); - - - + parseMessage(msg.sysex); } } m_virusOut.clear(); diff --git a/source/jucePlugin/ui2/VirusEditor.cpp b/source/jucePlugin/ui2/VirusEditor.cpp @@ -240,7 +240,7 @@ void VirusEditor::updateParts() { String sZero; m_patchName.setText("["+juce::String(m_controller.getCurrentPart()+1) - +"][" + getCurrentPartBankStr(m_controller.getCurrentPartBank(m_controller.getCurrentPart())) + "] " + +"][" + m_patchBrowser->GetSelectBankNum() + "] " + juce::String(processorRef.getController().getCurrentPartProgram(m_controller.getCurrentPart())+1)+": " + patchName, dontSendNotification); } } diff --git a/source/jucePlugin/ui2/Virus_Panel4_ArpEditor.h b/source/jucePlugin/ui2/Virus_Panel4_ArpEditor.h @@ -33,11 +33,7 @@ private: VirusParameterBinding &m_parameterBinding; Buttons::Button3 m_partSelect[16]; - //juce::Label m_partLabels[16]; - //Buttons::PresetButtonDown m_PresetPatch[16]; juce::Label m_presetNames[16]; - //Buttons::PresetButtonRight m_nextPatch[16]; - //Buttons::PresetButtonLeft m_prevPatch[16]; juce::Slider m_partVolumes[16]; juce::Slider m_partPans[16]; diff --git a/source/jucePlugin/ui2/Virus_Panel5_PatchBrowser.cpp b/source/jucePlugin/ui2/Virus_Panel5_PatchBrowser.cpp @@ -97,7 +97,6 @@ PatchBrowser::PatchBrowser(VirusParameterBinding & _parameterBinding, AudioPlugi m_ROMBankSelect.onChange = [this]() { m_LastBankRomNoUsed = m_ROMBankSelect.getSelectedItemIndex()+1; - //m_LastPatchNoUsed = 0; LoadBankNr(m_LastBankRomNoUsed); m_bIsFileMode = false; m_search.setText("", true); @@ -119,17 +118,17 @@ PatchBrowser::~PatchBrowser() void PatchBrowser::IntiPatches() { //Read Last Patch used from config file - //m_LastPatchNoUsed = m_properties->getIntValue("last_patch_no_used", 1) - 1; m_bIsFileMode = m_properties->getBoolValue("is_file_used", false); m_LastBankRomNoUsed = m_properties->getIntValue("last_bank_rom_no_used", 1); m_LastFileUsed = m_properties->getValue("last_file_used", ""); if(!m_bIsFileMode) { + m_controller.setCurrentPartPreset(0,(virusLib::BankNumber)(m_LastBankRomNoUsed),0); m_ROMBankSelect.setSelectedItemIndex(m_LastBankRomNoUsed-1, dontSendNotification); LoadBankNr(m_LastBankRomNoUsed); m_search.setText("", true); - //getParentComponent()->postCommandMessage(VirusEditor::Commands::SelectFirstPatch); + } else { @@ -138,18 +137,11 @@ void PatchBrowser::IntiPatches() const juce::File &file(m_LastFileUsed); LoadPatchesFromFile(file); } - - //getParentComponent()->postCommandMessage(VirusEditor::Commands::SelectFirstPatch); - //getParentComponent()->postCommandMessage(VirusEditor::Commands::UpdateParts); - - //m_patchList.selectRow(m_LastPatchNoUsed,true,true); - //getParentComponent()->postCommandMessage(VirusEditor::Commands::UpdateParts); } void PatchBrowser::SaveSettings() { m_properties->setValue("last_file_used", m_LastFileUsed); - //m_properties->setValue("last_patch_no_used", m_LastPatchNoUsed+1); m_properties->setValue("is_file_used", m_bIsFileMode); m_properties->setValue("last_bank_rom_no_used", m_LastBankRomNoUsed); m_properties->save(); @@ -166,6 +158,13 @@ juce::TableListBox* PatchBrowser::GetTablePatchList() return &m_patchList; } +juce::String PatchBrowser::GetSelectBankNum() +{ + return getCurrentPartBankStr((virusLib::BankNumber)m_LastBankRomNoUsed); +} + + + bool PatchBrowser::GetIsFileMode() { @@ -523,8 +522,6 @@ void PatchBrowser::selectedRowsChanged(int lastRowSelected) { m_controller.setCurrentPartPreset(m_controller.getCurrentPart(), (virusLib::BankNumber) m_LastBankRomNoUsed, m_filteredPatches[idx].progNumber); getParentComponent()->postCommandMessage(VirusEditor::Commands::UpdateParts); } - - //m_LastPatchNoUsed = m_filteredPatches[idx].progNumber; } void PatchBrowser::cellDoubleClicked(int rowNumber, int columnId, const juce::MouseEvent &) diff --git a/source/jucePlugin/ui2/Virus_Panel5_PatchBrowser.h b/source/jucePlugin/ui2/Virus_Panel5_PatchBrowser.h @@ -4,7 +4,6 @@ #include "Virus_Buttons.h" #include <juce_gui_extra/juce_gui_extra.h> #include "../VirusController.h" -//#include "Virus_LookAndFeel.h" const juce::Array<juce::String> ModelList = {"A","B","C","TI"}; @@ -20,11 +19,6 @@ struct Patch uint8_t transpose; }; -/* -struct RomBank -{ - virusLib::BankNumber m_RomNumber; -};*/ class PatchBrowser : public juce::Component, juce::FileBrowserListener, juce::TableListBoxModel { @@ -36,6 +30,7 @@ public: void loadBankFileToRom(const juce::File &file); void savePreset(); bool GetIsFileMode(); + juce::String GetSelectBankNum(); juce::String GetLastPatchSelected(); juce::TableListBox* GetTablePatchList(); @@ -43,7 +38,6 @@ public: private: Virus::LookAndFeelPatchBrowser m_landf; - //Virus::LookAndFeel m_lookAndFeel; VirusParameterBinding &m_parameterBinding; Virus::Controller& m_controller; @@ -60,7 +54,6 @@ private: juce::WildcardFileFilter m_fileFilter; juce::FileBrowserComponent m_bankList; - //juce::TableListBox m_romBankList; juce::TextEditor m_search; juce::Array<Patch> m_patches; juce::Array<Patch> m_filteredPatches; @@ -68,10 +61,8 @@ private: juce::HashMap<juce::String, bool> m_checksums; int loadBankFile(const juce::File &file, const int _startIndex, const bool dedupe); // Inherited via FileBrowserListener - //Buttons::OptionButtonLoadBank m_LoadBank; Buttons::OptionButtonSavePreset m_SavePreset; - //Buttons::Button2 m_btModeRomFile; void LoadBankNr(int iBankNo); void SaveSettings(); void LoadPatchesFromFile(const juce::File &file);