dbus_message_unref(reply);
}
-pa_dbusiface_card_profile *pa_dbusiface_card_profile_new(pa_dbusiface_card *card, pa_core *core, pa_card_profile *profile, uint32_t idx) {
+pa_dbusiface_card_profile *pa_dbusiface_card_profile_new(
+ pa_dbusiface_card *card,
+ pa_core *core,
+ pa_card_profile *profile,
+ uint32_t idx) {
pa_dbusiface_card_profile *p = NULL;
pa_assert(card);
typedef struct pa_dbusiface_card_profile pa_dbusiface_card_profile;
-pa_dbusiface_card_profile *pa_dbusiface_card_profile_new(pa_dbusiface_card *card, pa_core *core, pa_card_profile *profile, uint32_t idx);
+pa_dbusiface_card_profile *pa_dbusiface_card_profile_new(
+ pa_dbusiface_card *card,
+ pa_core *core,
+ pa_card_profile *profile,
+ uint32_t idx);
void pa_dbusiface_card_profile_free(pa_dbusiface_card_profile *p);
const char *pa_dbusiface_card_profile_get_path(pa_dbusiface_card_profile *p);
pa_assert(c);
if (!c->active_profile) {
- pa_dbus_send_error(conn, msg, PA_DBUS_ERROR_NO_SUCH_PROPERTY, "The card %s has no profiles, and therefore there's no active profile either.", c->card->name);
+ pa_assert(pa_hashmap_isempty(c->profiles));
+
+ pa_dbus_send_error(conn, msg, PA_DBUS_ERROR_NO_SUCH_PROPERTY,
+ "The card %s has no profiles, and therefore there's no active profile either.", c->card->name);
return;
}
c->active_profile = c->card->active_profile;
object_path = pa_dbusiface_card_profile_get_path(pa_hashmap_get(c->profiles, c->active_profile->name));
- pa_assert_se(signal = dbus_message_new_signal(c->path, PA_DBUSIFACE_CARD_INTERFACE, signals[SIGNAL_ACTIVE_PROFILE_UPDATED].name));
+ pa_assert_se(signal = dbus_message_new_signal(c->path,
+ PA_DBUSIFACE_CARD_INTERFACE,
+ signals[SIGNAL_ACTIVE_PROFILE_UPDATED].name));
pa_assert_se(dbus_message_append_args(signal, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID));
pa_dbus_protocol_send_signal(c->dbus_protocol, signal);
pa_proplist_update(c->proplist, PA_UPDATE_SET, c->card->proplist);
- pa_assert_se(signal = dbus_message_new_signal(c->path, PA_DBUSIFACE_CARD_INTERFACE, signals[SIGNAL_PROPERTY_LIST_UPDATED].name));
+ pa_assert_se(signal = dbus_message_new_signal(c->path,
+ PA_DBUSIFACE_CARD_INTERFACE,
+ signals[SIGNAL_PROPERTY_LIST_UPDATED].name));
dbus_message_iter_init_append(signal, &msg_iter);
pa_dbus_append_proplist(&msg_iter, c->proplist);