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
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::DisableIf< cereal::traits::is_text_archive< Archive >::value > = cereal::traits::sfinae>
void serialize (Archive &archive, const uint32_t version)
 
template<class Archive , cereal::traits::EnableIf< 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

Member Function Documentation

◆ serialize() [1/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(juce::translate(msg).toStdString(), version),
63 fmt::format(msg, version), std::source_location::current());
64 }
65 break;
66 }
67 }
void LogAndAlertError(const juce::String &error_text, const std::source_location &location=std::source_location::current()) noexcept
Definition Misc.cpp:142

◆ serialize() [2/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
73 {
74 try {
75 switch (version) {
76 case 1:
77 {
78 std::string methodstr {"undefined"};
79 switch (method) {
81 methodstr = "Absolute";
82 break;
84 methodstr = "BinaryOffset";
85 break;
87 methodstr = "SignMagnitude";
88 break;
90 methodstr = "TwosComplement";
91 break;
92 }
93 archive(cereal::make_nvp("CC", control_number), CEREAL_NVP(high), CEREAL_NVP(low),
94 cereal::make_nvp("method", methodstr));
95 switch (methodstr.front()) {
96 case 'B':
98 break;
99 case 'S':
101 break;
102 case 'T':
104 break;
105 case 'A':
106 default:
108 break;
109 }
110 break;
111 }
112 default:
113 {
114 constexpr auto msg {"The file, 'settings.xml', is marked as a version not "
115 "supported by the current version of MIDI2LR SettingsStruct, "
116 "and won't be loaded. File version: {}."};
117 rsj::LogAndAlertError(fmt::format(juce::translate(msg).toStdString(), version),
118 fmt::format(msg, version), std::source_location::current());
119 }
120 break;
121 }
122 }
123 catch (const std::exception& e) {
124 rsj::ExceptionResponse(e, std::source_location::current());
125 throw;
126 }
127 }
void ExceptionResponse(gsl::czstring id, gsl::czstring fu, const std::exception &e) noexcept

Member Data Documentation

◆ control_number

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

◆ 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: