Skip to content

Commit

Permalink
Fix 96 - Reword and improve routing options (#114)
Browse files Browse the repository at this point in the history
* Reword "enter receiving Channel"

* Slightly widen DS pane to fit new text

* Don't show ranges for single channel sources

* Better spacing of meters with wider column

* meterWidth and meterSpacing consts

* Tidy routing combo addTextEntry logic

* Const ints for input plugin desired sizes

* Make const ints statics

* Desired widths/heights in anonymous namespaces

* Ensure correct UI sizing in plugin resized() methods
  • Loading branch information
firthm01 authored Sep 3, 2021
1 parent e9e1004 commit ae82c0f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class ChannelGainsBox : public Component {
void updateChannelGainBounds() {
auto area = getLocalBounds();
for (auto channelGain : channelGains_) {
channelGain->setBounds(area.removeFromLeft(50));
area.removeFromLeft(6);
channelGain->setBounds(area.removeFromLeft(meterWidth));
area.removeFromLeft(meterSpacing);
}
}

Expand All @@ -63,6 +63,9 @@ class ChannelGainsBox : public Component {
private:
std::vector<ChannelGain*> channelGains_;

static const int meterWidth{ 52 };
static const int meterSpacing{ 5 };

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ChannelGainsBox)
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
#include "components/ear_combo_box.hpp"
#include "components/ear_name_text_editor.hpp"

namespace {
String routingLayoutDescriptionAt(int position, int layoutSizeFixed) {
String routingDescription = String(position);
if(layoutSizeFixed > 0) {
routingDescription += String::fromUTF8("-") + String(position + layoutSizeFixed);
}
return routingDescription;
}
}

namespace ear {
namespace plugin {
namespace ui {
Expand Down Expand Up @@ -138,8 +148,7 @@ void DirectSpeakersJuceFrontendConnector::setSpeakerSetup(
routingComboBoxLocked->clearEntries();
auto layoutSizeFixed = layoutSize != 0 ? layoutSize - 1 : layoutSize;
for (int i = 1; i + layoutSizeFixed <= 64; ++i) {
routingComboBoxLocked->addTextEntry(String(i) + String::fromUTF8("") +
String(i + layoutSizeFixed));
routingComboBoxLocked->addTextEntry(routingLayoutDescriptionAt(i, layoutSizeFixed));
}
routingComboBoxLocked->selectEntry(cachedRouting_, sendNotification);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
#include "direct_speakers_plugin_processor.hpp"
#include "direct_speakers_frontend_connector.hpp"

namespace{
const int desiredWidth{ 750 };
const int desiredHeight{ 930 };
}

using namespace ear::plugin::ui;

DirectSpeakersAudioProcessorEditor::DirectSpeakersAudioProcessorEditor(
Expand Down Expand Up @@ -41,8 +46,8 @@ DirectSpeakersAudioProcessorEditor::DirectSpeakersAudioProcessorEditor(
addAndMakeVisible(viewport_.get());

setResizable(true, false);
setResizeLimits(0, 0, 726, 930);
setSize(726, 930);
setResizeLimits(0, 0, desiredWidth, desiredHeight);
setSize(desiredWidth, desiredHeight);
}

DirectSpeakersAudioProcessorEditor::~DirectSpeakersAudioProcessorEditor() {}
Expand All @@ -51,5 +56,5 @@ void DirectSpeakersAudioProcessorEditor::paint(Graphics& g) {}

void DirectSpeakersAudioProcessorEditor::resized() {
viewport_->setBounds(getLocalBounds());
content_->setBounds(0, 0, 726, 930);
content_->setBounds(0, 0, desiredWidth, desiredHeight);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ValueBoxMain : public Component {
routingLabel_->setJustificationType(Justification::right);
addAndMakeVisible(routingLabel_.get());

routingComboBox_->setDefaultText("enter receiving Channel");
routingComboBox_->setDefaultText("Select Scene channel range");
addAndMakeVisible(routingComboBox_.get());

speakerSetupLabel_->setFont(EarFonts::Label);
Expand All @@ -42,7 +42,7 @@ class ValueBoxMain : public Component {
juce::NotificationType::dontSendNotification);
speakerSetupLabel_->setJustificationType(Justification::right);
addAndMakeVisible(speakerSetupLabel_.get());
speakerSetupsComboBox_->setDefaultText("select speaker layout");
speakerSetupsComboBox_->setDefaultText("Select speaker layout");

for (auto const& setup : SPEAKER_SETUPS) {
speakerSetupsComboBox_->addTextEntry(setup.displayName + " (" + setup.name + ")" + " - " + setup.specification);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
#include "object_frontend_connector.hpp"
#include "object_plugin_processor.hpp"

namespace {
const int desiredWidth{ 726 };
const int desiredHeight{ 672 };
}

using namespace ear::plugin::ui;

ObjectAudioProcessorEditor::ObjectAudioProcessorEditor(ObjectsAudioProcessor* p)
Expand Down Expand Up @@ -50,10 +55,9 @@ ObjectAudioProcessorEditor::ObjectAudioProcessorEditor(ObjectsAudioProcessor* p)
addAndMakeVisible(viewport_.get());

setResizable(true, false);
// TODO - old size (with metadata box and divergence) setResizeLimits(0, 0, 726, 950);
setResizeLimits(0, 0, 726, 672);
// TODO - old size (with metadata box and divergence) setSize(726, 950);
setSize(726, 672);
setResizeLimits(0, 0, desiredWidth, desiredHeight);
// Note: old size (with metadata box and divergence) setSize(726, 950);
setSize(desiredWidth, desiredHeight);
}

ObjectAudioProcessorEditor::~ObjectAudioProcessorEditor() {}
Expand All @@ -63,5 +67,5 @@ void ObjectAudioProcessorEditor::paint(Graphics& g) {}
void ObjectAudioProcessorEditor::resized() {
viewport_->setBounds(getLocalBounds());
// TODO - old size (with metadata box and divergence) content_->setBounds(0, 0, 726, 950);
content_->setBounds(0, 0, 726, 672);
content_->setBounds(0, 0, desiredWidth, desiredHeight);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ class ValueBoxMain : public Component {
routingLabel_->setJustificationType(Justification::right);
addAndMakeVisible(routingLabel_.get());
// routingComboBox_->setLookAndFeel(&routingLookAndFeel_);
routingComboBox_->setDefaultText("enter receiving Channel");
routingComboBox_->setDefaultText("Select Scene channel");
for (int i = 1; i <= 64; ++i) {
routingComboBox_->addTextEntry(String(i) + String::fromUTF8("") +
String(i));
routingComboBox_->addTextEntry(String(i));
}
addAndMakeVisible(routingComboBox_.get());

Expand Down

0 comments on commit ae82c0f

Please sign in to comment.