![]() |
MIDI2LR 6.3.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.
|
#include <LR_IPC_Out.h>
Classes | |
| struct | RecenterInfo |
Public Member Functions | |
| LrIpcOut (const CommandSet &command_set, ControlsModel &c_model, const Profile &profile, const MidiSender &midi_sender, MidiReceiver &midi_receiver, asio::io_context &io_context) | |
| LrIpcOut (const LrIpcOut &other)=delete | |
| LrIpcOut (LrIpcOut &&other)=delete | |
| ~LrIpcOut ()=default | |
| template<class T> | |
| void | AddCallback (_In_ T *const object, _In_ void(T::*const mf)(bool, bool)) |
| LrIpcOut & | operator= (const LrIpcOut &other)=delete |
| LrIpcOut & | operator= (LrIpcOut &&other)=delete |
| void | SendCommand (const std::string &command) const |
| void | SendCommand (std::string &&command) const |
| void | SendingRestart () |
| void | SendingStop () |
| void | Start () |
| void | Stop () |
Private Types | |
| using | Clock = std::chrono::steady_clock |
| using | RepeatCmdIterator |
| using | TimePoint = Clock::time_point |
Private Member Functions | |
| void | Connect (std::shared_ptr< LrIpcOutShared > lr_ipc_out_shared) |
| void | ConnectionMade () |
| void | MidiCmdCallback (rsj::MidiMessage mm) |
| void | ProcessMessage (const rsj::MidiMessageId &message, const rsj::MidiMessage &mm) |
| void | ProcessRepeatedCommand (const RepeatCmdIterator &repeats, const rsj::MidiMessage &mm, const rsj::MidiMessageId &message) |
| void | SendNonRepeatedCommand (const std::string &command_to_send, const rsj::MidiMessage &mm) const |
| void | SendRepeatedCommand (const RepeatCmdIterator &repeats, const rsj::MidiMessage &mm) const |
| void | SetRecenter (const rsj::MidiMessageId &, RecenterInfo &) |
| bool | ShouldSetRecenter (const rsj::MidiMessage &mm) const |
Private Attributes | |
| std::mutex | callback_mtx_ |
| std::vector< std::function< void(bool, bool)> > | callbacks_ {} |
| bool | connected_ {false} |
| ControlsModel & | controls_model_ |
| std::shared_ptr< LrIpcOutShared > | lr_ipc_out_shared_ |
| const MidiSender & | midi_sender_ |
| const Profile & | profile_ |
| std::map< rsj::MidiMessageId, RecenterInfo > | recenter_timers_ |
| std::mutex | recenter_timers_mtx_ {} |
| const std::unordered_map< std::string, std::pair< std::string, std::string > > & | repeat_cmd_ |
| std::atomic< bool > | sending_stopped_ {false} |
| asio::strand< asio::io_context::executor_type > | timer_strand_ |
| const std::vector< std::string > & | wrap_ |
|
private |
|
private |
|
private |
| LrIpcOut::LrIpcOut | ( | const CommandSet & | command_set, |
| ControlsModel & | c_model, | ||
| const Profile & | profile, | ||
| const MidiSender & | midi_sender, | ||
| MidiReceiver & | midi_receiver, | ||
| asio::io_context & | io_context ) |
References timer_strand_.
|
default |
|
delete |
|
delete |
|
inline |
|
private |
Referenced by Start().
|
private |
References connected_, and sending_stopped_.
|
private |
References rsj::MidiMessageId::MidiMessageId(), Profile::MessageExistsInMap(), ProcessMessage(), and profile_.
|
private |
References Profile::GetCommandForMessage(), profile_, repeat_cmd_, and SendNonRepeatedCommand().
Referenced by MidiCmdCallback().
|
private |
References recenter_timers_, SetRecenter(), ShouldSetRecenter(), and timer_strand_.
| void LrIpcOut::SendCommand | ( | const std::string & | command | ) | const |
References sending_stopped_.
| void LrIpcOut::SendCommand | ( | std::string && | command | ) | const |
References sending_stopped_.
Referenced by SettingsManager::ConnectionCallback(), SendingRestart(), SettingsManager::SetPickupEnabled(), and SettingsManager::WriteDebugInfo().
| void LrIpcOut::SendingRestart | ( | ) |
References SendCommand(), and sending_stopped_.
Referenced by MainContentComponent::DisconnectClicked().
| void LrIpcOut::SendingStop | ( | ) |
References sending_stopped_.
Referenced by MainContentComponent::DisconnectClicked().
|
private |
References ControlsModel::ControllerToPlugin(), and controls_model_.
Referenced by ProcessMessage().
|
private |
References controls_model_, and ControlsModel::MeasureChange().
|
private |
References LrIpcOut::RecenterInfo::timer.
Referenced by ProcessRepeatedCommand().
|
nodiscardprivate |
References rsj::MidiMessage::channel, rsj::MidiMessage::control_number, controls_model_, ControlsModel::GetCcMethod(), rsj::kAbsolute, rsj::kCc, rsj::kPw, and rsj::MidiMessage::message_type_byte.
Referenced by ProcessRepeatedCommand().
|
inline |
References Connect(), and lr_ipc_out_shared_.
| void LrIpcOut::Stop | ( | ) |
|
mutableprivate |
|
private |
|
private |
Referenced by ConnectionMade().
|
private |
Referenced by SendNonRepeatedCommand(), SendRepeatedCommand(), and ShouldSetRecenter().
|
private |
Referenced by Start().
|
private |
|
private |
Referenced by MidiCmdCallback(), and ProcessMessage().
|
private |
Referenced by ProcessRepeatedCommand().
|
private |
|
private |
Referenced by ProcessMessage().
|
private |
Referenced by ConnectionMade(), SendCommand(), SendCommand(), SendingRestart(), and SendingStop().
|
private |
Referenced by LrIpcOut(), and ProcessRepeatedCommand().
|
private |