MIDI2LR 6.3.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
rsj::SettingsStruct Struct Reference

#include <ControlsModel.h>

Public Member Functions

 SettingsStruct (int n=0, int l=0, int h=0x7F, rsj::CCmethod m=rsj::CCmethod::kAbsolute) noexcept
template<class Archive, cereal::traits::EnableIf< cereal::traits::is_text_archive< Archive >::value > = cereal::traits::sfinae>
void serialize (Archive &archive, const uint32_t version)
template<class Archive, cereal::traits::DisableIf< cereal::traits::is_text_archive< Archive >::value > = cereal::traits::sfinae>
void serialize (Archive &archive, const uint32_t version)

Public Attributes

int control_number {}
int high {}
int low {}
rsj::CCmethod method {}

Constructor & Destructor Documentation

◆ SettingsStruct()

rsj::SettingsStruct::SettingsStruct ( int n = 0,
int l = 0,
int h = 0x7F,
rsj::CCmethod m = rsj::CCmethod::kAbsolute )
inlinenoexcept
44 : control_number {n}, low {l}, high {h}, method {m}
45 {
46 }
int low
Definition ControlsModel.h:37
int control_number
Definition ControlsModel.h:36
int high
Definition ControlsModel.h:38
rsj::CCmethod method
Definition ControlsModel.h:39

References control_number.

Member Function Documentation

◆ serialize() [1/2]

template<class Archive, cereal::traits::EnableIf< cereal::traits::is_text_archive< Archive >::value > = cereal::traits::sfinae>
void rsj::SettingsStruct::serialize ( Archive & archive,
const uint32_t version )
inline
74 {
75 try {
76 switch (version) {
77 case 1:
78 {
79 std::string methodstr {"undefined"};
80 switch (method) {
82 methodstr = "Absolute";
83 break;
85 methodstr = "BinaryOffset";
86 break;
88 methodstr = "SignMagnitude";
89 break;
91 methodstr = "TwosComplement";
92 break;
93 }
94 archive(cereal::make_nvp("CC", control_number), CEREAL_NVP(high), CEREAL_NVP(low),
95 cereal::make_nvp("method", methodstr));
96 switch (methodstr.front()) {
97 case 'B':
99 break;
100 case 'S':
102 break;
103 case 'T':
105 break;
106 case 'A':
107 default:
109 break;
110 }
111 break;
112 }
113 default:
114 {
115 constexpr auto msg {"The file, 'settings.xml', is marked as a version not "
116 "supported by the current version of MIDI2LR SettingsStruct, "
117 "and won't be loaded. File version: {}."};
119 fmt::format(fmt::runtime(juce::translate(msg).toStdString()), version),
120 fmt::format(fmt::runtime(msg), version), std::source_location::current());
121 }
122 break;
123 }
124 }
125 catch (const std::exception& e) {
126 rsj::ExceptionResponse(e, std::source_location::current());
127 throw;
128 }
129 }
@ kBinaryOffset
Definition ControlsModel.h:33
@ kTwosComplement
Definition ControlsModel.h:33
@ kAbsolute
Definition ControlsModel.h:33
@ kSignMagnitude
Definition ControlsModel.h:33
void ExceptionResponse(gsl::czstring id, gsl::czstring fu, const std::exception &e) noexcept
void LogAndAlertError(const juce::String &error_text, const std::source_location &location=std::source_location::current()) noexcept
Definition Misc.cpp:141

◆ serialize() [2/2]

template<class Archive, cereal::traits::DisableIf< cereal::traits::is_text_archive< Archive >::value > = cereal::traits::sfinae>
void rsj::SettingsStruct::serialize ( Archive & archive,
const uint32_t version )
inline
52 {
53 switch (version) {
54 case 1:
55 archive(control_number, high, low, method);
56 break;
57 default:
58 {
59 constexpr auto msg {
60 "The file, 'settings.xml', is marked as a version not supported by the current "
61 "version of MIDI2LR SettingsStruct, and won't be loaded. File version: {}."};
62 rsj::LogAndAlertError(fmt::format(fmt::runtime(juce::translate(msg).toStdString()),
63 version),
64 fmt::format(msg, version), std::source_location::current());
65 }
66 break;
67 }
68 }

Member Data Documentation

◆ control_number

int rsj::SettingsStruct::control_number {}
36{};

Referenced by SettingsStruct().

◆ high

int rsj::SettingsStruct::high {}
38{};

◆ low

int rsj::SettingsStruct::low {}
37{};

◆ method

rsj::CCmethod rsj::SettingsStruct::method {}
39{};

The documentation for this struct was generated from the following file: