MIDI2LR 6.1.0.0
MIDI2LR is an application that interfaces MIDI controllers with Lightroom 6+/CC Classic. It processes MIDI input into develop parameter updates and photo actions, and sends MIDI output when parameters are changed for motorized feedback (on controllers that have motorized faders). A listing of available LightRoom commands is in the Wiki. Assistance on the code and design is welcome.
Loading...
Searching...
No Matches
SettingsComponent Class Referencefinal

#include <SettingsComponent.h>

+ Inheritance diagram for SettingsComponent:

Public Member Functions

 SettingsComponent (const SettingsComponent &other)=delete
 
 SettingsComponent (SettingsComponent &&other)=delete
 
 SettingsComponent (SettingsManager &settings_manager)
 
 ~SettingsComponent ()=default
 
void Init ()
 
SettingsComponentoperator= (const SettingsComponent &other)=delete
 
SettingsComponentoperator= (SettingsComponent &&other)=delete
 

Private Member Functions

void paint (juce::Graphics &) override
 

Private Attributes

juce::Label autohide_explain_label_ {}
 
juce::GroupComponent autohide_group_ {}
 
juce::Slider autohide_setting_
 
juce::ToggleButton pickup_enabled_ {juce::translate("Enable Pickup Mode")}
 
juce::GroupComponent pickup_group_ {}
 
juce::Label pickup_label_ {"PickupLabel", ""}
 
juce::GroupComponent profile_group_ {}
 
juce::TextButton profile_location_button_ {juce::translate("Choose Profile Folder")}
 
juce::Label profile_location_label_ {"Profile Label"}
 
SettingsManagersettings_manager_
 

Constructor & Destructor Documentation

◆ SettingsComponent() [1/3]

SettingsComponent::SettingsComponent ( SettingsManager settings_manager)
explicit
34 : ResizableLayout {this}, settings_manager_ {settings_manager}
35{
36}
SettingsManager & settings_manager_
Definition SettingsComponent.h:48

◆ ~SettingsComponent()

SettingsComponent::~SettingsComponent ( )
default

◆ SettingsComponent() [2/3]

SettingsComponent::SettingsComponent ( const SettingsComponent other)
delete

◆ SettingsComponent() [3/3]

SettingsComponent::SettingsComponent ( SettingsComponent &&  other)
delete

Member Function Documentation

◆ Init()

void SettingsComponent::Init ( )
39{
40 try {
41 setSize(kSettingsWidth, kSettingsHeight);
42 pickup_group_.setText(juce::translate("Pick up"));
43 pickup_group_.setBounds(0, 0, kSettingsWidth, 100);
44 addToLayout(&pickup_group_, anchorMidLeft, anchorMidRight);
45 addAndMakeVisible(pickup_group_);
46 pickup_label_.setFont(juce::Font {16.F, juce::Font::bold});
47 pickup_label_.setText(juce::translate("Disabling the pickup mode may be better for "
48 "touchscreen interfaces and may solve issues with "
49 "Lightroom not picking up fast fader/knob movements"),
50 juce::NotificationType::dontSendNotification);
51 pickup_label_.setBounds(kSettingsLeft, 15, kSettingsWidth - 2 * kSettingsLeft, 50);
52 addToLayout(&pickup_label_, anchorMidLeft, anchorMidRight);
53 pickup_label_.setEditable(false);
54 pickup_label_.setColour(juce::Label::textColourId, juce::Colours::darkgrey);
55 addAndMakeVisible(pickup_label_);
56
58 juce::NotificationType::dontSendNotification);
59 pickup_enabled_.setBounds(kSettingsLeft, 60, kSettingsWidth - 2 * kSettingsLeft,
60 32); //-V112
61 addToLayout(&pickup_enabled_, anchorMidLeft, anchorMidRight);
62 addAndMakeVisible(pickup_enabled_);
63 pickup_enabled_.onClick = [this] {
64 const auto pickup_state {pickup_enabled_.getToggleState()};
66 rsj::Log(pickup_state ? "Pickup set to enabled." : "Pickup set to disabled.");
67 };
68
69 /* profile */
70 profile_group_.setText(juce::translate("Profile"));
71 profile_group_.setBounds(0, 100, kSettingsWidth, 100);
72 addToLayout(&profile_group_, anchorMidLeft, anchorMidRight);
73 addAndMakeVisible(profile_group_);
74
75 profile_location_button_.setBounds(kSettingsLeft, 120, kSettingsWidth - 2 * kSettingsLeft,
76 25);
77 addToLayout(&profile_location_button_, anchorMidLeft, anchorMidRight);
78 addAndMakeVisible(profile_location_button_);
79 profile_location_button_.onClick = [this] {
80 juce::FileChooser chooser {juce::translate("Select Folder"),
81 juce::File::getSpecialLocation(juce::File::userDocumentsDirectory), "", true};
82 if (chooser.browseForDirectory()) {
83 const auto profile_location {chooser.getResult().getFullPathName()};
84 settings_manager_.SetProfileDirectory(profile_location);
85 rsj::Log(fmt::format(FMT_STRING("Profile location set to {}."),
86 profile_location.toStdString()));
87 profile_location_label_.setText(profile_location,
88 juce::NotificationType::dontSendNotification);
89 }
90 };
91
92 profile_location_label_.setEditable(false);
93 profile_location_label_.setBounds(kSettingsLeft, 145, kSettingsWidth - 2 * kSettingsLeft, 30);
94 addToLayout(&profile_location_label_, anchorMidLeft, anchorMidRight);
95 profile_location_label_.setColour(juce::Label::textColourId, juce::Colours::darkgrey);
96 addAndMakeVisible(profile_location_label_);
98 juce::NotificationType::dontSendNotification);
99
100 /* autohide */
101 autohide_group_.setText(juce::translate("Auto hide"));
102 autohide_group_.setBounds(0, 200, kSettingsWidth, 100);
103 addToLayout(&autohide_group_, anchorMidLeft, anchorMidRight);
104 addAndMakeVisible(autohide_group_);
105
106 autohide_explain_label_.setFont(juce::Font {16.F, juce::Font::bold});
107 autohide_explain_label_.setText(juce::translate("Autohide the plugin window in x seconds, "
108 "select 0 for disabling autohide"),
109 juce::NotificationType::dontSendNotification);
110 autohide_explain_label_.setBounds(kSettingsLeft, 215, kSettingsWidth - 2 * kSettingsLeft, 50);
111 addToLayout(&autohide_explain_label_, anchorMidLeft, anchorMidRight);
112 autohide_explain_label_.setEditable(false);
113 autohide_explain_label_.setFont(juce::Font {16.F, juce::Font::bold});
114 autohide_explain_label_.setColour(juce::Label::textColourId, juce::Colours::darkgrey);
115 addAndMakeVisible(autohide_explain_label_);
116
117 autohide_setting_.setBounds(kSettingsLeft, 245, kSettingsWidth - 2 * kSettingsLeft, 50);
118 autohide_setting_.setRange(0., 10., 1.);
120 juce::NotificationType::dontSendNotification);
121
122 addToLayout(&autohide_setting_, anchorMidLeft, anchorMidRight);
123 addAndMakeVisible(autohide_setting_);
124 autohide_setting_.onValueChange = [this] {
126 gsl::narrow<int>(std::lrint(autohide_setting_.getValue())));
127 rsj::Log(fmt::format(FMT_STRING("Autohide time set to {} seconds."),
129 };
130 /* turn it on */
131 activateLayout();
132 }
133 catch (const std::exception& e) {
135 throw;
136 }
137}
juce::GroupComponent profile_group_
Definition SettingsComponent.h:41
juce::Label profile_location_label_
Definition SettingsComponent.h:44
juce::Label autohide_explain_label_
Definition SettingsComponent.h:42
juce::GroupComponent pickup_group_
Definition SettingsComponent.h:40
juce::ToggleButton pickup_enabled_
Definition SettingsComponent.h:47
juce::Label pickup_label_
Definition SettingsComponent.h:43
juce::TextButton profile_location_button_
Definition SettingsComponent.h:46
juce::GroupComponent autohide_group_
Definition SettingsComponent.h:39
juce::Slider autohide_setting_
Definition SettingsComponent.h:45
int GetAutoHideTime() const noexcept
Definition SettingsManager.h:37
void SetPickupEnabled(bool enabled)
Definition SettingsManager.h:75
bool GetPickupEnabled() const noexcept
Definition SettingsManager.h:52
juce::String GetProfileDirectory() const noexcept
Definition SettingsManager.h:57
void SetAutoHideTime(int new_time)
Definition SettingsManager.h:63
void SetProfileDirectory(const juce::String &profile_directory)
Definition SettingsManager.h:81
void ExceptionResponse(gsl::czstring id, gsl::czstring fu, const std::exception &e) noexcept
void Log(const juce::String &info, const std::source_location &location=std::source_location::current()) noexcept
Definition Misc.cpp:131

◆ operator=() [1/2]

SettingsComponent & SettingsComponent::operator= ( const SettingsComponent other)
delete

◆ operator=() [2/2]

SettingsComponent & SettingsComponent::operator= ( SettingsComponent &&  other)
delete

◆ paint()

void SettingsComponent::paint ( juce::Graphics &  g)
overrideprivate
140{ //-V2009 overridden method
141 try {
142 g.fillAll(juce::Colours::white); /* clear the background */
143 }
144 catch (const std::exception& e) {
146 throw;
147 }
148}

Member Data Documentation

◆ autohide_explain_label_

juce::Label SettingsComponent::autohide_explain_label_ {}
private
42{};

◆ autohide_group_

juce::GroupComponent SettingsComponent::autohide_group_ {}
private
39{};

◆ autohide_setting_

juce::Slider SettingsComponent::autohide_setting_
private

◆ pickup_enabled_

juce::ToggleButton SettingsComponent::pickup_enabled_ {juce::translate("Enable Pickup Mode")}
private
47{juce::translate("Enable Pickup Mode")};

◆ pickup_group_

juce::GroupComponent SettingsComponent::pickup_group_ {}
private
40{};

◆ pickup_label_

juce::Label SettingsComponent::pickup_label_ {"PickupLabel", ""}
private
43{"PickupLabel", ""};

◆ profile_group_

juce::GroupComponent SettingsComponent::profile_group_ {}
private
41{};

◆ profile_location_button_

juce::TextButton SettingsComponent::profile_location_button_ {juce::translate("Choose Profile Folder")}
private
46{juce::translate("Choose Profile Folder")};

◆ profile_location_label_

juce::Label SettingsComponent::profile_location_label_ {"Profile Label"}
private
44{"Profile Label"};

◆ settings_manager_

SettingsManager& SettingsComponent::settings_manager_
private

The documentation for this class was generated from the following files: