151 QString path, QString entrypoint, QString nodeVersion, QString apiversion,
152 module_configuration config);
155 using module_handler_base::do_write;
156 void do_write(QString res);
157 QString jsonToString(QJsonObject obj);
159 void afterRegistration(std::function<
void()>);
161 void processMessage(std::string_view v)
override;
163 int writeRequest(QString name, QString p);
164 void writeReply(QJsonValue
id, QString p);
165 void writeReply(QJsonValue
id, QJsonObject p);
166 void writeReply(QJsonValue
id, QString p,
bool success);
167 void writeReply(QJsonValue
id, QJsonObject p,
bool success);
170 void on_register(QJsonValue
id);
171 void on_setActionDefinitions(QJsonArray obj);
172 void on_setVariableDefinitions(QJsonArray obj);
173 void on_setFeedbackDefinitions(QJsonArray obj);
174 void on_setPresetDefinitions(QJsonArray obj);
175 void on_setVariableValues(QJsonArray obj);
176 void on_set_status(QJsonObject obj);
177 void on_saveConfig(QJsonObject obj);
178 void on_parseVariablesInString(QJsonValue
id, QJsonObject obj);
179 void on_updateFeedbackValues(QJsonObject obj);
180 void on_recordAction(QJsonObject obj);
181 void on_setCustomVariable(QJsonObject obj);
182 void on_sharedUdpSocketJoin(QJsonValue
id, QJsonObject obj);
183 void on_sharedUdpSocketLeave(QJsonObject obj);
184 void on_sharedUdpSocketSend(QJsonObject obj);
185 void on_send_osc(QJsonObject obj);
190 void on_response_configFields(QJsonArray fields);
194 int init(QString label);
195 void send_success(QJsonValue
id);
196 void updateConfigAndLabel(QString label, module_configuration conf);
197 int requestConfigFields();
198 void updateFeedbacks(
const std::map<QString, module_data::feedback_instance>& feedbacks);
199 void feedbackLearnValues();
200 void feedbackDelete();
201 void variablesChanged();
204 void actionLearnValues();
205 void actionRun(std::string_view act, QVariantMap options);
207 void executeHttpRequest(
208 const QString& method,
const QString& path,
const QString& body,
212 void startStopRecordingActions();
213 void sharedUdpSocketMessage();
214 void sharedUdpSocketError();
217 void configurationParsed() W_SIGNAL(configurationParsed);
218 void variableChanged(QString var, QVariant val) W_SIGNAL(variableChanged, var, val);
219 void feedbackValueChanged(QString
id, QString controlId, QVariant value)
220 W_SIGNAL(feedbackValueChanged,
id, controlId, value);
223 struct shared_udp_handle
228 boost::asio::ip::udp::socket socket;
229 boost::asio::ip::udp::endpoint sender_endpoint;
230 std::array<char, 65536> recv_buffer{};
232 explicit shared_udp_handle(boost::asio::io_context& ctx)
238 void start_udp_receive(shared_udp_handle* h);
242 boost::asio::io_context m_send_service;
243 boost::asio::ip::udp::socket m_socket{m_send_service};
245 std::map<QString, std::unique_ptr<shared_udp_handle>> m_shared_udp_handles;
248 std::vector<std::function<void()>> m_afterRegistrationQueue;
251 int m_init_msg_id{-1};
252 int m_req_cfg_id{-1};
254 bool m_expects_label_updates{
true};
255 bool m_hasHttpHandler{
false};
256 bool m_registered{
false};