forked from surge-synthesizer/surge
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Implement a ModEditorWindow class which does basic text dump 2. Hook it up to the RMB sliders 3. Clean up the copyright headers on the new code I've been working on Addresses surge-synthesizer#2049
- Loading branch information
Showing
11 changed files
with
208 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
** Surge Synthesizer is Free and Open Source Software | ||
** | ||
** Surge is made available under the Gnu General Public License, v3.0 | ||
** https://www.gnu.org/licenses/gpl-3.0.en.html | ||
** | ||
** Copyright 2004-2021 by various individuals as described by the Git transaction log | ||
** | ||
** All source at: https://github.com/surge-synthesizer/surge.git | ||
** | ||
** Surge was a commercial product from 2004-2018, with Copyright and ownership | ||
** in that period held by Claes Johanson at Vember Audio. Claes made Surge | ||
** open source in September 2018. | ||
*/ | ||
|
||
#include "ModulationEditor.h" | ||
#include "SurgeSynthesizer.h" | ||
#include "SurgeGUIEditor.h" | ||
#include "RuntimeFont.h" | ||
#include <sstream> | ||
|
||
ModulationEditor::ModulationEditor(SurgeGUIEditor *ed, SurgeSynthesizer *s) | ||
: ed(ed), synth(s), juce::Component("Modulation Editor") | ||
{ | ||
setSize(750, 450); // FIXME | ||
|
||
textBox = std::make_unique<juce::TextEditor>("Mod editor text box"); | ||
textBox->setMultiLine(true, false); | ||
textBox->setBounds(5, 5, 740, 440); | ||
textBox->setFont(Surge::GUI::getFontManager()->getLatoAtSize(9)); | ||
addAndMakeVisible(*textBox); | ||
|
||
/* | ||
* Obviously clean this up | ||
*/ | ||
std::ostringstream oss; | ||
auto append = [&oss, this](const std::string &type, const std::vector<ModulationRouting> &r) { | ||
if (r.empty()) | ||
return; | ||
oss << type << "\n"; | ||
char nm[TXT_SIZE], dst[TXT_SIZE]; | ||
for (auto q : r) | ||
{ | ||
SurgeSynthesizer::ID ptagid; | ||
if (synth->fromSynthSideId(q.destination_id, ptagid)) | ||
synth->getParameterName(ptagid, nm); | ||
; | ||
oss << " > " << this->ed->modulatorName(q.source_id, false) << " to " << nm << " at " | ||
<< q.depth << "\n"; | ||
} | ||
}; | ||
append("Global", synth->storage.getPatch().modulation_global); | ||
append("Scene A Voice", synth->storage.getPatch().scene[0].modulation_voice); | ||
append("Scene A Scene", synth->storage.getPatch().scene[0].modulation_scene); | ||
append("Scene B Voice", synth->storage.getPatch().scene[1].modulation_voice); | ||
append("Scene B Scene", synth->storage.getPatch().scene[1].modulation_scene); | ||
|
||
textBox->setText(oss.str()); | ||
} | ||
|
||
ModulationEditor::~ModulationEditor() = default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
** Surge Synthesizer is Free and Open Source Software | ||
** | ||
** Surge is made available under the Gnu General Public License, v3.0 | ||
** https://www.gnu.org/licenses/gpl-3.0.en.html | ||
** | ||
** Copyright 2004-2021 by various individuals as described by the Git transaction log | ||
** | ||
** All source at: https://github.com/surge-synthesizer/surge.git | ||
** | ||
** Surge was a commercial product from 2004-2018, with Copyright and ownership | ||
** in that period held by Claes Johanson at Vember Audio. Claes made Surge | ||
** open source in September 2018. | ||
*/ | ||
|
||
#ifndef SURGE_XT_MODULATIONEDITOR_H | ||
#define SURGE_XT_MODULATIONEDITOR_H | ||
|
||
#include <JuceHeader.h> | ||
|
||
class SurgeGUIEditor; | ||
class SurgeSynthesizer; | ||
|
||
class ModulationEditor : public juce::Component | ||
{ | ||
public: | ||
ModulationEditor(SurgeGUIEditor *ed, SurgeSynthesizer *s); | ||
~ModulationEditor(); | ||
|
||
std::unique_ptr<juce::TextEditor> textBox; | ||
SurgeGUIEditor *ed; | ||
SurgeSynthesizer *synth; | ||
}; | ||
|
||
#endif // SURGE_XT_MODULATIONEDITOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters