1 /* GSequencer - Advanced GTK Sequencer
2 * Copyright (C) 2005-2019 Joël Krähemann
3 *
4 * This file is part of GSequencer.
5 *
6 * GSequencer is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * GSequencer is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with GSequencer. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include <ags/X/osc/controller/ags_ui_osc_renew_controller.h>
21
22 #include <ags/X/ags_ui_provider.h>
23 #include <ags/X/ags_machine.h>
24 #include <ags/X/ags_effect_bridge.h>
25 #include <ags/X/ags_pad.h>
26 #include <ags/X/ags_line.h>
27 #include <ags/X/ags_effect_pad.h>
28 #include <ags/X/ags_effect_line.h>
29 #include <ags/X/ags_line_member.h>
30 #include <ags/X/ags_bulk_member.h>
31
32 #include <ags/X/machine/ags_panel.h>
33 #include <ags/X/machine/ags_spectrometer.h>
34 #include <ags/X/machine/ags_equalizer10.h>
35 #include <ags/X/machine/ags_mixer.h>
36 #include <ags/X/machine/ags_drum.h>
37 #include <ags/X/machine/ags_matrix.h>
38 #include <ags/X/machine/ags_synth.h>
39 #include <ags/X/machine/ags_fm_synth.h>
40 #include <ags/X/machine/ags_syncsynth.h>
41 #include <ags/X/machine/ags_fm_syncsynth.h>
42 #include <ags/X/machine/ags_ffplayer.h>
43 #include <ags/X/machine/ags_pitch_sampler.h>
44 #include <ags/X/machine/ags_audiorec.h>
45
46 #include <ags/i18n.h>
47
48 void ags_ui_osc_renew_controller_class_init(AgsUiOscRenewControllerClass *ui_osc_renew_controller);
49 void ags_ui_osc_renew_controller_osc_plugin_controller_interface_init(AgsOscPluginControllerInterface *osc_plugin_controller);
50 void ags_ui_osc_renew_controller_init(AgsUiOscRenewController *ui_osc_renew_controller);
51 void ags_ui_osc_renew_controller_set_property(GObject *gobject,
52 guint prop_id,
53 const GValue *value,
54 GParamSpec *param_spec);
55 void ags_ui_osc_renew_controller_get_property(GObject *gobject,
56 guint prop_id,
57 GValue *value,
58 GParamSpec *param_spec);
59 void ags_ui_osc_renew_controller_dispose(GObject *gobject);
60 void ags_ui_osc_renew_controller_finalize(GObject *gobject);
61
62 gpointer ags_ui_osc_renew_controller_do_request(AgsOscPluginController *osc_plugin_controller,
63 AgsOscConnection *osc_connection,
64 unsigned char *message, guint message_size);
65
66 gpointer ags_ui_osc_renew_controller_set_data_machine(AgsUiOscRenewController *ui_osc_renew_controller,
67 AgsOscConnection *osc_connection,
68 AgsMachine *machine,
69 unsigned char *message, guint message_size,
70 gchar *type_tag,
71 gchar *path, guint path_offset);
72 gpointer ags_ui_osc_renew_controller_set_data_effect_bridge(AgsUiOscRenewController *ui_osc_renew_controller,
73 AgsOscConnection *osc_connection,
74 AgsEffectBridge *effect_bridge,
75 unsigned char *message, guint message_size,
76 gchar *type_tag,
77 gchar *path, guint path_offset);
78
79 gpointer ags_ui_osc_renew_controller_set_data_pad(AgsUiOscRenewController *ui_osc_renew_controller,
80 AgsOscConnection *osc_connection,
81 AgsPad *pad,
82 unsigned char *message, guint message_size,
83 gchar *type_tag,
84 gchar *path, guint path_offset);
85 gpointer ags_ui_osc_renew_controller_set_data_line(AgsUiOscRenewController *ui_osc_renew_controller,
86 AgsOscConnection *osc_connection,
87 AgsLine *line,
88 unsigned char *message, guint message_size,
89 gchar *type_tag,
90 gchar *path, guint path_offset);
91
92 gpointer ags_ui_osc_renew_controller_set_data_effect_pad(AgsUiOscRenewController *ui_osc_renew_controller,
93 AgsOscConnection *osc_connection,
94 AgsEffectPad *effect_pad,
95 unsigned char *message, guint message_size,
96 gchar *type_tag,
97 gchar *path, guint path_offset);
98 gpointer ags_ui_osc_renew_controller_set_data_effect_line(AgsUiOscRenewController *ui_osc_renew_controller,
99 AgsOscConnection *osc_connection,
100 AgsEffectLine *effect_line,
101 unsigned char *message, guint message_size,
102 gchar *type_tag,
103 gchar *path, guint path_offset);
104
105 gpointer ags_ui_osc_renew_controller_set_data_bulk_member(AgsUiOscRenewController *ui_osc_renew_controller,
106 AgsOscConnection *osc_connection,
107 AgsBulkMember *bulk_member,
108 unsigned char *message, guint message_size,
109 gchar *type_tag,
110 gchar *path, guint path_offset);
111 gpointer ags_ui_osc_renew_controller_set_data_line_member(AgsUiOscRenewController *ui_osc_renew_controller,
112 AgsOscConnection *osc_connection,
113 AgsLineMember *line_member,
114 unsigned char *message, guint message_size,
115 gchar *type_tag,
116 gchar *path, guint path_offset);
117
118 gpointer ags_ui_osc_renew_controller_real_set_data(AgsUiOscRenewController *ui_osc_renew_controller,
119 AgsOscConnection *osc_connection,
120 unsigned char *message, guint message_size);
121
122 /**
123 * SECTION:ags_ui_osc_renew_controller
124 * @short_description: UI OSC renew controller
125 * @title: AgsUiOscRenewController
126 * @section_id:
127 * @include: ags/X/osc/controller/ags_ui_osc_renew_controller.h
128 *
129 * The #AgsUiOscRenewController implements the UI OSC renew controller.
130 */
131
132 enum{
133 PROP_0,
134 };
135
136 enum{
137 SET_DATA,
138 LAST_SIGNAL,
139 };
140
141 static gpointer ags_ui_osc_renew_controller_parent_class = NULL;
142 static guint ui_osc_renew_controller_signals[LAST_SIGNAL];
143
144 static GMutex regex_mutex;
145
146 GType
ags_ui_osc_renew_controller_get_type()147 ags_ui_osc_renew_controller_get_type()
148 {
149 static volatile gsize g_define_type_id__volatile = 0;
150
151 if(g_once_init_enter (&g_define_type_id__volatile)){
152 GType ags_type_ui_osc_renew_controller = 0;
153
154 static const GTypeInfo ags_ui_osc_renew_controller_info = {
155 sizeof (AgsUiOscRenewControllerClass),
156 NULL, /* base_init */
157 NULL, /* base_finalize */
158 (GClassInitFunc) ags_ui_osc_renew_controller_class_init,
159 NULL, /* class_finalize */
160 NULL, /* class_data */
161 sizeof (AgsUiOscRenewController),
162 0, /* n_preallocs */
163 (GInstanceInitFunc) ags_ui_osc_renew_controller_init,
164 };
165
166 static const GInterfaceInfo ags_osc_plugin_controller_interface_info = {
167 (GInterfaceInitFunc) ags_ui_osc_renew_controller_osc_plugin_controller_interface_init,
168 NULL, /* interface_finalize */
169 NULL, /* interface_data */
170 };
171
172 ags_type_ui_osc_renew_controller = g_type_register_static(AGS_TYPE_OSC_CONTROLLER,
173 "AgsUiOscRenewController",
174 &ags_ui_osc_renew_controller_info,
175 0);
176
177 g_type_add_interface_static(ags_type_ui_osc_renew_controller,
178 AGS_TYPE_OSC_PLUGIN_CONTROLLER,
179 &ags_osc_plugin_controller_interface_info);
180
181 g_once_init_leave(&g_define_type_id__volatile, ags_type_ui_osc_renew_controller);
182 }
183
184 return g_define_type_id__volatile;
185 }
186
187 void
ags_ui_osc_renew_controller_class_init(AgsUiOscRenewControllerClass * ui_osc_renew_controller)188 ags_ui_osc_renew_controller_class_init(AgsUiOscRenewControllerClass *ui_osc_renew_controller)
189 {
190 GObjectClass *gobject;
191 GParamSpec *param_spec;
192
193 ags_ui_osc_renew_controller_parent_class = g_type_class_peek_parent(ui_osc_renew_controller);
194
195 /* GObjectClass */
196 gobject = (GObjectClass *) ui_osc_renew_controller;
197
198 gobject->set_property = ags_ui_osc_renew_controller_set_property;
199 gobject->get_property = ags_ui_osc_renew_controller_get_property;
200
201 gobject->dispose = ags_ui_osc_renew_controller_dispose;
202 gobject->finalize = ags_ui_osc_renew_controller_finalize;
203
204 /* properties */
205
206 /* AgsUiOscRenewControllerClass */
207 ui_osc_renew_controller->set_data = ags_ui_osc_renew_controller_real_set_data;
208
209 /* signals */
210 /**
211 * AgsUiOscRenewController::set-data:
212 * @ui_osc_renew_controller: the #AgsUiOscRenewController
213 * @osc_connection: the #AgsOscConnection
214 * @message: the message received
215 * @message_size: the message size
216 *
217 * The ::set-data signal is emited during get data of renew controller.
218 *
219 * Returns: the #AgsOscResponse
220 *
221 * Since: 3.0.0
222 */
223 ui_osc_renew_controller_signals[SET_DATA] =
224 g_signal_new("set-data",
225 G_TYPE_FROM_CLASS(ui_osc_renew_controller),
226 G_SIGNAL_RUN_LAST,
227 G_STRUCT_OFFSET(AgsUiOscRenewControllerClass, set_data),
228 NULL, NULL,
229 ags_cclosure_marshal_POINTER__OBJECT_POINTER_UINT,
230 G_TYPE_POINTER, 3,
231 G_TYPE_OBJECT,
232 G_TYPE_POINTER,
233 G_TYPE_UINT);
234 }
235
236 void
ags_ui_osc_renew_controller_osc_plugin_controller_interface_init(AgsOscPluginControllerInterface * osc_plugin_controller)237 ags_ui_osc_renew_controller_osc_plugin_controller_interface_init(AgsOscPluginControllerInterface *osc_plugin_controller)
238 {
239 osc_plugin_controller->do_request = ags_ui_osc_renew_controller_do_request;
240 }
241
242 void
ags_ui_osc_renew_controller_init(AgsUiOscRenewController * ui_osc_renew_controller)243 ags_ui_osc_renew_controller_init(AgsUiOscRenewController *ui_osc_renew_controller)
244 {
245 AgsApplicationContext *application_context;
246
247 application_context = ags_application_context_get_instance();
248
249 g_signal_connect(application_context, "check-message",
250 G_CALLBACK(ags_ui_osc_renew_controller_check_message_callback), ui_osc_renew_controller);
251
252 g_object_set(ui_osc_renew_controller,
253 "context-path", "/ui-renew",
254 NULL);
255 }
256
257 void
ags_ui_osc_renew_controller_set_property(GObject * gobject,guint prop_id,const GValue * value,GParamSpec * param_spec)258 ags_ui_osc_renew_controller_set_property(GObject *gobject,
259 guint prop_id,
260 const GValue *value,
261 GParamSpec *param_spec)
262 {
263 AgsUiOscRenewController *ui_osc_renew_controller;
264
265 GRecMutex *osc_controller_mutex;
266
267 ui_osc_renew_controller = AGS_UI_OSC_RENEW_CONTROLLER(gobject);
268
269 /* get osc controller mutex */
270 osc_controller_mutex = AGS_OSC_CONTROLLER_GET_OBJ_MUTEX(ui_osc_renew_controller);
271
272 switch(prop_id){
273 default:
274 G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, param_spec);
275 break;
276 }
277 }
278
279 void
ags_ui_osc_renew_controller_get_property(GObject * gobject,guint prop_id,GValue * value,GParamSpec * param_spec)280 ags_ui_osc_renew_controller_get_property(GObject *gobject,
281 guint prop_id,
282 GValue *value,
283 GParamSpec *param_spec)
284 {
285 AgsUiOscRenewController *ui_osc_renew_controller;
286
287 GRecMutex *osc_controller_mutex;
288
289 ui_osc_renew_controller = AGS_UI_OSC_RENEW_CONTROLLER(gobject);
290
291 /* get osc controller mutex */
292 osc_controller_mutex = AGS_OSC_CONTROLLER_GET_OBJ_MUTEX(ui_osc_renew_controller);
293
294 switch(prop_id){
295 default:
296 G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, param_spec);
297 break;
298 }
299 }
300
301 void
ags_ui_osc_renew_controller_dispose(GObject * gobject)302 ags_ui_osc_renew_controller_dispose(GObject *gobject)
303 {
304 AgsUiOscRenewController *ui_osc_renew_controller;
305
306 ui_osc_renew_controller = AGS_UI_OSC_RENEW_CONTROLLER(gobject);
307
308 /* call parent */
309 G_OBJECT_CLASS(ags_ui_osc_renew_controller_parent_class)->dispose(gobject);
310 }
311
312 void
ags_ui_osc_renew_controller_finalize(GObject * gobject)313 ags_ui_osc_renew_controller_finalize(GObject *gobject)
314 {
315 AgsUiOscRenewController *ui_osc_renew_controller;
316
317 AgsApplicationContext *application_context;
318
319 ui_osc_renew_controller = AGS_UI_OSC_RENEW_CONTROLLER(gobject);
320
321 application_context = ags_application_context_get_instance();
322
323 g_object_disconnect(application_context,
324 "any_signal::check-message",
325 G_CALLBACK(ags_ui_osc_renew_controller_check_message_callback),
326 ui_osc_renew_controller,
327 NULL);
328
329 /* call parent */
330 G_OBJECT_CLASS(ags_ui_osc_renew_controller_parent_class)->finalize(gobject);
331 }
332
333 gpointer
ags_ui_osc_renew_controller_do_request(AgsOscPluginController * osc_plugin_controller,AgsOscConnection * osc_connection,unsigned char * message,guint message_size)334 ags_ui_osc_renew_controller_do_request(AgsOscPluginController *osc_plugin_controller,
335 AgsOscConnection *osc_connection,
336 unsigned char *message, guint message_size)
337 {
338 gpointer response;
339
340 response = ags_ui_osc_renew_controller_set_data(AGS_UI_OSC_RENEW_CONTROLLER(osc_plugin_controller),
341 osc_connection,
342 message, message_size);
343
344 return(response);
345 }
346
347 gpointer
ags_ui_osc_renew_controller_set_data_machine(AgsUiOscRenewController * ui_osc_renew_controller,AgsOscConnection * osc_connection,AgsMachine * machine,unsigned char * message,guint message_size,gchar * type_tag,gchar * path,guint path_offset)348 ags_ui_osc_renew_controller_set_data_machine(AgsUiOscRenewController *ui_osc_renew_controller,
349 AgsOscConnection *osc_connection,
350 AgsMachine *machine,
351 unsigned char *message, guint message_size,
352 gchar *type_tag,
353 gchar *path, guint path_offset)
354 {
355 AgsOscResponse *osc_response;
356
357 AgsMessageDelivery *message_delivery;
358 AgsMessageQueue *message_queue;
359
360 GList *start_response;
361
362 unsigned char *packet;
363
364 guint type_tag_length;
365 guint path_length;
366 guint real_packet_size;
367 guint packet_size;
368
369 if(!AGS_IS_MACHINE(machine)){
370 return(NULL);
371 }
372
373 start_response = NULL;
374
375 message_delivery = ags_message_delivery_get_instance();
376
377 message_queue = (AgsMessageQueue *) ags_message_delivery_find_sender_namespace(message_delivery,
378 "libgsequencer");
379
380 real_packet_size = 0;
381 packet_size = 0;
382
383 if(!strncmp(path + path_offset,
384 "/GtkButton",
385 10)){
386 path_offset += 10;
387
388 if(path[path_offset] == '[' &&
389 path[path_offset + 1] == '"'){
390 gchar *button_specifier;
391 gchar *offset;
392
393 guint length;
394
395 if((offset = strchr(path + path_offset + 2, '"')) == NULL){
396 osc_response = ags_osc_response_new();
397 start_response = g_list_prepend(start_response,
398 osc_response);
399
400 ags_osc_response_set_flags(osc_response,
401 AGS_OSC_RESPONSE_ERROR);
402
403 g_object_set(osc_response,
404 "error-message", AGS_OSC_RESPONSE_ERROR_MESSAGE_CHUNK_SIZE_EXCEEDED,
405 NULL);
406
407 return(start_response);
408 }
409
410 length = offset - (path + path_offset + 2);
411
412 button_specifier = (gchar *) malloc((length + 1) * sizeof(gchar));
413 memcpy(button_specifier, path + path_offset + 2, (length) * sizeof(gchar));
414 button_specifier[length] = '\0';
415
416 if(!strncmp(button_specifier,
417 "play",
418 5)){
419 path_offset += length;
420
421 if(!strncmp(path + path_offset,
422 "::",
423 2)){
424 path_offset += 2;
425
426 if(!strncmp(path + path_offset,
427 "clicked",
428 7)){
429 /* emit message */
430 if(message_queue != NULL){
431 AgsMessageEnvelope *message;
432
433 xmlDoc *doc;
434 xmlNode *root_node;
435
436 /* specify message body */
437 doc = xmlNewDoc(BAD_CAST "1.0");
438
439 root_node = xmlNewNode(NULL,
440 BAD_CAST "ags-command");
441 xmlDocSetRootElement(doc, root_node);
442
443 xmlNewProp(root_node,
444 BAD_CAST "method",
445 BAD_CAST "AgsMachine:run::clicked");
446
447 /* add message */
448 message = ags_message_envelope_new((GObject *) machine,
449 NULL,
450 doc);
451
452 /* set parameter */
453 message->n_params = 0;
454
455 message->parameter_name = NULL;
456 message->value = NULL;
457
458 /* add message */
459 ags_message_delivery_add_message_envelope(message_delivery,
460 "libgsequencer",
461 (GObject *) message);
462 }
463 }
464 }
465 }
466
467 free(button_specifier);
468 }else{
469 osc_response = ags_osc_response_new();
470 start_response = g_list_prepend(start_response,
471 osc_response);
472
473 ags_osc_response_set_flags(osc_response,
474 AGS_OSC_RESPONSE_ERROR);
475
476 g_object_set(osc_response,
477 "error-message", AGS_OSC_RESPONSE_ERROR_MESSAGE_SERVER_FAILURE,
478 NULL);
479
480 return(start_response);
481 }
482 }else{
483 if(AGS_IS_PANEL(machine)){
484 //TODO:JK: implement me
485 }else if(AGS_IS_SPECTROMETER(machine)){
486 //TODO:JK: implement me
487 }else if(AGS_IS_EQUALIZER10(machine)){
488 //TODO:JK: implement me
489 }else if(AGS_IS_MIXER(machine)){
490 //TODO:JK: implement me
491 }else if(AGS_IS_DRUM(machine)){
492 //TODO:JK: implement me
493 }else if(AGS_IS_MATRIX(machine)){
494 //TODO:JK: implement me
495 }else if(AGS_IS_SYNTH(machine)){
496 //TODO:JK: implement me
497 }else if(AGS_IS_FM_SYNTH(machine)){
498 //TODO:JK: implement me
499 }else if(AGS_IS_SYNCSYNTH(machine)){
500 //TODO:JK: implement me
501 }else if(AGS_IS_FM_SYNCSYNTH(machine)){
502 //TODO:JK: implement me
503 }else if(AGS_IS_FFPLAYER(machine)){
504 //TODO:JK: implement me
505 }else if(AGS_IS_PITCH_SAMPLER(machine)){
506 //TODO:JK: implement me
507 }else if(AGS_IS_AUDIOREC(machine)){
508 //TODO:JK: implement me
509 }else{
510 osc_response = ags_osc_response_new();
511 start_response = g_list_prepend(start_response,
512 osc_response);
513
514 ags_osc_response_set_flags(osc_response,
515 AGS_OSC_RESPONSE_ERROR);
516
517 g_object_set(osc_response,
518 "error-message", AGS_OSC_RESPONSE_ERROR_MESSAGE_SERVER_FAILURE,
519 NULL);
520
521 return(start_response);
522 }
523 }
524
525 return(start_response);
526 }
527
528 gpointer
ags_ui_osc_renew_controller_set_data_effect_bridge(AgsUiOscRenewController * ui_osc_renew_controller,AgsOscConnection * osc_connection,AgsEffectBridge * effect_bridge,unsigned char * message,guint message_size,gchar * type_tag,gchar * path,guint path_offset)529 ags_ui_osc_renew_controller_set_data_effect_bridge(AgsUiOscRenewController *ui_osc_renew_controller,
530 AgsOscConnection *osc_connection,
531 AgsEffectBridge *effect_bridge,
532 unsigned char *message, guint message_size,
533 gchar *type_tag,
534 gchar *path, guint path_offset)
535 {
536 AgsOscResponse *osc_response;
537
538 GList *start_response;
539
540 unsigned char *packet;
541
542 guint type_tag_length;
543 guint path_length;
544 guint real_packet_size;
545 guint packet_size;
546
547 if(!AGS_IS_EFFECT_BRIDGE(effect_bridge)){
548 return(NULL);
549 }
550
551 start_response = NULL;
552
553 real_packet_size = 0;
554 packet_size = 0;
555
556 //TODO:JK: implement me
557
558 return(start_response);
559 }
560
561 gpointer
ags_ui_osc_renew_controller_set_data_pad(AgsUiOscRenewController * ui_osc_renew_controller,AgsOscConnection * osc_connection,AgsPad * pad,unsigned char * message,guint message_size,gchar * type_tag,gchar * path,guint path_offset)562 ags_ui_osc_renew_controller_set_data_pad(AgsUiOscRenewController *ui_osc_renew_controller,
563 AgsOscConnection *osc_connection,
564 AgsPad *pad,
565 unsigned char *message, guint message_size,
566 gchar *type_tag,
567 gchar *path, guint path_offset)
568 {
569 AgsOscResponse *osc_response;
570
571 GList *start_response;
572
573 unsigned char *packet;
574
575 guint type_tag_length;
576 guint path_length;
577 guint real_packet_size;
578 guint packet_size;
579
580 if(!AGS_IS_PAD(pad)){
581 return(NULL);
582 }
583
584 start_response = NULL;
585
586 real_packet_size = 0;
587 packet_size = 0;
588
589 //TODO:JK: implement me
590
591 return(start_response);
592 }
593
594 gpointer
ags_ui_osc_renew_controller_set_data_line(AgsUiOscRenewController * ui_osc_renew_controller,AgsOscConnection * osc_connection,AgsLine * line,unsigned char * message,guint message_size,gchar * type_tag,gchar * path,guint path_offset)595 ags_ui_osc_renew_controller_set_data_line(AgsUiOscRenewController *ui_osc_renew_controller,
596 AgsOscConnection *osc_connection,
597 AgsLine *line,
598 unsigned char *message, guint message_size,
599 gchar *type_tag,
600 gchar *path, guint path_offset)
601 {
602 AgsOscResponse *osc_response;
603
604 GList *start_response;
605
606 unsigned char *packet;
607
608 guint type_tag_length;
609 guint path_length;
610 guint real_packet_size;
611 guint packet_size;
612
613 if(!AGS_IS_LINE(line)){
614 return(NULL);
615 }
616
617 start_response = NULL;
618
619 real_packet_size = 0;
620 packet_size = 0;
621
622 //TODO:JK: implement me
623
624 return(start_response);
625 }
626
627 gpointer
ags_ui_osc_renew_controller_set_data_effect_pad(AgsUiOscRenewController * ui_osc_renew_controller,AgsOscConnection * osc_connection,AgsEffectPad * effect_pad,unsigned char * message,guint message_size,gchar * type_tag,gchar * path,guint path_offset)628 ags_ui_osc_renew_controller_set_data_effect_pad(AgsUiOscRenewController *ui_osc_renew_controller,
629 AgsOscConnection *osc_connection,
630 AgsEffectPad *effect_pad,
631 unsigned char *message, guint message_size,
632 gchar *type_tag,
633 gchar *path, guint path_offset)
634 {
635 AgsOscResponse *osc_response;
636
637 GList *start_response;
638
639 unsigned char *packet;
640
641 guint type_tag_length;
642 guint path_length;
643 guint real_packet_size;
644 guint packet_size;
645
646 if(!AGS_IS_EFFECT_PAD(effect_pad)){
647 return(NULL);
648 }
649
650 start_response = NULL;
651
652 real_packet_size = 0;
653 packet_size = 0;
654
655 //TODO:JK: implement me
656
657 return(start_response);
658 }
659
660 gpointer
ags_ui_osc_renew_controller_set_data_effect_line(AgsUiOscRenewController * ui_osc_renew_controller,AgsOscConnection * osc_connection,AgsEffectLine * effect_line,unsigned char * message,guint message_size,gchar * type_tag,gchar * path,guint path_offset)661 ags_ui_osc_renew_controller_set_data_effect_line(AgsUiOscRenewController *ui_osc_renew_controller,
662 AgsOscConnection *osc_connection,
663 AgsEffectLine *effect_line,
664 unsigned char *message, guint message_size,
665 gchar *type_tag,
666 gchar *path, guint path_offset)
667 {
668 AgsOscResponse *osc_response;
669
670 GList *start_response;
671
672 unsigned char *packet;
673
674 guint type_tag_length;
675 guint path_length;
676 guint real_packet_size;
677 guint packet_size;
678
679 if(!AGS_IS_EFFECT_LINE(effect_line)){
680 return(NULL);
681 }
682
683 start_response = NULL;
684
685 real_packet_size = 0;
686 packet_size = 0;
687
688 //TODO:JK: implement me
689
690 return(start_response);
691 }
692
693 gpointer
ags_ui_osc_renew_controller_set_data_bulk_member(AgsUiOscRenewController * ui_osc_renew_controller,AgsOscConnection * osc_connection,AgsBulkMember * bulk_member,unsigned char * message,guint message_size,gchar * type_tag,gchar * path,guint path_offset)694 ags_ui_osc_renew_controller_set_data_bulk_member(AgsUiOscRenewController *ui_osc_renew_controller,
695 AgsOscConnection *osc_connection,
696 AgsBulkMember *bulk_member,
697 unsigned char *message, guint message_size,
698 gchar *type_tag,
699 gchar *path, guint path_offset)
700 {
701 AgsOscResponse *osc_response;
702
703 GList *start_response;
704
705 unsigned char *packet;
706
707 guint type_tag_length;
708 guint path_length;
709 guint real_packet_size;
710 guint packet_size;
711
712 if(!AGS_IS_BULK_MEMBER(bulk_member)){
713 return(NULL);
714 }
715
716 start_response = NULL;
717
718 real_packet_size = 0;
719 packet_size = 0;
720
721 //TODO:JK: implement me
722
723 return(start_response);
724 }
725
726 gpointer
ags_ui_osc_renew_controller_set_data_line_member(AgsUiOscRenewController * ui_osc_renew_controller,AgsOscConnection * osc_connection,AgsLineMember * line_member,unsigned char * message,guint message_size,gchar * type_tag,gchar * path,guint path_offset)727 ags_ui_osc_renew_controller_set_data_line_member(AgsUiOscRenewController *ui_osc_renew_controller,
728 AgsOscConnection *osc_connection,
729 AgsLineMember *line_member,
730 unsigned char *message, guint message_size,
731 gchar *type_tag,
732 gchar *path, guint path_offset)
733 {
734 AgsOscResponse *osc_response;
735
736 GList *start_response;
737
738 unsigned char *packet;
739
740 guint type_tag_length;
741 guint path_length;
742 guint real_packet_size;
743 guint packet_size;
744
745 if(!AGS_IS_LINE_MEMBER(line_member)){
746 return(NULL);
747 }
748
749 start_response = NULL;
750
751 real_packet_size = 0;
752 packet_size = 0;
753
754 //TODO:JK: implement me
755
756 return(start_response);
757 }
758
759 gpointer
ags_ui_osc_renew_controller_real_set_data(AgsUiOscRenewController * ui_osc_renew_controller,AgsOscConnection * osc_connection,unsigned char * message,guint message_size)760 ags_ui_osc_renew_controller_real_set_data(AgsUiOscRenewController *ui_osc_renew_controller,
761 AgsOscConnection *osc_connection,
762 unsigned char *message, guint message_size)
763 {
764 AgsOscResponse *osc_response;
765
766 AgsApplicationContext *application_context;
767
768 GList *start_response;
769
770 gchar *type_tag;
771 gchar *path;
772
773 guint path_offset;
774 gboolean success;
775
776 start_response = NULL;
777
778 /* read type tag */
779 ags_osc_buffer_util_get_string(message + 8,
780 &type_tag, NULL);
781
782 success = (type_tag != NULL &&
783 !strncmp(type_tag, ",s", 2)) ? TRUE: FALSE;
784
785 if(!success){
786 osc_response = ags_osc_response_new();
787 start_response = g_list_prepend(start_response,
788 osc_response);
789
790 ags_osc_response_set_flags(osc_response,
791 AGS_OSC_RESPONSE_ERROR);
792
793 g_object_set(osc_response,
794 "error-message", AGS_OSC_RESPONSE_ERROR_MESSAGE_MALFORMED_REQUEST,
795 NULL);
796
797 if(type_tag != NULL){
798 free(type_tag);
799 }
800
801 return(start_response);
802 }
803
804 /* read argument */
805 ags_osc_buffer_util_get_string(message + 8 + (4 * (guint) ceil((gdouble) (strlen(type_tag) + 1) / 4.0)),
806 &path, NULL);
807
808 if(path == NULL){
809 osc_response = ags_osc_response_new();
810 start_response = g_list_prepend(start_response,
811 osc_response);
812
813 ags_osc_response_set_flags(osc_response,
814 AGS_OSC_RESPONSE_ERROR);
815
816 g_object_set(osc_response,
817 "error-message", AGS_OSC_RESPONSE_ERROR_MESSAGE_MALFORMED_REQUEST,
818 NULL);
819
820 free(type_tag);
821
822 return(start_response);
823 }
824
825 /* create packet */
826 application_context = ags_application_context_get_instance();
827
828 path_offset = 0;
829
830 if(!strncmp(path,
831 "/AgsUiProvider",
832 14)){
833 AgsMessageDelivery *message_delivery;
834 AgsMessageQueue *message_queue;
835
836 unsigned char *duplicated_message;
837
838 osc_response = ags_osc_response_new();
839 start_response = g_list_prepend(start_response,
840 osc_response);
841
842 ags_osc_response_set_flags(osc_response,
843 AGS_OSC_RESPONSE_OK);
844
845 /* emit message */
846 message_delivery = ags_message_delivery_get_instance();
847
848 message_queue = (AgsMessageQueue *) ags_message_delivery_find_sender_namespace(message_delivery,
849 "libgsequencer");
850
851 if(message_queue != NULL){
852 AgsMessageEnvelope *message;
853
854 xmlDoc *doc;
855 xmlNode *root_node;
856
857 /* specify message body */
858 doc = xmlNewDoc(BAD_CAST "1.0");
859
860 root_node = xmlNewNode(NULL,
861 BAD_CAST "ags-command");
862 xmlDocSetRootElement(doc, root_node);
863
864 xmlNewProp(root_node,
865 BAD_CAST "method",
866 BAD_CAST "AgsUiOscRenewController::set-data");
867
868 /* add message */
869 message = ags_message_envelope_new((GObject *) ui_osc_renew_controller,
870 NULL,
871 doc);
872
873 /* set parameter */
874 message->n_params = 3;
875
876 message->parameter_name = (gchar **) malloc(4 * sizeof(gchar *));
877 message->value = g_new0(GValue,
878 3);
879
880 /* osc-connection */
881 message->parameter_name[0] = "osc-connection";
882
883 g_value_init(&(message->value[0]),
884 G_TYPE_OBJECT);
885 g_value_set_object(&(message->value[0]),
886 osc_connection);
887
888 /* message */
889 message->parameter_name[1] = "message";
890
891 duplicated_message = (unsigned char *) malloc(message_size * sizeof(unsigned char));
892 memcpy(duplicated_message, message, message_size * sizeof(unsigned char));
893
894 g_value_init(&(message->value[1]),
895 G_TYPE_POINTER);
896 g_value_set_pointer(&(message->value[1]),
897 duplicated_message);
898
899 /* audio channels */
900 message->parameter_name[2] = "message-size";
901
902 g_value_init(&(message->value[2]),
903 G_TYPE_UINT);
904 g_value_set_uint(&(message->value[2]),
905 message_size);
906
907 /* terminate string vector */
908 message->parameter_name[3] = NULL;
909 }
910 }
911
912 if(start_response == NULL){
913 osc_response = ags_osc_response_new();
914 start_response = g_list_prepend(start_response,
915 osc_response);
916
917 ags_osc_response_set_flags(osc_response,
918 AGS_OSC_RESPONSE_ERROR);
919
920 g_object_set(osc_response,
921 "error-message", AGS_OSC_RESPONSE_ERROR_MESSAGE_SERVER_FAILURE,
922 NULL);
923
924 free(type_tag);
925 free(path);
926
927 return(start_response);
928 }
929
930 free(type_tag);
931 free(path);
932
933 return(start_response);
934 }
935
936 /**
937 * ags_ui_osc_renew_controller_set_data:
938 * @ui_osc_renew_controller: the #AgsUiOscRenewController
939 * @osc_connection: the #AgsOscConnection
940 * @message: the message received
941 * @message_size: the message size
942 *
943 * Renew data.
944 *
945 * Returns: the #GList-struct containing #AgsOscResponse
946 *
947 * Since: 3.0.0
948 */
949 gpointer
ags_ui_osc_renew_controller_set_data(AgsUiOscRenewController * ui_osc_renew_controller,AgsOscConnection * osc_connection,unsigned char * message,guint message_size)950 ags_ui_osc_renew_controller_set_data(AgsUiOscRenewController *ui_osc_renew_controller,
951 AgsOscConnection *osc_connection,
952 unsigned char *message, guint message_size)
953 {
954 gpointer osc_response;
955
956 g_return_val_if_fail(AGS_IS_UI_OSC_RENEW_CONTROLLER(ui_osc_renew_controller), NULL);
957
958 g_object_ref((GObject *) ui_osc_renew_controller);
959 g_signal_emit(G_OBJECT(ui_osc_renew_controller),
960 ui_osc_renew_controller_signals[SET_DATA], 0,
961 osc_connection,
962 message, message_size,
963 &osc_response);
964 g_object_unref((GObject *) ui_osc_renew_controller);
965
966 return(osc_response);
967 }
968
969 void
ags_ui_osc_renew_controller_check_message_callback(GObject * application_context,AgsUiOscRenewController * ui_osc_renew_controller)970 ags_ui_osc_renew_controller_check_message_callback(GObject *application_context, AgsUiOscRenewController *ui_osc_renew_controller)
971 {
972 AgsChannel *channel;
973
974 AgsMessageDelivery *message_delivery;
975
976 GList *start_message_envelope, *message_envelope;
977
978 /* retrieve message */
979 message_delivery = ags_message_delivery_get_instance();
980
981 message_envelope =
982 start_message_envelope = ags_message_delivery_find_sender(message_delivery,
983 "libgsequencer",
984 (GObject *) ui_osc_renew_controller);
985
986 while(message_envelope != NULL){
987 xmlNode *root_node;
988
989 root_node = xmlDocGetRootElement(AGS_MESSAGE_ENVELOPE(message_envelope->data)->doc);
990
991 if(!xmlStrncmp(root_node->name,
992 BAD_CAST "ags-command",
993 12)){
994 if(!xmlStrncmp(xmlGetProp(root_node,
995 BAD_CAST "method"),
996 BAD_CAST "AgsUiOscRenewController::set-data",
997 34)){
998 AgsOscConnection *osc_connection;
999 AgsOscResponse *osc_response;
1000
1001 AgsApplicationContext *application_context;
1002
1003 GList *start_response;
1004
1005 unsigned char *duplicated_message;
1006 gchar *type_tag;
1007 gchar *path;
1008
1009 guint message_size;
1010 guint path_offset;
1011 gint position;
1012 gboolean success;
1013
1014 position = ags_strv_index(AGS_MESSAGE_ENVELOPE(message_envelope->data)->parameter_name,
1015 "osc-connection");
1016 osc_connection = g_value_get_object(&(AGS_MESSAGE_ENVELOPE(message_envelope->data)->value[position]));
1017
1018 position = ags_strv_index(AGS_MESSAGE_ENVELOPE(message_envelope->data)->parameter_name,
1019 "message");
1020 duplicated_message = g_value_get_pointer(&(AGS_MESSAGE_ENVELOPE(message_envelope->data)->value[position]));
1021
1022 position = ags_strv_index(AGS_MESSAGE_ENVELOPE(message_envelope->data)->parameter_name,
1023 "message-size");
1024 message_size = g_value_get_uint(&(AGS_MESSAGE_ENVELOPE(message_envelope->data)->value[position]));
1025
1026 start_response = NULL;
1027
1028 /* read type tag */
1029 ags_osc_buffer_util_get_string(duplicated_message + 8,
1030 &type_tag, NULL);
1031
1032 success = (type_tag != NULL &&
1033 !strncmp(type_tag, ",s", 2)) ? TRUE: FALSE;
1034
1035 if(!success){
1036 goto ags_ui_osc_renew_controller_message_monitor_timeout_NEXT;
1037 }
1038
1039 /* read argument */
1040 ags_osc_buffer_util_get_string(duplicated_message + 8 + (4 * (guint) ceil((gdouble) (strlen(type_tag) + 1) / 4.0)),
1041 &path, NULL);
1042
1043 if(path == NULL){
1044 goto ags_ui_osc_renew_controller_message_monitor_timeout_NEXT;
1045 }
1046
1047 /* create packet */
1048 application_context = ags_application_context_get_instance();
1049
1050 path_offset = 0;
1051
1052 if(!strncmp(path,
1053 "/AgsUiProvider",
1054 14)){
1055 GType machine_type;
1056
1057 GList *start_machine, *machine;
1058
1059 regmatch_t match_arr[2];
1060
1061 static regex_t single_access_regex;
1062 static regex_t range_access_regex;
1063 static regex_t voluntary_access_regex;
1064 static regex_t more_access_regex;
1065 static regex_t wildcard_access_regex;
1066
1067 static gboolean regex_compiled = FALSE;
1068
1069 static const gchar *single_access_pattern = "^\\[([0-9]+)\\]";
1070 static const gchar *range_access_pattern = "^\\[([0-9]+)\\-([0-9]+)\\]";
1071 static const gchar *voluntary_access_pattern = "^\\[(\\?)\\]";
1072 static const gchar *more_access_pattern = "^\\[(\\+)\\]";
1073 static const gchar *wildcard_access_pattern = "^\\[(\\*)\\]";
1074
1075 static const size_t max_matches = 2;
1076 static const size_t index_max_matches = 1;
1077
1078 path_offset = 14;
1079
1080 /* compile regex */
1081 g_mutex_lock(®ex_mutex);
1082
1083 if(!regex_compiled){
1084 regex_compiled = TRUE;
1085
1086 ags_regcomp(&single_access_regex, single_access_pattern, REG_EXTENDED);
1087 ags_regcomp(&range_access_regex, range_access_pattern, REG_EXTENDED);
1088 ags_regcomp(&voluntary_access_regex, voluntary_access_pattern, REG_EXTENDED);
1089 ags_regcomp(&more_access_regex, more_access_pattern, REG_EXTENDED);
1090 ags_regcomp(&wildcard_access_regex, wildcard_access_pattern, REG_EXTENDED);
1091 }
1092
1093 g_mutex_unlock(®ex_mutex);
1094
1095 machine_type = G_TYPE_NONE;
1096
1097 if(!strncmp(path + path_offset,
1098 "/AgsPanel",
1099 9)){
1100 path_offset += 9;
1101
1102 machine_type = AGS_TYPE_PANEL;
1103 }else if(!strncmp(path + path_offset,
1104 "/AgsSpectrometer",
1105 16)){
1106 path_offset += 16;
1107
1108 machine_type = AGS_TYPE_SPECTROMETER;
1109 }else if(!strncmp(path + path_offset,
1110 "/AgsEqualizer10",
1111 15)){
1112 path_offset += 15;
1113
1114 machine_type = AGS_TYPE_EQUALIZER10;
1115 }else if(!strncmp(path + path_offset,
1116 "/AgsMixer",
1117 9)){
1118 path_offset += 9;
1119
1120 machine_type = AGS_TYPE_MIXER;
1121 }else if(!strncmp(path + path_offset,
1122 "/AgsDrum",
1123 8)){
1124 path_offset += 8;
1125
1126 machine_type = AGS_TYPE_DRUM;
1127 }else if(!strncmp(path + path_offset,
1128 "/AgsMatrix",
1129 10)){
1130 path_offset += 10;
1131
1132 machine_type = AGS_TYPE_MATRIX;
1133 }else if(!strncmp(path + path_offset,
1134 "/AgsSynth",
1135 9)){
1136 path_offset += 9;
1137
1138 machine_type = AGS_TYPE_SYNTH;
1139 }else if(!strncmp(path + path_offset,
1140 "/AgsFMSynth",
1141 11)){
1142 path_offset += 11;
1143
1144 machine_type = AGS_TYPE_FM_SYNTH;
1145 }else if(!strncmp(path + path_offset,
1146 "/AgsSyncsynth",
1147 13)){
1148 path_offset += 13;
1149
1150 machine_type = AGS_TYPE_SYNCSYNTH;
1151 }else if(!strncmp(path + path_offset,
1152 "/AgsFMSyncsynth",
1153 15)){
1154 path_offset += 15;
1155
1156 machine_type = AGS_TYPE_FM_SYNCSYNTH;
1157 }else if(!strncmp(path + path_offset,
1158 "/AgsFFPlayer",
1159 11)){
1160 path_offset += 11;
1161
1162 machine_type = AGS_TYPE_FFPLAYER;
1163 }else if(!strncmp(path + path_offset,
1164 "/AgsPitchSampler",
1165 16)){
1166 path_offset += 16;
1167
1168 machine_type = AGS_TYPE_PITCH_SAMPLER;
1169 }else if(!strncmp(path + path_offset,
1170 "/AgsAudiorec",
1171 12)){
1172 path_offset += 12;
1173
1174 machine_type = AGS_TYPE_AUDIOREC;
1175 }
1176
1177 if(machine_type != G_TYPE_NONE){
1178 machine =
1179 start_machine = ags_ui_provider_get_machine(AGS_UI_PROVIDER(application_context));
1180
1181 if(ags_regexec(&single_access_regex, path + path_offset, index_max_matches, match_arr, 0) == 0){
1182 AgsMachine *current;
1183
1184 gchar *endptr;
1185
1186 guint i;
1187 guint i_stop;
1188
1189 endptr = NULL;
1190 i_stop = g_ascii_strtoull(path + path_offset + 1,
1191 &endptr,
1192 10);
1193
1194 current = NULL;
1195
1196 for(i = 0; machine != NULL; ){
1197 if(G_OBJECT_TYPE(machine->data) == machine_type){
1198 i++;
1199
1200 if(i > i_stop){
1201 current = machine->data;
1202
1203 break;
1204 }
1205 }
1206
1207 machine = machine->next;
1208 }
1209
1210 g_list_free(start_machine);
1211
1212 path_offset += ((endptr + 1) - (path + path_offset));
1213
1214 start_response = ags_ui_osc_renew_controller_set_data_machine(ui_osc_renew_controller,
1215 osc_connection,
1216 current,
1217 duplicated_message, message_size,
1218 type_tag,
1219 path, path_offset);
1220 }else if(ags_regexec(&range_access_regex, path + path_offset, max_matches, match_arr, 0) == 0){
1221 AgsMachine *current;
1222
1223 gchar *endptr;
1224
1225 guint i;
1226 guint i_start, i_stop;
1227
1228 endptr = NULL;
1229 i_start = g_ascii_strtoull(path + path_offset + 1,
1230 &endptr,
1231 10);
1232
1233 i_stop = g_ascii_strtoull(endptr + 1,
1234 &endptr,
1235 10);
1236
1237 path_offset += ((endptr + 1) - (path + path_offset));
1238
1239 for(i = 0; machine != NULL; ){
1240 GList *retval;
1241
1242 if(G_OBJECT_TYPE(machine->data) == machine_type){
1243 i++;
1244
1245 if(i > i_start){
1246 current = machine->data;
1247
1248 retval = ags_ui_osc_renew_controller_set_data_machine(ui_osc_renew_controller,
1249 osc_connection,
1250 current,
1251 duplicated_message, message_size,
1252 type_tag,
1253 path, path_offset);
1254
1255 if(start_response != NULL){
1256 start_response = g_list_concat(start_response,
1257 retval);
1258 }else{
1259 start_response = retval;
1260 }
1261 }
1262
1263 if(i > i_stop){
1264 current = machine->data;
1265
1266 break;
1267 }
1268 }
1269
1270 machine = machine->next;
1271 }
1272 }else if(ags_regexec(&voluntary_access_regex, path + path_offset, index_max_matches, match_arr, 0) == 0){
1273 path_offset += 3;
1274
1275 while(machine != NULL){
1276 if(G_OBJECT_TYPE(machine->data) == machine_type){
1277 start_response = ags_ui_osc_renew_controller_set_data_machine(ui_osc_renew_controller,
1278 osc_connection,
1279 start_machine->data,
1280 duplicated_message, message_size,
1281 type_tag,
1282 path, path_offset);
1283 break;
1284 }
1285
1286 machine = machine->next;
1287 }
1288 }else if(ags_regexec(&more_access_regex, path + path_offset, index_max_matches, match_arr, 0) == 0){
1289 path_offset += 3;
1290
1291 if(start_machine == NULL){
1292 goto ags_ui_osc_renew_controller_message_monitor_timeout_NEXT;
1293 }
1294
1295 while(machine != NULL){
1296 if(G_OBJECT_TYPE(machine->data) == machine_type){
1297 GList *retval;
1298
1299 retval = ags_ui_osc_renew_controller_set_data_machine(ui_osc_renew_controller,
1300 osc_connection,
1301 machine->data,
1302 duplicated_message, message_size,
1303 type_tag,
1304 path, path_offset);
1305
1306 if(start_response != NULL){
1307 start_response = g_list_concat(start_response,
1308 retval);
1309 }else{
1310 start_response = retval;
1311 }
1312 }
1313
1314 machine = machine->next;
1315 }
1316 }else if(ags_regexec(&wildcard_access_regex, path + path_offset, index_max_matches, match_arr, 0) == 0){
1317 path_offset += 3;
1318
1319 if(start_machine == NULL){
1320 goto ags_ui_osc_renew_controller_message_monitor_timeout_NEXT;
1321 }
1322
1323 while(machine != NULL){
1324 if(G_OBJECT_TYPE(machine->data) == machine_type){
1325 GList *retval;
1326
1327 retval = ags_ui_osc_renew_controller_set_data_machine(ui_osc_renew_controller,
1328 osc_connection,
1329 machine->data,
1330 duplicated_message, message_size,
1331 type_tag,
1332 path, path_offset);
1333
1334 if(start_response != NULL){
1335 start_response = g_list_concat(start_response,
1336 retval);
1337 }else{
1338 start_response = retval;
1339 }
1340 }
1341
1342 machine = machine->next;
1343 }
1344 }else if(path[path_offset] == '[' &&
1345 path[path_offset + 1] == '"'){
1346 gchar *machine_name;
1347 gchar *offset;
1348
1349 guint length;
1350
1351 if((offset = strchr(path + path_offset + 2, '"')) == NULL){
1352 goto ags_ui_osc_renew_controller_message_monitor_timeout_NEXT;
1353 }
1354
1355 length = offset - (path + path_offset + 2);
1356
1357 machine_name = (gchar *) malloc((length + 1) * sizeof(gchar));
1358 memcpy(machine_name, path + path_offset + 2, (length) * sizeof(gchar));
1359 machine_name[length] = '\0';
1360
1361 while(machine != NULL){
1362 if(G_OBJECT_TYPE(machine->data) == machine_type &&
1363 !g_ascii_strcasecmp(AGS_MACHINE(machine->data)->machine_name,
1364 machine_name)){
1365 GList *retval;
1366
1367 retval = ags_ui_osc_renew_controller_set_data_machine(ui_osc_renew_controller,
1368 osc_connection,
1369 machine->data,
1370 duplicated_message, message_size,
1371 type_tag,
1372 path, path_offset);
1373
1374 if(start_response != NULL){
1375 start_response = g_list_concat(start_response,
1376 retval);
1377 }else{
1378 start_response = retval;
1379 }
1380 }
1381
1382 machine = machine->next;
1383 }
1384 }
1385 }
1386 }else{
1387 goto ags_ui_osc_renew_controller_message_monitor_timeout_NEXT;
1388 }
1389
1390 ags_ui_osc_renew_controller_message_monitor_timeout_NEXT:
1391 if(duplicated_message != NULL){
1392 free(duplicated_message);
1393 }
1394 }
1395 }
1396
1397 message_envelope = message_envelope->next;
1398 }
1399
1400 g_list_free_full(start_message_envelope,
1401 (GDestroyNotify) g_object_unref);
1402 }
1403
1404 /**
1405 * ags_ui_osc_renew_controller_new:
1406 *
1407 * Instantiate new #AgsUiOscRenewController.
1408 *
1409 * Returns: the #AgsUiOscRenewController
1410 *
1411 * Since: 3.0.0
1412 */
1413 AgsUiOscRenewController*
ags_ui_osc_renew_controller_new()1414 ags_ui_osc_renew_controller_new()
1415 {
1416 AgsUiOscRenewController *ui_osc_renew_controller;
1417
1418 ui_osc_renew_controller = (AgsUiOscRenewController *) g_object_new(AGS_TYPE_UI_OSC_RENEW_CONTROLLER,
1419 NULL);
1420
1421 return(ui_osc_renew_controller);
1422 }
1423