166{
167 try {
168 for (auto line_copy = lr_ipc_shared->line_.pop(); line_copy != kTerminate;
169 line_copy = lr_ipc_shared->line_.pop()) {
170 auto [command_view, value_view] {SplitLine(line_copy)};
171 if (command_view == "TerminateApplication") {
172 juce::JUCEApplication::getInstance()->systemRequestedQuit();
173 return;
174 }
175 if (value_view.empty()) {
176 rsj::Log(fmt::format(FMT_STRING(
"No value attached to message. Message from plugin was "
177 "\"{}\"."),
179 }
180 else if (command_view == "SwitchProfile") {
182 }
183 else if (command_view == "Log") {
184 rsj::Log(fmt::format(FMT_STRING(
"Plugin: {}."), value_view));
185 }
186 else if (command_view == "SendKey") {
187 int modifiers = 0;
188 std::from_chars(value_view.data(), value_view.data() + value_view.size(), modifiers);
189
190 const auto first_not_digit {value_view.find_first_not_of("0123456789")};
191 if (first_not_digit != std::string_view::npos) {
192 value_view.remove_prefix(first_not_digit + 1);
193 if (!value_view.empty()) {
196 continue;
197 }
198 }
200 "Message from plugin was \"{}\"."),
202 }
203 else {
204#ifdef _MSC_VER
205 double original_value = 0.0;
206 std::from_chars(value_view.data(), value_view.data() + value_view.size(),
207 original_value);
208#else
209 const auto original_value {std::stod(std::string(value_view))};
210#endif
212 for (const auto& msg : messages) {
213
218 }
219 }
220 }
221 }
222 }
223 catch (const std::exception& e) {
225 throw;
226 }
227}
rsj::CCmethod GetCcMethod(int channel, int controlnumber) const
Definition ControlsModel.h:244
int PluginToController(rsj::MidiMessageId msg_id, double value)
Definition ControlsModel.h:270
void Send(rsj::MidiMessageId id, int value) const
Definition MIDISender.cpp:52
std::vector< rsj::MidiMessageId > GetMessagesForCommand(const std::string &command) const
Definition Profile.cpp:83
void SwitchToProfile(int profile_index)
Definition ProfileManager.cpp:57
std::string ReplaceInvisibleChars(std::string_view in)
void SendKeyDownUp(const std::string &key, rsj::ActiveModifiers mods) noexcept
Definition SendKeysMac.cpp:378
void LogAndAlertError(const juce::String &error_text, const std::source_location &location=std::source_location::current()) noexcept
Definition Misc.cpp:160
static ActiveModifiers FromMidi2LR(int from) noexcept
Definition SendKeys.cpp:30