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
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, std::uint32_t const 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 }
78 else {
79 rsj::LogAndAlertError(juce::translate("Unable to load MenuTrans.xml."),
80 "Unable to load MenuTrans.xml.");
81 }
82 }
83 catch (const std::exception& e) {
85 throw;
86 }
87}
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:160
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:131

◆ ~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,
std::uint32_t const  version 
)
inline
76 {
77 try {
78 if (std::cmp_equal(version, 2)) {
79 archive(cereal::make_nvp("language", language_),
80 cereal::make_nvp("all_commands", allcommands_),
81 cereal::make_nvp("repeats", repeat_messages_),
82 cereal::make_nvp("wraps", wraps_));
83 }
84 else {
85 constexpr auto msg {
86 "The file, 'MenuTrans.xml', is marked as a version not supported by the current "
87 "version of MIDI2LR, and won't be loaded. File version: {}."};
88 rsj::LogAndAlertError(fmt::format(juce::translate(msg).toStdString(), version),
89 fmt::format(msg, version));
90 }
91 }
92 catch (const std::exception& e) {
94 throw;
95 }
96 }
std::string language_
Definition CommandSet.h:98
std::vector< std::pair< std::string, std::vector< std::pair< std::string, std::string > > > > allcommands_
Definition CommandSet.h:100
std::vector< std::string > wraps_
Definition CommandSet.h:102
std::unordered_map< std::string, std::pair< std::string, std::string > > repeat_messages_
Definition CommandSet.h:101

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: