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
CommandSet::Impl Class Reference

Public Member Functions

 Impl ()
 
 Impl (const Impl &other)=delete
 
 Impl (Impl &&other)=delete
 
 ~Impl ()=default
 
Imploperator= (const Impl &other)=delete
 
Imploperator= (Impl &&other)=delete
 
template<class Archive >
void serialize (Archive &archive, const std::uint32_t version)
 

Public Attributes

std::vector< std::pair< std::string, std::vector< std::pair< std::string, std::string > > > > allcommands_
 
std::string language_
 
std::unordered_map< std::string, std::pair< std::string, std::string > > repeat_messages_
 
std::vector< std::string > wraps_
 

Constructor & Destructor Documentation

◆ Impl() [1/3]

CommandSet::Impl::Impl ( )
69{
70 try {
71 const fs::path p {rsj::AppDataFilePath(MIDI2LR_UC_LITERAL("MenuTrans.xml"))};
72 if (std::ifstream infile {p}; infile.is_open()) {
73#pragma warning(suppress : 26414) /* too large to construct on stack */
74 const auto iarchive {std::make_unique<cereal::XMLInputArchive>(infile)};
75 (*iarchive)(*this);
76 rsj::Log(fmt::format(FMT_STRING("MenuTrans.xml archive loaded from {}."), p.string()),
77 std::source_location::current());
78 }
79 else {
80 rsj::LogAndAlertError(juce::translate("Unable to load MenuTrans.xml."),
81 "Unable to load MenuTrans.xml.", std::source_location::current());
82 }
83 }
84 catch (const std::exception& e) {
85 rsj::ExceptionResponse(e, std::source_location::current());
86 throw;
87 }
88}
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:142
std::string AppDataFilePath(const std::string &file_name)
void Log(const juce::String &info, const std::source_location &location=std::source_location::current()) noexcept
Definition Misc.cpp:113

◆ ~Impl()

CommandSet::Impl::~Impl ( )
default

◆ Impl() [2/3]

CommandSet::Impl::Impl ( const Impl other)
delete

◆ Impl() [3/3]

CommandSet::Impl::Impl ( Impl &&  other)
delete

Member Function Documentation

◆ operator=() [1/2]

Impl & CommandSet::Impl::operator= ( const Impl other)
delete

◆ operator=() [2/2]

Impl & CommandSet::Impl::operator= ( Impl &&  other)
delete

◆ serialize()

template<class Archive >
void CommandSet::Impl::serialize ( Archive &  archive,
const std::uint32_t  version 
)
inline
83 {
84 try {
85 if (std::cmp_equal(version, 2)) {
86 archive(cereal::make_nvp("language", language_),
87 cereal::make_nvp("all_commands", allcommands_),
88 cereal::make_nvp("repeats", repeat_messages_),
89 cereal::make_nvp("wraps", wraps_));
90 }
91 else {
92 constexpr auto msg {
93 "The file, 'MenuTrans.xml', is marked as a version not supported by the current "
94 "version of MIDI2LR, and won't be loaded. File version: {}."};
95 rsj::LogAndAlertError(fmt::format(juce::translate(msg).toStdString(), version),
96 fmt::format(msg, version), std::source_location::current());
97 }
98 }
99 catch (const std::exception& e) {
100 rsj::ExceptionResponse(e, std::source_location::current());
101 throw;
102 }
103 }
std::string language_
Definition CommandSet.h:105
std::vector< std::pair< std::string, std::vector< std::pair< std::string, std::string > > > > allcommands_
Definition CommandSet.h:107
std::vector< std::string > wraps_
Definition CommandSet.h:109
std::unordered_map< std::string, std::pair< std::string, std::string > > repeat_messages_
Definition CommandSet.h:108

Member Data Documentation

◆ allcommands_

std::vector<std::pair<std::string, std::vector<std::pair<std::string, std::string> > > > CommandSet::Impl::allcommands_

◆ language_

std::string CommandSet::Impl::language_

◆ repeat_messages_

std::unordered_map<std::string, std::pair<std::string, std::string> > CommandSet::Impl::repeat_messages_

◆ wraps_

std::vector<std::string> CommandSet::Impl::wraps_

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