pull/295/head
Fabian Gonzalez 2025-04-06 14:40:37 -04:00
rodzic 67e5f79970
commit 7952a4cbef
7 zmienionych plików z 13 dodań i 21 usunięć

Wyświetl plik

@ -12,9 +12,7 @@ EffectsComponent::EffectsComponent(OscirenderAudioProcessor& p, OscirenderAudioP
{
setText("Audio Effects");
#if !defined(MIDI_ALWAYS_ENABLED) || (MIDI_ALWAYS_ENABLED == 0)
addAndMakeVisible(frequency);
#endif
frequency.slider.setSkewFactorFromMidPoint(500.0);
frequency.slider.setTextValueSuffix("Hz");

Wyświetl plik

@ -6,10 +6,6 @@
#include "PluginProcessor.h"
#include "components/DraggableListBox.h"
#include "components/EffectsListComponent.h"
#include "components/ComponentList.h"
#include "components/LuaListComponent.h"
#include <juce_gui_basics/juce_gui_basics.h>
#include <juce_gui_extra/juce_gui_extra.h>
class OscirenderAudioProcessorEditor;
class EffectsComponent : public juce::GroupComponent, public juce::ChangeListener {
@ -33,14 +29,5 @@ private:
EffectComponent frequency = EffectComponent(*audioProcessor.frequencyEffect, false);
// Remove preset buttons and chooser
// juce::TextButton loadPresetButton { "Load" };
// juce::TextButton savePresetButton { "Save" };
// std::unique_ptr<juce::FileChooser> presetChooser;
// Remove preset click handlers
// void loadPresetClicked();
// void savePresetClicked();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(EffectsComponent)
};

Wyświetl plik

@ -52,6 +52,7 @@ MainComponent::MainComponent(OscirenderAudioProcessor& p, OscirenderAudioProcess
inputEnabled.onClick = [this] {
audioProcessor.inputEnabled->setBoolValueNotifyingHost(!audioProcessor.inputEnabled->getBoolValue());
};
addAndMakeVisible(fileLabel);
fileLabel.setJustificationType(juce::Justification::centred);
updateFileLabel();

Wyświetl plik

@ -315,7 +315,9 @@ void OscirenderAudioProcessorEditor::addCodeEditor(int index) {
codeDocuments.insert(codeDocuments.begin() + index, codeDocument);
codeEditors.insert(codeEditors.begin() + index, editor);
addChildComponent(*editor);
// I need to disable accessibility otherwise it doesn't work! Appears to be a JUCE issue, very annoying!
editor->setAccessible(false);
// listen for changes to the code editor
codeDocument->addListener(this);
editor->getEditor().setColourScheme(colourScheme);
}
@ -329,6 +331,7 @@ void OscirenderAudioProcessorEditor::removeCodeEditor(int index) {
// parsersLock AND effectsLock must be locked before calling this function
void OscirenderAudioProcessorEditor::updateCodeEditor(bool binaryFile, bool shouldOpenEditor) {
// check if any code editors are visible
bool visible = shouldOpenEditor;
if (!visible) {
for (int i = 0; i < codeEditors.size(); i++) {
@ -353,6 +356,10 @@ void OscirenderAudioProcessorEditor::updateCodeEditor(bool binaryFile, bool shou
codeEditors[i]->setVisible(false);
}
codeEditors[index]->setVisible(true);
// used so that codeDocumentTextInserted and codeDocumentTextDeleted know whether the parserLock
// is held by the message thread or not. We hold the lock in this function, but not when the
// code document is updated by the user editing text. Since both functions are called by the
// message thread, this is safe.
updatingDocumentsWithParserLock = true;
if (index == 0) {
codeEditors[index]->getEditor().loadContent(audioProcessor.customEffect->getCode());
@ -391,6 +398,8 @@ void OscirenderAudioProcessorEditor::changeListenerCallback(juce::ChangeBroadcas
repaint();
} else if (source == &audioProcessor.fileChangeBroadcaster) {
juce::SpinLock::ScopedLockType lock(audioProcessor.parsersLock);
// triggered when the audioProcessor changes the current file (e.g. to Blender)
settings.fileUpdated(audioProcessor.getCurrentFileName());
}
}

Wyświetl plik

@ -10,8 +10,6 @@
#include "components/LuaConsole.h"
#include "visualiser/VisualiserSettings.h"
#include "CommonPluginEditor.h"
#include "MainComponent.h"
#include "PresetComponent.h"
class OscirenderAudioProcessorEditor : public CommonPluginEditor, private juce::CodeDocument::Listener, public juce::AsyncUpdater, public juce::ChangeListener, public juce::FileDragAndDropTarget {
public:

Wyświetl plik

@ -452,7 +452,7 @@ void OscirenderAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer, ju
bool usingInput = inputEnabled->getBoolValue();
bool usingMidi = midiEnabled->getBoolValue();
if (!midiEnabled->getBoolValue()) {
if (!usingMidi) {
midiMessages.clear();
}

Wyświetl plik

@ -81,8 +81,7 @@ void ShapeVoice::renderNextBlock(juce::AudioSampleBuffer& outputBuffer, int star
int numChannels = outputBuffer.getNumChannels();
bool usingMidi = audioProcessor.midiEnabled->getBoolValue();
if (usingMidi) {
if (audioProcessor.midiEnabled->getBoolValue()) {
actualFrequency = frequency * pitchWheelAdjustment;
} else {
actualFrequency = audioProcessor.frequency.load();
@ -135,7 +134,7 @@ void ShapeVoice::renderNextBlock(juce::AudioSampleBuffer& outputBuffer, int star
break;
}
double gain = usingMidi ? adsr.lookup(time) : 1.0;
double gain = audioProcessor.midiEnabled->getBoolValue() ? adsr.lookup(time) : 1.0;
gain *= velocity;
if (numChannels >= 3) {