MIDI2LR 6.2.0.1
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
PWoptions Class Reference

#include <PWoptions.h>

+ Inheritance diagram for PWoptions:

Public Member Functions

 PWoptions ()
 
 PWoptions (PWoptions &&other) noexcept=delete
 
 ~PWoptions ()
 
void BindToControl (int channel)
 
PWoptionsoperator= (PWoptions &&other) noexcept=delete
 
void paint (juce::Graphics &g) override
 
void resized () override
 

Static Public Member Functions

static void LinkToControlsModel (_In_ ControlsModel *model) noexcept
 

Private Member Functions

void textEditorFocusLost (juce::TextEditor &t) override
 

Private Attributes

int boundchannel_ {0}
 
std::unique_ptr< juce::Label > label
 
std::unique_ptr< juce::Label > label2
 
std::unique_ptr< juce::Label > label3
 
std::unique_ptr< juce::TextEditor > maxval
 
std::unique_ptr< juce::TextEditor > minval
 
juce::TextEditor::LengthAndCharacterRestriction numrestrict_ {5, "0123456789"}
 

Static Private Attributes

static ControlsModelcontrols_model_ {nullptr}
 

Detailed Description

[Comments] An auto-generated component, created by the Projucer.

Describe your class and how it works here! [/Comments]

Constructor & Destructor Documentation

◆ PWoptions() [1/2]

PWoptions::PWoptions ( )
51{
52 //[Constructor_pre] You can add your own custom stuff here..
53 auto fo {juce::FontOptions(15.00f, Font::plain)};
54 //[/Constructor_pre]
55
56 label.reset(new Label("new label", TRANS("Minimum value")));
57 addAndMakeVisible(label.get());
58 label->setFont(Font(fo).withTypefaceStyle("Regular"));
59 label->setJustificationType(Justification::centredLeft);
60 label->setEditable(false, false, false);
61 label->setColour(TextEditor::textColourId, Colours::black);
62 label->setColour(TextEditor::backgroundColourId, Colour(0x00000000));
63
64 label->setBounds(32, 48, 150, 24);
65
66 minval.reset(new TextEditor("minval"));
67 addAndMakeVisible(minval.get());
68 minval->setExplicitFocusOrder(1);
69 minval->setMultiLine(false);
70 minval->setReturnKeyStartsNewLine(false);
71 minval->setReadOnly(false);
72 minval->setScrollbarsShown(true);
73 minval->setCaretVisible(true);
74 minval->setPopupMenuEnabled(true);
75 minval->setText(TRANS("0"));
76
77 minval->setBounds(32, 80, 150, 24);
78
79 label2.reset(new Label("new label", TRANS("Maximum value")));
80 addAndMakeVisible(label2.get());
81 label2->setFont(Font(fo).withTypefaceStyle("Regular"));
82 label2->setJustificationType(Justification::centredLeft);
83 label2->setEditable(false, false, false);
84 label2->setColour(TextEditor::textColourId, Colours::black);
85 label2->setColour(TextEditor::backgroundColourId, Colour(0x00000000));
86
87 label2->setBounds(32, 112, 150, 24);
88
89 maxval.reset(new TextEditor("maxval"));
90 addAndMakeVisible(maxval.get());
91 maxval->setExplicitFocusOrder(2);
92 maxval->setMultiLine(false);
93 maxval->setReturnKeyStartsNewLine(false);
94 maxval->setReadOnly(false);
95 maxval->setScrollbarsShown(true);
96 maxval->setCaretVisible(true);
97 maxval->setPopupMenuEnabled(true);
98 maxval->setText(TRANS("16383"));
99
100 maxval->setBounds(32, 144, 150, 24);
101
102 label3.reset(new Label("new label", TRANS("Pitch Wheel")));
103 addAndMakeVisible(label3.get());
104 label3->setFont(Font(fo).withTypefaceStyle("Regular"));
105 label3->setJustificationType(Justification::centredLeft);
106 label3->setEditable(false, false, false);
107 label3->setColour(TextEditor::textColourId, Colours::black);
108 label3->setColour(TextEditor::backgroundColourId, Colour(0x00000000));
109
110 label3->setBounds(32, 16, 150, 24);
111
112 //[UserPreSize]
113 //[/UserPreSize]
114
115 setSize(280, 350);
116
117 //[Constructor] You can add your own custom stuff here..
118 minval->setInputFilter(&numrestrict_, false);
119 maxval->setInputFilter(&numrestrict_, false);
120 minval->addListener(this);
121 maxval->addListener(this);
122 //[/Constructor]
123}
std::unique_ptr< juce::TextEditor > maxval
Definition PWoptions.h:86
std::unique_ptr< juce::Label > label2
Definition PWoptions.h:85
std::unique_ptr< juce::Label > label3
Definition PWoptions.h:87
std::unique_ptr< juce::Label > label
Definition PWoptions.h:83
juce::TextEditor::LengthAndCharacterRestriction numrestrict_
Definition PWoptions.h:75
std::unique_ptr< juce::TextEditor > minval
Definition PWoptions.h:84

◆ ~PWoptions()

PWoptions::~PWoptions ( )
126{
127 //[Destructor_pre]. You can add your own custom destruction code here..
128 //[/Destructor_pre]
129
130 label = nullptr;
131 minval = nullptr;
132 label2 = nullptr;
133 maxval = nullptr;
134 label3 = nullptr;
135
136 //[Destructor]. You can add your own custom destruction code here..
137 //[/Destructor]
138}

◆ PWoptions() [2/2]

PWoptions::PWoptions ( PWoptions &&  other)
deletenoexcept

Member Function Documentation

◆ BindToControl()

void PWoptions::BindToControl ( int  channel)
175{
176 boundchannel_ = channel;
177 minval->setText(juce::String(controls_model_->GetPwMin(boundchannel_)),
178 juce::dontSendNotification);
179 maxval->setText(juce::String(controls_model_->GetPwMax(boundchannel_)),
180 juce::dontSendNotification);
181}
int GetPwMin(int channel) const
Definition ControlsModel.h:268
int GetPwMax(int channel) const
Definition ControlsModel.h:266
int boundchannel_
Definition PWoptions.h:78
static ControlsModel * controls_model_
Definition PWoptions.h:77

◆ LinkToControlsModel()

static void PWoptions::LinkToControlsModel ( _In_ ControlsModel model)
inlinestaticnoexcept
63{ controls_model_ = model; }

◆ operator=()

PWoptions & PWoptions::operator= ( PWoptions &&  other)
deletenoexcept

◆ paint()

void PWoptions::paint ( juce::Graphics &  g)
override
142{
143 //[UserPrePaint] Add your own custom painting code here..
144 //[/UserPrePaint]
145
146 g.fillAll(Colours::white);
147
148 //[UserPaint] Add your own custom painting code here..
149 //[/UserPaint]
150}

◆ resized()

void PWoptions::resized ( )
override
153{
154 //[UserPreResize] Add your own custom resize code here..
155 //[/UserPreResize]
156
157 //[UserResized] Add your own custom resize handling here..
158 //[/UserResized]
159}

◆ textEditorFocusLost()

void PWoptions::textEditorFocusLost ( juce::TextEditor &  t)
overrideprivate
163{
164 const auto val {t.getText().getIntValue()};
165 const auto& nam {t.getName()};
166 if (nam == "minval") { controls_model_->SetPwMin(boundchannel_, val); }
167 else if (nam == "maxval") {
169 }
170 else { /* no action needed */
171 }
172}
void SetPwMin(int channel, int value)
Definition ControlsModel.h:309
void SetPwMax(int channel, int value)
Definition ControlsModel.h:307

Member Data Documentation

◆ boundchannel_

int PWoptions::boundchannel_ {0}
private
78{0}; // note: 0-based

◆ controls_model_

ControlsModel* PWoptions::controls_model_ {nullptr}
inlinestaticprivate
77{nullptr};

◆ label

std::unique_ptr<juce::Label> PWoptions::label
private

◆ label2

std::unique_ptr<juce::Label> PWoptions::label2
private

◆ label3

std::unique_ptr<juce::Label> PWoptions::label3
private

◆ maxval

std::unique_ptr<juce::TextEditor> PWoptions::maxval
private

◆ minval

std::unique_ptr<juce::TextEditor> PWoptions::minval
private

◆ numrestrict_

juce::TextEditor::LengthAndCharacterRestriction PWoptions::numrestrict_ {5, "0123456789"}
private
75{5, "0123456789"};

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