Skip to content

Commit

Permalink
Common setup code for Routing Info Icon
Browse files Browse the repository at this point in the history
  • Loading branch information
firthm01 committed Nov 3, 2023
1 parent d40c80e commit 0a282ca
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ set(HEADERS_DIRECT_SPEAKERS_INPUT
${EPS_SHARED_DIR}/components/onboarding.hpp
${EPS_SHARED_DIR}/components/onboarding_slide.hpp
${EPS_SHARED_DIR}/components/overlay.hpp
${EPS_SHARED_DIR}/components/routing_info_icon.hpp
${EPS_SHARED_DIR}/components/segment_progress_bar.hpp
${EPS_SHARED_DIR}/components/speaker_layer.hpp
${EPS_SHARED_DIR}/components/version_label.hpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "components/ear_combo_box.hpp"
#include "components/ear_name_text_editor.hpp"
#include "components/routing_info_icon.hpp"
#include "components/look_and_feel/colours.hpp"
#include "components/look_and_feel/fonts.hpp"

Expand All @@ -20,7 +21,7 @@ class ValueBoxMain : public Component {
speakerSetupLabel_(std::make_unique<Label>()),
speakerSetupsComboBox_(std::make_shared<EarComboBox>()),
routingLabel_(std::make_unique<Label>()),
routingInfoIcon_(std::make_unique<ImageComponent>()),
routingInfoIcon_(createRoutingInfoIcon()),
routingComboBox_(std::make_shared<EarComboBox>()) {
name_->setLabelText("Object Name");
name_->setText("Object_1");
Expand All @@ -39,14 +40,6 @@ class ValueBoxMain : public Component {
routingLabel_->setJustificationType(Justification::right);
addAndMakeVisible(routingLabel_.get());

routingInfoIcon_->setImage(ImageFileFormat::loadFrom(
binary_data::infologo_png, binary_data::infologo_pngSize));
routingInfoIcon_->setImagePlacement(RectanglePlacement::centred +
RectanglePlacement::doNotResize);
routingInfoIcon_->setAlpha(0.8);
routingInfoIcon_->setMouseCursor(MouseCursor::PointingHandCursor);
routingInfoIcon_->setTooltip(
"128 channel support requires REAPER v7 or later.");
addChildComponent(routingInfoIcon_.get());

routingComboBox_->setDefaultText("Select Scene channel range");
Expand Down
1 change: 1 addition & 0 deletions ear-production-suite-plugins/plugins/hoa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ set(HEADERS_HOA_INPUT
${EPS_SHARED_DIR}/components/level_meter_calculator.hpp
${EPS_SHARED_DIR}/components/non_automatable_parameter.hpp
${EPS_SHARED_DIR}/components/onboarding.hpp
${EPS_SHARED_DIR}/components/routing_info_icon.hpp
${EPS_SHARED_DIR}/components/version_label.hpp

${EPS_SHARED_DIR}/components/look_and_feel/colours.hpp
Expand Down
11 changes: 2 additions & 9 deletions ear-production-suite-plugins/plugins/hoa/src/value_box_main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "components/ear_combo_box.hpp"
#include "components/ear_name_text_editor.hpp"
#include "components/routing_info_icon.hpp"
#include "components/look_and_feel/colours.hpp"
#include "components/look_and_feel/fonts.hpp"

Expand All @@ -19,7 +20,7 @@ class ValueBoxMain : public Component {
hoaTypeLabel_(std::make_unique<Label>()),
hoaTypeComboBox_(std::make_shared<EarComboBox>()),
routingLabel_(std::make_unique<Label>()),
routingInfoIcon_(std::make_unique<ImageComponent>()),
routingInfoIcon_(createRoutingInfoIcon()),
routingComboBox_(std::make_shared<EarComboBox>()) {

colourComboBox_->setName("EarComboBox (ValueBoxMain::colourComboBox_)");
Expand All @@ -46,14 +47,6 @@ class ValueBoxMain : public Component {
routingLabel_->setJustificationType(Justification::right);
addAndMakeVisible(routingLabel_.get());

routingInfoIcon_->setImage(ImageFileFormat::loadFrom(
binary_data::infologo_png, binary_data::infologo_pngSize));
routingInfoIcon_->setImagePlacement(RectanglePlacement::centred +
RectanglePlacement::doNotResize);
routingInfoIcon_->setAlpha(0.8);
routingInfoIcon_->setMouseCursor(MouseCursor::PointingHandCursor);
routingInfoIcon_->setTooltip(
"128 channel support requires REAPER v7 or later.");
addChildComponent(routingInfoIcon_.get());

routingComboBox_->setDefaultText("Select Scene channel range");
Expand Down
1 change: 1 addition & 0 deletions ear-production-suite-plugins/plugins/object/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ set(HEADERS_OBJECT_INPUT
${EPS_SHARED_DIR}/components/overlay.hpp
${EPS_SHARED_DIR}/components/panner_side_view.hpp
${EPS_SHARED_DIR}/components/panner_top_view.hpp
${EPS_SHARED_DIR}/components/routing_info_icon.hpp
${EPS_SHARED_DIR}/components/segment_progress_bar.hpp
${EPS_SHARED_DIR}/components/version_label.hpp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "components/ear_combo_box.hpp"
#include "components/ear_name_text_editor.hpp"
#include "components/routing_info_icon.hpp"
#include "components/look_and_feel/colours.hpp"
#include "components/look_and_feel/fonts.hpp"
#include <daw_channel_count.h>
Expand All @@ -19,7 +20,7 @@ class ValueBoxMain : public Component {
name_(std::make_shared<EarNameTextEditor>()),
useTrackNameCheckbox_(std::make_shared<ToggleButton>()),
routingLabel_(std::make_unique<Label>()),
routingInfoIcon_(std::make_unique<ImageComponent>()),
routingInfoIcon_(createRoutingInfoIcon()),
routingComboBox_(std::make_shared<EarComboBox>()) {
setColour(backgroundColourId, EarColours::Area04dp);

Expand All @@ -33,13 +34,6 @@ class ValueBoxMain : public Component {
useTrackNameCheckbox_->setClickingTogglesState(false); // FrontendConnector controls state
addAndMakeVisible(useTrackNameCheckbox_.get());

routingInfoIcon_->setImage(ImageFileFormat::loadFrom(
binary_data::infologo_png, binary_data::infologo_pngSize));
routingInfoIcon_->setImagePlacement(RectanglePlacement::centred +
RectanglePlacement::doNotResize);
routingInfoIcon_->setAlpha(0.8);
routingInfoIcon_->setMouseCursor(MouseCursor::PointingHandCursor);
routingInfoIcon_->setTooltip("128 channel support requires REAPER v7 or later.");
addChildComponent(routingInfoIcon_.get());

routingLabel_->setFont(EarFontsSingleton::instance().Label);
Expand Down
26 changes: 26 additions & 0 deletions shared/components/routing_info_icon.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#pragma once

#include "JuceHeader.h"

#include <memory>

namespace ear {
namespace plugin {
namespace ui {

inline std::unique_ptr<ImageComponent> createRoutingInfoIcon() {
auto routingIcon = std::make_unique<ImageComponent>();
routingIcon->setImage(ImageFileFormat::loadFrom(
binary_data::infologo_png, binary_data::infologo_pngSize));
routingIcon->setImagePlacement(RectanglePlacement::centred +
RectanglePlacement::doNotResize);
routingIcon->setAlpha(0.8);
routingIcon->setMouseCursor(MouseCursor::PointingHandCursor);
routingIcon->setTooltip(
"128 channel support requires REAPER v7 or later.");
return std::move(routingIcon);
}

} // namespace ui
} // namespace plugin
} // namespace ear

0 comments on commit 0a282ca

Please sign in to comment.