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

◆ ~PWoptions()

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

◆ PWoptions() [2/2]

PWoptions::PWoptions ( PWoptions &&  other)
deletenoexcept

Member Function Documentation

◆ BindToControl()

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

◆ LinkToControlsModel()

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

◆ operator=()

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

◆ paint()

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

◆ resized()

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

◆ textEditorFocusLost()

void PWoptions::textEditorFocusLost ( juce::TextEditor &  t)
overrideprivate
161{
162 const auto val {t.getText().getIntValue()};
163 const auto& nam {t.getName()};
164 if (nam == "minval") { controls_model_->SetPwMin(boundchannel_, val); }
165 else if (nam == "maxval") {
167 }
168 else { /* no action needed */
169 }
170}
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
84{0}; // note: 0-based

◆ controls_model_

ControlsModel* PWoptions::controls_model_ {nullptr}
inlinestaticprivate
83{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
81{5, "0123456789"};

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