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
CommandTable Class Referencefinal

#include <CommandTable.h>

+ Inheritance diagram for CommandTable:

Public Member Functions

 CommandTable (CommandTable &&other)=delete
 
 CommandTable (const CommandTable &other)=delete
 
 CommandTable (const juce::String &component_name, CommandTableModel *model)
 
 ~CommandTable ()
 
CommandTableoperator= (CommandTable &&other)=delete
 
CommandTableoperator= (const CommandTable &other)=delete
 

Private Member Functions

bool keyPressed (const juce::KeyPress &k) override
 

Constructor & Destructor Documentation

◆ CommandTable() [1/3]

CommandTable::CommandTable ( const juce::String &  component_name,
CommandTableModel model 
)
28 : juce
29 ::TableListBox {component_name, model}
30 {
31 juce::TableListBox::setHeader(std::make_unique<juce::TableHeaderComponent>());
32 juce::TableListBox::getHeader().addColumn(juce::translate("MIDI Command"), 1, 150, 30, -1,
33 juce::TableHeaderComponent::notResizable | juce::TableHeaderComponent::sortable);
34 juce::TableListBox::getHeader().addColumn(juce::translate("LR Command"), 2, 350, 30, -1,
35 juce::TableHeaderComponent::notResizable | juce::TableHeaderComponent::sortable
36 | juce::TableHeaderComponent::sortedForwards);
37 }
38
39catch (const std::exception& e) {
40 rsj::ExceptionResponse(e, std::source_location::current());
41 throw;
42}
void ExceptionResponse(gsl::czstring id, gsl::czstring fu, const std::exception &e) noexcept

◆ ~CommandTable()

CommandTable::~CommandTable ( )
inline
26{ juce::TableListBox::setModel(nullptr); } // NOLINT(modernize-use-override)

◆ CommandTable() [2/3]

CommandTable::CommandTable ( const CommandTable other)
delete

◆ CommandTable() [3/3]

CommandTable::CommandTable ( CommandTable &&  other)
delete

Member Function Documentation

◆ keyPressed()

bool CommandTable::keyPressed ( const juce::KeyPress &  k)
overrideprivate
45{
46 try {
47 const auto key_pressed {k.getKeyCode()};
48 const auto selected_row {juce::ListBox::getSelectedRow()};
49 const auto num_rows {juce::TableListBox::getNumRows()};
50 if (num_rows == 0 || selected_row == -1) { return false; }
51 if (key_pressed == juce::KeyPress::deleteKey) {
52 if (const auto ptr {
53 dynamic_cast<CommandTableModel*>(juce::TableListBox::getTableListBoxModel())}) {
54 ptr->RemoveRow(gsl::narrow_cast<size_t>(selected_row));
55 juce::ListBox::updateContent();
56 if (selected_row == num_rows - 1) { /* keep selection at the end */
57 juce::ListBox::selectRow(num_rows - 2);
58 }
59 return true;
60 }
61 return false;
62 }
63 if (key_pressed == juce::KeyPress::downKey) {
64 juce::ListBox::selectRow(std::min(selected_row + 1, num_rows - 1));
65 return true;
66 }
67 if (key_pressed == juce::KeyPress::upKey) {
68 juce::ListBox::selectRow(std::max(selected_row - 1, 0));
69 return true;
70 }
71 if (key_pressed == juce::KeyPress::pageUpKey) {
72 juce::ListBox::selectRow(std::max(selected_row - 20, 0));
73 return true;
74 }
75 if (key_pressed == juce::KeyPress::pageDownKey) {
76 juce::ListBox::selectRow(std::min(selected_row + 20, num_rows - 1));
77 return true;
78 }
79 if (key_pressed == juce::KeyPress::homeKey) {
80 juce::ListBox::selectRow(0);
81 return true;
82 }
83 if (key_pressed == juce::KeyPress::endKey) {
84 juce::ListBox::selectRow(num_rows - 1);
85 return true;
86 }
87 return false;
88 }
89 catch (const std::exception& e) {
90 rsj::ExceptionResponse(e, std::source_location::current());
91 throw;
92 }
93}
Definition CommandTableModel.h:26

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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