47 std::vector<choice> choices;
48 QVariant default_value{};
56 std::vector<config_field> options;
66 bool isInverted{
false};
70 std::vector<config_field> options;
84 std::vector<QVariantMap> feedbacks;
85 std::vector<QVariantMap> steps;
88 std::map<QString, action_definition> actions;
89 std::map<QString, variable_definition> variables;
90 std::map<QString, feedback_definition> feedbacks;
91 std::map<QString, preset_definition> presets;
92 std::vector<config_field> config_fields;
93 module_configuration config;
111 char buf[16 * 4096]{};
112 std::vector<char> queue;
114 QSocketNotifier* socket{};
118 QString node_path, QString module_path, QString entrypoint);
121 void on_read(QSocketDescriptor, QSocketNotifier::Type);
122 void do_write(std::string_view res);
124 virtual void processMessage(std::string_view) = 0;
133 QString path, QString entrypoint, QString nodeVersion, QString apiversion,
134 module_configuration config);
137 using module_handler_base::do_write;
138 void do_write(QString res);
139 QString jsonToString(QJsonObject obj);
141 void afterRegistration(std::function<
void()>);
143 void processMessage(std::string_view v)
override;
145 int writeRequest(QString name, QString p);
146 void writeReply(QJsonValue
id, QString p);
147 void writeReply(QJsonValue
id, QJsonObject p);
148 void writeReply(QJsonValue
id, QString p,
bool success);
149 void writeReply(QJsonValue
id, QJsonObject p,
bool success);
152 void on_register(QJsonValue
id);
153 void on_setActionDefinitions(QJsonArray obj);
154 void on_setVariableDefinitions(QJsonArray obj);
155 void on_setFeedbackDefinitions(QJsonArray obj);
156 void on_setPresetDefinitions(QJsonArray obj);
157 void on_setVariableValues(QJsonArray obj);
158 void on_set_status(QJsonObject obj);
159 void on_saveConfig(QJsonObject obj);
160 void on_parseVariablesInString(QJsonValue
id, QJsonObject obj);
161 void on_updateFeedbackValues(QJsonObject obj);
162 void on_recordAction(QJsonObject obj);
163 void on_setCustomVariable(QJsonObject obj);
164 void on_sharedUdpSocketJoin(QJsonObject obj);
165 void on_sharedUdpSocketLeave(QJsonObject obj);
166 void on_sharedUdpSocketSend(QJsonObject obj);
167 void on_send_osc(QJsonObject obj);
172 void on_response_configFields(QJsonArray fields);
176 int init(QString label);
177 void send_success(QJsonValue
id);
178 void updateConfigAndLabel(QString label, module_configuration conf);
179 int requestConfigFields();
180 void updateFeedbacks();
181 void feedbackLearnValues();
182 void feedbackDelete();
183 void variablesChanged();
186 void actionLearnValues();
187 void actionRun(std::string_view act, QVariantMap options);
189 void executeHttpRequest();
190 void startStopRecordingActions();
191 void sharedUdpSocketMessage();
192 void sharedUdpSocketError();
195 void configurationParsed() W_SIGNAL(configurationParsed);
196 void variableChanged(QString var, QVariant val) W_SIGNAL(variableChanged, var, val);
201 boost::asio::io_context m_send_service;
202 boost::asio::ip::udp::socket m_socket{m_send_service};
204 std::vector<std::function<void()>> m_afterRegistrationQueue;
207 int m_init_msg_id{-1};
208 int m_req_cfg_id{-1};
210 bool m_expects_label_updates{
true};
211 bool m_registered{
false};