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
LrIpcOutShared Class Reference

Public Member Functions

 LrIpcOutShared (asio::io_context &io_context)
 
 LrIpcOutShared (asio::io_context &io_context)
 

Static Private Member Functions

static void SendOut (std::shared_ptr< LrIpcOutShared > lr_ipc_out_shared)
 
static void SendOut (std::shared_ptr< LrIpcOutShared > lr_ipc_out_shared)
 

Private Attributes

rsj::ConcurrentQueue< std::string > command_
 
friend LrIpcOut
 
asio::ip::tcp::socket socket_
 

Constructor & Destructor Documentation

◆ LrIpcOutShared() [1/2]

LrIpcOutShared::LrIpcOutShared ( asio::io_context &  io_context)
inlineexplicit
53 : socket_ {asio::make_strand(io_context)}
54 {
55 }
asio::ip::tcp::socket socket_
Definition LR_IPC_Out.cpp:48

◆ LrIpcOutShared() [2/2]

LrIpcOutShared::LrIpcOutShared ( asio::io_context &  io_context)
inlineexplicit
53 : socket_ {asio::make_strand(io_context)}
54 {
55 }

Member Function Documentation

◆ SendOut() [1/2]

void LrIpcOutShared::SendOut ( std::shared_ptr< LrIpcOutShared lr_ipc_out_shared)
staticprivate
249{
250 try {
251 auto command_copy {std::make_shared<std::string>(lr_ipc_out_shared->command_.pop())};
252 if (*command_copy == kTerminate) [[unlikely]] { return; }
253 if (command_copy->back() != '\n') [[unlikely]] { /* should be terminated with \n */
254 command_copy->push_back('\n');
255 } // ReSharper disable once CppLambdaCaptureNeverUsed
256 asio::async_write(lr_ipc_out_shared->socket_, asio::buffer(*command_copy),
257 [command_copy, lr_ipc_out_shared](const asio::error_code& error, std::size_t) mutable {
258 if (!error) [[likely]] { SendOut(std::move(lr_ipc_out_shared)); }
259 else {
260 rsj::Log(fmt::format(FMT_STRING("LR_IPC_Out Write: {}."), error.message()));
261 }
262 });
263 }
264 catch (const std::exception& e) {
266 throw;
267 }
268}
void ExceptionResponse(gsl::czstring id, gsl::czstring fu, const std::exception &e) noexcept

◆ SendOut() [2/2]

static void LrIpcOutShared::SendOut ( std::shared_ptr< LrIpcOutShared lr_ipc_out_shared)
staticprivate

Member Data Documentation

◆ command_

rsj::ConcurrentQueue< std::string > LrIpcOutShared::command_
private

◆ LrIpcOut

LrIpcOut
private

◆ socket_

asio::ip::tcp::socket LrIpcOutShared::socket_
private

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