1 /* -*- Mode: C ; c-basic-offset: 4 -*- */
3 Copyright (C) 2007,2008,2011 Nedko Arnaudov
4 Copyright (C) 2007-2008 Juuso Alasuutari
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #if defined(HAVE_CONFIG_H)
28 #include <dbus/dbus.h>
31 #include "controller_internal.h"
34 unsigned char jack_controller_dbus_types
[JACK_PARAM_MAX
] =
36 [JackParamInt
] = DBUS_TYPE_INT32
,
37 [JackParamUInt
] = DBUS_TYPE_UINT32
,
38 [JackParamChar
] = DBUS_TYPE_BYTE
,
39 [JackParamString
] = DBUS_TYPE_STRING
,
40 [JackParamBool
] = DBUS_TYPE_BOOLEAN
,
43 const char *jack_controller_dbus_type_signatures
[JACK_PARAM_MAX
] =
45 [JackParamInt
] = DBUS_TYPE_INT32_AS_STRING
,
46 [JackParamUInt
] = DBUS_TYPE_UINT32_AS_STRING
,
47 [JackParamChar
] = DBUS_TYPE_BYTE_AS_STRING
,
48 [JackParamString
] = DBUS_TYPE_STRING_AS_STRING
,
49 [JackParamBool
] = DBUS_TYPE_BOOLEAN_AS_STRING
,
52 #define PARAM_TYPE_JACK_TO_DBUS(_) jack_controller_dbus_types[_]
53 #define PARAM_TYPE_JACK_TO_DBUS_SIGNATURE(_) jack_controller_dbus_type_signatures[_]
57 jack_controller_jack_to_dbus_variant(
58 jackctl_param_type_t type
,
59 const union jackctl_parameter_value
*value_ptr
,
60 message_arg_t
*dbusv_ptr
)
65 dbusv_ptr
->int32
= (dbus_int32_t
)value_ptr
->i
;
68 dbusv_ptr
->uint32
= (dbus_uint32_t
)value_ptr
->ui
;
71 dbusv_ptr
->byte
= value_ptr
->c
;
74 dbusv_ptr
->string
= value_ptr
->str
;
77 dbusv_ptr
->boolean
= (dbus_bool_t
)value_ptr
->b
;
81 jack_error("Unknown JACK parameter type %i", (int)type
);
88 jack_controller_dbus_to_jack_variant(
90 const message_arg_t
*dbusv_ptr
,
91 union jackctl_parameter_value
*value_ptr
)
98 value_ptr
->i
= dbusv_ptr
->int32
;
100 case DBUS_TYPE_UINT32
:
101 value_ptr
->ui
= dbusv_ptr
->uint32
;
104 value_ptr
->c
= dbusv_ptr
->byte
;
106 case DBUS_TYPE_STRING
:
107 len
= strlen(dbusv_ptr
->string
);
108 if (len
> JACK_PARAM_STRING_MAX
)
110 jack_error("Parameter string value is too long (%u)", (unsigned int)len
);
113 memcpy(value_ptr
->str
, dbusv_ptr
->string
, len
+ 1);
116 case DBUS_TYPE_BOOLEAN
:
117 value_ptr
->b
= dbusv_ptr
->boolean
;
121 jack_error("Unknown D-Bus parameter type %i", (int)type
);
126 * Construct a return message for a Get[Driver|Engine]ParameterValue method call.
128 * The operation can only fail due to lack of memory, in which case
129 * there's no sense in trying to construct an error return. Instead,
130 * call->reply will be set to NULL and handled in send_method_return().
133 jack_dbus_construct_method_return_parameter(
134 struct jack_dbus_method_call
* call
,
137 const char *signature
,
138 message_arg_t default_value
,
141 DBusMessageIter iter
;
143 /* Create a new method return message. */
144 call
->reply
= dbus_message_new_method_return (call
->message
);
150 dbus_message_iter_init_append (call
->reply
, &iter
);
152 /* Append the is_set argument. */
153 if (!dbus_message_iter_append_basic (&iter
, DBUS_TYPE_BOOLEAN
, (const void *) &is_set
))
158 /* Append the 'default' and 'value' arguments. */
159 if (!jack_dbus_message_append_variant(&iter
, type
, signature
, &default_value
))
163 if (!jack_dbus_message_append_variant(&iter
, type
, signature
, &value
))
171 dbus_message_unref (call
->reply
);
175 jack_error ("Ran out of memory trying to construct method return");
180 jack_controller_dbus_get_parameter_address_ex(
181 struct jack_dbus_method_call
* call
,
182 DBusMessageIter
* iter_ptr
,
183 const char ** address_array
)
185 const char * signature
;
186 DBusMessageIter array_iter
;
190 if (!dbus_message_iter_init(call
->message
, iter_ptr
))
194 JACK_DBUS_ERROR_INVALID_ARGS
,
195 "Invalid arguments to method '%s'. No input arguments found.",
200 signature
= dbus_message_iter_get_signature(iter_ptr
);
201 if (signature
== NULL
)
203 jack_error("dbus_message_iter_get_signature() failed");
207 if (strcmp(signature
, "as") != 0)
211 JACK_DBUS_ERROR_INVALID_ARGS
,
212 "Invalid arguments to method '%s'. Input arguments signature '%s', must begin with 'as'.",
218 dbus_message_iter_recurse(iter_ptr
, &array_iter
);
221 while ((type
= dbus_message_iter_get_arg_type(&array_iter
)) != DBUS_TYPE_INVALID
)
223 if (index
== PARAM_ADDRESS_SIZE
)
227 JACK_DBUS_ERROR_INVALID_ARGS
,
228 "Invalid arguments to method '%s'. Parameter address array must contain not more than %u elements.",
229 (unsigned int)PARAM_ADDRESS_SIZE
,
235 if (type
!= DBUS_TYPE_STRING
)
239 JACK_DBUS_ERROR_FATAL
,
240 "Internal error when parsing parameter address of method '%s'. Address array element type '%c' is not string type.",
246 dbus_message_iter_get_basic(&array_iter
, address_array
+ index
);
247 //jack_info("address component: '%s'", address_array[index]);
249 dbus_message_iter_next(&array_iter
);
253 while (index
< PARAM_ADDRESS_SIZE
)
255 address_array
[index
] = NULL
;
264 jack_controller_dbus_get_parameter_address(
265 struct jack_dbus_method_call
* call
,
266 const char ** address_array
)
268 DBusMessageIter iter
;
271 ret
= jack_controller_dbus_get_parameter_address_ex(call
, &iter
, address_array
);
272 if (ret
&& dbus_message_iter_has_next(&iter
))
276 JACK_DBUS_ERROR_INVALID_ARGS
,
277 "Invalid arguments to method '%s'. Input arguments signature must be 'as'.",
285 #define controller_ptr ((struct jack_controller *)call->context)
287 static bool append_node_name(void * context
, const char * name
)
289 return dbus_message_iter_append_basic(context
, DBUS_TYPE_STRING
, &name
);
294 jack_controller_dbus_read_container(
295 struct jack_dbus_method_call
* call
)
297 const char * address
[PARAM_ADDRESS_SIZE
];
299 DBusMessageIter iter
;
300 DBusMessageIter array_iter
;
302 //jack_info("jack_controller_dbus_read_container() called");
304 if (!jack_controller_dbus_get_parameter_address(call
, address
))
306 /* The method call had invalid arguments meaning that
307 * jack_controller_dbus_get_parameter_address() has
308 * constructed an error for us. */
312 //jack_info("address is '%s':'%s':'%s'", address[0], address[1], address[2]);
314 /* Create a new method return message. */
315 call
->reply
= dbus_message_new_method_return(call
->message
);
321 dbus_message_iter_init_append(call
->reply
, &iter
);
323 if (!jack_params_check_address(controller_ptr
->params
, address
, false))
327 JACK_DBUS_ERROR_INVALID_ARGS
,
328 "Invalid container address '%s':'%s':'%s' supplied to method '%s'.",
336 leaf
= jack_params_is_leaf_container(controller_ptr
->params
, address
);
337 if (!dbus_message_iter_append_basic(&iter
, DBUS_TYPE_BOOLEAN
, &leaf
))
342 if (!dbus_message_iter_open_container(&iter
, DBUS_TYPE_ARRAY
, "s", &array_iter
))
348 if (!jack_params_iterate_container(controller_ptr
->params
, address
, append_node_name
, &array_iter
))
350 goto oom_close_unref
;
353 dbus_message_iter_close_container(&iter
, &array_iter
);
358 dbus_message_iter_close_container(&iter
, &array_iter
);
361 dbus_message_unref(call
->reply
);
365 jack_error ("Ran out of memory trying to construct method return");
368 static bool append_parameter(void * context
, const struct jack_parameter
* param_ptr
)
370 DBusMessageIter struct_iter
;
373 /* Open the struct. */
374 if (!dbus_message_iter_open_container(context
, DBUS_TYPE_STRUCT
, NULL
, &struct_iter
))
379 /* Append parameter type. */
380 type
= PARAM_TYPE_JACK_TO_DBUS(param_ptr
->type
);
381 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_BYTE
, &type
))
386 /* Append parameter name. */
387 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_STRING
, ¶m_ptr
->name
))
392 /* Append parameter short description. */
393 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_STRING
, ¶m_ptr
->short_decr
))
398 /* Append parameter long description. */
399 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_STRING
, ¶m_ptr
->long_descr
))
404 /* Close the struct. */
405 if (!dbus_message_iter_close_container(context
, &struct_iter
))
413 dbus_message_iter_close_container(context
, &struct_iter
);
421 jack_controller_dbus_get_parameters_info(
422 struct jack_dbus_method_call
* call
)
424 const char * address
[PARAM_ADDRESS_SIZE
];
425 DBusMessageIter iter
, array_iter
;
427 //jack_info("jack_controller_dbus_get_parameters_info() called");
429 if (!jack_controller_dbus_get_parameter_address(call
, address
))
431 /* The method call had invalid arguments meaning that
432 * jack_controller_dbus_get_parameter_address() has
433 * constructed an error for us. */
437 //jack_info("address is '%s':'%s':'%s'", address[0], address[1], address[2]);
439 if (!jack_params_check_address(controller_ptr
->params
, address
, true))
443 JACK_DBUS_ERROR_INVALID_ARGS
,
444 "Invalid container address '%s':'%s':'%s' supplied to method '%s'.",
452 call
->reply
= dbus_message_new_method_return (call
->message
);
458 dbus_message_iter_init_append (call
->reply
, &iter
);
460 /* Open the array. */
461 if (!dbus_message_iter_open_container (&iter
, DBUS_TYPE_ARRAY
, "(ysss)", &array_iter
))
466 if (!jack_params_iterate_params(controller_ptr
->params
, address
, append_parameter
, &array_iter
))
468 goto fail_close_unref
;
471 /* Close the array. */
472 if (!dbus_message_iter_close_container (&iter
, &array_iter
))
480 dbus_message_iter_close_container (&iter
, &array_iter
);
483 dbus_message_unref (call
->reply
);
487 jack_error ("Ran out of memory trying to construct method return");
492 jack_controller_dbus_get_parameter_info(
493 struct jack_dbus_method_call
* call
)
495 const char * address
[PARAM_ADDRESS_SIZE
];
496 const struct jack_parameter
* param_ptr
;
497 DBusMessageIter iter
;
499 //jack_info("jack_controller_dbus_get_parameter_info() called");
501 if (!jack_controller_dbus_get_parameter_address(call
, address
))
503 /* The method call had invalid arguments meaning that
504 * jack_controller_dbus_get_parameter_address() has
505 * constructed an error for us. */
509 //jack_info("address is '%s':'%s':'%s'", address[0], address[1], address[2]);
511 param_ptr
= jack_params_get_parameter(controller_ptr
->params
, address
);
512 if (param_ptr
== NULL
)
516 JACK_DBUS_ERROR_INVALID_ARGS
,
517 "Invalid container address '%s':'%s':'%s' supplied to method '%s'.",
525 call
->reply
= dbus_message_new_method_return(call
->message
);
531 dbus_message_iter_init_append(call
->reply
, &iter
);
533 if (!append_parameter(&iter
, param_ptr
))
541 dbus_message_unref(call
->reply
);
545 jack_error("Ran out of memory trying to construct method return");
550 jack_controller_dbus_get_parameter_constraint(
551 struct jack_dbus_method_call
* call
)
553 const char * address
[PARAM_ADDRESS_SIZE
];
554 const struct jack_parameter
* param_ptr
;
556 DBusMessageIter iter
, array_iter
, struct_iter
;
560 //jack_info("jack_controller_dbus_get_parameter_constraint() called");
562 if (!jack_controller_dbus_get_parameter_address(call
, address
))
564 /* The method call had invalid arguments meaning that
565 * jack_controller_dbus_get_parameter_address() has
566 * constructed an error for us. */
570 //jack_info("address is '%s':'%s':'%s'", address[0], address[1], address[2]);
572 param_ptr
= jack_params_get_parameter(controller_ptr
->params
, address
);
573 if (param_ptr
== NULL
)
577 JACK_DBUS_ERROR_INVALID_ARGS
,
578 "Invalid container address '%s':'%s':'%s' supplied to method '%s'.",
586 call
->reply
= dbus_message_new_method_return(call
->message
);
592 dbus_message_iter_init_append(call
->reply
, &iter
);
594 if ((param_ptr
->constraint_flags
& JACK_CONSTRAINT_FLAG_VALID
) != 0)
596 value
.boolean
= param_ptr
->constraint_range
;
600 value
.boolean
= false;
603 if (!dbus_message_iter_append_basic(&iter
, DBUS_TYPE_BOOLEAN
, &value
))
608 if ((param_ptr
->constraint_flags
& JACK_CONSTRAINT_FLAG_VALID
) != 0)
610 value
.boolean
= (param_ptr
->constraint_flags
& JACK_CONSTRAINT_FLAG_STRICT
) != 0;
613 if (!dbus_message_iter_append_basic(&iter
, DBUS_TYPE_BOOLEAN
, &value
))
618 if ((param_ptr
->constraint_flags
& JACK_CONSTRAINT_FLAG_VALID
) != 0)
620 value
.boolean
= (param_ptr
->constraint_flags
& JACK_CONSTRAINT_FLAG_FAKE_VALUE
) != 0;
623 if (!dbus_message_iter_append_basic(&iter
, DBUS_TYPE_BOOLEAN
, &value
))
628 /* Open the array. */
629 if (!dbus_message_iter_open_container(&iter
, DBUS_TYPE_ARRAY
, "(vs)", &array_iter
))
634 if ((param_ptr
->constraint_flags
& JACK_CONSTRAINT_FLAG_VALID
) == 0)
639 if (param_ptr
->constraint_range
)
641 /* Open the struct. */
642 if (!dbus_message_iter_open_container(&array_iter
, DBUS_TYPE_STRUCT
, NULL
, &struct_iter
))
644 goto fail_close_unref
;
647 jack_controller_jack_to_dbus_variant(param_ptr
->type
, ¶m_ptr
->constraint
.range
.min
, &value
);
649 if (!jack_dbus_message_append_variant(
651 PARAM_TYPE_JACK_TO_DBUS(param_ptr
->type
),
652 PARAM_TYPE_JACK_TO_DBUS_SIGNATURE(param_ptr
->type
),
655 goto fail_close2_unref
;
660 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_STRING
, &descr
))
662 goto fail_close2_unref
;
665 /* Close the struct. */
666 if (!dbus_message_iter_close_container(&array_iter
, &struct_iter
))
668 goto fail_close_unref
;
671 /* Open the struct. */
672 if (!dbus_message_iter_open_container(&array_iter
, DBUS_TYPE_STRUCT
, NULL
, &struct_iter
))
674 goto fail_close_unref
;
677 jack_controller_jack_to_dbus_variant(param_ptr
->type
, ¶m_ptr
->constraint
.range
.max
, &value
);
679 if (!jack_dbus_message_append_variant(
681 PARAM_TYPE_JACK_TO_DBUS(param_ptr
->type
),
682 PARAM_TYPE_JACK_TO_DBUS_SIGNATURE(param_ptr
->type
),
685 goto fail_close2_unref
;
690 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_STRING
, &descr
))
692 goto fail_close2_unref
;
695 /* Close the struct. */
696 if (!dbus_message_iter_close_container(&array_iter
, &struct_iter
))
698 goto fail_close_unref
;
703 /* Append enum values to the array. */
704 for (index
= 0 ; index
< param_ptr
->constraint
.enumeration
.count
; index
++)
706 descr
= param_ptr
->constraint
.enumeration
.possible_values_array
[index
].short_desc
;
708 jack_controller_jack_to_dbus_variant(param_ptr
->type
, ¶m_ptr
->constraint
.enumeration
.possible_values_array
[index
].value
, &value
);
710 /* Open the struct. */
711 if (!dbus_message_iter_open_container(&array_iter
, DBUS_TYPE_STRUCT
, NULL
, &struct_iter
))
713 goto fail_close_unref
;
716 if (!jack_dbus_message_append_variant(
718 PARAM_TYPE_JACK_TO_DBUS(param_ptr
->type
),
719 PARAM_TYPE_JACK_TO_DBUS_SIGNATURE(param_ptr
->type
),
722 goto fail_close2_unref
;
725 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_STRING
, &descr
))
727 goto fail_close2_unref
;
730 /* Close the struct. */
731 if (!dbus_message_iter_close_container(&array_iter
, &struct_iter
))
733 goto fail_close_unref
;
739 /* Close the array. */
740 if (!dbus_message_iter_close_container(&iter
, &array_iter
))
748 dbus_message_iter_close_container(&array_iter
, &struct_iter
);
751 dbus_message_iter_close_container(&iter
, &array_iter
);
754 dbus_message_unref(call
->reply
);
758 jack_error ("Ran out of memory trying to construct method return");
762 jack_controller_dbus_get_parameter_value(
763 struct jack_dbus_method_call
* call
)
765 const char * address
[PARAM_ADDRESS_SIZE
];
766 const struct jack_parameter
* param_ptr
;
767 union jackctl_parameter_value jackctl_value
;
768 union jackctl_parameter_value jackctl_default_value
;
770 message_arg_t default_value
;
772 //jack_info("jack_controller_dbus_get_parameter_value() called");
774 if (!jack_controller_dbus_get_parameter_address(call
, address
))
776 /* The method call had invalid arguments meaning that
777 * jack_controller_dbus_get_parameter_address() has
778 * constructed an error for us. */
782 //jack_info("address is '%s':'%s':'%s'", address[0], address[1], address[2]);
784 param_ptr
= jack_params_get_parameter(controller_ptr
->params
, address
);
785 if (param_ptr
== NULL
)
789 JACK_DBUS_ERROR_INVALID_ARGS
,
790 "Invalid container address '%s':'%s':'%s' supplied to method '%s'.",
798 jackctl_default_value
= param_ptr
->vtable
.get_default_value(param_ptr
->obj
);
799 jackctl_value
= param_ptr
->vtable
.get_value(param_ptr
->obj
);
801 jack_controller_jack_to_dbus_variant(param_ptr
->type
, &jackctl_value
, &value
);
802 jack_controller_jack_to_dbus_variant(param_ptr
->type
, &jackctl_default_value
, &default_value
);
804 /* Construct the reply. */
805 jack_dbus_construct_method_return_parameter(
807 (dbus_bool_t
)(param_ptr
->vtable
.is_set(param_ptr
->obj
) ? TRUE
: FALSE
),
808 PARAM_TYPE_JACK_TO_DBUS(param_ptr
->type
),
809 PARAM_TYPE_JACK_TO_DBUS_SIGNATURE(param_ptr
->type
),
816 jack_controller_dbus_set_parameter_value(
817 struct jack_dbus_method_call
* call
)
819 const char * address
[PARAM_ADDRESS_SIZE
];
820 const struct jack_parameter
* param_ptr
;
821 DBusMessageIter iter
;
822 DBusMessageIter variant_iter
;
825 union jackctl_parameter_value value
;
827 //jack_info("jack_controller_dbus_set_parameter_value() called");
829 if (!jack_controller_dbus_get_parameter_address_ex(call
, &iter
, address
))
831 /* The method call had invalid arguments meaning that
832 * jack_controller_dbus_get_parameter_address() has
833 * constructed an error for us. */
837 //jack_info("address is '%s':'%s':'%s'", address[0], address[1], address[2]);
839 param_ptr
= jack_params_get_parameter(controller_ptr
->params
, address
);
840 if (param_ptr
== NULL
)
844 JACK_DBUS_ERROR_INVALID_ARGS
,
845 "Invalid container address '%s':'%s':'%s' supplied to method '%s'.",
853 dbus_message_iter_next(&iter
);
855 if (dbus_message_iter_has_next(&iter
))
859 JACK_DBUS_ERROR_INVALID_ARGS
,
860 "Invalid arguments to method '%s'. Too many arguments.",
865 if (dbus_message_iter_get_arg_type(&iter
) != DBUS_TYPE_VARIANT
)
869 JACK_DBUS_ERROR_INVALID_ARGS
,
870 "Invalid arguments to method '%s'. Value to set must be variant.",
875 dbus_message_iter_recurse (&iter
, &variant_iter
);
876 dbus_message_iter_get_basic(&variant_iter
, &arg
);
877 arg_type
= dbus_message_iter_get_arg_type(&variant_iter
);
879 //jack_info("argument of type '%c'", arg_type);
881 if (PARAM_TYPE_JACK_TO_DBUS(param_ptr
->type
) != arg_type
)
885 JACK_DBUS_ERROR_INVALID_ARGS
,
886 "Parameter value type mismatch: was expecting '%c', got '%c'",
887 (char)PARAM_TYPE_JACK_TO_DBUS(param_ptr
->type
),
892 if (!jack_controller_dbus_to_jack_variant(
899 JACK_DBUS_ERROR_INVALID_ARGS
,
900 "Cannot convert parameter value");
904 param_ptr
->vtable
.set_value(param_ptr
->obj
, &value
);
906 jack_controller_pending_save(controller_ptr
);
908 jack_dbus_construct_method_return_empty(call
);
914 jack_controller_dbus_reset_parameter_value(
915 struct jack_dbus_method_call
* call
)
917 const char * address
[PARAM_ADDRESS_SIZE
];
918 const struct jack_parameter
* param_ptr
;
920 //jack_info("jack_controller_dbus_reset_parameter_value() called");
922 if (!jack_controller_dbus_get_parameter_address(call
, address
))
924 /* The method call had invalid arguments meaning that
925 * jack_controller_dbus_get_parameter_address() has
926 * constructed an error for us. */
930 //jack_info("address is '%s':'%s':'%s'", address[0], address[1], address[2]);
932 param_ptr
= jack_params_get_parameter(controller_ptr
->params
, address
);
933 if (param_ptr
== NULL
)
937 JACK_DBUS_ERROR_INVALID_ARGS
,
938 "Invalid container address '%s':'%s':'%s' supplied to method '%s'.",
946 param_ptr
->vtable
.reset(param_ptr
->obj
);
948 jack_controller_pending_save(controller_ptr
);
950 jack_dbus_construct_method_return_empty(call
);
953 #undef controller_ptr
955 JACK_DBUS_METHOD_ARGUMENTS_BEGIN_EX(ReadContainer
, "Get names of child parameters or containers")
956 JACK_DBUS_METHOD_ARGUMENT_IN("parent", "as", "Address of parent container")
957 JACK_DBUS_METHOD_ARGUMENT_OUT("leaf", "b", "Whether children are parameters (true) or containers (false)")
958 JACK_DBUS_METHOD_ARGUMENT_OUT("children", "as", "Array of child names")
959 JACK_DBUS_METHOD_ARGUMENTS_END
961 JACK_DBUS_METHOD_ARGUMENTS_BEGIN_EX(GetParametersInfo
, "Retrieve info about parameters")
962 JACK_DBUS_METHOD_ARGUMENT_IN("parent", "as", "Address of parameters parent")
963 JACK_DBUS_METHOD_ARGUMENT_OUT("parameter_info_array", "a(ysss)", "Array of parameter info structs. Each info struct contains: type char, name, short and long description")
964 JACK_DBUS_METHOD_ARGUMENTS_END
966 JACK_DBUS_METHOD_ARGUMENTS_BEGIN_EX(GetParameterInfo
, "Retrieve info about parameter")
967 JACK_DBUS_METHOD_ARGUMENT_IN("parameter", "as", "Address of parameter")
968 JACK_DBUS_METHOD_ARGUMENT_OUT("parameter_info", "(ysss)", "Parameter info struct that contains: type char, name, short and long description")
969 JACK_DBUS_METHOD_ARGUMENTS_END
971 JACK_DBUS_METHOD_ARGUMENTS_BEGIN_EX(GetParameterConstraint
, "Get constraint of parameter")
972 JACK_DBUS_METHOD_ARGUMENT_IN("parameter", "as", "Address of parameter")
973 JACK_DBUS_METHOD_ARGUMENT_OUT("is_range", "b", "Whether constrinat is a range. If so, values parameter will contain two values, min and max")
974 JACK_DBUS_METHOD_ARGUMENT_OUT("is_strict", "b", "Whether enum constraint is strict. I.e. value not listed in values array will not work")
975 JACK_DBUS_METHOD_ARGUMENT_OUT("is_fake_value", "b", "Whether enum values are fake. I.e. have no user meaningful meaning")
976 JACK_DBUS_METHOD_ARGUMENT_OUT("values", "a(vs)", "Values. If there is no constraint, this array will be empty. For range constraint there will be two values, min and max. For enum constraint there will be 2 or more values.")
977 JACK_DBUS_METHOD_ARGUMENTS_END
979 JACK_DBUS_METHOD_ARGUMENTS_BEGIN_EX(GetParameterValue
, "Get value of parameter")
980 JACK_DBUS_METHOD_ARGUMENT_IN("parameter", "as", "Address of parameter")
981 JACK_DBUS_METHOD_ARGUMENT_OUT("is_set", "b", "Whether parameter is set or its default value is used")
982 JACK_DBUS_METHOD_ARGUMENT_OUT("default", "v", "Default value of parameter")
983 JACK_DBUS_METHOD_ARGUMENT_OUT("value", "v", "Actual value of parameter")
984 JACK_DBUS_METHOD_ARGUMENTS_END
986 JACK_DBUS_METHOD_ARGUMENTS_BEGIN_EX(SetParameterValue
, "Set value of parameter")
987 JACK_DBUS_METHOD_ARGUMENT_IN("parameter", "as", "Address of parameter")
988 JACK_DBUS_METHOD_ARGUMENT_IN("value", "v", "New value for parameter")
989 JACK_DBUS_METHOD_ARGUMENTS_END
991 JACK_DBUS_METHOD_ARGUMENTS_BEGIN_EX(ResetParameterValue
, "Reset parameter to default value")
992 JACK_DBUS_METHOD_ARGUMENT_IN("parameter", "as", "Address of parameter")
993 JACK_DBUS_METHOD_ARGUMENTS_END
995 JACK_DBUS_METHODS_BEGIN
996 JACK_DBUS_METHOD_DESCRIBE(ReadContainer
, jack_controller_dbus_read_container
)
997 JACK_DBUS_METHOD_DESCRIBE(GetParametersInfo
, jack_controller_dbus_get_parameters_info
)
998 JACK_DBUS_METHOD_DESCRIBE(GetParameterInfo
, jack_controller_dbus_get_parameter_info
)
999 JACK_DBUS_METHOD_DESCRIBE(GetParameterConstraint
, jack_controller_dbus_get_parameter_constraint
)
1000 JACK_DBUS_METHOD_DESCRIBE(GetParameterValue
, jack_controller_dbus_get_parameter_value
)
1001 JACK_DBUS_METHOD_DESCRIBE(SetParameterValue
, jack_controller_dbus_set_parameter_value
)
1002 JACK_DBUS_METHOD_DESCRIBE(ResetParameterValue
, jack_controller_dbus_reset_parameter_value
)
1003 JACK_DBUS_METHODS_END
1006 * Parameter addresses:
1009 * "engine", "driver"
1010 * "engine", "realtime"
1011 * "engine", ...more engine parameters
1013 * "driver", "device"
1014 * "driver", ...more driver parameters
1016 * "drivers", "alsa", "device"
1017 * "drivers", "alsa", ...more alsa driver parameters
1019 * "drivers", ...more drivers
1021 * "internals", "netmanager", "multicast_ip"
1022 * "internals", "netmanager", ...more netmanager parameters
1024 * "internals", ...more internals
1028 JACK_DBUS_IFACE_BEGIN(g_jack_controller_iface_configure
, "org.jackaudio.Configure")
1029 JACK_DBUS_IFACE_EXPOSE_METHODS