kopia lustrzana https://github.com/jameshball/osci-render
commit
30d0215c96
|
@ -7,6 +7,8 @@ ci/sign.sh
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
.vscode
|
||||||
|
|
||||||
*.pkg
|
*.pkg
|
||||||
*.psd
|
*.psd
|
||||||
*.xcf
|
*.xcf
|
||||||
|
|
|
@ -46,8 +46,7 @@ CommonPluginEditor::CommonPluginEditor(CommonAudioProcessor& p, juce::String app
|
||||||
visualiserSettings.setColour(juce::ResizableWindow::backgroundColourId, Colours::dark);
|
visualiserSettings.setColour(juce::ResizableWindow::backgroundColourId, Colours::dark);
|
||||||
|
|
||||||
recordingSettings.setLookAndFeel(&getLookAndFeel());
|
recordingSettings.setLookAndFeel(&getLookAndFeel());
|
||||||
recordingSettings.setSize(350, 280);
|
recordingSettings.setSize(300, 280);
|
||||||
recordingSettingsWindow.centreWithSize(350, 320);
|
|
||||||
#if JUCE_WINDOWS
|
#if JUCE_WINDOWS
|
||||||
// if not standalone, use native title bar for compatibility with DAWs
|
// if not standalone, use native title bar for compatibility with DAWs
|
||||||
recordingSettingsWindow.setUsingNativeTitleBar(processor.wrapperType == juce::AudioProcessor::WrapperType::wrapperType_Standalone);
|
recordingSettingsWindow.setUsingNativeTitleBar(processor.wrapperType == juce::AudioProcessor::WrapperType::wrapperType_Standalone);
|
||||||
|
@ -63,6 +62,8 @@ CommonPluginEditor::CommonPluginEditor(CommonAudioProcessor& p, juce::String app
|
||||||
|
|
||||||
tooltipDropShadow.setOwner(&tooltipWindow);
|
tooltipDropShadow.setOwner(&tooltipWindow);
|
||||||
|
|
||||||
|
updateTitle();
|
||||||
|
|
||||||
#if SOSCI_FEATURES
|
#if SOSCI_FEATURES
|
||||||
sharedTextureManager.initGL();
|
sharedTextureManager.initGL();
|
||||||
#endif
|
#endif
|
||||||
|
@ -156,9 +157,17 @@ void CommonPluginEditor::updateTitle() {
|
||||||
if (!audioProcessor.currentProjectFile.isEmpty()) {
|
if (!audioProcessor.currentProjectFile.isEmpty()) {
|
||||||
title += " - " + audioProcessor.currentProjectFile;
|
title += " - " + audioProcessor.currentProjectFile;
|
||||||
}
|
}
|
||||||
|
if (currentFileName.isNotEmpty()) {
|
||||||
|
title += " - " + currentFileName;
|
||||||
|
}
|
||||||
getTopLevelComponent()->setName(title);
|
getTopLevelComponent()->setName(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CommonPluginEditor::fileUpdated(juce::String fileName) {
|
||||||
|
currentFileName = fileName;
|
||||||
|
updateTitle();
|
||||||
|
}
|
||||||
|
|
||||||
void CommonPluginEditor::openAudioSettings() {
|
void CommonPluginEditor::openAudioSettings() {
|
||||||
juce::StandalonePluginHolder* standalone = juce::StandalonePluginHolder::getInstance();
|
juce::StandalonePluginHolder* standalone = juce::StandalonePluginHolder::getInstance();
|
||||||
standalone->showAudioSettingsDialog();
|
standalone->showAudioSettingsDialog();
|
||||||
|
@ -172,5 +181,6 @@ void CommonPluginEditor::resetToDefault() {
|
||||||
juce::StandaloneFilterWindow* window = findParentComponentOfClass<juce::StandaloneFilterWindow>();
|
juce::StandaloneFilterWindow* window = findParentComponentOfClass<juce::StandaloneFilterWindow>();
|
||||||
if (window != nullptr) {
|
if (window != nullptr) {
|
||||||
window->resetToDefaultState();
|
window->resetToDefaultState();
|
||||||
|
window->setName(ProjectInfo::projectName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ public:
|
||||||
void saveProject();
|
void saveProject();
|
||||||
void saveProjectAs();
|
void saveProjectAs();
|
||||||
void updateTitle();
|
void updateTitle();
|
||||||
|
void fileUpdated(juce::String fileName);
|
||||||
void openAudioSettings();
|
void openAudioSettings();
|
||||||
void openRecordingSettings();
|
void openRecordingSettings();
|
||||||
void resetToDefault();
|
void resetToDefault();
|
||||||
|
@ -46,20 +47,21 @@ public:
|
||||||
|
|
||||||
juce::String appName;
|
juce::String appName;
|
||||||
juce::String projectFileType;
|
juce::String projectFileType;
|
||||||
|
juce::String currentFileName;
|
||||||
|
|
||||||
#if SOSCI_FEATURES
|
#if SOSCI_FEATURES
|
||||||
SharedTextureManager sharedTextureManager;
|
SharedTextureManager sharedTextureManager;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SOSCI_FEATURES
|
#if SOSCI_FEATURES
|
||||||
int VISUALISER_SETTINGS_HEIGHT = 1250;
|
int VISUALISER_SETTINGS_HEIGHT = 1200;
|
||||||
#else
|
#else
|
||||||
int VISUALISER_SETTINGS_HEIGHT = 800;
|
int VISUALISER_SETTINGS_HEIGHT = 700;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VisualiserSettings visualiserSettings = VisualiserSettings(audioProcessor.visualiserParameters, 3);
|
VisualiserSettings visualiserSettings = VisualiserSettings(audioProcessor.visualiserParameters, 3);
|
||||||
RecordingSettings recordingSettings = RecordingSettings(audioProcessor.recordingParameters);
|
RecordingSettings recordingSettings = RecordingSettings(audioProcessor.recordingParameters);
|
||||||
SettingsWindow recordingSettingsWindow = SettingsWindow("Recording Settings", recordingSettings);
|
SettingsWindow recordingSettingsWindow = SettingsWindow("Recording Settings", recordingSettings, 330, 320, 330, 320);
|
||||||
VisualiserComponent visualiser{
|
VisualiserComponent visualiser{
|
||||||
audioProcessor,
|
audioProcessor,
|
||||||
#if SOSCI_FEATURES
|
#if SOSCI_FEATURES
|
||||||
|
|
|
@ -396,7 +396,7 @@ void OscirenderLookAndFeel::drawCallOutBoxBackground(juce::CallOutBox& box, juce
|
||||||
g.setColour(juce::Colours::black);
|
g.setColour(juce::Colours::black);
|
||||||
g.drawImageAt(cachedImage, 0, 0);
|
g.drawImageAt(cachedImage, 0, 0);
|
||||||
|
|
||||||
g.setColour(Colours::dark);
|
g.setColour(Colours::darker);
|
||||||
g.fillPath(path);
|
g.fillPath(path);
|
||||||
|
|
||||||
g.setColour(juce::Colours::black);
|
g.setColour(juce::Colours::black);
|
||||||
|
|
|
@ -359,6 +359,7 @@ void OscirenderAudioProcessorEditor::updateCodeEditor(bool binaryFile, bool shou
|
||||||
|
|
||||||
// parsersLock MUST be locked before calling this function
|
// parsersLock MUST be locked before calling this function
|
||||||
void OscirenderAudioProcessorEditor::fileUpdated(juce::String fileName, bool shouldOpenEditor) {
|
void OscirenderAudioProcessorEditor::fileUpdated(juce::String fileName, bool shouldOpenEditor) {
|
||||||
|
CommonPluginEditor::fileUpdated(fileName);
|
||||||
settings.fileUpdated(fileName);
|
settings.fileUpdated(fileName);
|
||||||
updateCodeEditor(isBinaryFile(fileName), shouldOpenEditor);
|
updateCodeEditor(isBinaryFile(fileName), shouldOpenEditor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public:
|
||||||
juce::ComponentAnimator codeEditorAnimator;
|
juce::ComponentAnimator codeEditorAnimator;
|
||||||
LuaComponent lua{audioProcessor, *this};
|
LuaComponent lua{audioProcessor, *this};
|
||||||
|
|
||||||
SettingsWindow visualiserSettingsWindow = SettingsWindow("Visualiser Settings", visualiserSettings);
|
SettingsWindow visualiserSettingsWindow = SettingsWindow("Visualiser Settings", visualiserSettings, 550, 500, 550, VISUALISER_SETTINGS_HEIGHT);
|
||||||
|
|
||||||
LuaConsole console;
|
LuaConsole console;
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,7 @@ void OscirenderAudioProcessor::addLuaSlider() {
|
||||||
"Lua Slider " + sliderName,
|
"Lua Slider " + sliderName,
|
||||||
"Controls the value of the Lua variable called slider_" + sliderName.toLowerCase() + ".",
|
"Controls the value of the Lua variable called slider_" + sliderName.toLowerCase() + ".",
|
||||||
"lua" + sliderName,
|
"lua" + sliderName,
|
||||||
VERSION_HINT, 0.0, 0.0, 1.0, 0.001, false
|
VERSION_HINT, 0.0, 0.0, 1.0
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,13 +77,13 @@ public:
|
||||||
"Trace Start",
|
"Trace Start",
|
||||||
"Defines how far into the frame the drawing is started at. This has the effect of 'tracing' out the image from a single dot when animated. By default, we start drawing from the beginning of the frame, so this value is 0.0.",
|
"Defines how far into the frame the drawing is started at. This has the effect of 'tracing' out the image from a single dot when animated. By default, we start drawing from the beginning of the frame, so this value is 0.0.",
|
||||||
"traceStart",
|
"traceStart",
|
||||||
VERSION_HINT, 0.0, 0.0, 1.0, 0.001, 0.001
|
VERSION_HINT, 0.0, 0.0, 1.0, 0.001
|
||||||
),
|
),
|
||||||
new EffectParameter(
|
new EffectParameter(
|
||||||
"Trace Length",
|
"Trace Length",
|
||||||
"Defines how much of the frame is drawn per cycle. This has the effect of 'tracing' out the image from a single dot when animated. By default, we draw the whole frame, corresponding to a value of 1.0.",
|
"Defines how much of the frame is drawn per cycle. This has the effect of 'tracing' out the image from a single dot when animated. By default, we draw the whole frame, corresponding to a value of 1.0.",
|
||||||
"traceLength",
|
"traceLength",
|
||||||
VERSION_HINT, 1.0, 0.0, 1.0, 0.001, 0.001
|
VERSION_HINT, 1.0, 0.0, 1.0, 0.001
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -170,7 +170,7 @@ public:
|
||||||
"Image Stride",
|
"Image Stride",
|
||||||
"Controls the spacing between pixels when drawing an image. Larger values mean more of the image can be drawn, but at a lower fidelity.",
|
"Controls the spacing between pixels when drawing an image. Larger values mean more of the image can be drawn, but at a lower fidelity.",
|
||||||
"imageStride",
|
"imageStride",
|
||||||
VERSION_HINT, 4, 1, 50, 1, false
|
VERSION_HINT, 4, 1, 50, 1
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,17 @@ void Effect::animateValues(double volume) {
|
||||||
auto parameter = parameters[i];
|
auto parameter = parameters[i];
|
||||||
float minValue = parameter->min;
|
float minValue = parameter->min;
|
||||||
float maxValue = parameter->max;
|
float maxValue = parameter->max;
|
||||||
bool lfoEnabled = parameter->lfo != nullptr && parameter->lfo->getValueUnnormalised() != (int)LfoType::Static;
|
bool lfoEnabled = parameter->isLfoEnabled() && parameter->lfo->getValueUnnormalised() != (int)LfoType::Static;
|
||||||
float phase = lfoEnabled ? nextPhase(parameter) : 0.0;
|
float phase = lfoEnabled ? nextPhase(parameter) : 0.0;
|
||||||
float percentage = phase / (2 * std::numbers::pi);
|
float percentage = phase / (2 * std::numbers::pi);
|
||||||
LfoType type = lfoEnabled ? (LfoType)(int)parameter->lfo->getValueUnnormalised() : LfoType::Static;
|
LfoType type = lfoEnabled ? (LfoType)(int)parameter->lfo->getValueUnnormalised() : LfoType::Static;
|
||||||
|
|
||||||
|
if (lfoEnabled) {
|
||||||
|
double originalMin = minValue;
|
||||||
|
minValue = originalMin + (parameter->lfoStartPercent->getValueUnnormalised() / 100.0) * (maxValue - originalMin);
|
||||||
|
maxValue = originalMin + (parameter->lfoEndPercent->getValueUnnormalised() / 100.0) * (maxValue - originalMin);
|
||||||
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case LfoType::Sine:
|
case LfoType::Sine:
|
||||||
actualValues[i] = std::sin(phase) * 0.5 + 0.5;
|
actualValues[i] = std::sin(phase) * 0.5 + 0.5;
|
||||||
|
@ -69,17 +75,20 @@ void Effect::animateValues(double volume) {
|
||||||
actualValues[i] = ((float)rand() / RAND_MAX) * (maxValue - minValue) + minValue;
|
actualValues[i] = ((float)rand() / RAND_MAX) * (maxValue - minValue) + minValue;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
double weight = 1.0;
|
double smoothValueChange = juce::jlimit(SMOOTHING_SPEED_MIN, 1.0, parameter->smoothValueChange.load());
|
||||||
if (parameter->smoothValueChange < 1.0 && parameter->smoothValueChange > SMOOTHING_SPEED_MIN) {
|
smoothValueChange /= 1000;
|
||||||
weight = parameter->smoothValueChange.load() * 192000 / sampleRate;
|
double weight = smoothValueChange * 192000 / sampleRate;
|
||||||
}
|
|
||||||
double newValue;
|
double newValue;
|
||||||
if (parameter->sidechain != nullptr && parameter->sidechain->getBoolValue()) {
|
if (parameter->sidechain != nullptr && parameter->sidechain->getBoolValue()) {
|
||||||
newValue = volume * (maxValue - minValue) + minValue;
|
newValue = volume * (maxValue - minValue) + minValue;
|
||||||
} else {
|
} else {
|
||||||
newValue = parameter->getValueUnnormalised();
|
newValue = parameter->getValueUnnormalised();
|
||||||
}
|
}
|
||||||
|
if (parameter->smoothValueChange.load() >= 1.0) {
|
||||||
|
actualValues[i] = newValue;
|
||||||
|
} else {
|
||||||
actualValues[i] = (1.0 - weight) * actualValues[i] + weight * newValue;
|
actualValues[i] = (1.0 - weight) * actualValues[i] + weight * newValue;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#include <JuceHeader.h>
|
#include <JuceHeader.h>
|
||||||
#include "BooleanParameter.h"
|
#include "BooleanParameter.h"
|
||||||
|
|
||||||
#define SMOOTHING_SPEED_CONSTANT 0.0003
|
#define SMOOTHING_SPEED_CONSTANT 0.3
|
||||||
#define SMOOTHING_SPEED_MIN 0.0001
|
#define SMOOTHING_SPEED_MIN 0.00001
|
||||||
|
|
||||||
class FloatParameter : public juce::AudioProcessorParameterWithID {
|
class FloatParameter : public juce::AudioProcessorParameterWithID {
|
||||||
public:
|
public:
|
||||||
|
@ -337,6 +337,8 @@ public:
|
||||||
std::atomic<double> smoothValueChange = SMOOTHING_SPEED_CONSTANT;
|
std::atomic<double> smoothValueChange = SMOOTHING_SPEED_CONSTANT;
|
||||||
LfoTypeParameter* lfo = new LfoTypeParameter(name + " LFO", paramID + "Lfo", getVersionHint(), 1);
|
LfoTypeParameter* lfo = new LfoTypeParameter(name + " LFO", paramID + "Lfo", getVersionHint(), 1);
|
||||||
FloatParameter* lfoRate = new FloatParameter(name + " LFO Rate", paramID + "LfoRate", getVersionHint(), 1.0f, 0.0f, 10000.0f, 0.001f, "Hz");
|
FloatParameter* lfoRate = new FloatParameter(name + " LFO Rate", paramID + "LfoRate", getVersionHint(), 1.0f, 0.0f, 10000.0f, 0.001f, "Hz");
|
||||||
|
FloatParameter* lfoStartPercent = new FloatParameter(name + " LFO Start", paramID + "LfoStart", getVersionHint(), 0.0f, 0.0f, 100.0f, 0.0001f, "%");
|
||||||
|
FloatParameter* lfoEndPercent = new FloatParameter(name + " LFO End", paramID + "LfoEnd", getVersionHint(), 100.0f, 0.0f, 100.0f, 0.0001f, "%");
|
||||||
BooleanParameter* sidechain = new BooleanParameter(name + " Sidechain Enabled", paramID + "Sidechain", getVersionHint(), false, "Toggles " + name + " Sidechain.");
|
BooleanParameter* sidechain = new BooleanParameter(name + " Sidechain Enabled", paramID + "Sidechain", getVersionHint(), false, "Toggles " + name + " Sidechain.");
|
||||||
std::atomic<float> phase = 0.0f;
|
std::atomic<float> phase = 0.0f;
|
||||||
juce::String description;
|
juce::String description;
|
||||||
|
@ -350,6 +352,12 @@ public:
|
||||||
if (lfoRate != nullptr) {
|
if (lfoRate != nullptr) {
|
||||||
parameters.push_back(lfoRate);
|
parameters.push_back(lfoRate);
|
||||||
}
|
}
|
||||||
|
if (lfoStartPercent != nullptr) {
|
||||||
|
parameters.push_back(lfoStartPercent);
|
||||||
|
}
|
||||||
|
if (lfoEndPercent != nullptr) {
|
||||||
|
parameters.push_back(lfoEndPercent);
|
||||||
|
}
|
||||||
if (sidechain != nullptr) {
|
if (sidechain != nullptr) {
|
||||||
parameters.push_back(sidechain);
|
parameters.push_back(sidechain);
|
||||||
}
|
}
|
||||||
|
@ -357,10 +365,15 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void disableLfo() {
|
void disableLfo() {
|
||||||
|
lfoEnabled = false;
|
||||||
delete lfo;
|
delete lfo;
|
||||||
delete lfoRate;
|
delete lfoRate;
|
||||||
|
delete lfoStartPercent;
|
||||||
|
delete lfoEndPercent;
|
||||||
lfo = nullptr;
|
lfo = nullptr;
|
||||||
lfoRate = nullptr;
|
lfoRate = nullptr;
|
||||||
|
lfoStartPercent = nullptr;
|
||||||
|
lfoEndPercent = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void disableSidechain() {
|
void disableSidechain() {
|
||||||
|
@ -370,11 +383,16 @@ public:
|
||||||
|
|
||||||
void save(juce::XmlElement* xml) {
|
void save(juce::XmlElement* xml) {
|
||||||
FloatParameter::save(xml);
|
FloatParameter::save(xml);
|
||||||
|
xml->setAttribute("smoothValueChange", smoothValueChange.load());
|
||||||
|
|
||||||
if (lfo != nullptr && lfoRate != nullptr) {
|
if (lfoEnabled) {
|
||||||
auto lfoXml = xml->createNewChildElement("lfo");
|
auto lfoXml = xml->createNewChildElement("lfo");
|
||||||
lfo->save(lfoXml);
|
lfo->save(lfoXml);
|
||||||
lfoRate->save(lfoXml);
|
lfoRate->save(lfoXml);
|
||||||
|
auto lfoStartXml = xml->createNewChildElement("lfoStart");
|
||||||
|
lfoStartPercent->save(lfoStartXml);
|
||||||
|
auto lfoEndXml = xml->createNewChildElement("lfoEnd");
|
||||||
|
lfoEndPercent->save(lfoEndXml);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sidechain != nullptr) {
|
if (sidechain != nullptr) {
|
||||||
|
@ -385,8 +403,13 @@ public:
|
||||||
|
|
||||||
void load(juce::XmlElement* xml) {
|
void load(juce::XmlElement* xml) {
|
||||||
FloatParameter::load(xml);
|
FloatParameter::load(xml);
|
||||||
|
if (xml->hasAttribute("smoothValueChange")) {
|
||||||
|
smoothValueChange = xml->getDoubleAttribute("smoothValueChange");
|
||||||
|
} else {
|
||||||
|
smoothValueChange = SMOOTHING_SPEED_CONSTANT;
|
||||||
|
}
|
||||||
|
|
||||||
if (lfo != nullptr && lfoRate != nullptr) {
|
if (lfoEnabled) {
|
||||||
auto lfoXml = xml->getChildByName("lfo");
|
auto lfoXml = xml->getChildByName("lfo");
|
||||||
if (lfoXml != nullptr) {
|
if (lfoXml != nullptr) {
|
||||||
lfo->load(lfoXml);
|
lfo->load(lfoXml);
|
||||||
|
@ -395,6 +418,20 @@ public:
|
||||||
lfo->setValueNotifyingHost(lfo->getValueForText("Static"));
|
lfo->setValueNotifyingHost(lfo->getValueForText("Static"));
|
||||||
lfoRate->setUnnormalisedValueNotifyingHost(1.0f);
|
lfoRate->setUnnormalisedValueNotifyingHost(1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto lfoStartXml = xml->getChildByName("lfoStart");
|
||||||
|
if (lfoStartXml != nullptr) {
|
||||||
|
lfoStartPercent->load(lfoStartXml);
|
||||||
|
} else {
|
||||||
|
lfoStartPercent->setUnnormalisedValueNotifyingHost(0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto lfoEndXml = xml->getChildByName("lfoEnd");
|
||||||
|
if (lfoEndXml != nullptr) {
|
||||||
|
lfoEndPercent->load(lfoEndXml);
|
||||||
|
} else {
|
||||||
|
lfoEndPercent->setUnnormalisedValueNotifyingHost(100.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sidechain != nullptr) {
|
if (sidechain != nullptr) {
|
||||||
|
@ -407,5 +444,12 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EffectParameter(juce::String name, juce::String description, juce::String id, int versionHint, float value, float min, float max, float step = 0.0001, double smoothValueChange = SMOOTHING_SPEED_CONSTANT) : FloatParameter(name, id, versionHint, value, min, max, step), smoothValueChange(smoothValueChange), description(description) {}
|
bool isLfoEnabled() {
|
||||||
|
return lfoEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
EffectParameter(juce::String name, juce::String description, juce::String id, int versionHint, float value, float min, float max, float step = 0.0001) : FloatParameter(name, id, versionHint, value, min, max, step), description(description) {}
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool lfoEnabled = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@ EffectComponent::EffectComponent(Effect& effect, int index) : effect(effect), in
|
||||||
addChildComponent(lfoSlider);
|
addChildComponent(lfoSlider);
|
||||||
addAndMakeVisible(lfo);
|
addAndMakeVisible(lfo);
|
||||||
addAndMakeVisible(label);
|
addAndMakeVisible(label);
|
||||||
addAndMakeVisible(rangeButton);
|
addAndMakeVisible(settingsButton);
|
||||||
|
|
||||||
sidechainEnabled = effect.parameters[index]->sidechain != nullptr;
|
sidechainEnabled = effect.parameters[index]->sidechain != nullptr;
|
||||||
if (sidechainEnabled) {
|
if (sidechainEnabled) {
|
||||||
|
@ -40,12 +40,13 @@ EffectComponent::EffectComponent(Effect& effect, int index) : effect(effect), in
|
||||||
lfo.addItem("Reverse Sawtooth", static_cast<int>(LfoType::ReverseSawtooth));
|
lfo.addItem("Reverse Sawtooth", static_cast<int>(LfoType::ReverseSawtooth));
|
||||||
lfo.addItem("Noise", static_cast<int>(LfoType::Noise));
|
lfo.addItem("Noise", static_cast<int>(LfoType::Noise));
|
||||||
|
|
||||||
rangeButton.setTooltip("Click to change the range of the slider.");
|
settingsButton.setTooltip("Click to change the slider settings, including range.");
|
||||||
|
|
||||||
rangeButton.onClick = [this] {
|
settingsButton.onClick = [this] {
|
||||||
auto range = std::make_unique<EffectRangeComponent>(this);
|
auto settings = std::make_unique<EffectSettingsComponent>(this);
|
||||||
range->setSize(200, 110);
|
settings->setLookAndFeel(&getLookAndFeel());
|
||||||
auto& myBox = juce::CallOutBox::launchAsynchronously(std::move(range), rangeButton.getScreenBounds(), nullptr);
|
settings->setSize(200, 290);
|
||||||
|
auto& myBox = juce::CallOutBox::launchAsynchronously(std::move(settings), settingsButton.getScreenBounds(), nullptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
effect.addListener(index, this);
|
effect.addListener(index, this);
|
||||||
|
@ -153,15 +154,17 @@ void EffectComponent::resized() {
|
||||||
sidechainButton->setBounds(bounds.removeFromRight(20));
|
sidechainButton->setBounds(bounds.removeFromRight(20));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settingsButton.isVisible()) {
|
||||||
|
settingsButton.setBounds(bounds.removeFromRight(20));
|
||||||
|
}
|
||||||
|
|
||||||
bool drawingSmall = bounds.getWidth() < 3.5 * TEXT_WIDTH;
|
bool drawingSmall = bounds.getWidth() < 3.5 * TEXT_WIDTH;
|
||||||
|
|
||||||
if (lfoEnabled) {
|
if (lfoEnabled) {
|
||||||
lfo.setBounds(bounds.removeFromRight(drawingSmall ? 70 : 100).reduced(0, 5));
|
lfo.setBounds(bounds.removeFromRight(drawingSmall ? 70 : 100).reduced(0, 5));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rangeButton.isVisible()) {
|
bounds.removeFromRight(2);
|
||||||
rangeButton.setBounds(bounds.removeFromRight(20));
|
|
||||||
}
|
|
||||||
|
|
||||||
bounds.removeFromLeft(5);
|
bounds.removeFromLeft(5);
|
||||||
|
|
||||||
|
@ -198,7 +201,7 @@ void EffectComponent::handleAsyncUpdate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EffectComponent::setRangeEnabled(bool enabled) {
|
void EffectComponent::setRangeEnabled(bool enabled) {
|
||||||
rangeButton.setVisible(enabled);
|
settingsButton.setVisible(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EffectComponent::setComponent(std::shared_ptr<juce::Component> component) {
|
void EffectComponent::setComponent(std::shared_ptr<juce::Component> component) {
|
||||||
|
|
|
@ -27,12 +27,18 @@ public:
|
||||||
int index = 0;
|
int index = 0;
|
||||||
juce::ComboBox lfo;
|
juce::ComboBox lfo;
|
||||||
|
|
||||||
class EffectRangeComponent : public juce::Component {
|
class EffectSettingsComponent : public juce::Component {
|
||||||
public:
|
public:
|
||||||
EffectRangeComponent(EffectComponent* parent) {
|
EffectSettingsComponent(EffectComponent* parent) {
|
||||||
addAndMakeVisible(popupLabel);
|
addAndMakeVisible(popupLabel);
|
||||||
addAndMakeVisible(min);
|
addAndMakeVisible(min);
|
||||||
addAndMakeVisible(max);
|
addAndMakeVisible(max);
|
||||||
|
addAndMakeVisible(lfoStartLabel);
|
||||||
|
addAndMakeVisible(lfoEndLabel);
|
||||||
|
addAndMakeVisible(lfoStartSlider);
|
||||||
|
addAndMakeVisible(lfoEndSlider);
|
||||||
|
addAndMakeVisible(smoothValueChangeLabel);
|
||||||
|
addAndMakeVisible(smoothValueChangeSlider);
|
||||||
|
|
||||||
EffectParameter* parameter = parent->effect.parameters[parent->index];
|
EffectParameter* parameter = parent->effect.parameters[parent->index];
|
||||||
|
|
||||||
|
@ -61,6 +67,38 @@ public:
|
||||||
parent->slider.setRange(parameter->min, parameter->max, parameter->step);
|
parent->slider.setRange(parameter->min, parameter->max, parameter->step);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
lfoStartLabel.setText("LFO Start", juce::dontSendNotification);
|
||||||
|
lfoStartLabel.setJustificationType(juce::Justification::centred);
|
||||||
|
lfoStartLabel.setFont(juce::Font(14.0f, juce::Font::bold));
|
||||||
|
|
||||||
|
lfoEndLabel.setText("LFO End", juce::dontSendNotification);
|
||||||
|
lfoEndLabel.setJustificationType(juce::Justification::centred);
|
||||||
|
lfoEndLabel.setFont(juce::Font(14.0f, juce::Font::bold));
|
||||||
|
|
||||||
|
lfoStartSlider.setRange(parameter->lfoStartPercent->min, parameter->lfoStartPercent->max, parameter->lfoStartPercent->step);
|
||||||
|
lfoStartSlider.setValue(parameter->lfoStartPercent->getValueUnnormalised(), juce::dontSendNotification);
|
||||||
|
lfoStartSlider.setTextValueSuffix("%");
|
||||||
|
lfoStartSlider.onValueChange = [this, parameter]() {
|
||||||
|
parameter->lfoStartPercent->setUnnormalisedValueNotifyingHost(lfoStartSlider.getValue());
|
||||||
|
};
|
||||||
|
|
||||||
|
lfoEndSlider.setRange(parameter->lfoEndPercent->min, parameter->lfoEndPercent->max, parameter->lfoEndPercent->step);
|
||||||
|
lfoEndSlider.setValue(parameter->lfoEndPercent->getValueUnnormalised(), juce::dontSendNotification);
|
||||||
|
lfoEndSlider.setTextValueSuffix("%");
|
||||||
|
lfoEndSlider.onValueChange = [this, parameter]() {
|
||||||
|
parameter->lfoEndPercent->setUnnormalisedValueNotifyingHost(lfoEndSlider.getValue());
|
||||||
|
};
|
||||||
|
|
||||||
|
smoothValueChangeLabel.setText("Smooth Value Change Speed", juce::dontSendNotification);
|
||||||
|
smoothValueChangeLabel.setJustificationType(juce::Justification::centred);
|
||||||
|
smoothValueChangeLabel.setFont(juce::Font(14.0f, juce::Font::bold));
|
||||||
|
|
||||||
|
smoothValueChangeSlider.setRange(0.01, 1.0, 0.0001);
|
||||||
|
smoothValueChangeSlider.setValue(parameter->smoothValueChange, juce::dontSendNotification);
|
||||||
|
smoothValueChangeSlider.onValueChange = [this, parameter]() {
|
||||||
|
parameter->smoothValueChange = smoothValueChangeSlider.getValue();
|
||||||
|
};
|
||||||
|
|
||||||
popupLabel.setText(parameter->name + " Range", juce::dontSendNotification);
|
popupLabel.setText(parameter->name + " Range", juce::dontSendNotification);
|
||||||
popupLabel.setJustificationType(juce::Justification::centred);
|
popupLabel.setJustificationType(juce::Justification::centred);
|
||||||
popupLabel.setFont(juce::Font(14.0f, juce::Font::bold));
|
popupLabel.setFont(juce::Font(14.0f, juce::Font::bold));
|
||||||
|
@ -71,12 +109,24 @@ public:
|
||||||
popupLabel.setBounds(bounds.removeFromTop(30));
|
popupLabel.setBounds(bounds.removeFromTop(30));
|
||||||
min.setBounds(bounds.removeFromTop(40));
|
min.setBounds(bounds.removeFromTop(40));
|
||||||
max.setBounds(bounds.removeFromTop(40));
|
max.setBounds(bounds.removeFromTop(40));
|
||||||
|
lfoStartLabel.setBounds(bounds.removeFromTop(20));
|
||||||
|
lfoStartSlider.setBounds(bounds.removeFromTop(40));
|
||||||
|
lfoEndLabel.setBounds(bounds.removeFromTop(20));
|
||||||
|
lfoEndSlider.setBounds(bounds.removeFromTop(40));
|
||||||
|
smoothValueChangeLabel.setBounds(bounds.removeFromTop(20));
|
||||||
|
smoothValueChangeSlider.setBounds(bounds.removeFromTop(40));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
juce::Label popupLabel;
|
juce::Label popupLabel;
|
||||||
LabelledTextBox min{"Min"};
|
LabelledTextBox min{"Min"};
|
||||||
LabelledTextBox max{"Max"};
|
LabelledTextBox max{"Max"};
|
||||||
|
juce::Label lfoStartLabel;
|
||||||
|
juce::Label lfoEndLabel;
|
||||||
|
juce::Slider lfoStartSlider;
|
||||||
|
juce::Slider lfoEndSlider;
|
||||||
|
juce::Label smoothValueChangeLabel;
|
||||||
|
juce::Slider smoothValueChangeSlider;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::function<void()> updateToggleState;
|
std::function<void()> updateToggleState;
|
||||||
|
@ -98,7 +148,7 @@ private:
|
||||||
|
|
||||||
juce::Label label;
|
juce::Label label;
|
||||||
|
|
||||||
SvgButton rangeButton = { "rangeButton", BinaryData::range_svg, juce::Colours::white };
|
SvgButton settingsButton = { "settingsButton", BinaryData::cog_svg, juce::Colours::white };
|
||||||
|
|
||||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(EffectComponent)
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(EffectComponent)
|
||||||
};
|
};
|
||||||
|
|
|
@ -901,6 +901,13 @@ Texture VisualiserComponent::makeTexture(int width, int height, GLuint textureID
|
||||||
float borderColor[] = { 0.0f, 0.0f, 0.0f, 1.0f };
|
float borderColor[] = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||||
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);
|
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);
|
||||||
|
|
||||||
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureID, 0);
|
||||||
|
glViewport(0, 0, width, height);
|
||||||
|
|
||||||
|
// Clear it once so we don't see uninitialized pixels
|
||||||
|
glClearColor(0, 0, 0, 0);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0); // Unbind
|
glBindTexture(GL_TEXTURE_2D, 0); // Unbind
|
||||||
|
|
||||||
return { textureID, width, height };
|
return { textureID, width, height };
|
||||||
|
@ -909,8 +916,12 @@ Texture VisualiserComponent::makeTexture(int width, int height, GLuint textureID
|
||||||
void VisualiserComponent::setResolution(int width) {
|
void VisualiserComponent::setResolution(int width) {
|
||||||
using namespace juce::gl;
|
using namespace juce::gl;
|
||||||
|
|
||||||
|
glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer);
|
||||||
|
|
||||||
lineTexture = makeTexture(width, width, lineTexture.id);
|
lineTexture = makeTexture(width, width, lineTexture.id);
|
||||||
renderTexture = makeTexture(width, width, renderTexture.id);
|
renderTexture = makeTexture(width, width, renderTexture.id);
|
||||||
|
|
||||||
|
glBindFramebuffer(GL_FRAMEBUFFER, 0); // Unbind
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualiserComponent::drawLineTexture(const std::vector<float>& xPoints, const std::vector<float>& yPoints, const std::vector<float>& zPoints) {
|
void VisualiserComponent::drawLineTexture(const std::vector<float>& xPoints, const std::vector<float>& yPoints, const std::vector<float>& zPoints) {
|
||||||
|
|
|
@ -548,10 +548,10 @@ private:
|
||||||
|
|
||||||
class SettingsWindow : public juce::DialogWindow {
|
class SettingsWindow : public juce::DialogWindow {
|
||||||
public:
|
public:
|
||||||
SettingsWindow(juce::String name, juce::Component& component) : juce::DialogWindow(name, Colours::darker, true, true), component(component) {
|
SettingsWindow(juce::String name, juce::Component& component, int windowWidth, int windowHeight, int componentWidth, int componentHeight) : juce::DialogWindow(name, Colours::darker, true, true), component(component) {
|
||||||
setContentComponent(&viewport);
|
setContentComponent(&viewport);
|
||||||
centreWithSize(550, 500);
|
centreWithSize(windowWidth, windowHeight);
|
||||||
setResizeLimits(getWidth(), 300, getWidth(), 1080);
|
setResizeLimits(windowWidth, windowHeight, componentWidth, componentHeight);
|
||||||
setResizable(true, false);
|
setResizable(true, false);
|
||||||
viewport.setColour(juce::ScrollBar::trackColourId, juce::Colours::white);
|
viewport.setColour(juce::ScrollBar::trackColourId, juce::Colours::white);
|
||||||
viewport.setViewedComponent(&component, false);
|
viewport.setViewedComponent(&component, false);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginCharacteristicsValue="pluginWantsMidiIn"
|
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginCharacteristicsValue="pluginWantsMidiIn"
|
||||||
pluginManufacturer="jameshball" aaxIdentifier="sh.ball.oscirender"
|
pluginManufacturer="jameshball" aaxIdentifier="sh.ball.oscirender"
|
||||||
cppLanguageStandard="20" projectLineFeed=" " headerPath="./include"
|
cppLanguageStandard="20" projectLineFeed=" " headerPath="./include"
|
||||||
version="2.4.10.3" companyName="James H Ball" companyWebsite="https://osci-render.com"
|
version="2.4.11.0" companyName="James H Ball" companyWebsite="https://osci-render.com"
|
||||||
companyEmail="james@ball.sh" defines="NOMINMAX=1 INTERNET_FLAG_NO_AUTO_REDIRECT=0 SOSCI_FEATURES=1 JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1"
|
companyEmail="james@ball.sh" defines="NOMINMAX=1 INTERNET_FLAG_NO_AUTO_REDIRECT=0 SOSCI_FEATURES=1 JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1"
|
||||||
pluginAUMainType="'aumf'">
|
pluginAUMainType="'aumf'">
|
||||||
<MAINGROUP id="j5Ge2T" name="osci-render">
|
<MAINGROUP id="j5Ge2T" name="osci-render">
|
||||||
|
@ -720,7 +720,7 @@
|
||||||
</GROUP>
|
</GROUP>
|
||||||
</MAINGROUP>
|
</MAINGROUP>
|
||||||
<JUCEOPTIONS JUCE_STRICT_REFCOUNTEDPOINTER="1" JUCE_VST3_CAN_REPLACE_VST2="0"
|
<JUCEOPTIONS JUCE_STRICT_REFCOUNTEDPOINTER="1" JUCE_VST3_CAN_REPLACE_VST2="0"
|
||||||
JUCE_WIN_PER_MONITOR_DPI_AWARE="0" JUCE_WEB_BROWSER="0"/>
|
JUCE_WEB_BROWSER="0"/>
|
||||||
<EXPORTFORMATS>
|
<EXPORTFORMATS>
|
||||||
<LINUX_MAKE targetFolder="Builds/osci-render/LinuxMakefile" smallIcon="pSc1mq"
|
<LINUX_MAKE targetFolder="Builds/osci-render/LinuxMakefile" smallIcon="pSc1mq"
|
||||||
bigIcon="pSc1mq">
|
bigIcon="pSc1mq">
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<JUCERPROJECT id="HH2E72" name="sosci" projectType="audioplug" useAppConfig="0"
|
<JUCERPROJECT id="HH2E72" name="sosci" projectType="audioplug" useAppConfig="0"
|
||||||
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginManufacturer="jameshball"
|
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginManufacturer="jameshball"
|
||||||
aaxIdentifier="sh.ball.sosci" cppLanguageStandard="20" projectLineFeed=" "
|
aaxIdentifier="sh.ball.sosci" cppLanguageStandard="20" projectLineFeed=" "
|
||||||
headerPath="./include" version="1.1.4.3" companyName="James H Ball"
|
headerPath="./include" version="1.1.5.0" companyName="James H Ball"
|
||||||
companyWebsite="https://osci-render.com" companyEmail="james@ball.sh"
|
companyWebsite="https://osci-render.com" companyEmail="james@ball.sh"
|
||||||
defines="NOMINMAX=1 INTERNET_FLAG_NO_AUTO_REDIRECT=0 SOSCI_FEATURES=1 JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1"
|
defines="NOMINMAX=1 INTERNET_FLAG_NO_AUTO_REDIRECT=0 SOSCI_FEATURES=1 JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1"
|
||||||
pluginManufacturerCode="Jhba" pluginCode="Sosc" pluginAUMainType="'aufx'">
|
pluginManufacturerCode="Jhba" pluginCode="Sosc" pluginAUMainType="'aufx'">
|
||||||
|
@ -225,7 +225,7 @@
|
||||||
</GROUP>
|
</GROUP>
|
||||||
</MAINGROUP>
|
</MAINGROUP>
|
||||||
<JUCEOPTIONS JUCE_STRICT_REFCOUNTEDPOINTER="1" JUCE_VST3_CAN_REPLACE_VST2="0"
|
<JUCEOPTIONS JUCE_STRICT_REFCOUNTEDPOINTER="1" JUCE_VST3_CAN_REPLACE_VST2="0"
|
||||||
JUCE_WIN_PER_MONITOR_DPI_AWARE="0" JUCE_WEB_BROWSER="0" JUCE_USE_MP3AUDIOFORMAT="1"/>
|
JUCE_WEB_BROWSER="0" JUCE_USE_MP3AUDIOFORMAT="1"/>
|
||||||
<EXPORTFORMATS>
|
<EXPORTFORMATS>
|
||||||
<LINUX_MAKE targetFolder="Builds/sosci/LinuxMakefile" smallIcon="KigaoN"
|
<LINUX_MAKE targetFolder="Builds/sosci/LinuxMakefile" smallIcon="KigaoN"
|
||||||
bigIcon="KigaoN">
|
bigIcon="KigaoN">
|
||||||
|
|
Ładowanie…
Reference in New Issue