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
MIDI2LRApplication Class Referencefinal
+ Inheritance diagram for MIDI2LRApplication:

Public Member Functions

void anotherInstanceStarted (const juce::String &command_line) override
 
void anotherInstanceStarted (const juce::String &command_line) override
 
const juce::String getApplicationName () override
 
const juce::String getApplicationName () override
 
const juce::String getApplicationVersion () override
 
const juce::String getApplicationVersion () override
 
void initialise (const juce::String &command_line) override
 
void initialise (const juce::String &command_line) override
 
bool moreThanOneInstanceAllowed () noexcept override
 
bool moreThanOneInstanceAllowed () noexcept override
 
void shutdown () override
 
void shutdown () override
 
void systemRequestedQuit () override
 
void systemRequestedQuit () override
 
void unhandledException (const std::exception *e, const juce::String &source_filename, int line_number) override
 
void unhandledException (const std::exception *e, const juce::String &source_filename, int line_number) override
 

Private Member Functions

void DefaultProfileSave () noexcept
 
void DefaultProfileSave () noexcept
 
void InitializeThreads ()
 
void InitializeThreads ()
 
void LinkControlsModels ()
 
void LinkControlsModels ()
 
void LoadControlsModel ()
 
void LoadControlsModel ()
 
void SaveControlsModel () const noexcept
 
void SaveControlsModel () const noexcept
 
void SetAppFont () const noexcept
 
void SetAppFont () const noexcept
 
void SetupUi ()
 
void SetupUi ()
 
void StartServices ()
 
void StartServices ()
 
void StartThread (std::future< void > &thread, const char *threadName)
 
void StartThread (std::future< void > &thread, const char *threadName)
 
void StopServices ()
 
void StopServices ()
 

Private Attributes

const CommandSet command_set_ {}
 
ControlsModel controls_model_ {}
 
Devices devices_ {}
 
const LookAndFeelMIDI2LR dummy1_
 
const SetLogger dummy_ {}
 
asio::executor_work_guard< asio::io_context::executor_type > guard_
 
asio::io_context io_context_ {}
 
std::future< void > io_thread0_
 
std::future< void > io_thread1_
 
LrIpcIn lr_ipc_in_ {controls_model_, profile_manager_, profile_, midi_sender_, io_context_}
 
LrIpcOut lr_ipc_out_
 
std::unique_ptr< MainWindowmain_window_ {nullptr}
 
MidiReceiver midi_receiver_ {devices_}
 
MidiSender midi_sender_ {devices_}
 
Profile profile_ {command_set_}
 
ProfileManager profile_manager_ {controls_model_, profile_, lr_ipc_out_, midi_receiver_}
 
SettingsManager settings_manager_ {profile_manager_, lr_ipc_out_}
 
VersionChecker version_checker_ {settings_manager_}
 

Member Function Documentation

◆ anotherInstanceStarted() [1/2]

void MIDI2LRApplication::anotherInstanceStarted ( const juce::String &  command_line)
inlineoverride
264 {
265 if (command_line == kShutDownString) { systemRequestedQuit(); }
266 }
void systemRequestedQuit() override
Definition Main.cpp:237

◆ anotherInstanceStarted() [2/2]

void MIDI2LRApplication::anotherInstanceStarted ( const juce::String &  command_line)
inlineoverride
264 {
265 if (command_line == kShutDownString) { systemRequestedQuit(); }
266 }

◆ DefaultProfileSave() [1/2]

void MIDI2LRApplication::DefaultProfileSave ( )
inlineprivatenoexcept
365 {
366 try {
367 const auto file_name {rsj::AppDataFilePath(kDefaultsFile)};
368 const auto profile_file {juce::File(file_name.data())};
369 profile_.ToXmlFile(profile_file);
370 rsj::Log(fmt::format(FMT_STRING("Default profile saved to {}."),
371 profile_file.getFullPathName().toStdString()));
372 }
373 catch (const std::exception& e) {
375 }
376 }
Profile profile_
Definition Main.cpp:456
void ToXmlFile(const juce::File &file)
Definition Profile.cpp:239
void ExceptionResponse(gsl::czstring id, gsl::czstring fu, const std::exception &e) noexcept
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

◆ DefaultProfileSave() [2/2]

void MIDI2LRApplication::DefaultProfileSave ( )
inlineprivatenoexcept
365 {
366 try {
367 const auto file_name {rsj::AppDataFilePath(kDefaultsFile)};
368 const auto profile_file {juce::File(file_name.data())};
369 profile_.ToXmlFile(profile_file);
370 rsj::Log(fmt::format(FMT_STRING("Default profile saved to {}."),
371 profile_file.getFullPathName().toStdString()));
372 }
373 catch (const std::exception& e) {
375 }
376 }

◆ getApplicationName() [1/2]

const juce::String MIDI2LRApplication::getApplicationName ( )
inlineoverride
185 {
186 return ProjectInfo::projectName;
187 }

◆ getApplicationName() [2/2]

const juce::String MIDI2LRApplication::getApplicationName ( )
inlineoverride
185 {
186 return ProjectInfo::projectName;
187 }

◆ getApplicationVersion() [1/2]

const juce::String MIDI2LRApplication::getApplicationVersion ( )
inlineoverride
191 {
192 return ProjectInfo::versionString;
193 }

◆ getApplicationVersion() [2/2]

const juce::String MIDI2LRApplication::getApplicationVersion ( )
inlineoverride
191 {
192 return ProjectInfo::versionString;
193 }

◆ initialise() [1/2]

void MIDI2LRApplication::initialise ( const juce::String &  command_line)
inlineoverride
198 {
199 /*Called when the application starts. This will be called once to let the application do
200 * whatever initialization it needs, create its windows, etc. After the method returns, the
201 * normal event - dispatch loop will be run, until the quit() method is called, at which
202 * point the shutdown() method will be called to let the application clear up anything it
203 * needs to delete. If during the initialise() method, the application decides not to
204 * start-up after all, it can just call the quit() method and the event loop won't be
205 * run. */
206 try {
207 if (command_line != kShutDownString) {
210 /* Need to start main window before ipc so it's already registered its callbacks and can
211 * receive messages */
212 SetupUi();
214 }
215 else {
216 quit();
217 }
218 }
219 catch (const std::exception& e) {
221 throw;
222 }
223 }
void LinkControlsModels()
Definition Main.cpp:328
void SetupUi()
Definition Main.cpp:334
void StartServices()
Definition Main.cpp:342
void InitializeThreads()
Definition Main.cpp:303

◆ initialise() [2/2]

void MIDI2LRApplication::initialise ( const juce::String &  command_line)
inlineoverride
198 {
199 /*Called when the application starts. This will be called once to let the application do
200 * whatever initialization it needs, create its windows, etc. After the method returns, the
201 * normal event - dispatch loop will be run, until the quit() method is called, at which
202 * point the shutdown() method will be called to let the application clear up anything it
203 * needs to delete. If during the initialise() method, the application decides not to
204 * start-up after all, it can just call the quit() method and the event loop won't be
205 * run. */
206 try {
207 if (command_line != kShutDownString) {
210 /* Need to start main window before ipc so it's already registered its callbacks and can
211 * receive messages */
212 SetupUi();
214 }
215 else {
216 quit();
217 }
218 }
219 catch (const std::exception& e) {
221 throw;
222 }
223 }

◆ InitializeThreads() [1/2]

void MIDI2LRApplication::InitializeThreads ( )
inlineprivate
304 {
305 MIDI2LR_FAST_FLOATS;
306 rsj::LabelThread(MIDI2LR_UC_LITERAL("Main MIDI2LR thread"));
307 StartThread(io_thread0_, "io_thread0_");
308 StartThread(io_thread1_, "io_thread1_");
309 }
void StartThread(std::future< void > &thread, const char *threadName)
Definition Main.cpp:311
std::future< void > io_thread1_
Definition Main.cpp:450
std::future< void > io_thread0_
Definition Main.cpp:449
void LabelThread(gsl::czstring threadname)
Definition Misc.cpp:48

◆ InitializeThreads() [2/2]

void MIDI2LRApplication::InitializeThreads ( )
inlineprivate
304 {
305 MIDI2LR_FAST_FLOATS;
306 rsj::LabelThread(MIDI2LR_UC_LITERAL("Main MIDI2LR thread"));
307 StartThread(io_thread0_, "io_thread0_");
308 StartThread(io_thread1_, "io_thread1_");
309 }

◆ LinkControlsModels() [1/2]

void MIDI2LRApplication::LinkControlsModels ( )
inlineprivate
329 {
332 }
static void LinkToControlsModel(_In_ ControlsModel *model) noexcept
Definition CCoptions.h:66
ControlsModel controls_model_
Definition Main.cpp:455
static void LinkToControlsModel(_In_ ControlsModel *model) noexcept
Definition PWoptions.h:65

◆ LinkControlsModels() [2/2]

void MIDI2LRApplication::LinkControlsModels ( )
inlineprivate

◆ LoadControlsModel() [1/2]

void MIDI2LRApplication::LoadControlsModel ( )
inlineprivate
400 {
401 try {
402 const fs::path px {rsj::AppDataFilePath(kSettingsFileX)};
403 if (std::ifstream in_file {px}; in_file.is_open() && !in_file.eof()) {
404#pragma warning(suppress : 26414) /* too large to construct on stack */
405 const auto iarchive {std::make_unique<cereal::XMLInputArchive>(in_file)};
406 (*iarchive)(controls_model_);
407 rsj::Log(fmt::format(FMT_STRING("ControlsModel archive in Main loaded from {}."),
408 px.string()));
409 }
410 }
411 catch (const std::exception& e) {
413 throw;
414 }
415 }

◆ LoadControlsModel() [2/2]

void MIDI2LRApplication::LoadControlsModel ( )
inlineprivate
400 {
401 try {
402 const fs::path px {rsj::AppDataFilePath(kSettingsFileX)};
403 if (std::ifstream in_file {px}; in_file.is_open() && !in_file.eof()) {
404#pragma warning(suppress : 26414) /* too large to construct on stack */
405 const auto iarchive {std::make_unique<cereal::XMLInputArchive>(in_file)};
406 (*iarchive)(controls_model_);
407 rsj::Log(fmt::format(FMT_STRING("ControlsModel archive in Main loaded from {}."),
408 px.string()));
409 }
410 }
411 catch (const std::exception& e) {
413 throw;
414 }
415 }

◆ moreThanOneInstanceAllowed() [1/2]

bool MIDI2LRApplication::moreThanOneInstanceAllowed ( )
inlineoverridenoexcept
195{ return false; }

◆ moreThanOneInstanceAllowed() [2/2]

bool MIDI2LRApplication::moreThanOneInstanceAllowed ( )
inlineoverridenoexcept
195{ return false; }

◆ SaveControlsModel() [1/2]

void MIDI2LRApplication::SaveControlsModel ( ) const
inlineprivatenoexcept
379 {
380 try {
381 const fs::path p {rsj::AppDataFilePath(kSettingsFileX)};
382 if (std::ofstream outfile {p, std::ios::trunc}; outfile.is_open()) {
383#pragma warning(suppress : 26414) /* too large to construct on stack */
384 const auto oarchive {std::make_unique<cereal::XMLOutputArchive>(outfile)};
385 (*oarchive)(controls_model_);
386 rsj::Log(fmt::format(FMT_STRING("ControlsModel archive in Main saved to {}."),
387 p.string()));
388 }
389 else {
390 rsj::LogAndAlertError(juce::translate("Unable to save settings.xml"),
391 "Unable to save settings.xml");
392 }
393 }
394 catch (const std::exception& e) {
396 }
397 }
void LogAndAlertError(const juce::String &error_text, const std::source_location &location=std::source_location::current()) noexcept
Definition Misc.cpp:160

◆ SaveControlsModel() [2/2]

void MIDI2LRApplication::SaveControlsModel ( ) const
inlineprivatenoexcept
379 {
380 try {
381 const fs::path p {rsj::AppDataFilePath(kSettingsFileX)};
382 if (std::ofstream outfile {p, std::ios::trunc}; outfile.is_open()) {
383#pragma warning(suppress : 26414) /* too large to construct on stack */
384 const auto oarchive {std::make_unique<cereal::XMLOutputArchive>(outfile)};
385 (*oarchive)(controls_model_);
386 rsj::Log(fmt::format(FMT_STRING("ControlsModel archive in Main saved to {}."),
387 p.string()));
388 }
389 else {
390 rsj::LogAndAlertError(juce::translate("Unable to save settings.xml"),
391 "Unable to save settings.xml");
392 }
393 }
394 catch (const std::exception& e) {
396 }
397 }

◆ SetAppFont() [1/2]

void MIDI2LRApplication::SetAppFont ( ) const
inlineprivatenoexcept
418 {
419 try {
420 using namespace std::string_literals;
421 const auto& lang {command_set_.GetLanguage()};
422 const std::unordered_map<std::string, std::pair<std::string, std::string>> font_map {
423 { "ko"s, {"NotoSansKR-Regular.otf", ""}},
424 { "zh_TW"s, {"NotoSansTC-Regular.otf", ""}},
425 { "zh_tw"s, {"NotoSansTC-Regular.otf", ""}},
426 { "zh_CN"s, {"NotoSansSC-Regular.otf", ""}},
427 { "zh_cn"s, {"NotoSansSC-Regular.otf", ""}},
428 { "ja"s, {"NotoSansJP-Regular.otf", ""}},
429 {"default", {"NotoSans-Regular-MIDI2LR.ttf", "NotoSans-Bold-MIDI2LR.ttf"}}
430 };
431 auto font_pair = font_map.find(lang);
432 if (font_pair == font_map.end()) { font_pair = font_map.find("default"); }
433 const auto& primary_font_name = font_pair->second.first;
434 const auto& bold_font_name = font_pair->second.second;
435 LoadFont(primary_font_name, true);
436 if (!bold_font_name.empty()) { LoadFont(bold_font_name, false); }
437 }
438 catch (const std::exception& e) {
440 }
441 }
const auto & GetLanguage() const noexcept
Definition CommandSet.h:47
const CommandSet command_set_
Definition Main.cpp:454

◆ SetAppFont() [2/2]

void MIDI2LRApplication::SetAppFont ( ) const
inlineprivatenoexcept
418 {
419 try {
420 using namespace std::string_literals;
421 const auto& lang {command_set_.GetLanguage()};
422 const std::unordered_map<std::string, std::pair<std::string, std::string>> font_map {
423 { "ko"s, {"NotoSansKR-Regular.otf", ""}},
424 { "zh_TW"s, {"NotoSansTC-Regular.otf", ""}},
425 { "zh_tw"s, {"NotoSansTC-Regular.otf", ""}},
426 { "zh_CN"s, {"NotoSansSC-Regular.otf", ""}},
427 { "zh_cn"s, {"NotoSansSC-Regular.otf", ""}},
428 { "ja"s, {"NotoSansJP-Regular.otf", ""}},
429 {"default", {"NotoSans-Regular-MIDI2LR.ttf", "NotoSans-Bold-MIDI2LR.ttf"}}
430 };
431 auto font_pair = font_map.find(lang);
432 if (font_pair == font_map.end()) { font_pair = font_map.find("default"); }
433 const auto& primary_font_name = font_pair->second.first;
434 const auto& bold_font_name = font_pair->second.second;
435 LoadFont(primary_font_name, true);
436 if (!bold_font_name.empty()) { LoadFont(bold_font_name, false); }
437 }
438 catch (const std::exception& e) {
440 }
441 }

◆ SetupUi() [1/2]

void MIDI2LRApplication::SetupUi ( )
inlineprivate
335 {
336 SetAppFont();
338 main_window_ = std::make_unique<MainWindow>(getApplicationName(), command_set_, profile_,
340 }
MidiReceiver midi_receiver_
Definition Main.cpp:458
LrIpcOut lr_ipc_out_
Definition Main.cpp:459
std::unique_ptr< MainWindow > main_window_
Definition Main.cpp:465
SettingsManager settings_manager_
Definition Main.cpp:463
const juce::String getApplicationName() override
Definition Main.cpp:184
MidiSender midi_sender_
Definition Main.cpp:457
ProfileManager profile_manager_
Definition Main.cpp:461
void SetAppFont() const noexcept
Definition Main.cpp:417
void LoadControlsModel()
Definition Main.cpp:399

◆ SetupUi() [2/2]

void MIDI2LRApplication::SetupUi ( )
inlineprivate

◆ shutdown() [1/2]

void MIDI2LRApplication::shutdown ( )
inlineoverride
226 {
227 /*Called to allow the application to clear up before exiting. After JUCEApplication::quit()
228 * has been called, the event-dispatch loop will terminate, and this method will get called
229 * to allow the application to sort itself out. Be careful that nothing happens in this method
230 * that might rely on messages being sent, or any kind of window activity, because the message
231 * loop is no longer running at this point. */
232 StopServices();
235 }
void DefaultProfileSave() noexcept
Definition Main.cpp:364
void StopServices()
Definition Main.cpp:351
void SaveControlsModel() const noexcept
Definition Main.cpp:378

◆ shutdown() [2/2]

void MIDI2LRApplication::shutdown ( )
inlineoverride
226 {
227 /*Called to allow the application to clear up before exiting. After JUCEApplication::quit()
228 * has been called, the event-dispatch loop will terminate, and this method will get called
229 * to allow the application to sort itself out. Be careful that nothing happens in this method
230 * that might rely on messages being sent, or any kind of window activity, because the message
231 * loop is no longer running at this point. */
232 StopServices();
235 }

◆ StartServices() [1/2]

void MIDI2LRApplication::StartServices ( )
inlineprivate
343 {
349 }
void Start()
Definition LR_IPC_In.cpp:73
void Start()
Definition LR_IPC_Out.h:64
VersionChecker version_checker_
Definition Main.cpp:466
LrIpcIn lr_ipc_in_
Definition Main.cpp:462
void Start()
Definition MIDIReceiver.cpp:39
void Start()
Definition MIDISender.cpp:32
void Start()
Definition VersionChecker.cpp:50

◆ StartServices() [2/2]

void MIDI2LRApplication::StartServices ( )
inlineprivate

◆ StartThread() [1/2]

void MIDI2LRApplication::StartThread ( std::future< void > &  thread,
const char *  threadName 
)
inlineprivate
312 {
313 thread = std::async(std::launch::async, [this, threadName] {
314#ifdef _WIN32
315 const auto uwr = ww898::utf::convz<wchar_t>(threadName);
316 rsj::LabelThread(uwr.c_str());
317#else
318 rsj::LabelThread(threadName);
319#endif
320 MIDI2LR_FAST_FLOATS;
321 if constexpr (kNdebug) { io_context_.run(); }
322 else {
323 rsj::Log(fmt::format(FMT_STRING("{} ran {} handlers."), threadName, io_context_.run()));
324 }
325 });
326 }
asio::io_context io_context_
Definition Main.cpp:448

◆ StartThread() [2/2]

void MIDI2LRApplication::StartThread ( std::future< void > &  thread,
const char *  threadName 
)
inlineprivate
312 {
313 thread = std::async(std::launch::async, [this, threadName] {
314#ifdef _WIN32
315 const auto uwr = ww898::utf::convz<wchar_t>(threadName);
316 rsj::LabelThread(uwr.c_str());
317#else
318 rsj::LabelThread(threadName);
319#endif
320 MIDI2LR_FAST_FLOATS;
321 if constexpr (kNdebug) { io_context_.run(); }
322 else {
323 rsj::Log(fmt::format(FMT_STRING("{} ran {} handlers."), threadName, io_context_.run()));
324 }
325 });
326 }

◆ StopServices() [1/2]

void MIDI2LRApplication::StopServices ( )
inlineprivate
352 {
353 /*Primary goals: 1) remove callbacks in LR_IPC_Out and MIDIReceiver before the callee is
354 * destroyed, 2) stop additional threads in VersionChecker, LR_IPC_In, LR_IPC_Out and
355 * MIDIReceiver. Add to this list if new threads or callback lists are developed in this
356 * app. */
361 io_context_.stop();
362 }
void Stop()
Definition LR_IPC_In.cpp:90
void Stop()
Definition LR_IPC_Out.cpp:106
void Stop()
Definition MIDIReceiver.cpp:55
void Stop() noexcept
Definition VersionChecker.h:35

◆ StopServices() [2/2]

void MIDI2LRApplication::StopServices ( )
inlineprivate
352 {
353 /*Primary goals: 1) remove callbacks in LR_IPC_Out and MIDIReceiver before the callee is
354 * destroyed, 2) stop additional threads in VersionChecker, LR_IPC_In, LR_IPC_Out and
355 * MIDIReceiver. Add to this list if new threads or callback lists are developed in this
356 * app. */
361 io_context_.stop();
362 }

◆ systemRequestedQuit() [1/2]

void MIDI2LRApplication::systemRequestedQuit ( )
inlineoverride
238 {
239 /*This is called when the application is being asked to quit: you can ignore this request
240 * and let the application carry on running, or call quit() to allow the application to
241 * close. */
242 try {
243 static std::once_flag of; /* function might be called twice during LR shutdown */
244 std::call_once(of, [this] {
246 if (juce::NativeMessageBox::showYesNoBox(juce::AlertWindow::WarningIcon,
247 juce::translate("MIDI2LR profiles"),
248 juce::translate("Profile changed. Do you want to save your changes? If "
249 "you continue without saving, your changes will be "
250 "lost."))) {
251 main_window_->SaveProfile();
252 }
253 }
254 quit();
255 });
256 }
257 catch (const std::exception& e) {
259 throw;
260 }
261 }
bool ProfileUnsaved() const
Definition Profile.h:139

◆ systemRequestedQuit() [2/2]

void MIDI2LRApplication::systemRequestedQuit ( )
inlineoverride
238 {
239 /*This is called when the application is being asked to quit: you can ignore this request
240 * and let the application carry on running, or call quit() to allow the application to
241 * close. */
242 try {
243 static std::once_flag of; /* function might be called twice during LR shutdown */
244 std::call_once(of, [this] {
246 if (juce::NativeMessageBox::showYesNoBox(juce::AlertWindow::WarningIcon,
247 juce::translate("MIDI2LR profiles"),
248 juce::translate("Profile changed. Do you want to save your changes? If "
249 "you continue without saving, your changes will be "
250 "lost."))) {
251 main_window_->SaveProfile();
252 }
253 }
254 quit();
255 });
256 }
257 catch (const std::exception& e) {
259 throw;
260 }
261 }

◆ unhandledException() [1/2]

void MIDI2LRApplication::unhandledException ( const std::exception *  e,
const juce::String &  source_filename,
int  line_number 
)
inlineoverride
270 {
271 /* If any unhandled exceptions make it through to the message dispatch loop, this callback
272 * will be triggered, in case you want to log them or do some other type of error-handling. If
273 * the type of exception is derived from the std::exception class, the pointer passed-in will
274 * be valid. If the exception is of unknown type, this pointer will be null. */
275 try {
276 if (e) {
277 const auto msgt {juce::translate("unhandled exception").toStdString()
278 + " {}, {} line {}. Total uncaught {}."};
279 rsj::LogAndAlertError(fmt::format(msgt, e->what(), source_filename.toStdString(),
280 line_number, std::uncaught_exceptions()),
281 fmt::format(FMT_STRING("Unhandled exception {}, {} line {}. Total uncaught {}."),
282 e->what(), source_filename.toStdString(), line_number,
283 std::uncaught_exceptions()));
284 }
285 else {
286 const auto msgt {juce::translate("unhandled exception").toStdString()
287 + " {} line {}. Total uncaught {}."};
288 rsj::LogAndAlertError(fmt::format(msgt, source_filename.toStdString(), line_number,
289 std::uncaught_exceptions()),
290 fmt::format(FMT_STRING("Unhandled exception {} line {}. Total uncaught {}."),
291 source_filename.toStdString(), line_number, std::uncaught_exceptions()));
292 }
293 }
294 catch (...) {
295 /* we'll terminate anyway */
296 std::terminate();
297 }
298 /* can't go on with the program */
299 std::terminate();
300 }

◆ unhandledException() [2/2]

void MIDI2LRApplication::unhandledException ( const std::exception *  e,
const juce::String &  source_filename,
int  line_number 
)
inlineoverride
270 {
271 /* If any unhandled exceptions make it through to the message dispatch loop, this callback
272 * will be triggered, in case you want to log them or do some other type of error-handling. If
273 * the type of exception is derived from the std::exception class, the pointer passed-in will
274 * be valid. If the exception is of unknown type, this pointer will be null. */
275 try {
276 if (e) {
277 const auto msgt {juce::translate("unhandled exception").toStdString()
278 + " {}, {} line {}. Total uncaught {}."};
279 rsj::LogAndAlertError(fmt::format(msgt, e->what(), source_filename.toStdString(),
280 line_number, std::uncaught_exceptions()),
281 fmt::format(FMT_STRING("Unhandled exception {}, {} line {}. Total uncaught {}."),
282 e->what(), source_filename.toStdString(), line_number,
283 std::uncaught_exceptions()));
284 }
285 else {
286 const auto msgt {juce::translate("unhandled exception").toStdString()
287 + " {} line {}. Total uncaught {}."};
288 rsj::LogAndAlertError(fmt::format(msgt, source_filename.toStdString(), line_number,
289 std::uncaught_exceptions()),
290 fmt::format(FMT_STRING("Unhandled exception {} line {}. Total uncaught {}."),
291 source_filename.toStdString(), line_number, std::uncaught_exceptions()));
292 }
293 }
294 catch (...) {
295 /* we'll terminate anyway */
296 std::terminate();
297 }
298 /* can't go on with the program */
299 std::terminate();
300 }

Member Data Documentation

◆ command_set_

const CommandSet MIDI2LRApplication::command_set_ {}
private
454{};

◆ controls_model_

ControlsModel MIDI2LRApplication::controls_model_ {}
private
455{};

◆ devices_

Devices MIDI2LRApplication::devices_ {}
private
453{};

◆ dummy1_

const LookAndFeelMIDI2LR MIDI2LRApplication::dummy1_
private

◆ dummy_

const SetLogger MIDI2LRApplication::dummy_ {}
private
447{};

◆ guard_

asio::executor_work_guard< asio::io_context::executor_type > MIDI2LRApplication::guard_
private
Initial value:
{
asio::make_work_guard(io_context_)}
451 {
452 asio::make_work_guard(io_context_)};

◆ io_context_

asio::io_context MIDI2LRApplication::io_context_ {}
private
448{};

◆ io_thread0_

std::future< void > MIDI2LRApplication::io_thread0_
private

◆ io_thread1_

std::future< void > MIDI2LRApplication::io_thread1_
private

◆ lr_ipc_in_

◆ lr_ipc_out_

◆ main_window_

std::unique_ptr< MainWindow > MIDI2LRApplication::main_window_ {nullptr}
private
465{nullptr};

◆ midi_receiver_

MidiReceiver MIDI2LRApplication::midi_receiver_ {devices_}
private
458{devices_};
Devices devices_
Definition Main.cpp:453

◆ midi_sender_

MidiSender MIDI2LRApplication::midi_sender_ {devices_}
private
457{devices_};

◆ profile_

Profile MIDI2LRApplication::profile_ {command_set_}
private

◆ profile_manager_

◆ settings_manager_

SettingsManager MIDI2LRApplication::settings_manager_ {profile_manager_, lr_ipc_out_}
private

◆ version_checker_

VersionChecker MIDI2LRApplication::version_checker_ {settings_manager_}
private

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