Skip to content

Commit

Permalink
Pass data file component and combobox handles to FE connector
Browse files Browse the repository at this point in the history
  • Loading branch information
firthm01 committed Jan 10, 2024
1 parent 502c3d4 commit 7833e34
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,19 @@ void BinauralMonitoringJuceFrontendConnector::setOscInvertQuatZButton(
setOscInvertQuatZ(cachedOscInvertQuatZ_);
}

void BinauralMonitoringJuceFrontendConnector::setDataFileComponent(
std::shared_ptr<Component> comp) {
dataFileComponent_ = comp;
// TODO: Update visibility
}

void BinauralMonitoringJuceFrontendConnector::setDataFileComboBox(
std::shared_ptr<EarComboBox> comboBox) {
comboBox->addListener(this);
dataFileComboBox_ = comboBox;
// TODO: Set entries and select
}

void BinauralMonitoringJuceFrontendConnector::setRendererStatusLabel(
std::shared_ptr<Label> label) {
rendererStatusLabel_ = label;
Expand Down Expand Up @@ -366,6 +379,11 @@ void BinauralMonitoringJuceFrontendConnector::orientationChange(
});
}

void BinauralMonitoringJuceFrontendConnector::comboBoxChanged(
EarComboBox* comboBoxThatHasChanged) {
// TODO
}

void BinauralMonitoringJuceFrontendConnector::parameterValueChanged(
int parameterIndex, float newValue) {
// Parameter change callback from JUCE Processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "components/orientation.hpp"
#include "components/ear_button.hpp"
#include "components/ear_combo_box.hpp"
#include "components/ear_slider.hpp"
#include "helper/multi_async_updater.h"

Expand All @@ -21,6 +22,7 @@ class BinauralMonitoringJuceFrontendConnector
private AudioProcessorParameter::Listener,
Slider::Listener,
Button::Listener,
ear::plugin::ui::EarComboBox::Listener,
ear::plugin::ui::OrientationView::Listener,
ear::plugin::ListenerOrientation::EulerListener {
public:
Expand Down Expand Up @@ -54,6 +56,8 @@ class BinauralMonitoringJuceFrontendConnector
void setOscInvertQuatZButton(std::shared_ptr<ToggleButton> button);

// Renderer and Filter Set Selection Controls
void setDataFileComponent(std::shared_ptr<Component> comp);
void setDataFileComboBox(std::shared_ptr<EarComboBox> comboBox);
void setRendererStatusLabel(std::shared_ptr<Label> label);

// Listener Orientation Object
Expand Down Expand Up @@ -97,6 +101,9 @@ class BinauralMonitoringJuceFrontendConnector
void orientationChange(
ear::plugin::ListenerOrientation::Euler euler) override;

// EarComboBox::Listener
void comboBoxChanged(EarComboBox* comboBoxThatHasChanged) override;

private:
EarBinauralMonitoringAudioProcessor* p_;
std::map<int, RangedAudioParameter*> parameters_;
Expand All @@ -119,7 +126,9 @@ class BinauralMonitoringJuceFrontendConnector
std::weak_ptr<ToggleButton> oscInvertQuatYButton_;
std::weak_ptr<ToggleButton> oscInvertQuatZButton_;

// Renderer and Filter Set Selection Controls
// Renderer Status and Filter Set Selection Controls
std::weak_ptr<Component> dataFileComponent_;
std::weak_ptr<EarComboBox> dataFileComboBox_;
std::weak_ptr<Label> rendererStatusLabel_;

// Values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ EarBinauralMonitoringAudioProcessorEditor::
EarBinauralMonitoringAudioProcessor* p)
: AudioProcessorEditor(p),
p_(p),
dataFileValueBox(std::make_unique<ValueBoxDataFile>()),
dataFileValueBox(std::make_shared<ValueBoxDataFile>()),
oscValueBox(std::make_unique<ValueBoxOsc>()),
orientationValueBox(std::make_unique<ValueBoxOrientation>()),
header_(std::make_unique<EarHeader>()),
Expand Down Expand Up @@ -79,6 +79,8 @@ EarBinauralMonitoringAudioProcessorEditor::

/* clang-format off */
p->getFrontendConnector()->setRendererStatusLabel(statusLabel);
p->getFrontendConnector()->setDataFileComponent(dataFileValueBox);
p->getFrontendConnector()->setDataFileComboBox(dataFileValueBox->getDataFileComboBox());
p->getFrontendConnector()->setYawView(orientationValueBox->getYawControl());
p->getFrontendConnector()->setPitchView(orientationValueBox->getPitchControl());
p->getFrontendConnector()->setRollView(orientationValueBox->getRollControl());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class EarBinauralMonitoringAudioProcessorEditor

std::unique_ptr<ear::plugin::ui::ValueBoxOrientation> orientationValueBox;
std::unique_ptr<ear::plugin::ui::ValueBoxOsc> oscValueBox;
std::unique_ptr<ear::plugin::ui::ValueBoxDataFile> dataFileValueBox;
std::shared_ptr<ear::plugin::ui::ValueBoxDataFile> dataFileValueBox;

private:
EarBinauralMonitoringAudioProcessor* p_;
Expand Down

0 comments on commit 7833e34

Please sign in to comment.