/* pulseDaemon.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from pulseDaemon.vala, do not modify */

/* From SwaySettings PulseAudio page: https://github.com/ErikReider/SwaySettings/blob/407c9e99dd3e50a0f09c64d94a9e6ff741488378/src/Pages/Pulse/PulseDaemon.vala*/

#include <glib-object.h>
#include <pulse/pulseaudio.h>
#include <pulse/glib-mainloop.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <stdio.h>
#include <float.h>
#include <math.h>
#include <gio/gio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON (sway_notification_center_widgets_pulse_daemon_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, SwayNotificationCenterWidgetsPulseDaemon))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, SwayNotificationCenterWidgetsPulseDaemonClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, SwayNotificationCenterWidgetsPulseDaemonClass))

typedef struct _SwayNotificationCenterWidgetsPulseDaemon SwayNotificationCenterWidgetsPulseDaemon;
typedef struct _SwayNotificationCenterWidgetsPulseDaemonClass SwayNotificationCenterWidgetsPulseDaemonClass;
typedef struct _SwayNotificationCenterWidgetsPulseDaemonPrivate SwayNotificationCenterWidgetsPulseDaemonPrivate;

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE (sway_notification_center_widgets_pulse_device_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE, SwayNotificationCenterWidgetsPulseDevice))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE, SwayNotificationCenterWidgetsPulseDeviceClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE, SwayNotificationCenterWidgetsPulseDeviceClass))

typedef struct _SwayNotificationCenterWidgetsPulseDevice SwayNotificationCenterWidgetsPulseDevice;
typedef struct _SwayNotificationCenterWidgetsPulseDeviceClass SwayNotificationCenterWidgetsPulseDeviceClass;

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_SINK_INPUT (sway_notification_center_widgets_pulse_sink_input_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_SINK_INPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_SINK_INPUT, SwayNotificationCenterWidgetsPulseSinkInput))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_SINK_INPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_SINK_INPUT, SwayNotificationCenterWidgetsPulseSinkInputClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_SINK_INPUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_SINK_INPUT))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_SINK_INPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_SINK_INPUT))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_SINK_INPUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_SINK_INPUT, SwayNotificationCenterWidgetsPulseSinkInputClass))

typedef struct _SwayNotificationCenterWidgetsPulseSinkInput SwayNotificationCenterWidgetsPulseSinkInput;
typedef struct _SwayNotificationCenterWidgetsPulseSinkInputClass SwayNotificationCenterWidgetsPulseSinkInputClass;
enum  {
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_0_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_RUNNING_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_SINKS_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_ACTIVE_SINKS_PROPERTY,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NUM_PROPERTIES
};
static GParamSpec* sway_notification_center_widgets_pulse_daemon_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NUM_PROPERTIES];
#define _pa_context_unref0(var) ((var == NULL) ? NULL : (var = (pa_context_unref (var), NULL)))
#define _pa_glib_mainloop_free0(var) ((var == NULL) ? NULL : (var = (pa_glib_mainloop_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _pa_operation_unref0(var) ((var == NULL) ? NULL : (var = (pa_operation_unref (var), NULL)))
typedef struct _SwayNotificationCenterWidgetsPulseSinkInputPrivate SwayNotificationCenterWidgetsPulseSinkInputPrivate;
typedef struct _Block27Data Block27Data;

#define SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_CARD_PROFILE (sway_notification_center_widgets_pulse_card_profile_get_type ())
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_CARD_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_CARD_PROFILE, SwayNotificationCenterWidgetsPulseCardProfile))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_CARD_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_CARD_PROFILE, SwayNotificationCenterWidgetsPulseCardProfileClass))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_CARD_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_CARD_PROFILE))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_CARD_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_CARD_PROFILE))
#define SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_CARD_PROFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_CARD_PROFILE, SwayNotificationCenterWidgetsPulseCardProfileClass))

typedef struct _SwayNotificationCenterWidgetsPulseCardProfile SwayNotificationCenterWidgetsPulseCardProfile;
typedef struct _SwayNotificationCenterWidgetsPulseCardProfileClass SwayNotificationCenterWidgetsPulseCardProfileClass;
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))
typedef struct _Block28Data Block28Data;
typedef struct _Block29Data Block29Data;
typedef struct _SwayNotificationCenterWidgetsPulseDevicePrivate SwayNotificationCenterWidgetsPulseDevicePrivate;
typedef struct _Block30Data Block30Data;
typedef struct _Block31Data Block31Data;
typedef struct _SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData;
typedef struct _Block32Data Block32Data;
typedef struct _SwayNotificationCenterWidgetsPulseDaemonWaitForUpdateData SwayNotificationCenterWidgetsPulseDaemonWaitForUpdateData;
typedef struct _Block33Data Block33Data;
typedef struct _SwayNotificationCenterWidgetsPulseCardProfilePrivate SwayNotificationCenterWidgetsPulseCardProfilePrivate;
typedef struct _SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData;
typedef struct _Block34Data Block34Data;
typedef struct _SwayNotificationCenterWidgetsPulseDaemonSetCardProfileByIndexData SwayNotificationCenterWidgetsPulseDaemonSetCardProfileByIndexData;
typedef struct _Block35Data Block35Data;
typedef struct _SwayNotificationCenterWidgetsPulseDaemonSetSinkPortByNameData SwayNotificationCenterWidgetsPulseDaemonSetSinkPortByNameData;
typedef struct _Block36Data Block36Data;
typedef struct _SwayNotificationCenterWidgetsPulseDaemonSetDefaultSinkData SwayNotificationCenterWidgetsPulseDaemonSetDefaultSinkData;
enum  {
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_DEFAULT_DEVICE_SIGNAL,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NEW_ACTIVE_SINK_SIGNAL,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_ACTIVE_SINK_SIGNAL,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_REMOVE_ACTIVE_SINK_SIGNAL,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NEW_DEVICE_SIGNAL,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_DEVICE_SIGNAL,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_REMOVE_DEVICE_SIGNAL,
	SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NUM_SIGNALS
};
static guint sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NUM_SIGNALS] = {0};

struct _SwayNotificationCenterWidgetsPulseDaemon {
	GObject parent_instance;
	SwayNotificationCenterWidgetsPulseDaemonPrivate * priv;
};

struct _SwayNotificationCenterWidgetsPulseDaemonClass {
	GObjectClass parent_class;
};

struct _SwayNotificationCenterWidgetsPulseDaemonPrivate {
	pa_context* context;
	pa_glib_mainloop* mainloop;
	gboolean quitting;
	gboolean _running;
	gchar* _default_sink_name;
	gchar* _default_source_name;
	SwayNotificationCenterWidgetsPulseDevice* default_sink;
	GeeHashMap* _sinks;
	GeeHashMap* _active_sinks;
};

struct _SwayNotificationCenterWidgetsPulseSinkInput {
	GObject parent_instance;
	SwayNotificationCenterWidgetsPulseSinkInputPrivate * priv;
	guint32 index;
	guint32 sink_index;
	guint32 client_index;
	gchar* name;
	gchar* application_binary;
	gchar* application_icon_name;
	gchar* media_name;
	gboolean is_muted;
	gdouble volume;
	pa_cvolume cvolume;
	pa_channel_map channel_map;
	GeeLinkedList* volume_operations;
	gboolean active;
};

struct _SwayNotificationCenterWidgetsPulseSinkInputClass {
	GObjectClass parent_class;
};

struct _Block27Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseSinkInput* sink_input;
};

struct _Block28Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseDevice* device;
};

struct _Block29Data {
	int _ref_count_;
	Block28Data * _data28_;
	SwayNotificationCenterWidgetsPulseDevice* device;
};

struct _SwayNotificationCenterWidgetsPulseDevice {
	GObject parent_instance;
	SwayNotificationCenterWidgetsPulseDevicePrivate * priv;
	pa_cvolume cvolume;
	pa_channel_map channel_map;
};

struct _SwayNotificationCenterWidgetsPulseDeviceClass {
	GObjectClass parent_class;
};

struct _Block30Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseSinkInput* sink_input;
};

struct _Block31Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseDevice* device;
};

struct _SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseDevice* device;
	gboolean is_input;
	pa_direction_t _tmp0_;
	pa_direction_t _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gchar* profile_name;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gint _tmp5_;
	gchar** _tmp6_;
	gint _tmp6__length1;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	SwayNotificationCenterWidgetsPulseDevice* alt_device;
	SwayNotificationCenterWidgetsPulseDevice* _tmp9_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp10_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp11_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	gint _tmp13_;
	gchar** _tmp14_;
	gint _tmp14__length1;
	gchar** profile_collection;
	gint profile_collection_length1;
	gint _profile_collection_size_;
	gint profile_it;
	gchar* _tmp15_;
	gchar* profile;
	const gchar* _tmp16_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp17_;
	gchar** _tmp18_;
	gint _tmp18__length1;
	gint _tmp19_;
	gchar** _tmp20_;
	gint _tmp20__length1;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
};

struct _Block32Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	gulong handler_id;
	SwayNotificationCenterWidgetsPulseDevice* device;
	gchar* prop_name;
	gpointer _async_data_;
};

struct _SwayNotificationCenterWidgetsPulseDaemonWaitForUpdateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseDevice* device;
	gchar* prop_name;
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	Block32Data* _data32_;
	gchar* _tmp0_;
	gulong _tmp1_;
};

struct _Block33Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseCardProfile* profile;
	SwayNotificationCenterWidgetsPulseDevice* device;
	gpointer _async_data_;
};

struct _SwayNotificationCenterWidgetsPulseCardProfile {
	GObject parent_instance;
	SwayNotificationCenterWidgetsPulseCardProfilePrivate * priv;
	gchar* name;
	gchar* description;
	guint32 n_sinks;
	guint32 priority;
};

struct _SwayNotificationCenterWidgetsPulseCardProfileClass {
	GObjectClass parent_class;
};

struct _SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseCardProfile* profile;
	SwayNotificationCenterWidgetsPulseDevice* device;
	Block33Data* _data33_;
	pa_context* _tmp0_;
	guint32 _tmp1_;
	guint32 _tmp2_;
	const gchar* _tmp3_;
	pa_operation* _tmp4_;
	pa_operation* _tmp5_;
};

struct _Block34Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	gchar* profile_name;
	SwayNotificationCenterWidgetsPulseDevice* device;
	gpointer _async_data_;
};

struct _SwayNotificationCenterWidgetsPulseDaemonSetCardProfileByIndexData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	gchar* profile_name;
	SwayNotificationCenterWidgetsPulseDevice* device;
	Block34Data* _data34_;
	pa_context* _tmp0_;
	guint32 _tmp1_;
	guint32 _tmp2_;
	pa_operation* _tmp3_;
	pa_operation* _tmp4_;
};

struct _Block35Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseDevice* device;
	gpointer _async_data_;
};

struct _SwayNotificationCenterWidgetsPulseDaemonSetSinkPortByNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseDevice* device;
	Block35Data* _data35_;
	pa_context* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	pa_operation* _tmp5_;
	pa_operation* _tmp6_;
};

struct _Block36Data {
	int _ref_count_;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseDevice* device;
	gpointer _async_data_;
};

struct _SwayNotificationCenterWidgetsPulseDaemonSetDefaultSinkData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	SwayNotificationCenterWidgetsPulseDevice* device;
	Block36Data* _data36_;
	pa_context* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	pa_operation* _tmp3_;
	pa_operation* _tmp4_;
};

static gint SwayNotificationCenterWidgetsPulseDaemon_private_offset;
static gpointer sway_notification_center_widgets_pulse_daemon_parent_class = NULL;

VALA_EXTERN GType sway_notification_center_widgets_pulse_daemon_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsPulseDaemon, g_object_unref)
VALA_EXTERN GType sway_notification_center_widgets_pulse_device_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsPulseDevice, g_object_unref)
VALA_EXTERN GType sway_notification_center_widgets_pulse_sink_input_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsPulseSinkInput, g_object_unref)
VALA_EXTERN void sway_notification_center_widgets_pulse_daemon_close (SwayNotificationCenterWidgetsPulseDaemon* self);
VALA_EXTERN void sway_notification_center_widgets_pulse_daemon_start (SwayNotificationCenterWidgetsPulseDaemon* self);
static void sway_notification_center_widgets_pulse_daemon_get_context (SwayNotificationCenterWidgetsPulseDaemon* self);
static void __lambda70_ (SwayNotificationCenterWidgetsPulseDaemon* self,
                  pa_context* ctx);
static const char* _pa_context_state_to_string (pa_context_state_t value);
static void sway_notification_center_widgets_pulse_daemon_subscription (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                 pa_context* ctx,
                                                                 pa_subscription_event_type_t t,
                                                                 guint32 index);
static void _sway_notification_center_widgets_pulse_daemon_subscription_pa_context_subscribe_cb_t (pa_context* c,
                                                                                            pa_subscription_event_type_t t,
                                                                                            guint32 idx,
                                                                                            gpointer self);
static void sway_notification_center_widgets_pulse_daemon_get_server_info (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                    pa_context* ctx,
                                                                    pa_server_info* info);
static void _sway_notification_center_widgets_pulse_daemon_get_server_info_pa_server_info_cb_t (pa_context* c,
                                                                                         pa_server_info* i,
                                                                                         gpointer self);
static void sway_notification_center_widgets_pulse_daemon_set_running (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                gboolean value);
static void ___lambda70__pa_context_notify_cb_t (pa_context* c,
                                          gpointer self);
static void sway_notification_center_widgets_pulse_daemon_get_sink_input_info (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                        pa_context* ctx,
                                                                        pa_sink_input_info* info,
                                                                        gint eol);
static void _sway_notification_center_widgets_pulse_daemon_get_sink_input_info_pa_sink_input_info_cb_t (pa_context* c,
                                                                                                 pa_sink_input_info* i,
                                                                                                 gint eol,
                                                                                                 gpointer self);
VALA_EXTERN GeeHashMap* sway_notification_center_widgets_pulse_daemon_get_active_sinks (SwayNotificationCenterWidgetsPulseDaemon* self);
static void sway_notification_center_widgets_pulse_daemon_get_sink_info (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                  pa_context* ctx,
                                                                  pa_sink_info* info,
                                                                  gint eol);
static void _sway_notification_center_widgets_pulse_daemon_get_sink_info_pa_sink_info_cb_t (pa_context* c,
                                                                                     pa_sink_info* i,
                                                                                     gint eol,
                                                                                     gpointer self);
VALA_EXTERN GeeHashMap* sway_notification_center_widgets_pulse_daemon_get_sinks (SwayNotificationCenterWidgetsPulseDaemon* self);
VALA_EXTERN guint32 sway_notification_center_widgets_pulse_device_get_device_index (SwayNotificationCenterWidgetsPulseDevice* self);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_removed (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                gboolean value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_is_default (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                   gboolean value);
static void sway_notification_center_widgets_pulse_daemon_get_card_info (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                  pa_context* ctx,
                                                                  pa_card_info* info,
                                                                  gint eol);
static void _sway_notification_center_widgets_pulse_daemon_get_card_info_pa_card_info_cb_t (pa_context* c,
                                                                                     pa_card_info* i,
                                                                                     gint eol,
                                                                                     gpointer self);
VALA_EXTERN guint32 sway_notification_center_widgets_pulse_device_get_card_index (SwayNotificationCenterWidgetsPulseDevice* self);
static const gchar* sway_notification_center_widgets_pulse_daemon_get_default_sink_name (SwayNotificationCenterWidgetsPulseDaemon* self);
static void sway_notification_center_widgets_pulse_daemon_set_default_sink_name (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                          const gchar* value);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
VALA_EXTERN guint32 sway_notification_center_widgets_pulse_sink_input_get_hash_map_key (guint32 i);
VALA_EXTERN SwayNotificationCenterWidgetsPulseSinkInput* sway_notification_center_widgets_pulse_sink_input_new (void);
VALA_EXTERN SwayNotificationCenterWidgetsPulseSinkInput* sway_notification_center_widgets_pulse_sink_input_construct (GType object_type);
VALA_EXTERN void sway_notification_center_widgets_pulse_sink_input_set_balance (SwayNotificationCenterWidgetsPulseSinkInput* self,
                                                                    gfloat value);
static gboolean __lambda71_ (Block27Data* _data27_,
                      pa_operation* op);
static gboolean ___lambda71__gee_forall_func (gpointer g,
                                       gpointer self);
static gdouble sway_notification_center_widgets_pulse_daemon_volume_to_double (pa_volume_t vol);
VALA_EXTERN gchar* sway_notification_center_widgets_pulse_device_get_hash_map_key (const gchar* c_desc,
                                                                       const gchar* p_name);
VALA_EXTERN SwayNotificationCenterWidgetsPulseDevice* sway_notification_center_widgets_pulse_device_new (void);
VALA_EXTERN SwayNotificationCenterWidgetsPulseDevice* sway_notification_center_widgets_pulse_device_construct (GType object_type);
VALA_EXTERN gboolean sway_notification_center_widgets_pulse_device_get_removed (SwayNotificationCenterWidgetsPulseDevice* self);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_is_bluetooth (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                     gboolean value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_card_index (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                   guint32 value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_direction (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                  pa_direction_t value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_card_name (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                  const gchar* value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_card_description (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                         const gchar* value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_card_active_profile (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                            const gchar* value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_port_name (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                  const gchar* value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_port_description (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                         const gchar* value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_port_id (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                const gchar* value);
static pa_card_profile_info2** _vala_array_dup6 (pa_card_profile_info2** self,
                                          gssize length);
static gint ____lambda74_ (SwayNotificationCenterWidgetsPulseDaemon* self,
                    pa_card_profile_info2* a,
                    pa_card_profile_info2* b);
static gint _____lambda74__gcompare_data_func (gconstpointer a,
                                        gconstpointer b,
                                        gpointer self);
VALA_EXTERN GType sway_notification_center_widgets_pulse_card_profile_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SwayNotificationCenterWidgetsPulseCardProfile, g_object_unref)
static void _g_object_unref0_ (gpointer var);
static void _vala_SwayNotificationCenterWidgetsPulseCardProfile_free_function_content_of (gpointer data);
static void _vala_array_add46 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
VALA_EXTERN SwayNotificationCenterWidgetsPulseCardProfile* sway_notification_center_widgets_pulse_card_profile_new (pa_card_profile_info2* profile);
VALA_EXTERN SwayNotificationCenterWidgetsPulseCardProfile* sway_notification_center_widgets_pulse_card_profile_construct (GType object_type,
                                                                                                              pa_card_profile_info2* profile);
VALA_EXTERN const gchar* sway_notification_center_widgets_pulse_device_get_card_active_profile (SwayNotificationCenterWidgetsPulseDevice* self);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_active_profile (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                       SwayNotificationCenterWidgetsPulseCardProfile* value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_port_profiles (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                      gchar** value,
                                                                      gint value_length1);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_profiles (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                 GArray* value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_icon_name (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                  const gchar* value);
VALA_EXTERN const gchar* sway_notification_center_widgets_pulse_device_get_icon_name (SwayNotificationCenterWidgetsPulseDevice* self);
static void _vala_array_add47 (SwayNotificationCenterWidgetsPulseDevice** * array,
                        gint* length,
                        gint* size,
                        SwayNotificationCenterWidgetsPulseDevice* value);
VALA_EXTERN gchar* sway_notification_center_widgets_pulse_device_get_current_hash_key (SwayNotificationCenterWidgetsPulseDevice* self);
static Block28Data* block28_data_ref (Block28Data* _data28_);
static void block28_data_unref (void * _userdata_);
static Block29Data* block29_data_ref (Block29Data* _data29_);
static void block29_data_unref (void * _userdata_);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_device_name (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                    const gchar* value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_device_description (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                           const gchar* value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_device_index (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                     guint32 value);
VALA_EXTERN const gchar* sway_notification_center_widgets_pulse_device_get_port_name (SwayNotificationCenterWidgetsPulseDevice* self);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_card_sink_port_name (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                            const gchar* value);
VALA_EXTERN const gchar* sway_notification_center_widgets_pulse_device_get_device_name (SwayNotificationCenterWidgetsPulseDevice* self);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_is_muted (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                 gboolean value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_is_virtual (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                   gboolean value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_balance (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                gfloat value);
VALA_EXTERN GeeLinkedList* sway_notification_center_widgets_pulse_device_get_volume_operations (SwayNotificationCenterWidgetsPulseDevice* self);
static gboolean ______lambda72_ (Block29Data* _data29_,
                          pa_operation* op);
static gboolean _______lambda72__gee_forall_func (gpointer g,
                                           gpointer self);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_volume (SwayNotificationCenterWidgetsPulseDevice* self,
                                                               gdouble value);
VALA_EXTERN void sway_notification_center_widgets_pulse_device_set_has_card (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                 gboolean value);
static const gchar* sway_notification_center_widgets_pulse_daemon_get_default_source_name (SwayNotificationCenterWidgetsPulseDaemon* self);
static gboolean __lambda73_ (Block28Data* _data28_,
                      pa_operation* op);
static gboolean ___lambda73__gee_forall_func (gpointer g,
                                       gpointer self);
VALA_EXTERN void sway_notification_center_widgets_pulse_daemon_set_sink_input_volume (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                          SwayNotificationCenterWidgetsPulseSinkInput* sink_input,
                                                                          gdouble volume);
static Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
static gboolean __lambda75_ (Block30Data* _data30_,
                      pa_operation* operation);
static gboolean ___lambda75__gee_forall_func (gpointer g,
                                       gpointer self);
static pa_volume_t sway_notification_center_widgets_pulse_daemon_double_to_volume (gdouble vol);
VALA_EXTERN void sway_notification_center_widgets_pulse_daemon_set_device_volume (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                      SwayNotificationCenterWidgetsPulseDevice* device,
                                                                      gdouble volume);
static Block31Data* block31_data_ref (Block31Data* _data31_);
static void block31_data_unref (void * _userdata_);
static gboolean __lambda76_ (Block31Data* _data31_,
                      pa_operation* operation);
static gboolean ___lambda76__gee_forall_func (gpointer g,
                                       gpointer self);
VALA_EXTERN pa_direction_t sway_notification_center_widgets_pulse_device_get_direction (SwayNotificationCenterWidgetsPulseDevice* self);
static void sway_notification_center_widgets_pulse_daemon_set_default_device_data_free (gpointer _data);
VALA_EXTERN void sway_notification_center_widgets_pulse_daemon_set_default_device (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                       SwayNotificationCenterWidgetsPulseDevice* device,
                                                                       GAsyncReadyCallback _callback_,
                                                                       gpointer _user_data_);
VALA_EXTERN void sway_notification_center_widgets_pulse_daemon_set_default_device_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                              GAsyncResult* _res_);
static gboolean sway_notification_center_widgets_pulse_daemon_set_default_device_co (SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData* _data_);
VALA_EXTERN gboolean sway_notification_center_widgets_pulse_device_get_has_card (SwayNotificationCenterWidgetsPulseDevice* self);
VALA_EXTERN gchar** sway_notification_center_widgets_pulse_device_get_port_profiles (SwayNotificationCenterWidgetsPulseDevice* self,
                                                                         gint* result_length1);
static gboolean _vala_string_array_contains (gchar* * stack,
                                      gssize stack_length,
                                      const gchar* needle);
static void sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                              const gchar* profile_name,
                                                                              SwayNotificationCenterWidgetsPulseDevice* device,
                                                                              GAsyncReadyCallback _callback_,
                                                                              gpointer _user_data_);
static void sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                                     GAsyncResult* _res_);
static void sway_notification_center_widgets_pulse_daemon_set_default_device_ready (GObject* source_object,
                                                                             GAsyncResult* _res_,
                                                                             gpointer _user_data_);
static void sway_notification_center_widgets_pulse_daemon_wait_for_update (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                    GType t_type,
                                                                    GBoxedCopyFunc t_dup_func,
                                                                    GDestroyNotify t_destroy_func,
                                                                    SwayNotificationCenterWidgetsPulseDevice* device,
                                                                    const gchar* prop_name,
                                                                    GAsyncReadyCallback _callback_,
                                                                    gpointer _user_data_);
static void sway_notification_center_widgets_pulse_daemon_wait_for_update_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                           GAsyncResult* _res_);
VALA_EXTERN const gchar* sway_notification_center_widgets_pulse_device_get_card_sink_port_name (SwayNotificationCenterWidgetsPulseDevice* self);
static void sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                          SwayNotificationCenterWidgetsPulseDevice* device,
                                                                          GAsyncReadyCallback _callback_,
                                                                          gpointer _user_data_);
static void sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                                 GAsyncResult* _res_);
static void sway_notification_center_widgets_pulse_daemon_set_default_sink (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                     SwayNotificationCenterWidgetsPulseDevice* device,
                                                                     GAsyncReadyCallback _callback_,
                                                                     gpointer _user_data_);
static void sway_notification_center_widgets_pulse_daemon_set_default_sink_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                            GAsyncResult* _res_);
static void sway_notification_center_widgets_pulse_daemon_wait_for_update_data_free (gpointer _data);
static gboolean sway_notification_center_widgets_pulse_daemon_wait_for_update_co (SwayNotificationCenterWidgetsPulseDaemonWaitForUpdateData* _data_);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
static gboolean _sway_notification_center_widgets_pulse_daemon_wait_for_update_co_gsource_func (gpointer self);
static void __lambda78_ (Block32Data* _data32_,
                  GObject* s,
                  GParamSpec* p);
static void ___lambda78__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_data_free (gpointer _data);
VALA_EXTERN void sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                               SwayNotificationCenterWidgetsPulseCardProfile* profile,
                                                                               SwayNotificationCenterWidgetsPulseDevice* device,
                                                                               GAsyncReadyCallback _callback_,
                                                                               gpointer _user_data_);
VALA_EXTERN void sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                                      GAsyncResult* _res_);
static gboolean sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_co (SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData* _data_);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void __lambda81_ (Block33Data* _data33_,
                  pa_context* c,
                  gint success);
VALA_EXTERN const gchar* sway_notification_center_widgets_pulse_device_get_card_name (SwayNotificationCenterWidgetsPulseDevice* self);
static void ___lambda81__pa_context_success_cb_t (pa_context* c,
                                           gint success,
                                           gpointer self);
static void sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_ready (GObject* source_object,
                                                                                     GAsyncResult* _res_,
                                                                                     gpointer _user_data_);
static void sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index_data_free (gpointer _data);
static gboolean sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index_co (SwayNotificationCenterWidgetsPulseDaemonSetCardProfileByIndexData* _data_);
static Block34Data* block34_data_ref (Block34Data* _data34_);
static void block34_data_unref (void * _userdata_);
static void __lambda77_ (Block34Data* _data34_,
                  pa_context* c,
                  gint success);
static void ___lambda77__pa_context_success_cb_t (pa_context* c,
                                           gint success,
                                           gpointer self);
static void sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name_data_free (gpointer _data);
static gboolean sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name_co (SwayNotificationCenterWidgetsPulseDaemonSetSinkPortByNameData* _data_);
static Block35Data* block35_data_ref (Block35Data* _data35_);
static void block35_data_unref (void * _userdata_);
static void __lambda79_ (Block35Data* _data35_,
                  pa_context* c,
                  gint success);
static void ___lambda79__pa_context_success_cb_t (pa_context* c,
                                           gint success,
                                           gpointer self);
static void sway_notification_center_widgets_pulse_daemon_set_default_sink_data_free (gpointer _data);
static gboolean sway_notification_center_widgets_pulse_daemon_set_default_sink_co (SwayNotificationCenterWidgetsPulseDaemonSetDefaultSinkData* _data_);
static Block36Data* block36_data_ref (Block36Data* _data36_);
static void block36_data_unref (void * _userdata_);
static void __lambda80_ (Block36Data* _data36_,
                  pa_context* c,
                  gint success);
static void ___lambda80__pa_context_success_cb_t (pa_context* c,
                                           gint success,
                                           gpointer self);
VALA_EXTERN void sway_notification_center_widgets_pulse_daemon_set_device_mute (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                    gboolean state,
                                                                    SwayNotificationCenterWidgetsPulseDevice* device);
VALA_EXTERN gboolean sway_notification_center_widgets_pulse_device_get_is_muted (SwayNotificationCenterWidgetsPulseDevice* self);
VALA_EXTERN void sway_notification_center_widgets_pulse_daemon_set_sink_input_mute (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                        gboolean state,
                                                                        SwayNotificationCenterWidgetsPulseSinkInput* sink_input);
VALA_EXTERN SwayNotificationCenterWidgetsPulseDaemon* sway_notification_center_widgets_pulse_daemon_new (void);
VALA_EXTERN SwayNotificationCenterWidgetsPulseDaemon* sway_notification_center_widgets_pulse_daemon_construct (GType object_type);
VALA_EXTERN gboolean sway_notification_center_widgets_pulse_daemon_get_running (SwayNotificationCenterWidgetsPulseDaemon* self);
static void sway_notification_center_widgets_pulse_daemon_set_default_source_name (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                            const gchar* value);
static void sway_notification_center_widgets_pulse_daemon_set_sinks (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                              GeeHashMap* value);
static void sway_notification_center_widgets_pulse_daemon_set_active_sinks (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                     GeeHashMap* value);
static GObject * sway_notification_center_widgets_pulse_daemon_constructor (GType type,
                                                                     guint n_construct_properties,
                                                                     GObjectConstructParam * construct_properties);
static void sway_notification_center_widgets_pulse_daemon_finalize (GObject * obj);
static GType sway_notification_center_widgets_pulse_daemon_get_type_once (void);
static void _vala_sway_notification_center_widgets_pulse_daemon_get_property (GObject * object,
                                                                       guint property_id,
                                                                       GValue * value,
                                                                       GParamSpec * pspec);
static void _vala_sway_notification_center_widgets_pulse_daemon_set_property (GObject * object,
                                                                       guint property_id,
                                                                       const GValue * value,
                                                                       GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
sway_notification_center_widgets_pulse_daemon_get_instance_private (SwayNotificationCenterWidgetsPulseDaemon* self)
{
	return G_STRUCT_MEMBER_P (self, SwayNotificationCenterWidgetsPulseDaemon_private_offset);
}

void
sway_notification_center_widgets_pulse_daemon_start (SwayNotificationCenterWidgetsPulseDaemon* self)
{
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	sway_notification_center_widgets_pulse_daemon_get_context (self);
}

void
sway_notification_center_widgets_pulse_daemon_close (SwayNotificationCenterWidgetsPulseDaemon* self)
{
	pa_context* _tmp0_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	self->priv->quitting = TRUE;
	_tmp0_ = self->priv->context;
	if (_tmp0_ != NULL) {
		pa_context* _tmp1_;
		_tmp1_ = self->priv->context;
		pa_context_disconnect (_tmp1_);
		_pa_context_unref0 (self->priv->context);
		self->priv->context = NULL;
	}
}

static const char*
_pa_context_state_to_string (pa_context_state_t value)
{
	switch (value) {
		case PA_CONTEXT_UNCONNECTED:
		return "PA_CONTEXT_UNCONNECTED";
		case PA_CONTEXT_CONNECTING:
		return "PA_CONTEXT_CONNECTING";
		case PA_CONTEXT_AUTHORIZING:
		return "PA_CONTEXT_AUTHORIZING";
		case PA_CONTEXT_SETTING_NAME:
		return "PA_CONTEXT_SETTING_NAME";
		case PA_CONTEXT_READY:
		return "PA_CONTEXT_READY";
		case PA_CONTEXT_FAILED:
		return "PA_CONTEXT_FAILED";
		case PA_CONTEXT_TERMINATED:
		return "PA_CONTEXT_TERMINATED";
	}
	return NULL;
}

static void
_sway_notification_center_widgets_pulse_daemon_subscription_pa_context_subscribe_cb_t (pa_context* c,
                                                                                       pa_subscription_event_type_t t,
                                                                                       guint32 idx,
                                                                                       gpointer self)
{
	sway_notification_center_widgets_pulse_daemon_subscription ((SwayNotificationCenterWidgetsPulseDaemon*) self, c, t, idx);
}

static void
_sway_notification_center_widgets_pulse_daemon_get_server_info_pa_server_info_cb_t (pa_context* c,
                                                                                    pa_server_info* i,
                                                                                    gpointer self)
{
	sway_notification_center_widgets_pulse_daemon_get_server_info ((SwayNotificationCenterWidgetsPulseDaemon*) self, c, i);
}

static void
__lambda70_ (SwayNotificationCenterWidgetsPulseDaemon* self,
             pa_context* ctx)
{
	const gchar* _tmp0_;
	g_return_if_fail (ctx != NULL);
	_tmp0_ = _pa_context_state_to_string (pa_context_get_state (ctx));
	g_debug ("pulseDaemon.vala:63: Pulse Status: %s\n", _tmp0_);
	switch (pa_context_get_state (ctx)) {
		case PA_CONTEXT_CONNECTING:
		case PA_CONTEXT_AUTHORIZING:
		case PA_CONTEXT_SETTING_NAME:
		{
			break;
		}
		case PA_CONTEXT_READY:
		{
			pa_operation* _tmp1_;
			pa_operation* _tmp2_;
			pa_operation* _tmp3_;
			pa_operation* _tmp4_;
			pa_context_set_subscribe_callback (ctx, _sway_notification_center_widgets_pulse_daemon_subscription_pa_context_subscribe_cb_t, self);
			_tmp1_ = pa_context_subscribe (ctx, ((PA_SUBSCRIPTION_MASK_SINK_INPUT | PA_SUBSCRIPTION_MASK_SINK) | PA_SUBSCRIPTION_MASK_CARD) | PA_SUBSCRIPTION_MASK_SERVER, NULL, NULL);
			_tmp2_ = _tmp1_;
			_pa_operation_unref0 (_tmp2_);
			_tmp3_ = pa_context_get_server_info (ctx, _sway_notification_center_widgets_pulse_daemon_get_server_info_pa_server_info_cb_t, self);
			_tmp4_ = _tmp3_;
			_pa_operation_unref0 (_tmp4_);
			sway_notification_center_widgets_pulse_daemon_set_running (self, TRUE);
			break;
		}
		case PA_CONTEXT_TERMINATED:
		case PA_CONTEXT_FAILED:
		{
			FILE* _tmp5_;
			sway_notification_center_widgets_pulse_daemon_set_running (self, FALSE);
			if (self->priv->quitting) {
				self->priv->quitting = FALSE;
				break;
			}
			_tmp5_ = stderr;
			fprintf (_tmp5_, "PulseAudio connection lost. Will retry connection.\n");
			sway_notification_center_widgets_pulse_daemon_get_context (self);
			break;
		}
		default:
		{
			FILE* _tmp6_;
			const gchar* _tmp7_;
			sway_notification_center_widgets_pulse_daemon_set_running (self, FALSE);
			_tmp6_ = stderr;
			_tmp7_ = pa_strerror (pa_context_errno (ctx));
			fprintf (_tmp6_, "Connection failure: %s\n", _tmp7_);
			break;
		}
	}
}

static void
___lambda70__pa_context_notify_cb_t (pa_context* c,
                                     gpointer self)
{
	__lambda70_ ((SwayNotificationCenterWidgetsPulseDaemon*) self, c);
}

static gpointer
_pa_context_ref0 (gpointer self)
{
	return self ? pa_context_ref (self) : NULL;
}

static void
sway_notification_center_widgets_pulse_daemon_get_context (SwayNotificationCenterWidgetsPulseDaemon* self)
{
	pa_context* ctx = NULL;
	pa_glib_mainloop* _tmp0_;
	pa_mainloop_api* _tmp1_;
	pa_context* _tmp2_;
	pa_context* _tmp3_;
	pa_context* _tmp4_;
	pa_context* _tmp8_;
	pa_context* _tmp9_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	_tmp0_ = self->priv->mainloop;
	_tmp1_ = pa_glib_mainloop_get_api (_tmp0_);
	_tmp2_ = pa_context_new_with_proplist (_tmp1_, NULL, NULL);
	ctx = _tmp2_;
	_tmp3_ = ctx;
	pa_context_set_state_callback (_tmp3_, ___lambda70__pa_context_notify_cb_t, self);
	_tmp4_ = ctx;
	if (pa_context_connect (_tmp4_, NULL, PA_CONTEXT_NOFAIL, NULL) < 0) {
		FILE* _tmp5_;
		pa_context* _tmp6_;
		const gchar* _tmp7_;
		_tmp5_ = stdout;
		_tmp6_ = ctx;
		_tmp7_ = pa_strerror (pa_context_errno (_tmp6_));
		fprintf (_tmp5_, "pa_context_connect() failed: %s\n", _tmp7_);
	}
	_tmp8_ = ctx;
	_tmp9_ = _pa_context_ref0 (_tmp8_);
	_pa_context_unref0 (self->priv->context);
	self->priv->context = _tmp9_;
	_pa_context_unref0 (ctx);
}

static void
_sway_notification_center_widgets_pulse_daemon_get_sink_input_info_pa_sink_input_info_cb_t (pa_context* c,
                                                                                            pa_sink_input_info* i,
                                                                                            gint eol,
                                                                                            gpointer self)
{
	sway_notification_center_widgets_pulse_daemon_get_sink_input_info ((SwayNotificationCenterWidgetsPulseDaemon*) self, c, i, eol);
}

static void
_sway_notification_center_widgets_pulse_daemon_get_sink_info_pa_sink_info_cb_t (pa_context* c,
                                                                                pa_sink_info* i,
                                                                                gint eol,
                                                                                gpointer self)
{
	sway_notification_center_widgets_pulse_daemon_get_sink_info ((SwayNotificationCenterWidgetsPulseDaemon*) self, c, i, eol);
}

static void
_sway_notification_center_widgets_pulse_daemon_get_card_info_pa_card_info_cb_t (pa_context* c,
                                                                                pa_card_info* i,
                                                                                gint eol,
                                                                                gpointer self)
{
	sway_notification_center_widgets_pulse_daemon_get_card_info ((SwayNotificationCenterWidgetsPulseDaemon*) self, c, i, eol);
}

static void
sway_notification_center_widgets_pulse_daemon_subscription (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                            pa_context* ctx,
                                                            pa_subscription_event_type_t t,
                                                            guint32 index)
{
	pa_subscription_event_type_t type = 0;
	pa_subscription_event_type_t event = 0;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (ctx != NULL);
	type = t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK;
	event = t & PA_SUBSCRIPTION_EVENT_TYPE_MASK;
	switch (type) {
		case PA_SUBSCRIPTION_EVENT_SINK_INPUT:
		{
			switch (event) {
				default:
				{
					break;
				}
				case PA_SUBSCRIPTION_EVENT_NEW:
				case PA_SUBSCRIPTION_EVENT_CHANGE:
				{
					pa_operation* _tmp0_;
					pa_operation* _tmp1_;
					_tmp0_ = pa_context_get_sink_input_info_list (ctx, _sway_notification_center_widgets_pulse_daemon_get_sink_input_info_pa_sink_input_info_cb_t, self);
					_tmp1_ = _tmp0_;
					_pa_operation_unref0 (_tmp1_);
					break;
				}
				case PA_SUBSCRIPTION_EVENT_REMOVE:
				{
					GeeMapIterator* iter = NULL;
					GeeHashMap* _tmp2_;
					GeeMapIterator* _tmp3_;
					_tmp2_ = self->priv->_active_sinks;
					_tmp3_ = gee_abstract_map_map_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
					iter = _tmp3_;
					while (TRUE) {
						GeeMapIterator* _tmp4_;
						SwayNotificationCenterWidgetsPulseSinkInput* sink_input = NULL;
						GeeMapIterator* _tmp5_;
						gpointer _tmp6_;
						SwayNotificationCenterWidgetsPulseSinkInput* _tmp7_;
						SwayNotificationCenterWidgetsPulseSinkInput* _tmp8_;
						GeeMapIterator* _tmp9_;
						_tmp4_ = iter;
						if (!gee_map_iterator_next (_tmp4_)) {
							break;
						}
						_tmp5_ = iter;
						_tmp6_ = gee_map_iterator_get_value (_tmp5_);
						sink_input = (SwayNotificationCenterWidgetsPulseSinkInput*) _tmp6_;
						_tmp7_ = sink_input;
						if (_tmp7_->index != index) {
							_g_object_unref0 (sink_input);
							continue;
						}
						_tmp8_ = sink_input;
						g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_REMOVE_ACTIVE_SINK_SIGNAL], 0, _tmp8_);
						_tmp9_ = iter;
						gee_map_iterator_unset (_tmp9_);
						_g_object_unref0 (sink_input);
						break;
					}
					_g_object_unref0 (iter);
					break;
				}
			}
			break;
		}
		case PA_SUBSCRIPTION_EVENT_SINK:
		{
			switch (event) {
				default:
				{
					break;
				}
				case PA_SUBSCRIPTION_EVENT_NEW:
				case PA_SUBSCRIPTION_EVENT_CHANGE:
				{
					pa_operation* _tmp10_;
					pa_operation* _tmp11_;
					_tmp10_ = pa_context_get_sink_info_by_index (ctx, index, _sway_notification_center_widgets_pulse_daemon_get_sink_info_pa_sink_info_cb_t, self);
					_tmp11_ = _tmp10_;
					_pa_operation_unref0 (_tmp11_);
					break;
				}
				case PA_SUBSCRIPTION_EVENT_REMOVE:
				{
					{
						GeeIterator* _sink_it = NULL;
						GeeHashMap* _tmp12_;
						GeeCollection* _tmp13_;
						GeeCollection* _tmp14_;
						GeeCollection* _tmp15_;
						GeeIterator* _tmp16_;
						GeeIterator* _tmp17_;
						_tmp12_ = self->priv->_sinks;
						_tmp13_ = gee_abstract_map_get_values (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
						_tmp14_ = _tmp13_;
						_tmp15_ = _tmp14_;
						_tmp16_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GEE_TYPE_ITERABLE, GeeIterable));
						_tmp17_ = _tmp16_;
						_g_object_unref0 (_tmp15_);
						_sink_it = _tmp17_;
						while (TRUE) {
							GeeIterator* _tmp18_;
							SwayNotificationCenterWidgetsPulseDevice* sink = NULL;
							GeeIterator* _tmp19_;
							gpointer _tmp20_;
							SwayNotificationCenterWidgetsPulseDevice* _tmp21_;
							guint32 _tmp22_;
							guint32 _tmp23_;
							SwayNotificationCenterWidgetsPulseDevice* _tmp24_;
							SwayNotificationCenterWidgetsPulseDevice* _tmp25_;
							SwayNotificationCenterWidgetsPulseDevice* _tmp26_;
							_tmp18_ = _sink_it;
							if (!gee_iterator_next (_tmp18_)) {
								break;
							}
							_tmp19_ = _sink_it;
							_tmp20_ = gee_iterator_get (_tmp19_);
							sink = (SwayNotificationCenterWidgetsPulseDevice*) _tmp20_;
							_tmp21_ = sink;
							_tmp22_ = sway_notification_center_widgets_pulse_device_get_device_index (_tmp21_);
							_tmp23_ = _tmp22_;
							if (_tmp23_ != index) {
								_g_object_unref0 (sink);
								continue;
							}
							_tmp24_ = sink;
							sway_notification_center_widgets_pulse_device_set_removed (_tmp24_, TRUE);
							_tmp25_ = sink;
							sway_notification_center_widgets_pulse_device_set_is_default (_tmp25_, FALSE);
							_tmp26_ = sink;
							g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_REMOVE_DEVICE_SIGNAL], 0, _tmp26_);
							_g_object_unref0 (sink);
							break;
						}
						_g_object_unref0 (_sink_it);
					}
					break;
				}
			}
			break;
		}
		case PA_SUBSCRIPTION_EVENT_CARD:
		{
			switch (event) {
				default:
				{
					break;
				}
				case PA_SUBSCRIPTION_EVENT_NEW:
				case PA_SUBSCRIPTION_EVENT_CHANGE:
				{
					pa_operation* _tmp27_;
					pa_operation* _tmp28_;
					_tmp27_ = pa_context_get_card_info_by_index (ctx, index, _sway_notification_center_widgets_pulse_daemon_get_card_info_pa_card_info_cb_t, self);
					_tmp28_ = _tmp27_;
					_pa_operation_unref0 (_tmp28_);
					break;
				}
				case PA_SUBSCRIPTION_EVENT_REMOVE:
				{
					GeeMapIterator* iter = NULL;
					GeeHashMap* _tmp29_;
					GeeMapIterator* _tmp30_;
					_tmp29_ = self->priv->_sinks;
					_tmp30_ = gee_abstract_map_map_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
					iter = _tmp30_;
					while (TRUE) {
						GeeMapIterator* _tmp31_;
						SwayNotificationCenterWidgetsPulseDevice* device = NULL;
						GeeMapIterator* _tmp32_;
						gpointer _tmp33_;
						SwayNotificationCenterWidgetsPulseDevice* _tmp34_;
						guint32 _tmp35_;
						guint32 _tmp36_;
						SwayNotificationCenterWidgetsPulseDevice* _tmp37_;
						SwayNotificationCenterWidgetsPulseDevice* _tmp38_;
						GeeMapIterator* _tmp39_;
						SwayNotificationCenterWidgetsPulseDevice* _tmp40_;
						_tmp31_ = iter;
						if (!gee_map_iterator_next (_tmp31_)) {
							break;
						}
						_tmp32_ = iter;
						_tmp33_ = gee_map_iterator_get_value (_tmp32_);
						device = (SwayNotificationCenterWidgetsPulseDevice*) _tmp33_;
						_tmp34_ = device;
						_tmp35_ = sway_notification_center_widgets_pulse_device_get_card_index (_tmp34_);
						_tmp36_ = _tmp35_;
						if (_tmp36_ != index) {
							_g_object_unref0 (device);
							continue;
						}
						_tmp37_ = device;
						sway_notification_center_widgets_pulse_device_set_removed (_tmp37_, TRUE);
						_tmp38_ = device;
						sway_notification_center_widgets_pulse_device_set_is_default (_tmp38_, FALSE);
						_tmp39_ = iter;
						gee_map_iterator_unset (_tmp39_);
						_tmp40_ = device;
						g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_REMOVE_DEVICE_SIGNAL], 0, _tmp40_);
						_g_object_unref0 (device);
						break;
					}
					_g_object_unref0 (iter);
					break;
				}
			}
			break;
		}
		case PA_SUBSCRIPTION_EVENT_SERVER:
		{
			pa_operation* _tmp41_;
			pa_operation* _tmp42_;
			_tmp41_ = pa_context_get_server_info (ctx, _sway_notification_center_widgets_pulse_daemon_get_server_info_pa_server_info_cb_t, self);
			_tmp42_ = _tmp41_;
			_pa_operation_unref0 (_tmp42_);
			break;
		}
		default:
		{
			break;
		}
	}
}

/**
         * Gets called when any server value changes like default devices
         * Calls `get_card_info_list` and `get_sink_info_list`
         */
static void
sway_notification_center_widgets_pulse_daemon_get_server_info (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                               pa_context* ctx,
                                                               pa_server_info* info)
{
	const gchar* _tmp0_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	pa_operation* _tmp5_;
	pa_operation* _tmp6_;
	pa_operation* _tmp7_;
	pa_operation* _tmp8_;
	pa_operation* _tmp17_;
	pa_operation* _tmp18_;
	GeeMapIterator* iter = NULL;
	GeeHashMap* _tmp19_;
	GeeMapIterator* _tmp20_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (ctx != NULL);
	_tmp0_ = self->priv->_default_sink_name;
	if (_tmp0_ == NULL) {
		const gchar* _tmp1_;
		_tmp1_ = (*info).default_sink_name;
		sway_notification_center_widgets_pulse_daemon_set_default_sink_name (self, _tmp1_);
	}
	_tmp2_ = self->priv->_default_sink_name;
	_tmp3_ = (*info).default_sink_name;
	if (g_strcmp0 (_tmp2_, _tmp3_) != 0) {
		const gchar* _tmp4_;
		_tmp4_ = (*info).default_sink_name;
		sway_notification_center_widgets_pulse_daemon_set_default_sink_name (self, _tmp4_);
	}
	_tmp5_ = pa_context_get_card_info_list (ctx, _sway_notification_center_widgets_pulse_daemon_get_card_info_pa_card_info_cb_t, self);
	_tmp6_ = _tmp5_;
	_pa_operation_unref0 (_tmp6_);
	_tmp7_ = pa_context_get_sink_info_list (ctx, _sway_notification_center_widgets_pulse_daemon_get_sink_info_pa_sink_info_cb_t, self);
	_tmp8_ = _tmp7_;
	_pa_operation_unref0 (_tmp8_);
	{
		GeeIterator* _sink_input_it = NULL;
		GeeHashMap* _tmp9_;
		GeeIterator* _tmp10_;
		_tmp9_ = self->priv->_active_sinks;
		_tmp10_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ITERABLE, GeeIterable));
		_sink_input_it = _tmp10_;
		while (TRUE) {
			GeeIterator* _tmp11_;
			GeeMapEntry* sink_input = NULL;
			GeeIterator* _tmp12_;
			gpointer _tmp13_;
			GeeMapEntry* _tmp14_;
			gconstpointer _tmp15_;
			gconstpointer _tmp16_;
			_tmp11_ = _sink_input_it;
			if (!gee_iterator_next (_tmp11_)) {
				break;
			}
			_tmp12_ = _sink_input_it;
			_tmp13_ = gee_iterator_get (_tmp12_);
			sink_input = (GeeMapEntry*) _tmp13_;
			_tmp14_ = sink_input;
			_tmp15_ = gee_map_entry_get_value (_tmp14_);
			_tmp16_ = _tmp15_;
			((SwayNotificationCenterWidgetsPulseSinkInput*) _tmp16_)->active = FALSE;
			_g_object_unref0 (sink_input);
		}
		_g_object_unref0 (_sink_input_it);
	}
	_tmp17_ = pa_context_get_sink_input_info_list (ctx, _sway_notification_center_widgets_pulse_daemon_get_sink_input_info_pa_sink_input_info_cb_t, self);
	_tmp18_ = _tmp17_;
	_pa_operation_unref0 (_tmp18_);
	_tmp19_ = self->priv->_active_sinks;
	_tmp20_ = gee_abstract_map_map_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
	iter = _tmp20_;
	while (TRUE) {
		GeeMapIterator* _tmp21_;
		SwayNotificationCenterWidgetsPulseSinkInput* sink_input = NULL;
		GeeMapIterator* _tmp22_;
		gpointer _tmp23_;
		SwayNotificationCenterWidgetsPulseSinkInput* _tmp24_;
		_tmp21_ = iter;
		if (!gee_map_iterator_next (_tmp21_)) {
			break;
		}
		_tmp22_ = iter;
		_tmp23_ = gee_map_iterator_get_value (_tmp22_);
		sink_input = (SwayNotificationCenterWidgetsPulseSinkInput*) _tmp23_;
		_tmp24_ = sink_input;
		if (!_tmp24_->active) {
			SwayNotificationCenterWidgetsPulseSinkInput* _tmp25_;
			GeeMapIterator* _tmp26_;
			_tmp25_ = sink_input;
			g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_REMOVE_ACTIVE_SINK_SIGNAL], 0, _tmp25_);
			_tmp26_ = iter;
			gee_map_iterator_unset (_tmp26_);
		}
		_g_object_unref0 (sink_input);
	}
	_g_object_unref0 (iter);
}

static Block27Data*
block27_data_ref (Block27Data* _data27_)
{
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}

static void
block27_data_unref (void * _userdata_)
{
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		SwayNotificationCenterWidgetsPulseDaemon* self;
		self = _data27_->self;
		_g_object_unref0 (_data27_->sink_input);
		_g_object_unref0 (self);
		g_slice_free (Block27Data, _data27_);
	}
}

static gboolean
__lambda71_ (Block27Data* _data27_,
             pa_operation* op)
{
	SwayNotificationCenterWidgetsPulseDaemon* self;
	gboolean result;
	self = _data27_->self;
	g_return_val_if_fail (op != NULL, FALSE);
	if (pa_operation_get_state (op) != PA_OPERATION_RUNNING) {
		SwayNotificationCenterWidgetsPulseSinkInput* _tmp0_;
		GeeLinkedList* _tmp1_;
		_tmp0_ = _data27_->sink_input;
		_tmp1_ = _tmp0_->volume_operations;
		gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), op);
	}
	result = G_SOURCE_CONTINUE;
	_pa_operation_unref0 (op);
	return result;
}

static gboolean
___lambda71__gee_forall_func (gpointer g,
                              gpointer self)
{
	gboolean result;
	result = __lambda71_ (self, (pa_operation*) g);
	return result;
}

static void
sway_notification_center_widgets_pulse_daemon_get_sink_input_info (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                   pa_context* ctx,
                                                                   pa_sink_input_info* info,
                                                                   gint eol)
{
	Block27Data* _data27_;
	gboolean _tmp0_ = FALSE;
	guint32 id = 0U;
	gboolean has_sink_input = FALSE;
	GeeHashMap* _tmp1_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp5_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp6_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp7_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp8_;
	pa_proplist* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp12_;
	pa_proplist* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp16_;
	pa_proplist* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp20_;
	pa_proplist* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp24_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp25_;
	pa_cvolume _tmp26_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp27_;
	pa_channel_map _tmp28_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp29_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp30_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp31_;
	pa_channel_map _tmp32_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp33_;
	GeeLinkedList* _tmp34_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp35_;
	GeeLinkedList* _tmp36_;
	gboolean _tmp37_;
	gboolean _tmp38_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp41_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (ctx != NULL);
	_data27_ = g_slice_new0 (Block27Data);
	_data27_->_ref_count_ = 1;
	_data27_->self = g_object_ref (self);
	if (info == NULL) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = eol != 0;
	}
	if (_tmp0_) {
		block27_data_unref (_data27_);
		_data27_ = NULL;
		return;
	}
	id = sway_notification_center_widgets_pulse_sink_input_get_hash_map_key ((*info).index);
	_data27_->sink_input = NULL;
	_tmp1_ = self->priv->_active_sinks;
	has_sink_input = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) id));
	if (has_sink_input) {
		GeeHashMap* _tmp2_;
		gpointer _tmp3_;
		_tmp2_ = self->priv->_active_sinks;
		_tmp3_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) id));
		_g_object_unref0 (_data27_->sink_input);
		_data27_->sink_input = (SwayNotificationCenterWidgetsPulseSinkInput*) _tmp3_;
	} else {
		SwayNotificationCenterWidgetsPulseSinkInput* _tmp4_;
		_tmp4_ = sway_notification_center_widgets_pulse_sink_input_new ();
		if (_tmp4_) {
			g_object_set_data ((GObject *) _tmp4_, "vala-creation-function", "SwayNotificationCenter.Widgets.PulseDaemon.get_sink_input_info");
		}
		_g_object_unref0 (_data27_->sink_input);
		_data27_->sink_input = _tmp4_;
	}
	_tmp5_ = _data27_->sink_input;
	_tmp5_->index = (*info).index;
	_tmp6_ = _data27_->sink_input;
	_tmp6_->sink_index = (*info).sink;
	_tmp7_ = _data27_->sink_input;
	_tmp7_->client_index = (*info).client;
	_tmp8_ = _data27_->sink_input;
	_tmp9_ = (*info).proplist;
	_tmp10_ = pa_proplist_gets (_tmp9_, "application.name");
	_tmp11_ = g_strdup (_tmp10_);
	_g_free0 (_tmp8_->name);
	_tmp8_->name = _tmp11_;
	_tmp12_ = _data27_->sink_input;
	_tmp13_ = (*info).proplist;
	_tmp14_ = pa_proplist_gets (_tmp13_, "application.process.binary");
	_tmp15_ = g_strdup (_tmp14_);
	_g_free0 (_tmp12_->application_binary);
	_tmp12_->application_binary = _tmp15_;
	_tmp16_ = _data27_->sink_input;
	_tmp17_ = (*info).proplist;
	_tmp18_ = pa_proplist_gets (_tmp17_, "application.icon_name");
	_tmp19_ = g_strdup (_tmp18_);
	_g_free0 (_tmp16_->application_icon_name);
	_tmp16_->application_icon_name = _tmp19_;
	_tmp20_ = _data27_->sink_input;
	_tmp21_ = (*info).proplist;
	_tmp22_ = pa_proplist_gets (_tmp21_, "media.name");
	_tmp23_ = g_strdup (_tmp22_);
	_g_free0 (_tmp20_->media_name);
	_tmp20_->media_name = _tmp23_;
	_tmp24_ = _data27_->sink_input;
	_tmp24_->is_muted = (*info).mute == 1;
	_tmp25_ = _data27_->sink_input;
	_tmp26_ = (*info).volume;
	_tmp25_->cvolume = _tmp26_;
	_tmp27_ = _data27_->sink_input;
	_tmp28_ = (*info).channel_map;
	_tmp27_->channel_map = _tmp28_;
	_tmp29_ = _data27_->sink_input;
	_tmp30_ = _data27_->sink_input;
	_tmp31_ = _data27_->sink_input;
	_tmp32_ = _tmp31_->channel_map;
	sway_notification_center_widgets_pulse_sink_input_set_balance (_tmp29_, pa_cvolume_get_balance (&_tmp30_->cvolume, &_tmp32_));
	_tmp33_ = _data27_->sink_input;
	_tmp34_ = _tmp33_->volume_operations;
	gee_abstract_collection_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), ___lambda71__gee_forall_func, _data27_);
	_tmp35_ = _data27_->sink_input;
	_tmp36_ = _tmp35_->volume_operations;
	_tmp37_ = gee_collection_get_is_empty (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp38_ = _tmp37_;
	if (_tmp38_) {
		SwayNotificationCenterWidgetsPulseSinkInput* _tmp39_;
		SwayNotificationCenterWidgetsPulseSinkInput* _tmp40_;
		_tmp39_ = _data27_->sink_input;
		_tmp40_ = _data27_->sink_input;
		_tmp39_->volume = sway_notification_center_widgets_pulse_daemon_volume_to_double (pa_cvolume_max (&_tmp40_->cvolume));
	}
	_tmp41_ = _data27_->sink_input;
	_tmp41_->active = TRUE;
	if (!has_sink_input) {
		GeeHashMap* _tmp42_;
		SwayNotificationCenterWidgetsPulseSinkInput* _tmp43_;
		SwayNotificationCenterWidgetsPulseSinkInput* _tmp44_;
		_tmp42_ = self->priv->_active_sinks;
		_tmp43_ = _data27_->sink_input;
		gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), (gpointer) ((guintptr) id), _tmp43_);
		_tmp44_ = _data27_->sink_input;
		g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NEW_ACTIVE_SINK_SIGNAL], 0, _tmp44_);
	} else {
		SwayNotificationCenterWidgetsPulseSinkInput* _tmp45_;
		_tmp45_ = _data27_->sink_input;
		g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_ACTIVE_SINK_SIGNAL], 0, _tmp45_);
	}
	block27_data_unref (_data27_);
	_data27_ = NULL;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static pa_card_profile_info2**
_vala_array_dup6 (pa_card_profile_info2** self,
                  gssize length)
{
	if (length > 0) {
		return g_memdup2 (self, length * sizeof (pa_card_profile_info2*));
	}
	return NULL;
}

static gint
____lambda74_ (SwayNotificationCenterWidgetsPulseDaemon* self,
               pa_card_profile_info2* a,
               pa_card_profile_info2* b)
{
	gint _tmp0_ = 0;
	gint result;
	if ((*a).priority == (*b).priority) {
		result = 0;
		return result;
	}
	if ((*a).priority > (*b).priority) {
		_tmp0_ = -1;
	} else {
		_tmp0_ = 1;
	}
	result = _tmp0_;
	return result;
}

static gint
_____lambda74__gcompare_data_func (gconstpointer a,
                                   gconstpointer b,
                                   gpointer self)
{
	gint result;
	result = ____lambda74_ ((SwayNotificationCenterWidgetsPulseDaemon*) self, a, b);
	return result;
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static void
_vala_SwayNotificationCenterWidgetsPulseCardProfile_free_function_content_of (gpointer data)
{
	SwayNotificationCenterWidgetsPulseCardProfile* self;
	self = *((SwayNotificationCenterWidgetsPulseCardProfile**) data);
	_g_object_unref0_ (self);
}

static void
_vala_array_add46 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add47 (SwayNotificationCenterWidgetsPulseDevice** * array,
                   gint* length,
                   gint* size,
                   SwayNotificationCenterWidgetsPulseDevice* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (SwayNotificationCenterWidgetsPulseDevice*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
sway_notification_center_widgets_pulse_daemon_get_card_info (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                             pa_context* ctx,
                                                             pa_card_info* info,
                                                             gint eol)
{
	gboolean _tmp0_ = FALSE;
	const gchar* description = NULL;
	pa_proplist* _tmp1_;
	const gchar* _tmp2_;
	const gchar* props_icon = NULL;
	pa_proplist* _tmp3_;
	const gchar* _tmp4_;
	SwayNotificationCenterWidgetsPulseDevice** ports = NULL;
	SwayNotificationCenterWidgetsPulseDevice** _tmp5_;
	gint ports_length1;
	gint _ports_size_;
	pa_card_port_info** _tmp6_;
	gint _tmp6__length1;
	GeeMapIterator* iter = NULL;
	GeeHashMap* _tmp102_;
	GeeMapIterator* _tmp103_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (ctx != NULL);
	if (info == NULL) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = eol != 0;
	}
	if (_tmp0_) {
		return;
	}
	_tmp1_ = (*info).proplist;
	_tmp2_ = pa_proplist_gets (_tmp1_, "device.description");
	description = _tmp2_;
	_tmp3_ = (*info).proplist;
	_tmp4_ = pa_proplist_gets (_tmp3_, "device.icon_name");
	props_icon = _tmp4_;
	_tmp5_ = g_new0 (SwayNotificationCenterWidgetsPulseDevice*, 0 + 1);
	ports = _tmp5_;
	ports_length1 = 0;
	_ports_size_ = ports_length1;
	_tmp6_ = (*info).ports;
	_tmp6__length1 = (*info).n_ports;
	{
		pa_card_port_info** port_collection = NULL;
		gint port_collection_length1 = 0;
		gint _port_collection_size_ = 0;
		gint port_it = 0;
		port_collection = _tmp6_;
		port_collection_length1 = _tmp6__length1;
		for (port_it = 0; port_it < port_collection_length1; port_it = port_it + 1) {
			pa_card_port_info* port = NULL;
			port = port_collection[port_it];
			{
				pa_card_port_info* _tmp7_;
				gboolean is_input = FALSE;
				pa_card_port_info* _tmp8_;
				GeeHashMap* devices = NULL;
				GeeHashMap* _tmp9_;
				GeeHashMap* _tmp10_;
				gchar* id = NULL;
				const gchar* _tmp11_;
				pa_card_port_info* _tmp12_;
				const gchar* _tmp13_;
				gchar* _tmp14_;
				gboolean has_device = FALSE;
				GeeHashMap* _tmp15_;
				const gchar* _tmp16_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp17_ = NULL;
				SwayNotificationCenterWidgetsPulseDevice* device = NULL;
				SwayNotificationCenterWidgetsPulseDevice* _tmp22_;
				gboolean device_is_removed = FALSE;
				SwayNotificationCenterWidgetsPulseDevice* _tmp23_;
				gboolean _tmp24_;
				gboolean _tmp25_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp26_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp27_;
				pa_proplist* _tmp28_;
				const gchar* _tmp29_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp30_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp31_;
				pa_card_port_info* _tmp32_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp33_;
				const gchar* _tmp34_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp35_;
				const gchar* _tmp36_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp37_;
				pa_card_profile_info2* _tmp38_;
				const gchar* _tmp39_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp40_;
				pa_card_port_info* _tmp41_;
				const gchar* _tmp42_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp43_;
				pa_card_port_info* _tmp44_;
				const gchar* _tmp45_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp46_;
				pa_card_port_info* _tmp47_;
				pa_proplist* _tmp48_;
				const gchar* _tmp49_;
				GeeArrayList* profiles = NULL;
				pa_card_port_info* _tmp50_;
				pa_card_profile_info2** _tmp51_;
				gint _tmp51__length1;
				pa_card_profile_info2** _tmp52_;
				gint _tmp52__length1;
				GeeArrayList* _tmp53_;
				GeeArrayList* _tmp54_;
				gchar** new_profiles = NULL;
				gchar** _tmp55_;
				gint new_profiles_length1;
				gint _new_profiles_size_;
				GArray* pulse_profiles = NULL;
				GArray* _tmp56_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp80_;
				gchar** _tmp81_;
				gint _tmp81__length1;
				SwayNotificationCenterWidgetsPulseDevice* _tmp82_;
				GArray* _tmp83_;
				const gchar* _tmp84_ = NULL;
				pa_card_port_info* _tmp85_;
				pa_proplist* _tmp86_;
				const gchar* _tmp87_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp89_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp90_;
				const gchar* _tmp91_;
				const gchar* _tmp92_;
				GeeHashMap* _tmp95_;
				const gchar* _tmp96_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp97_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp98_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp99_;
				gboolean _tmp100_ = FALSE;
				_tmp7_ = port;
				if ((*_tmp7_).available == PA_PORT_AVAILABLE_NO) {
					continue;
				}
				_tmp8_ = port;
				is_input = (*_tmp8_).direction == PA_DIRECTION_INPUT;
				_tmp9_ = self->priv->_sinks;
				_tmp10_ = _g_object_ref0 (_tmp9_);
				devices = _tmp10_;
				_tmp11_ = description;
				_tmp12_ = port;
				_tmp13_ = (*_tmp12_).name;
				_tmp14_ = sway_notification_center_widgets_pulse_device_get_hash_map_key (_tmp11_, _tmp13_);
				id = _tmp14_;
				_tmp15_ = devices;
				_tmp16_ = id;
				has_device = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp16_);
				if (has_device) {
					GeeHashMap* _tmp18_;
					const gchar* _tmp19_;
					gpointer _tmp20_;
					_tmp18_ = devices;
					_tmp19_ = id;
					_tmp20_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp19_);
					_g_object_unref0 (_tmp17_);
					_tmp17_ = (SwayNotificationCenterWidgetsPulseDevice*) _tmp20_;
				} else {
					SwayNotificationCenterWidgetsPulseDevice* _tmp21_;
					_tmp21_ = sway_notification_center_widgets_pulse_device_new ();
					if (_tmp21_) {
						g_object_set_data ((GObject *) _tmp21_, "vala-creation-function", "SwayNotificationCenter.Widgets.PulseDaemon.get_card_info");
					}
					_g_object_unref0 (_tmp17_);
					_tmp17_ = _tmp21_;
				}
				_tmp22_ = _g_object_ref0 (_tmp17_);
				device = _tmp22_;
				_tmp23_ = device;
				_tmp24_ = sway_notification_center_widgets_pulse_device_get_removed (_tmp23_);
				_tmp25_ = _tmp24_;
				device_is_removed = _tmp25_;
				_tmp26_ = device;
				sway_notification_center_widgets_pulse_device_set_removed (_tmp26_, FALSE);
				_tmp27_ = device;
				_tmp28_ = (*info).proplist;
				_tmp29_ = pa_proplist_gets (_tmp28_, "device.api");
				sway_notification_center_widgets_pulse_device_set_is_bluetooth (_tmp27_, g_strcmp0 (_tmp29_, "bluez5") == 0);
				_tmp30_ = device;
				sway_notification_center_widgets_pulse_device_set_card_index (_tmp30_, (*info).index);
				_tmp31_ = device;
				_tmp32_ = port;
				sway_notification_center_widgets_pulse_device_set_direction (_tmp31_, (*_tmp32_).direction);
				_tmp33_ = device;
				_tmp34_ = (*info).name;
				sway_notification_center_widgets_pulse_device_set_card_name (_tmp33_, _tmp34_);
				_tmp35_ = device;
				_tmp36_ = description;
				sway_notification_center_widgets_pulse_device_set_card_description (_tmp35_, _tmp36_);
				_tmp37_ = device;
				_tmp38_ = (*info).active_profile2;
				_tmp39_ = (*_tmp38_).name;
				sway_notification_center_widgets_pulse_device_set_card_active_profile (_tmp37_, _tmp39_);
				_tmp40_ = device;
				_tmp41_ = port;
				_tmp42_ = (*_tmp41_).name;
				sway_notification_center_widgets_pulse_device_set_port_name (_tmp40_, _tmp42_);
				_tmp43_ = device;
				_tmp44_ = port;
				_tmp45_ = (*_tmp44_).description;
				sway_notification_center_widgets_pulse_device_set_port_description (_tmp43_, _tmp45_);
				_tmp46_ = device;
				_tmp47_ = port;
				_tmp48_ = (*_tmp47_).proplist;
				_tmp49_ = pa_proplist_gets (_tmp48_, "card.profile.port");
				sway_notification_center_widgets_pulse_device_set_port_id (_tmp46_, _tmp49_);
				_tmp50_ = port;
				_tmp51_ = (*_tmp50_).profiles2;
				_tmp51__length1 = (*_tmp50_).n_profiles;
				_tmp52_ = (_tmp51_ != NULL) ? _vala_array_dup6 (_tmp51_, _tmp51__length1) : _tmp51_;
				_tmp52__length1 = _tmp51__length1;
				_tmp53_ = gee_array_list_new_wrap (G_TYPE_POINTER, NULL, NULL, _tmp52_, _tmp52__length1, NULL, NULL, NULL);
				if (_tmp53_) {
					g_object_set_data ((GObject *) _tmp53_, "vala-creation-function", "SwayNotificationCenter.Widgets.PulseDaemon.get_card_info");
				}
				profiles = _tmp53_;
				_tmp54_ = profiles;
				gee_list_sort (G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, GEE_TYPE_LIST, GeeList), _____lambda74__gcompare_data_func, g_object_ref (self), g_object_unref);
				_tmp55_ = g_new0 (gchar*, 0 + 1);
				new_profiles = _tmp55_;
				new_profiles_length1 = 0;
				_new_profiles_size_ = new_profiles_length1;
				_tmp56_ = g_array_new (TRUE, TRUE, sizeof (SwayNotificationCenterWidgetsPulseCardProfile*));
				g_array_set_clear_func (_tmp56_, (GDestroyNotify) _vala_SwayNotificationCenterWidgetsPulseCardProfile_free_function_content_of);
				pulse_profiles = _tmp56_;
				{
					GeeArrayList* _profile_list = NULL;
					GeeArrayList* _tmp57_;
					gint _profile_size = 0;
					GeeArrayList* _tmp58_;
					gint _tmp59_;
					gint _tmp60_;
					gint _profile_index = 0;
					_tmp57_ = profiles;
					_profile_list = _tmp57_;
					_tmp58_ = _profile_list;
					_tmp59_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
					_tmp60_ = _tmp59_;
					_profile_size = _tmp60_;
					_profile_index = -1;
					while (TRUE) {
						gint _tmp61_;
						gint _tmp62_;
						pa_card_profile_info2* profile = NULL;
						GeeArrayList* _tmp63_;
						gpointer _tmp64_;
						pa_card_profile_info2* _tmp65_;
						const gchar* _tmp66_;
						gchar* _tmp67_;
						SwayNotificationCenterWidgetsPulseCardProfile* card_profile = NULL;
						pa_card_profile_info2* _tmp68_;
						SwayNotificationCenterWidgetsPulseCardProfile* _tmp69_;
						GArray* _tmp70_;
						SwayNotificationCenterWidgetsPulseCardProfile* _tmp71_;
						SwayNotificationCenterWidgetsPulseCardProfile* _tmp72_;
						pa_card_profile_info2* _tmp73_;
						const gchar* _tmp74_;
						SwayNotificationCenterWidgetsPulseDevice* _tmp75_;
						const gchar* _tmp76_;
						const gchar* _tmp77_;
						_profile_index = _profile_index + 1;
						_tmp61_ = _profile_index;
						_tmp62_ = _profile_size;
						if (!(_tmp61_ < _tmp62_)) {
							break;
						}
						_tmp63_ = _profile_list;
						_tmp64_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _profile_index);
						profile = _tmp64_;
						_tmp65_ = profile;
						_tmp66_ = (*_tmp65_).name;
						_tmp67_ = g_strdup (_tmp66_);
						_vala_array_add46 (&new_profiles, &new_profiles_length1, &_new_profiles_size_, _tmp67_);
						_tmp68_ = profile;
						_tmp69_ = sway_notification_center_widgets_pulse_card_profile_new (_tmp68_);
						if (_tmp69_) {
							g_object_set_data ((GObject *) _tmp69_, "vala-creation-function", "SwayNotificationCenter.Widgets.PulseDaemon.get_card_info");
						}
						card_profile = _tmp69_;
						_tmp70_ = pulse_profiles;
						_tmp71_ = card_profile;
						_tmp72_ = _g_object_ref0 (_tmp71_);
						g_array_append_val (_tmp70_, _tmp72_);
						_tmp73_ = profile;
						_tmp74_ = (*_tmp73_).name;
						_tmp75_ = device;
						_tmp76_ = sway_notification_center_widgets_pulse_device_get_card_active_profile (_tmp75_);
						_tmp77_ = _tmp76_;
						if (g_strcmp0 (_tmp74_, _tmp77_) == 0) {
							SwayNotificationCenterWidgetsPulseDevice* _tmp78_;
							SwayNotificationCenterWidgetsPulseCardProfile* _tmp79_;
							_tmp78_ = device;
							_tmp79_ = card_profile;
							sway_notification_center_widgets_pulse_device_set_active_profile (_tmp78_, _tmp79_);
						}
						_g_object_unref0 (card_profile);
					}
				}
				_tmp80_ = device;
				_tmp81_ = new_profiles;
				_tmp81__length1 = new_profiles_length1;
				sway_notification_center_widgets_pulse_device_set_port_profiles (_tmp80_, _tmp81_, _tmp81__length1);
				_tmp82_ = device;
				_tmp83_ = pulse_profiles;
				sway_notification_center_widgets_pulse_device_set_profiles (_tmp82_, _tmp83_);
				_tmp85_ = port;
				_tmp86_ = (*_tmp85_).proplist;
				_tmp87_ = pa_proplist_gets (_tmp86_, "device.icon_name");
				_tmp84_ = _tmp87_;
				if (_tmp84_ == NULL) {
					const gchar* _tmp88_;
					_tmp88_ = props_icon;
					_tmp84_ = _tmp88_;
				}
				_tmp89_ = device;
				sway_notification_center_widgets_pulse_device_set_icon_name (_tmp89_, _tmp84_);
				_tmp90_ = device;
				_tmp91_ = sway_notification_center_widgets_pulse_device_get_icon_name (_tmp90_);
				_tmp92_ = _tmp91_;
				if (_tmp92_ == NULL) {
					const gchar* _tmp93_ = NULL;
					SwayNotificationCenterWidgetsPulseDevice* _tmp94_;
					if (is_input) {
						_tmp93_ = "microphone-sensitivity-high";
					} else {
						_tmp93_ = "audio-speakers";
					}
					_tmp94_ = device;
					sway_notification_center_widgets_pulse_device_set_icon_name (_tmp94_, _tmp93_);
				}
				_tmp95_ = devices;
				_tmp96_ = id;
				_tmp97_ = device;
				gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp95_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp96_, _tmp97_);
				_tmp98_ = device;
				_tmp99_ = _g_object_ref0 (_tmp98_);
				_vala_array_add47 (&ports, &ports_length1, &_ports_size_, _tmp99_);
				if (!has_device) {
					_tmp100_ = TRUE;
				} else {
					_tmp100_ = device_is_removed;
				}
				if (_tmp100_) {
					SwayNotificationCenterWidgetsPulseDevice* _tmp101_;
					_tmp101_ = device;
					g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NEW_DEVICE_SIGNAL], 0, _tmp101_);
				}
				_g_array_unref0 (pulse_profiles);
				new_profiles = (_vala_array_free (new_profiles, new_profiles_length1, (GDestroyNotify) g_free), NULL);
				_g_object_unref0 (profiles);
				_g_object_unref0 (device);
				_g_object_unref0 (_tmp17_);
				_g_free0 (id);
				_g_object_unref0 (devices);
			}
		}
	}
	_tmp102_ = self->priv->_sinks;
	_tmp103_ = gee_abstract_map_map_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp102_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
	iter = _tmp103_;
	while (TRUE) {
		GeeMapIterator* _tmp104_;
		SwayNotificationCenterWidgetsPulseDevice* device = NULL;
		GeeMapIterator* _tmp105_;
		gpointer _tmp106_;
		SwayNotificationCenterWidgetsPulseDevice* _tmp107_;
		guint32 _tmp108_;
		guint32 _tmp109_;
		gboolean found = FALSE;
		SwayNotificationCenterWidgetsPulseDevice** _tmp110_;
		gint _tmp110__length1;
		_tmp104_ = iter;
		if (!gee_map_iterator_next (_tmp104_)) {
			break;
		}
		_tmp105_ = iter;
		_tmp106_ = gee_map_iterator_get_value (_tmp105_);
		device = (SwayNotificationCenterWidgetsPulseDevice*) _tmp106_;
		_tmp107_ = device;
		_tmp108_ = sway_notification_center_widgets_pulse_device_get_card_index (_tmp107_);
		_tmp109_ = _tmp108_;
		if (_tmp109_ != (*info).index) {
			_g_object_unref0 (device);
			continue;
		}
		found = FALSE;
		_tmp110_ = ports;
		_tmp110__length1 = ports_length1;
		{
			SwayNotificationCenterWidgetsPulseDevice** p_collection = NULL;
			gint p_collection_length1 = 0;
			gint _p_collection_size_ = 0;
			gint p_it = 0;
			p_collection = _tmp110_;
			p_collection_length1 = _tmp110__length1;
			for (p_it = 0; p_it < p_collection_length1; p_it = p_it + 1) {
				SwayNotificationCenterWidgetsPulseDevice* _tmp111_;
				SwayNotificationCenterWidgetsPulseDevice* p = NULL;
				_tmp111_ = _g_object_ref0 (p_collection[p_it]);
				p = _tmp111_;
				{
					SwayNotificationCenterWidgetsPulseDevice* _tmp112_;
					gchar* _tmp113_;
					gchar* _tmp114_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp115_;
					gchar* _tmp116_;
					gchar* _tmp117_;
					gboolean _tmp118_;
					_tmp112_ = device;
					_tmp113_ = sway_notification_center_widgets_pulse_device_get_current_hash_key (_tmp112_);
					_tmp114_ = _tmp113_;
					_tmp115_ = p;
					_tmp116_ = sway_notification_center_widgets_pulse_device_get_current_hash_key (_tmp115_);
					_tmp117_ = _tmp116_;
					_tmp118_ = g_strcmp0 (_tmp114_, _tmp117_) == 0;
					_g_free0 (_tmp117_);
					_g_free0 (_tmp114_);
					if (_tmp118_) {
						found = TRUE;
						_g_object_unref0 (p);
						break;
					}
					_g_object_unref0 (p);
				}
			}
		}
		if (!found) {
			GeeMapIterator* _tmp119_;
			SwayNotificationCenterWidgetsPulseDevice* _tmp120_;
			_tmp119_ = iter;
			gee_map_iterator_unset (_tmp119_);
			_tmp120_ = device;
			g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_REMOVE_DEVICE_SIGNAL], 0, _tmp120_);
			_g_object_unref0 (device);
			break;
		}
		_g_object_unref0 (device);
	}
	_g_object_unref0 (iter);
	ports = (_vala_array_free (ports, ports_length1, (GDestroyNotify) g_object_unref), NULL);
}

static Block28Data*
block28_data_ref (Block28Data* _data28_)
{
	g_atomic_int_inc (&_data28_->_ref_count_);
	return _data28_;
}

static void
block28_data_unref (void * _userdata_)
{
	Block28Data* _data28_;
	_data28_ = (Block28Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data28_->_ref_count_)) {
		SwayNotificationCenterWidgetsPulseDaemon* self;
		self = _data28_->self;
		_g_object_unref0 (_data28_->device);
		_g_object_unref0 (self);
		g_slice_free (Block28Data, _data28_);
	}
}

static Block29Data*
block29_data_ref (Block29Data* _data29_)
{
	g_atomic_int_inc (&_data29_->_ref_count_);
	return _data29_;
}

static void
block29_data_unref (void * _userdata_)
{
	Block29Data* _data29_;
	_data29_ = (Block29Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data29_->_ref_count_)) {
		SwayNotificationCenterWidgetsPulseDaemon* self;
		self = _data29_->_data28_->self;
		_g_object_unref0 (_data29_->device);
		block28_data_unref (_data29_->_data28_);
		_data29_->_data28_ = NULL;
		g_slice_free (Block29Data, _data29_);
	}
}

static gboolean
______lambda72_ (Block29Data* _data29_,
                 pa_operation* op)
{
	Block28Data* _data28_;
	SwayNotificationCenterWidgetsPulseDaemon* self;
	gboolean result;
	_data28_ = _data29_->_data28_;
	self = _data28_->self;
	g_return_val_if_fail (op != NULL, FALSE);
	if (pa_operation_get_state (op) != PA_OPERATION_RUNNING) {
		SwayNotificationCenterWidgetsPulseDevice* _tmp0_;
		GeeLinkedList* _tmp1_;
		GeeLinkedList* _tmp2_;
		_tmp0_ = _data29_->device;
		_tmp1_ = sway_notification_center_widgets_pulse_device_get_volume_operations (_tmp0_);
		_tmp2_ = _tmp1_;
		gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), op);
	}
	result = G_SOURCE_CONTINUE;
	_pa_operation_unref0 (op);
	return result;
}

static gboolean
_______lambda72__gee_forall_func (gpointer g,
                                  gpointer self)
{
	gboolean result;
	result = ______lambda72_ (self, (pa_operation*) g);
	return result;
}

static gboolean
__lambda73_ (Block28Data* _data28_,
             pa_operation* op)
{
	SwayNotificationCenterWidgetsPulseDaemon* self;
	gboolean result;
	self = _data28_->self;
	g_return_val_if_fail (op != NULL, FALSE);
	if (pa_operation_get_state (op) != PA_OPERATION_RUNNING) {
		SwayNotificationCenterWidgetsPulseDevice* _tmp0_;
		GeeLinkedList* _tmp1_;
		GeeLinkedList* _tmp2_;
		_tmp0_ = _data28_->device;
		_tmp1_ = sway_notification_center_widgets_pulse_device_get_volume_operations (_tmp0_);
		_tmp2_ = _tmp1_;
		gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), op);
	}
	result = G_SOURCE_CONTINUE;
	_pa_operation_unref0 (op);
	return result;
}

static gboolean
___lambda73__gee_forall_func (gpointer g,
                              gpointer self)
{
	gboolean result;
	result = __lambda73_ (self, (pa_operation*) g);
	return result;
}

static void
sway_notification_center_widgets_pulse_daemon_get_sink_info (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                             pa_context* ctx,
                                                             pa_sink_info* info,
                                                             gint eol)
{
	Block28Data* _data28_;
	gboolean _tmp0_ = FALSE;
	gboolean found = FALSE;
	GeeHashMap* devices = NULL;
	GeeHashMap* _tmp59_;
	GeeHashMap* _tmp60_;
	gchar* id = NULL;
	gchar* _tmp61_;
	gchar* _tmp62_;
	const gchar* _tmp63_;
	gchar* _tmp64_;
	gchar* _tmp65_;
	gboolean has_device = FALSE;
	GeeHashMap* _tmp66_;
	const gchar* _tmp67_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp68_ = NULL;
	SwayNotificationCenterWidgetsPulseDevice* _tmp73_;
	gboolean device_is_removed = FALSE;
	SwayNotificationCenterWidgetsPulseDevice* _tmp74_;
	gboolean _tmp75_;
	gboolean _tmp76_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp77_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp78_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp79_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp80_;
	const gchar* _tmp81_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp82_;
	const gchar* _tmp83_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp84_;
	gboolean is_default = FALSE;
	SwayNotificationCenterWidgetsPulseDevice* _tmp85_;
	const gchar* _tmp86_;
	const gchar* _tmp87_;
	const gchar* _tmp88_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp89_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp90_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp91_;
	pa_proplist* _tmp92_;
	const gchar* _tmp93_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp94_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp95_;
	pa_cvolume _tmp96_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp97_;
	pa_channel_map _tmp98_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp99_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp100_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp101_;
	pa_channel_map _tmp102_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp103_;
	GeeLinkedList* _tmp104_;
	GeeLinkedList* _tmp105_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp106_;
	GeeLinkedList* _tmp107_;
	GeeLinkedList* _tmp108_;
	gboolean _tmp109_;
	gboolean _tmp110_;
	GeeHashMap* _tmp113_;
	const gchar* _tmp114_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp115_;
	gboolean _tmp119_ = FALSE;
	SwayNotificationCenterWidgetsPulseDevice* _tmp121_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (ctx != NULL);
	_data28_ = g_slice_new0 (Block28Data);
	_data28_->_ref_count_ = 1;
	_data28_->self = g_object_ref (self);
	if (info == NULL) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = eol != 0;
	}
	if (_tmp0_) {
		block28_data_unref (_data28_);
		_data28_ = NULL;
		return;
	}
	found = FALSE;
	{
		GeeIterator* _device_it = NULL;
		GeeHashMap* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = self->priv->_sinks;
		_tmp2_ = gee_abstract_map_get_values (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ITERABLE, GeeIterable));
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_device_it = _tmp6_;
		while (TRUE) {
			Block29Data* _data29_;
			GeeIterator* _tmp7_;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			SwayNotificationCenterWidgetsPulseDevice* _tmp10_;
			guint32 _tmp11_;
			guint32 _tmp12_;
			_data29_ = g_slice_new0 (Block29Data);
			_data29_->_ref_count_ = 1;
			_data29_->_data28_ = block28_data_ref (_data28_);
			_tmp7_ = _device_it;
			if (!gee_iterator_next (_tmp7_)) {
				block29_data_unref (_data29_);
				_data29_ = NULL;
				break;
			}
			_tmp8_ = _device_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			_data29_->device = (SwayNotificationCenterWidgetsPulseDevice*) _tmp9_;
			_tmp10_ = _data29_->device;
			_tmp11_ = sway_notification_center_widgets_pulse_device_get_card_index (_tmp10_);
			_tmp12_ = _tmp11_;
			if (_tmp12_ == (*info).card) {
				SwayNotificationCenterWidgetsPulseDevice* _tmp13_;
				const gchar* _tmp14_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp15_;
				const gchar* _tmp16_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp17_;
				gboolean _tmp18_ = FALSE;
				pa_sink_port_info* _tmp19_;
				SwayNotificationCenterWidgetsPulseDevice* _tmp58_;
				_tmp13_ = _data29_->device;
				_tmp14_ = (*info).name;
				sway_notification_center_widgets_pulse_device_set_device_name (_tmp13_, _tmp14_);
				_tmp15_ = _data29_->device;
				_tmp16_ = (*info).description;
				sway_notification_center_widgets_pulse_device_set_device_description (_tmp15_, _tmp16_);
				_tmp17_ = _data29_->device;
				sway_notification_center_widgets_pulse_device_set_device_index (_tmp17_, (*info).index);
				_tmp19_ = (*info).active_port;
				if (_tmp19_ != NULL) {
					pa_sink_port_info* _tmp20_;
					const gchar* _tmp21_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp22_;
					const gchar* _tmp23_;
					const gchar* _tmp24_;
					_tmp20_ = (*info).active_port;
					_tmp21_ = (*_tmp20_).name;
					_tmp22_ = _data29_->device;
					_tmp23_ = sway_notification_center_widgets_pulse_device_get_port_name (_tmp22_);
					_tmp24_ = _tmp23_;
					_tmp18_ = g_strcmp0 (_tmp21_, _tmp24_) == 0;
				} else {
					_tmp18_ = FALSE;
				}
				if (_tmp18_) {
					SwayNotificationCenterWidgetsPulseDevice* _tmp25_;
					pa_sink_port_info* _tmp26_;
					const gchar* _tmp27_;
					gboolean is_default = FALSE;
					SwayNotificationCenterWidgetsPulseDevice* _tmp28_;
					const gchar* _tmp29_;
					const gchar* _tmp30_;
					const gchar* _tmp31_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp32_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp33_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp34_;
					pa_proplist* _tmp35_;
					const gchar* _tmp36_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp37_;
					pa_cvolume _tmp38_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp39_;
					pa_channel_map _tmp40_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp41_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp42_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp43_;
					pa_channel_map _tmp44_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp45_;
					GeeLinkedList* _tmp46_;
					GeeLinkedList* _tmp47_;
					SwayNotificationCenterWidgetsPulseDevice* _tmp48_;
					GeeLinkedList* _tmp49_;
					GeeLinkedList* _tmp50_;
					gboolean _tmp51_;
					gboolean _tmp52_;
					found = TRUE;
					_tmp25_ = _data29_->device;
					_tmp26_ = (*info).active_port;
					_tmp27_ = (*_tmp26_).name;
					sway_notification_center_widgets_pulse_device_set_card_sink_port_name (_tmp25_, _tmp27_);
					_tmp28_ = _data29_->device;
					_tmp29_ = sway_notification_center_widgets_pulse_device_get_device_name (_tmp28_);
					_tmp30_ = _tmp29_;
					_tmp31_ = self->priv->_default_sink_name;
					is_default = g_strcmp0 (_tmp30_, _tmp31_) == 0;
					_tmp32_ = _data29_->device;
					sway_notification_center_widgets_pulse_device_set_is_default (_tmp32_, is_default);
					_tmp33_ = _data29_->device;
					sway_notification_center_widgets_pulse_device_set_is_muted (_tmp33_, (*info).mute == 1);
					_tmp34_ = _data29_->device;
					_tmp35_ = (*info).proplist;
					_tmp36_ = pa_proplist_gets (_tmp35_, "node.virtual");
					sway_notification_center_widgets_pulse_device_set_is_virtual (_tmp34_, g_strcmp0 (_tmp36_, "true") == 0);
					_tmp37_ = _data29_->device;
					_tmp38_ = (*info).volume;
					_tmp37_->cvolume = _tmp38_;
					_tmp39_ = _data29_->device;
					_tmp40_ = (*info).channel_map;
					_tmp39_->channel_map = _tmp40_;
					_tmp41_ = _data29_->device;
					_tmp42_ = _data29_->device;
					_tmp43_ = _data29_->device;
					_tmp44_ = _tmp43_->channel_map;
					sway_notification_center_widgets_pulse_device_set_balance (_tmp41_, pa_cvolume_get_balance (&_tmp42_->cvolume, &_tmp44_));
					_tmp45_ = _data29_->device;
					_tmp46_ = sway_notification_center_widgets_pulse_device_get_volume_operations (_tmp45_);
					_tmp47_ = _tmp46_;
					gee_abstract_collection_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _______lambda72__gee_forall_func, _data29_);
					_tmp48_ = _data29_->device;
					_tmp49_ = sway_notification_center_widgets_pulse_device_get_volume_operations (_tmp48_);
					_tmp50_ = _tmp49_;
					_tmp51_ = gee_collection_get_is_empty (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, GEE_TYPE_COLLECTION, GeeCollection));
					_tmp52_ = _tmp51_;
					if (_tmp52_) {
						SwayNotificationCenterWidgetsPulseDevice* _tmp53_;
						SwayNotificationCenterWidgetsPulseDevice* _tmp54_;
						_tmp53_ = _data29_->device;
						_tmp54_ = _data29_->device;
						sway_notification_center_widgets_pulse_device_set_volume (_tmp53_, sway_notification_center_widgets_pulse_daemon_volume_to_double (pa_cvolume_max (&_tmp54_->cvolume)));
					}
					if (is_default) {
						SwayNotificationCenterWidgetsPulseDevice* _tmp55_;
						SwayNotificationCenterWidgetsPulseDevice* _tmp56_;
						SwayNotificationCenterWidgetsPulseDevice* _tmp57_;
						_tmp55_ = _data29_->device;
						_tmp56_ = _g_object_ref0 (_tmp55_);
						_g_object_unref0 (self->priv->default_sink);
						self->priv->default_sink = _tmp56_;
						_tmp57_ = _data29_->device;
						g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_DEFAULT_DEVICE_SIGNAL], 0, _tmp57_);
					}
				}
				_tmp58_ = _data29_->device;
				g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_DEVICE_SIGNAL], 0, _tmp58_);
			}
			block29_data_unref (_data29_);
			_data29_ = NULL;
		}
		_g_object_unref0 (_device_it);
	}
	if (found) {
		block28_data_unref (_data28_);
		_data28_ = NULL;
		return;
	}
	_tmp59_ = self->priv->_sinks;
	_tmp60_ = _g_object_ref0 (_tmp59_);
	devices = _tmp60_;
	_tmp61_ = g_strdup_printf ("%u", (*info).index);
	_tmp62_ = _tmp61_;
	_tmp63_ = (*info).description;
	_tmp64_ = sway_notification_center_widgets_pulse_device_get_hash_map_key (_tmp62_, _tmp63_);
	_tmp65_ = _tmp64_;
	_g_free0 (_tmp62_);
	id = _tmp65_;
	_tmp66_ = devices;
	_tmp67_ = id;
	has_device = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp66_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp67_);
	if (has_device) {
		GeeHashMap* _tmp69_;
		const gchar* _tmp70_;
		gpointer _tmp71_;
		_tmp69_ = devices;
		_tmp70_ = id;
		_tmp71_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp69_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp70_);
		_g_object_unref0 (_tmp68_);
		_tmp68_ = (SwayNotificationCenterWidgetsPulseDevice*) _tmp71_;
	} else {
		SwayNotificationCenterWidgetsPulseDevice* _tmp72_;
		_tmp72_ = sway_notification_center_widgets_pulse_device_new ();
		if (_tmp72_) {
			g_object_set_data ((GObject *) _tmp72_, "vala-creation-function", "SwayNotificationCenter.Widgets.PulseDaemon.get_sink_info");
		}
		_g_object_unref0 (_tmp68_);
		_tmp68_ = _tmp72_;
	}
	_tmp73_ = _g_object_ref0 (_tmp68_);
	_data28_->device = _tmp73_;
	_tmp74_ = _data28_->device;
	_tmp75_ = sway_notification_center_widgets_pulse_device_get_removed (_tmp74_);
	_tmp76_ = _tmp75_;
	device_is_removed = _tmp76_;
	_tmp77_ = _data28_->device;
	sway_notification_center_widgets_pulse_device_set_removed (_tmp77_, FALSE);
	_tmp78_ = _data28_->device;
	sway_notification_center_widgets_pulse_device_set_has_card (_tmp78_, FALSE);
	_tmp79_ = _data28_->device;
	sway_notification_center_widgets_pulse_device_set_direction (_tmp79_, PA_DIRECTION_OUTPUT);
	_tmp80_ = _data28_->device;
	_tmp81_ = (*info).name;
	sway_notification_center_widgets_pulse_device_set_device_name (_tmp80_, _tmp81_);
	_tmp82_ = _data28_->device;
	_tmp83_ = (*info).description;
	sway_notification_center_widgets_pulse_device_set_device_description (_tmp82_, _tmp83_);
	_tmp84_ = _data28_->device;
	sway_notification_center_widgets_pulse_device_set_device_index (_tmp84_, (*info).index);
	_tmp85_ = _data28_->device;
	_tmp86_ = sway_notification_center_widgets_pulse_device_get_device_name (_tmp85_);
	_tmp87_ = _tmp86_;
	_tmp88_ = self->priv->_default_source_name;
	is_default = g_strcmp0 (_tmp87_, _tmp88_) == 0;
	_tmp89_ = _data28_->device;
	sway_notification_center_widgets_pulse_device_set_is_default (_tmp89_, is_default);
	_tmp90_ = _data28_->device;
	sway_notification_center_widgets_pulse_device_set_is_muted (_tmp90_, (*info).mute == 1);
	_tmp91_ = _data28_->device;
	_tmp92_ = (*info).proplist;
	_tmp93_ = pa_proplist_gets (_tmp92_, "node.virtual");
	sway_notification_center_widgets_pulse_device_set_is_virtual (_tmp91_, g_strcmp0 (_tmp93_, "true") == 0);
	_tmp94_ = _data28_->device;
	sway_notification_center_widgets_pulse_device_set_icon_name (_tmp94_, "application-x-executable-symbolic");
	_tmp95_ = _data28_->device;
	_tmp96_ = (*info).volume;
	_tmp95_->cvolume = _tmp96_;
	_tmp97_ = _data28_->device;
	_tmp98_ = (*info).channel_map;
	_tmp97_->channel_map = _tmp98_;
	_tmp99_ = _data28_->device;
	_tmp100_ = _data28_->device;
	_tmp101_ = _data28_->device;
	_tmp102_ = _tmp101_->channel_map;
	sway_notification_center_widgets_pulse_device_set_balance (_tmp99_, pa_cvolume_get_balance (&_tmp100_->cvolume, &_tmp102_));
	_tmp103_ = _data28_->device;
	_tmp104_ = sway_notification_center_widgets_pulse_device_get_volume_operations (_tmp103_);
	_tmp105_ = _tmp104_;
	gee_abstract_collection_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp105_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), ___lambda73__gee_forall_func, _data28_);
	_tmp106_ = _data28_->device;
	_tmp107_ = sway_notification_center_widgets_pulse_device_get_volume_operations (_tmp106_);
	_tmp108_ = _tmp107_;
	_tmp109_ = gee_collection_get_is_empty (G_TYPE_CHECK_INSTANCE_CAST (_tmp108_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp110_ = _tmp109_;
	if (_tmp110_) {
		SwayNotificationCenterWidgetsPulseDevice* _tmp111_;
		SwayNotificationCenterWidgetsPulseDevice* _tmp112_;
		_tmp111_ = _data28_->device;
		_tmp112_ = _data28_->device;
		sway_notification_center_widgets_pulse_device_set_volume (_tmp111_, sway_notification_center_widgets_pulse_daemon_volume_to_double (pa_cvolume_max (&_tmp112_->cvolume)));
	}
	_tmp113_ = devices;
	_tmp114_ = id;
	_tmp115_ = _data28_->device;
	gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp113_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp114_, _tmp115_);
	if (is_default) {
		SwayNotificationCenterWidgetsPulseDevice* _tmp116_;
		SwayNotificationCenterWidgetsPulseDevice* _tmp117_;
		SwayNotificationCenterWidgetsPulseDevice* _tmp118_;
		_tmp116_ = _data28_->device;
		_tmp117_ = _g_object_ref0 (_tmp116_);
		_g_object_unref0 (self->priv->default_sink);
		self->priv->default_sink = _tmp117_;
		_tmp118_ = _data28_->device;
		g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_DEFAULT_DEVICE_SIGNAL], 0, _tmp118_);
	}
	if (!has_device) {
		_tmp119_ = TRUE;
	} else {
		_tmp119_ = device_is_removed;
	}
	if (_tmp119_) {
		SwayNotificationCenterWidgetsPulseDevice* _tmp120_;
		_tmp120_ = _data28_->device;
		g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NEW_DEVICE_SIGNAL], 0, _tmp120_);
	}
	_tmp121_ = _data28_->device;
	g_signal_emit (self, sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_DEVICE_SIGNAL], 0, _tmp121_);
	_g_object_unref0 (_tmp68_);
	_g_free0 (id);
	_g_object_unref0 (devices);
	block28_data_unref (_data28_);
	_data28_ = NULL;
}

static Block30Data*
block30_data_ref (Block30Data* _data30_)
{
	g_atomic_int_inc (&_data30_->_ref_count_);
	return _data30_;
}

static void
block30_data_unref (void * _userdata_)
{
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
		SwayNotificationCenterWidgetsPulseDaemon* self;
		self = _data30_->self;
		_g_object_unref0 (_data30_->sink_input);
		_g_object_unref0 (self);
		g_slice_free (Block30Data, _data30_);
	}
}

static gboolean
__lambda75_ (Block30Data* _data30_,
             pa_operation* operation)
{
	SwayNotificationCenterWidgetsPulseDaemon* self;
	GeeLinkedList* _tmp0_;
	gboolean result;
	self = _data30_->self;
	g_return_val_if_fail (operation != NULL, FALSE);
	if (pa_operation_get_state (operation) == PA_OPERATION_RUNNING) {
		pa_operation_cancel (operation);
	}
	_tmp0_ = _data30_->sink_input->volume_operations;
	gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), operation);
	result = G_SOURCE_CONTINUE;
	_pa_operation_unref0 (operation);
	return result;
}

static gboolean
___lambda75__gee_forall_func (gpointer g,
                              gpointer self)
{
	gboolean result;
	result = __lambda75_ (self, (pa_operation*) g);
	return result;
}

void
sway_notification_center_widgets_pulse_daemon_set_sink_input_volume (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                     SwayNotificationCenterWidgetsPulseSinkInput* sink_input,
                                                                     gdouble volume)
{
	Block30Data* _data30_;
	SwayNotificationCenterWidgetsPulseSinkInput* _tmp0_;
	GeeLinkedList* _tmp1_;
	pa_cvolume cvol = {0};
	pa_cvolume _tmp2_;
	pa_operation* operation = NULL;
	pa_context* _tmp3_;
	pa_cvolume _tmp4_;
	pa_operation* _tmp5_;
	pa_operation* _tmp6_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_SINK_INPUT (sink_input));
	_data30_ = g_slice_new0 (Block30Data);
	_data30_->_ref_count_ = 1;
	_data30_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (sink_input);
	_g_object_unref0 (_data30_->sink_input);
	_data30_->sink_input = _tmp0_;
	_tmp1_ = _data30_->sink_input->volume_operations;
	gee_abstract_collection_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), ___lambda75__gee_forall_func, _data30_);
	_tmp2_ = _data30_->sink_input->cvolume;
	cvol = _tmp2_;
	pa_cvolume_scale (&cvol, sway_notification_center_widgets_pulse_daemon_double_to_volume (volume));
	operation = NULL;
	_tmp3_ = self->priv->context;
	_tmp4_ = cvol;
	_tmp5_ = pa_context_set_sink_input_volume (_tmp3_, _data30_->sink_input->index, &_tmp4_, NULL, NULL);
	_pa_operation_unref0 (operation);
	operation = _tmp5_;
	_tmp6_ = operation;
	if (_tmp6_ != NULL) {
		GeeLinkedList* _tmp7_;
		pa_operation* _tmp8_;
		_tmp7_ = _data30_->sink_input->volume_operations;
		_tmp8_ = operation;
		gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp8_);
	}
	_pa_operation_unref0 (operation);
	block30_data_unref (_data30_);
	_data30_ = NULL;
}

static Block31Data*
block31_data_ref (Block31Data* _data31_)
{
	g_atomic_int_inc (&_data31_->_ref_count_);
	return _data31_;
}

static void
block31_data_unref (void * _userdata_)
{
	Block31Data* _data31_;
	_data31_ = (Block31Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data31_->_ref_count_)) {
		SwayNotificationCenterWidgetsPulseDaemon* self;
		self = _data31_->self;
		_g_object_unref0 (_data31_->device);
		_g_object_unref0 (self);
		g_slice_free (Block31Data, _data31_);
	}
}

static gboolean
__lambda76_ (Block31Data* _data31_,
             pa_operation* operation)
{
	SwayNotificationCenterWidgetsPulseDaemon* self;
	GeeLinkedList* _tmp0_;
	GeeLinkedList* _tmp1_;
	gboolean result;
	self = _data31_->self;
	g_return_val_if_fail (operation != NULL, FALSE);
	if (pa_operation_get_state (operation) == PA_OPERATION_RUNNING) {
		pa_operation_cancel (operation);
	}
	_tmp0_ = sway_notification_center_widgets_pulse_device_get_volume_operations (_data31_->device);
	_tmp1_ = _tmp0_;
	gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), operation);
	result = G_SOURCE_CONTINUE;
	_pa_operation_unref0 (operation);
	return result;
}

static gboolean
___lambda76__gee_forall_func (gpointer g,
                              gpointer self)
{
	gboolean result;
	result = __lambda76_ (self, (pa_operation*) g);
	return result;
}

void
sway_notification_center_widgets_pulse_daemon_set_device_volume (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                 SwayNotificationCenterWidgetsPulseDevice* device,
                                                                 gdouble volume)
{
	Block31Data* _data31_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp0_;
	GeeLinkedList* _tmp1_;
	GeeLinkedList* _tmp2_;
	pa_cvolume cvol = {0};
	pa_cvolume _tmp3_;
	pa_operation* operation = NULL;
	pa_direction_t _tmp4_;
	pa_direction_t _tmp5_;
	pa_operation* _tmp11_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DEVICE (device));
	_data31_ = g_slice_new0 (Block31Data);
	_data31_->_ref_count_ = 1;
	_data31_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (device);
	_g_object_unref0 (_data31_->device);
	_data31_->device = _tmp0_;
	_tmp1_ = sway_notification_center_widgets_pulse_device_get_volume_operations (_data31_->device);
	_tmp2_ = _tmp1_;
	gee_abstract_collection_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), ___lambda76__gee_forall_func, _data31_);
	_tmp3_ = _data31_->device->cvolume;
	cvol = _tmp3_;
	pa_cvolume_scale (&cvol, sway_notification_center_widgets_pulse_daemon_double_to_volume (volume));
	operation = NULL;
	_tmp4_ = sway_notification_center_widgets_pulse_device_get_direction (_data31_->device);
	_tmp5_ = _tmp4_;
	if (_tmp5_ == PA_DIRECTION_OUTPUT) {
		pa_context* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		pa_cvolume _tmp9_;
		pa_operation* _tmp10_;
		_tmp6_ = self->priv->context;
		_tmp7_ = sway_notification_center_widgets_pulse_device_get_device_name (_data31_->device);
		_tmp8_ = _tmp7_;
		_tmp9_ = cvol;
		_tmp10_ = pa_context_set_sink_volume_by_name (_tmp6_, _tmp8_, &_tmp9_, NULL, NULL);
		_pa_operation_unref0 (operation);
		operation = _tmp10_;
	}
	_tmp11_ = operation;
	if (_tmp11_ != NULL) {
		GeeLinkedList* _tmp12_;
		GeeLinkedList* _tmp13_;
		pa_operation* _tmp14_;
		_tmp12_ = sway_notification_center_widgets_pulse_device_get_volume_operations (_data31_->device);
		_tmp13_ = _tmp12_;
		_tmp14_ = operation;
		gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp14_);
	}
	_pa_operation_unref0 (operation);
	block31_data_unref (_data31_);
	_data31_ = NULL;
}

static void
sway_notification_center_widgets_pulse_daemon_set_default_device_data_free (gpointer _data)
{
	SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->device);
	_g_object_unref0 (_data_->self);
	g_slice_free (SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData, _data_);
}

void
sway_notification_center_widgets_pulse_daemon_set_default_device (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                  SwayNotificationCenterWidgetsPulseDevice* device,
                                                                  GAsyncReadyCallback _callback_,
                                                                  gpointer _user_data_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData* _data_;
	SwayNotificationCenterWidgetsPulseDaemon* _tmp0_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp1_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DEVICE (device));
	_data_ = g_slice_new0 (SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sway_notification_center_widgets_pulse_daemon_set_default_device_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (device);
	_g_object_unref0 (_data_->device);
	_data_->device = _tmp1_;
	sway_notification_center_widgets_pulse_daemon_set_default_device_co (_data_);
}

void
sway_notification_center_widgets_pulse_daemon_set_default_device_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                         GAsyncResult* _res_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gboolean
_vala_string_array_contains (gchar* * stack,
                             gssize stack_length,
                             const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

static void
sway_notification_center_widgets_pulse_daemon_set_default_device_ready (GObject* source_object,
                                                                        GAsyncResult* _res_,
                                                                        gpointer _user_data_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	sway_notification_center_widgets_pulse_daemon_set_default_device_co (_data_);
}

static gboolean
sway_notification_center_widgets_pulse_daemon_set_default_device_co (SwayNotificationCenterWidgetsPulseDaemonSetDefaultDeviceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->device == NULL) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = sway_notification_center_widgets_pulse_device_get_direction (_data_->device);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->is_input = _data_->_tmp1_ == PA_DIRECTION_INPUT;
	_data_->_tmp2_ = sway_notification_center_widgets_pulse_device_get_has_card (_data_->device);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_) {
		_data_->_tmp5_ = 0;
		_data_->_tmp4_ = sway_notification_center_widgets_pulse_device_get_port_profiles (_data_->device, &_data_->_tmp5_);
		_data_->_tmp4__length1 = _data_->_tmp5_;
		_data_->_tmp6_ = _data_->_tmp4_;
		_data_->_tmp6__length1 = _data_->_tmp4__length1;
		_data_->_tmp7_ = _data_->_tmp6_[0];
		_data_->_tmp8_ = g_strdup (_data_->_tmp7_);
		_data_->profile_name = _data_->_tmp8_;
		_data_->_tmp9_ = _data_->self->priv->default_sink;
		_data_->_tmp10_ = _g_object_ref0 (_data_->_tmp9_);
		_data_->alt_device = _data_->_tmp10_;
		_data_->_tmp11_ = _data_->alt_device;
		if (_data_->_tmp11_ != NULL) {
			_data_->_tmp13_ = 0;
			_data_->_tmp12_ = sway_notification_center_widgets_pulse_device_get_port_profiles (_data_->device, &_data_->_tmp13_);
			_data_->_tmp12__length1 = _data_->_tmp13_;
			_data_->_tmp14_ = _data_->_tmp12_;
			_data_->_tmp14__length1 = _data_->_tmp12__length1;
			{
				_data_->profile_collection_length1 = 0;
				_data_->_profile_collection_size_ = 0;
				_data_->profile_collection = _data_->_tmp14_;
				_data_->profile_collection_length1 = _data_->_tmp14__length1;
				for (_data_->profile_it = 0; _data_->profile_it < _data_->profile_collection_length1; _data_->profile_it = _data_->profile_it + 1) {
					_data_->_tmp15_ = g_strdup (_data_->profile_collection[_data_->profile_it]);
					_data_->profile = _data_->_tmp15_;
					{
						_data_->_tmp16_ = _data_->profile;
						_data_->_tmp17_ = _data_->alt_device;
						_data_->_tmp19_ = 0;
						_data_->_tmp18_ = sway_notification_center_widgets_pulse_device_get_port_profiles (_data_->_tmp17_, &_data_->_tmp19_);
						_data_->_tmp18__length1 = _data_->_tmp19_;
						_data_->_tmp20_ = _data_->_tmp18_;
						_data_->_tmp20__length1 = _data_->_tmp18__length1;
						if (_vala_string_array_contains (_data_->_tmp20_, _data_->_tmp20__length1, _data_->_tmp16_)) {
							_data_->_tmp21_ = _data_->profile;
							_data_->_tmp22_ = g_strdup (_data_->_tmp21_);
							_g_free0 (_data_->profile_name);
							_data_->profile_name = _data_->_tmp22_;
							_g_free0 (_data_->profile);
							break;
						}
						_g_free0 (_data_->profile);
					}
				}
			}
		}
		_data_->_tmp23_ = _data_->profile_name;
		_data_->_tmp24_ = sway_notification_center_widgets_pulse_device_get_card_active_profile (_data_->device);
		_data_->_tmp25_ = _data_->_tmp24_;
		if (g_strcmp0 (_data_->_tmp23_, _data_->_tmp25_) != 0) {
			_data_->_tmp26_ = _data_->profile_name;
			_data_->_state_ = 1;
			sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index (_data_->self, _data_->_tmp26_, _data_->device, sway_notification_center_widgets_pulse_daemon_set_default_device_ready, _data_);
			return FALSE;
			_state_1:
			sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index_finish (_data_->self, _data_->_res_);
			_data_->_state_ = 2;
			sway_notification_center_widgets_pulse_daemon_wait_for_update (_data_->self, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _data_->device, "device-name", sway_notification_center_widgets_pulse_daemon_set_default_device_ready, _data_);
			return FALSE;
			_state_2:
			sway_notification_center_widgets_pulse_daemon_wait_for_update_finish (_data_->self, _data_->_res_);
		}
		if (!_data_->is_input) {
			_data_->_tmp27_ = sway_notification_center_widgets_pulse_device_get_port_name (_data_->device);
			_data_->_tmp28_ = _data_->_tmp27_;
			_data_->_tmp29_ = sway_notification_center_widgets_pulse_device_get_card_sink_port_name (_data_->device);
			_data_->_tmp30_ = _data_->_tmp29_;
			if (g_strcmp0 (_data_->_tmp28_, _data_->_tmp30_) != 0) {
				_data_->_tmp31_ = sway_notification_center_widgets_pulse_device_get_port_name (_data_->device);
				_data_->_tmp32_ = _data_->_tmp31_;
				g_debug ("pulseDaemon.vala:551: Setting port to: %s", _data_->_tmp32_);
				_data_->_state_ = 3;
				sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name (_data_->self, _data_->device, sway_notification_center_widgets_pulse_daemon_set_default_device_ready, _data_);
				return FALSE;
				_state_3:
				sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name_finish (_data_->self, _data_->_res_);
			}
		}
		_data_->_tmp33_ = sway_notification_center_widgets_pulse_device_get_device_name (_data_->device);
		_data_->_tmp34_ = _data_->_tmp33_;
		if (_data_->_tmp34_ == NULL) {
			_data_->_state_ = 4;
			sway_notification_center_widgets_pulse_daemon_wait_for_update (_data_->self, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _data_->device, "device-name", sway_notification_center_widgets_pulse_daemon_set_default_device_ready, _data_);
			return FALSE;
			_state_4:
			sway_notification_center_widgets_pulse_daemon_wait_for_update_finish (_data_->self, _data_->_res_);
		}
		_g_object_unref0 (_data_->alt_device);
		_g_free0 (_data_->profile_name);
	}
	if (!_data_->is_input) {
		_data_->_tmp35_ = sway_notification_center_widgets_pulse_device_get_device_name (_data_->device);
		_data_->_tmp36_ = _data_->_tmp35_;
		_data_->_tmp37_ = _data_->self->priv->_default_sink_name;
		if (g_strcmp0 (_data_->_tmp36_, _data_->_tmp37_) != 0) {
			_data_->_tmp38_ = sway_notification_center_widgets_pulse_device_get_device_name (_data_->device);
			_data_->_tmp39_ = _data_->_tmp38_;
			g_debug ("pulseDaemon.vala:563: Setting default sink to: %s", _data_->_tmp39_);
			_data_->_state_ = 5;
			sway_notification_center_widgets_pulse_daemon_set_default_sink (_data_->self, _data_->device, sway_notification_center_widgets_pulse_daemon_set_default_device_ready, _data_);
			return FALSE;
			_state_5:
			sway_notification_center_widgets_pulse_daemon_set_default_sink_finish (_data_->self, _data_->_res_);
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sway_notification_center_widgets_pulse_daemon_wait_for_update_data_free (gpointer _data)
{
	SwayNotificationCenterWidgetsPulseDaemonWaitForUpdateData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (SwayNotificationCenterWidgetsPulseDaemonWaitForUpdateData, _data_);
}

static void
sway_notification_center_widgets_pulse_daemon_wait_for_update (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                               GType t_type,
                                                               GBoxedCopyFunc t_dup_func,
                                                               GDestroyNotify t_destroy_func,
                                                               SwayNotificationCenterWidgetsPulseDevice* device,
                                                               const gchar* prop_name,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_)
{
	SwayNotificationCenterWidgetsPulseDaemonWaitForUpdateData* _data_;
	SwayNotificationCenterWidgetsPulseDaemon* _tmp0_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DEVICE (device));
	g_return_if_fail (prop_name != NULL);
	_data_ = g_slice_new0 (SwayNotificationCenterWidgetsPulseDaemonWaitForUpdateData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sway_notification_center_widgets_pulse_daemon_wait_for_update_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (device);
	_g_object_unref0 (_data_->device);
	_data_->device = _tmp1_;
	_tmp2_ = g_strdup (prop_name);
	_g_free0 (_data_->prop_name);
	_data_->prop_name = _tmp2_;
	_data_->t_type = t_type;
	_data_->t_dup_func = t_dup_func;
	_data_->t_destroy_func = t_destroy_func;
	sway_notification_center_widgets_pulse_daemon_wait_for_update_co (_data_);
}

static void
sway_notification_center_widgets_pulse_daemon_wait_for_update_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                      GAsyncResult* _res_)
{
	SwayNotificationCenterWidgetsPulseDaemonWaitForUpdateData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block32Data*
block32_data_ref (Block32Data* _data32_)
{
	g_atomic_int_inc (&_data32_->_ref_count_);
	return _data32_;
}

static void
block32_data_unref (void * _userdata_)
{
	Block32Data* _data32_;
	_data32_ = (Block32Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data32_->_ref_count_)) {
		SwayNotificationCenterWidgetsPulseDaemon* self;
		GType t_type;
		GBoxedCopyFunc t_dup_func;
		GDestroyNotify t_destroy_func;
		self = _data32_->self;
		t_type = _data32_->t_type;
		t_dup_func = _data32_->t_dup_func;
		t_destroy_func = _data32_->t_destroy_func;
		(_data32_->callback_target_destroy_notify == NULL) ? NULL : (_data32_->callback_target_destroy_notify (_data32_->callback_target), NULL);
		_data32_->callback = NULL;
		_data32_->callback_target = NULL;
		_data32_->callback_target_destroy_notify = NULL;
		_g_object_unref0 (_data32_->device);
		_g_free0 (_data32_->prop_name);
		_g_object_unref0 (self);
		g_slice_free (Block32Data, _data32_);
	}
}

static gboolean
_sway_notification_center_widgets_pulse_daemon_wait_for_update_co_gsource_func (gpointer self)
{
	gboolean result;
	result = sway_notification_center_widgets_pulse_daemon_wait_for_update_co (self);
	return result;
}

static void
__lambda78_ (Block32Data* _data32_,
             GObject* s,
             GParamSpec* p)
{
	SwayNotificationCenterWidgetsPulseDaemon* self;
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	gpointer prop_value = NULL;
	gpointer _tmp0_ = NULL;
	gconstpointer _tmp1_;
	self = _data32_->self;
	t_type = _data32_->t_type;
	t_dup_func = _data32_->t_dup_func;
	t_destroy_func = _data32_->t_destroy_func;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (s, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (p, G_TYPE_PARAM));
	g_object_get (G_TYPE_CHECK_INSTANCE_CAST (_data32_->device, G_TYPE_OBJECT, GObject), _data32_->prop_name, &_tmp0_, NULL);
	((prop_value == NULL) || (t_destroy_func == NULL)) ? NULL : (prop_value = (t_destroy_func (prop_value), NULL));
	prop_value = _tmp0_;
	_tmp1_ = prop_value;
	if (_tmp1_ != NULL) {
		GSourceFunc _tmp2_;
		gpointer _tmp2__target;
		GDestroyNotify _tmp2__target_destroy_notify;
		g_signal_handler_disconnect (G_TYPE_CHECK_INSTANCE_CAST (_data32_->device, G_TYPE_OBJECT, GObject), _data32_->handler_id);
		_tmp2_ = _data32_->callback;
		_tmp2__target = _data32_->callback_target;
		_tmp2__target_destroy_notify = _data32_->callback_target_destroy_notify;
		_data32_->callback = NULL;
		_data32_->callback_target = NULL;
		_data32_->callback_target_destroy_notify = NULL;
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _tmp2_, _tmp2__target, _tmp2__target_destroy_notify);
	}
	((prop_value == NULL) || (t_destroy_func == NULL)) ? NULL : (prop_value = (t_destroy_func (prop_value), NULL));
}

static void
___lambda78__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda78_ (self, _sender, pspec);
}

static gboolean
sway_notification_center_widgets_pulse_daemon_wait_for_update_co (SwayNotificationCenterWidgetsPulseDaemonWaitForUpdateData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data32_ = g_slice_new0 (Block32Data);
	_data_->_data32_->_ref_count_ = 1;
	_data_->_data32_->self = g_object_ref (_data_->self);
	_data_->_data32_->t_type = _data_->t_type;
	_data_->_data32_->t_dup_func = _data_->t_dup_func;
	_data_->_data32_->t_destroy_func = _data_->t_destroy_func;
	_g_object_unref0 (_data_->_data32_->device);
	_data_->_data32_->device = _data_->device;
	_g_free0 (_data_->_data32_->prop_name);
	_data_->_data32_->prop_name = _data_->prop_name;
	_data_->_data32_->_async_data_ = _data_;
	_data_->_data32_->callback = _sway_notification_center_widgets_pulse_daemon_wait_for_update_co_gsource_func;
	_data_->_data32_->callback_target = _data_;
	_data_->_data32_->callback_target_destroy_notify = NULL;
	_data_->_data32_->handler_id = (gulong) 0;
	_data_->_tmp0_ = g_strconcat ("notify::", _data_->_data32_->prop_name, NULL);
	_data_->_tmp1_ = g_signal_connect_data (G_TYPE_CHECK_INSTANCE_CAST (_data_->_data32_->device, G_TYPE_OBJECT, GObject), _data_->_tmp0_, (GCallback) ___lambda78__g_object_notify, block32_data_ref (_data_->_data32_), (GClosureNotify) block32_data_unref, 0);
	_data_->_data32_->handler_id = _data_->_tmp1_;
	_g_free0 (_data_->_tmp0_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	block32_data_unref (_data_->_data32_);
	_data_->_data32_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_data_free (gpointer _data)
{
	SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData, _data_);
}

void
sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                          SwayNotificationCenterWidgetsPulseCardProfile* profile,
                                                                          SwayNotificationCenterWidgetsPulseDevice* device,
                                                                          GAsyncReadyCallback _callback_,
                                                                          gpointer _user_data_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData* _data_;
	SwayNotificationCenterWidgetsPulseDaemon* _tmp0_;
	SwayNotificationCenterWidgetsPulseCardProfile* _tmp1_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp2_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_CARD_PROFILE (profile));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DEVICE (device));
	_data_ = g_slice_new0 (SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (profile);
	_g_object_unref0 (_data_->profile);
	_data_->profile = _tmp1_;
	_tmp2_ = _g_object_ref0 (device);
	_g_object_unref0 (_data_->device);
	_data_->device = _tmp2_;
	sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_co (_data_);
}

void
sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                                 GAsyncResult* _res_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block33Data*
block33_data_ref (Block33Data* _data33_)
{
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}

static void
block33_data_unref (void * _userdata_)
{
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		SwayNotificationCenterWidgetsPulseDaemon* self;
		self = _data33_->self;
		_g_object_unref0 (_data33_->profile);
		_g_object_unref0 (_data33_->device);
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}

static void
__lambda81_ (Block33Data* _data33_,
             pa_context* c,
             gint success)
{
	SwayNotificationCenterWidgetsPulseDaemon* self;
	self = _data33_->self;
	g_return_if_fail (c != NULL);
	if (success == 1) {
		sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_co (_data33_->_async_data_);
	} else {
		FILE* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp0_ = stderr;
		_tmp1_ = sway_notification_center_widgets_pulse_device_get_card_name (_data33_->device);
		_tmp2_ = _tmp1_;
		_tmp3_ = _data33_->profile->name;
		fprintf (_tmp0_, "setting the card %s profile to %s failed\n", _tmp2_, _tmp3_);
	}
}

static void
___lambda81__pa_context_success_cb_t (pa_context* c,
                                      gint success,
                                      gpointer self)
{
	__lambda81_ (self, c, success);
}

static void
sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_ready (GObject* source_object,
                                                                                GAsyncResult* _res_,
                                                                                gpointer _user_data_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_co (_data_);
}

static gboolean
sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_co (SwayNotificationCenterWidgetsPulseDaemonSetBluetoothCardProfileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data33_ = g_slice_new0 (Block33Data);
	_data_->_data33_->_ref_count_ = 1;
	_data_->_data33_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data33_->profile);
	_data_->_data33_->profile = _data_->profile;
	_g_object_unref0 (_data_->_data33_->device);
	_data_->_data33_->device = _data_->device;
	_data_->_data33_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->context;
	_data_->_tmp1_ = sway_notification_center_widgets_pulse_device_get_card_index (_data_->_data33_->device);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->_data33_->profile->name;
	_data_->_tmp4_ = pa_context_set_card_profile_by_index (_data_->_tmp0_, _data_->_tmp2_, _data_->_tmp3_, ___lambda81__pa_context_success_cb_t, _data_->_data33_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_pa_operation_unref0 (_data_->_tmp5_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_state_ = 2;
	sway_notification_center_widgets_pulse_daemon_wait_for_update (_data_->self, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _data_->_data33_->device, "device-name", sway_notification_center_widgets_pulse_daemon_set_bluetooth_card_profile_ready, _data_);
	return FALSE;
	_state_2:
	sway_notification_center_widgets_pulse_daemon_wait_for_update_finish (_data_->self, _data_->_res_);
	block33_data_unref (_data_->_data33_);
	_data_->_data33_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index_data_free (gpointer _data)
{
	SwayNotificationCenterWidgetsPulseDaemonSetCardProfileByIndexData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (SwayNotificationCenterWidgetsPulseDaemonSetCardProfileByIndexData, _data_);
}

static void
sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                         const gchar* profile_name,
                                                                         SwayNotificationCenterWidgetsPulseDevice* device,
                                                                         GAsyncReadyCallback _callback_,
                                                                         gpointer _user_data_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetCardProfileByIndexData* _data_;
	SwayNotificationCenterWidgetsPulseDaemon* _tmp0_;
	gchar* _tmp1_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp2_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (profile_name != NULL);
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DEVICE (device));
	_data_ = g_slice_new0 (SwayNotificationCenterWidgetsPulseDaemonSetCardProfileByIndexData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (profile_name);
	_g_free0 (_data_->profile_name);
	_data_->profile_name = _tmp1_;
	_tmp2_ = _g_object_ref0 (device);
	_g_object_unref0 (_data_->device);
	_data_->device = _tmp2_;
	sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index_co (_data_);
}

static void
sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                                GAsyncResult* _res_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetCardProfileByIndexData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block34Data*
block34_data_ref (Block34Data* _data34_)
{
	g_atomic_int_inc (&_data34_->_ref_count_);
	return _data34_;
}

static void
block34_data_unref (void * _userdata_)
{
	Block34Data* _data34_;
	_data34_ = (Block34Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
		SwayNotificationCenterWidgetsPulseDaemon* self;
		self = _data34_->self;
		_g_free0 (_data34_->profile_name);
		_g_object_unref0 (_data34_->device);
		_g_object_unref0 (self);
		g_slice_free (Block34Data, _data34_);
	}
}

static void
__lambda77_ (Block34Data* _data34_,
             pa_context* c,
             gint success)
{
	SwayNotificationCenterWidgetsPulseDaemon* self;
	self = _data34_->self;
	g_return_if_fail (c != NULL);
	if (success == 1) {
		sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index_co (_data34_->_async_data_);
	} else {
		FILE* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		_tmp0_ = stderr;
		_tmp1_ = sway_notification_center_widgets_pulse_device_get_card_name (_data34_->device);
		_tmp2_ = _tmp1_;
		fprintf (_tmp0_, "setting the card %s profile to %s failed\n", _tmp2_, _data34_->profile_name);
	}
}

static void
___lambda77__pa_context_success_cb_t (pa_context* c,
                                      gint success,
                                      gpointer self)
{
	__lambda77_ (self, c, success);
}

static gboolean
sway_notification_center_widgets_pulse_daemon_set_card_profile_by_index_co (SwayNotificationCenterWidgetsPulseDaemonSetCardProfileByIndexData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data34_ = g_slice_new0 (Block34Data);
	_data_->_data34_->_ref_count_ = 1;
	_data_->_data34_->self = g_object_ref (_data_->self);
	_g_free0 (_data_->_data34_->profile_name);
	_data_->_data34_->profile_name = _data_->profile_name;
	_g_object_unref0 (_data_->_data34_->device);
	_data_->_data34_->device = _data_->device;
	_data_->_data34_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->context;
	_data_->_tmp1_ = sway_notification_center_widgets_pulse_device_get_card_index (_data_->_data34_->device);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = pa_context_set_card_profile_by_index (_data_->_tmp0_, _data_->_tmp2_, _data_->_data34_->profile_name, ___lambda77__pa_context_success_cb_t, _data_->_data34_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_pa_operation_unref0 (_data_->_tmp4_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	block34_data_unref (_data_->_data34_);
	_data_->_data34_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name_data_free (gpointer _data)
{
	SwayNotificationCenterWidgetsPulseDaemonSetSinkPortByNameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (SwayNotificationCenterWidgetsPulseDaemonSetSinkPortByNameData, _data_);
}

static void
sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                     SwayNotificationCenterWidgetsPulseDevice* device,
                                                                     GAsyncReadyCallback _callback_,
                                                                     gpointer _user_data_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetSinkPortByNameData* _data_;
	SwayNotificationCenterWidgetsPulseDaemon* _tmp0_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp1_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DEVICE (device));
	_data_ = g_slice_new0 (SwayNotificationCenterWidgetsPulseDaemonSetSinkPortByNameData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (device);
	_g_object_unref0 (_data_->device);
	_data_->device = _tmp1_;
	sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name_co (_data_);
}

static void
sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                            GAsyncResult* _res_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetSinkPortByNameData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block35Data*
block35_data_ref (Block35Data* _data35_)
{
	g_atomic_int_inc (&_data35_->_ref_count_);
	return _data35_;
}

static void
block35_data_unref (void * _userdata_)
{
	Block35Data* _data35_;
	_data35_ = (Block35Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
		SwayNotificationCenterWidgetsPulseDaemon* self;
		self = _data35_->self;
		_g_object_unref0 (_data35_->device);
		_g_object_unref0 (self);
		g_slice_free (Block35Data, _data35_);
	}
}

static void
__lambda79_ (Block35Data* _data35_,
             pa_context* c,
             gint success)
{
	SwayNotificationCenterWidgetsPulseDaemon* self;
	self = _data35_->self;
	g_return_if_fail (c != NULL);
	if (success == 1) {
		sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name_co (_data35_->_async_data_);
	} else {
		FILE* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		_tmp0_ = stderr;
		_tmp1_ = sway_notification_center_widgets_pulse_device_get_port_name (_data35_->device);
		_tmp2_ = _tmp1_;
		fprintf (_tmp0_, "setting sink port to %s failed\n", _tmp2_);
	}
}

static void
___lambda79__pa_context_success_cb_t (pa_context* c,
                                      gint success,
                                      gpointer self)
{
	__lambda79_ (self, c, success);
}

static gboolean
sway_notification_center_widgets_pulse_daemon_set_sink_port_by_name_co (SwayNotificationCenterWidgetsPulseDaemonSetSinkPortByNameData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data35_ = g_slice_new0 (Block35Data);
	_data_->_data35_->_ref_count_ = 1;
	_data_->_data35_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data35_->device);
	_data_->_data35_->device = _data_->device;
	_data_->_data35_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->context;
	_data_->_tmp1_ = sway_notification_center_widgets_pulse_device_get_device_name (_data_->_data35_->device);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = sway_notification_center_widgets_pulse_device_get_port_name (_data_->_data35_->device);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = pa_context_set_sink_port_by_name (_data_->_tmp0_, _data_->_tmp2_, _data_->_tmp4_, ___lambda79__pa_context_success_cb_t, _data_->_data35_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_pa_operation_unref0 (_data_->_tmp6_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	block35_data_unref (_data_->_data35_);
	_data_->_data35_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
sway_notification_center_widgets_pulse_daemon_set_default_sink_data_free (gpointer _data)
{
	SwayNotificationCenterWidgetsPulseDaemonSetDefaultSinkData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (SwayNotificationCenterWidgetsPulseDaemonSetDefaultSinkData, _data_);
}

static void
sway_notification_center_widgets_pulse_daemon_set_default_sink (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                SwayNotificationCenterWidgetsPulseDevice* device,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetDefaultSinkData* _data_;
	SwayNotificationCenterWidgetsPulseDaemon* _tmp0_;
	SwayNotificationCenterWidgetsPulseDevice* _tmp1_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DEVICE (device));
	_data_ = g_slice_new0 (SwayNotificationCenterWidgetsPulseDaemonSetDefaultSinkData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sway_notification_center_widgets_pulse_daemon_set_default_sink_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (device);
	_g_object_unref0 (_data_->device);
	_data_->device = _tmp1_;
	sway_notification_center_widgets_pulse_daemon_set_default_sink_co (_data_);
}

static void
sway_notification_center_widgets_pulse_daemon_set_default_sink_finish (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                       GAsyncResult* _res_)
{
	SwayNotificationCenterWidgetsPulseDaemonSetDefaultSinkData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block36Data*
block36_data_ref (Block36Data* _data36_)
{
	g_atomic_int_inc (&_data36_->_ref_count_);
	return _data36_;
}

static void
block36_data_unref (void * _userdata_)
{
	Block36Data* _data36_;
	_data36_ = (Block36Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data36_->_ref_count_)) {
		SwayNotificationCenterWidgetsPulseDaemon* self;
		self = _data36_->self;
		_g_object_unref0 (_data36_->device);
		_g_object_unref0 (self);
		g_slice_free (Block36Data, _data36_);
	}
}

static void
__lambda80_ (Block36Data* _data36_,
             pa_context* c,
             gint success)
{
	SwayNotificationCenterWidgetsPulseDaemon* self;
	self = _data36_->self;
	g_return_if_fail (c != NULL);
	if (success == 1) {
		sway_notification_center_widgets_pulse_daemon_set_default_sink_co (_data36_->_async_data_);
	} else {
		FILE* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		_tmp0_ = stderr;
		_tmp1_ = sway_notification_center_widgets_pulse_device_get_device_name (_data36_->device);
		_tmp2_ = _tmp1_;
		fprintf (_tmp0_, "setting default sink to %s failed\n", _tmp2_);
	}
}

static void
___lambda80__pa_context_success_cb_t (pa_context* c,
                                      gint success,
                                      gpointer self)
{
	__lambda80_ (self, c, success);
}

static gboolean
sway_notification_center_widgets_pulse_daemon_set_default_sink_co (SwayNotificationCenterWidgetsPulseDaemonSetDefaultSinkData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data36_ = g_slice_new0 (Block36Data);
	_data_->_data36_->_ref_count_ = 1;
	_data_->_data36_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data36_->device);
	_data_->_data36_->device = _data_->device;
	_data_->_data36_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->context;
	_data_->_tmp1_ = sway_notification_center_widgets_pulse_device_get_device_name (_data_->_data36_->device);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = pa_context_set_default_sink (_data_->_tmp0_, _data_->_tmp2_, ___lambda80__pa_context_success_cb_t, _data_->_data36_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_pa_operation_unref0 (_data_->_tmp4_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	block36_data_unref (_data_->_data36_);
	_data_->_data36_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
sway_notification_center_widgets_pulse_daemon_set_device_mute (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                               gboolean state,
                                                               SwayNotificationCenterWidgetsPulseDevice* device)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	pa_direction_t _tmp2_;
	pa_direction_t _tmp3_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DEVICE (device));
	_tmp0_ = sway_notification_center_widgets_pulse_device_get_is_muted (device);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == state) {
		return;
	}
	_tmp2_ = sway_notification_center_widgets_pulse_device_get_direction (device);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == PA_DIRECTION_OUTPUT) {
		pa_context* _tmp4_;
		guint32 _tmp5_;
		guint32 _tmp6_;
		pa_operation* _tmp7_;
		pa_operation* _tmp8_;
		_tmp4_ = self->priv->context;
		_tmp5_ = sway_notification_center_widgets_pulse_device_get_device_index (device);
		_tmp6_ = _tmp5_;
		_tmp7_ = pa_context_set_sink_mute_by_index (_tmp4_, _tmp6_, state, NULL, NULL);
		_tmp8_ = _tmp7_;
		_pa_operation_unref0 (_tmp8_);
	}
}

void
sway_notification_center_widgets_pulse_daemon_set_sink_input_mute (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                   gboolean state,
                                                                   SwayNotificationCenterWidgetsPulseSinkInput* sink_input)
{
	pa_context* _tmp0_;
	pa_operation* _tmp1_;
	pa_operation* _tmp2_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_SINK_INPUT (sink_input));
	if (sink_input->is_muted == state) {
		return;
	}
	_tmp0_ = self->priv->context;
	_tmp1_ = pa_context_set_sink_input_mute (_tmp0_, sink_input->index, state, NULL, NULL);
	_tmp2_ = _tmp1_;
	_pa_operation_unref0 (_tmp2_);
}

static gdouble
sway_notification_center_widgets_pulse_daemon_volume_to_double (pa_volume_t vol)
{
	gdouble tmp = 0.0;
	gdouble result;
	tmp = (gdouble) (vol - PA_VOLUME_MUTED);
	result = (100 * tmp) / ((gdouble) (PA_VOLUME_NORM - PA_VOLUME_MUTED));
	return result;
}

static pa_volume_t
sway_notification_center_widgets_pulse_daemon_double_to_volume (gdouble vol)
{
	gdouble tmp = 0.0;
	pa_volume_t result;
	tmp = (((gdouble) (PA_VOLUME_NORM - PA_VOLUME_MUTED)) * vol) / 100;
	result = ((pa_volume_t) tmp) + PA_VOLUME_MUTED;
	return result;
}

SwayNotificationCenterWidgetsPulseDaemon*
sway_notification_center_widgets_pulse_daemon_construct (GType object_type)
{
	SwayNotificationCenterWidgetsPulseDaemon * self = NULL;
	self = (SwayNotificationCenterWidgetsPulseDaemon*) g_object_new (object_type, NULL);
	return self;
}

SwayNotificationCenterWidgetsPulseDaemon*
sway_notification_center_widgets_pulse_daemon_new (void)
{
	return sway_notification_center_widgets_pulse_daemon_construct (SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON);
}

gboolean
sway_notification_center_widgets_pulse_daemon_get_running (SwayNotificationCenterWidgetsPulseDaemon* self)
{
	gboolean result;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self), FALSE);
	result = self->priv->_running;
	return result;
}

static void
sway_notification_center_widgets_pulse_daemon_set_running (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	old_value = sway_notification_center_widgets_pulse_daemon_get_running (self);
	if (old_value != value) {
		self->priv->_running = value;
		g_object_notify_by_pspec ((GObject *) self, sway_notification_center_widgets_pulse_daemon_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_RUNNING_PROPERTY]);
	}
}

static const gchar*
sway_notification_center_widgets_pulse_daemon_get_default_sink_name (SwayNotificationCenterWidgetsPulseDaemon* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self), NULL);
	_tmp0_ = self->priv->_default_sink_name;
	result = _tmp0_;
	return result;
}

static void
sway_notification_center_widgets_pulse_daemon_set_default_sink_name (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                     const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_default_sink_name);
	self->priv->_default_sink_name = _tmp0_;
}

static const gchar*
sway_notification_center_widgets_pulse_daemon_get_default_source_name (SwayNotificationCenterWidgetsPulseDaemon* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self), NULL);
	_tmp0_ = self->priv->_default_source_name;
	result = _tmp0_;
	return result;
}

static void
sway_notification_center_widgets_pulse_daemon_set_default_source_name (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                       const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_default_source_name);
	self->priv->_default_source_name = _tmp0_;
}

GeeHashMap*
sway_notification_center_widgets_pulse_daemon_get_sinks (SwayNotificationCenterWidgetsPulseDaemon* self)
{
	GeeHashMap* result;
	GeeHashMap* _tmp0_;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self), NULL);
	_tmp0_ = self->priv->_sinks;
	result = _tmp0_;
	return result;
}

static void
sway_notification_center_widgets_pulse_daemon_set_sinks (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                         GeeHashMap* value)
{
	GeeHashMap* old_value;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	old_value = sway_notification_center_widgets_pulse_daemon_get_sinks (self);
	if (old_value != value) {
		GeeHashMap* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_sinks);
		self->priv->_sinks = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, sway_notification_center_widgets_pulse_daemon_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_SINKS_PROPERTY]);
	}
}

GeeHashMap*
sway_notification_center_widgets_pulse_daemon_get_active_sinks (SwayNotificationCenterWidgetsPulseDaemon* self)
{
	GeeHashMap* result;
	GeeHashMap* _tmp0_;
	g_return_val_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self), NULL);
	_tmp0_ = self->priv->_active_sinks;
	result = _tmp0_;
	return result;
}

static void
sway_notification_center_widgets_pulse_daemon_set_active_sinks (SwayNotificationCenterWidgetsPulseDaemon* self,
                                                                GeeHashMap* value)
{
	GeeHashMap* old_value;
	g_return_if_fail (SWAY_NOTIFICATION_CENTER_WIDGETS_IS_PULSE_DAEMON (self));
	old_value = sway_notification_center_widgets_pulse_daemon_get_active_sinks (self);
	if (old_value != value) {
		GeeHashMap* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_active_sinks);
		self->priv->_active_sinks = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, sway_notification_center_widgets_pulse_daemon_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_ACTIVE_SINKS_PROPERTY]);
	}
}

static GObject *
sway_notification_center_widgets_pulse_daemon_constructor (GType type,
                                                           guint n_construct_properties,
                                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SwayNotificationCenterWidgetsPulseDaemon * self;
	pa_glib_mainloop* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	GeeHashMap* _tmp4_;
	parent_class = G_OBJECT_CLASS (sway_notification_center_widgets_pulse_daemon_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, SwayNotificationCenterWidgetsPulseDaemon);
	_tmp0_ = pa_glib_mainloop_new (NULL);
	_pa_glib_mainloop_free0 (self->priv->mainloop);
	self->priv->mainloop = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	if (_tmp1_) {
		g_object_set_data ((GObject *) _tmp1_, "vala-creation-function", "");
	}
	_tmp2_ = _tmp1_;
	sway_notification_center_widgets_pulse_daemon_set_sinks (self, _tmp2_);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_SINK_INPUT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	if (_tmp3_) {
		g_object_set_data ((GObject *) _tmp3_, "vala-creation-function", "");
	}
	_tmp4_ = _tmp3_;
	sway_notification_center_widgets_pulse_daemon_set_active_sinks (self, _tmp4_);
	_g_object_unref0 (_tmp4_);
	return obj;
}

static void
sway_notification_center_widgets_pulse_daemon_class_init (SwayNotificationCenterWidgetsPulseDaemonClass * klass,
                                                          gpointer klass_data)
{
	sway_notification_center_widgets_pulse_daemon_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwayNotificationCenterWidgetsPulseDaemon_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_sway_notification_center_widgets_pulse_daemon_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_sway_notification_center_widgets_pulse_daemon_set_property;
	G_OBJECT_CLASS (klass)->constructor = sway_notification_center_widgets_pulse_daemon_constructor;
	G_OBJECT_CLASS (klass)->finalize = sway_notification_center_widgets_pulse_daemon_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_RUNNING_PROPERTY, sway_notification_center_widgets_pulse_daemon_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_RUNNING_PROPERTY] = g_param_spec_boolean ("running", "running", "running", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_SINKS_PROPERTY, sway_notification_center_widgets_pulse_daemon_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_SINKS_PROPERTY] = g_param_spec_object ("sinks", "sinks", "sinks", GEE_TYPE_HASH_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_ACTIVE_SINKS_PROPERTY, sway_notification_center_widgets_pulse_daemon_properties[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_ACTIVE_SINKS_PROPERTY] = g_param_spec_object ("active-sinks", "active-sinks", "active-sinks", GEE_TYPE_HASH_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_DEFAULT_DEVICE_SIGNAL] = g_signal_new ("change-default-device", SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE);
	sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NEW_ACTIVE_SINK_SIGNAL] = g_signal_new ("new-active-sink", SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_SINK_INPUT);
	sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_ACTIVE_SINK_SIGNAL] = g_signal_new ("change-active-sink", SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_SINK_INPUT);
	sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_REMOVE_ACTIVE_SINK_SIGNAL] = g_signal_new ("remove-active-sink", SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_SINK_INPUT);
	sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_NEW_DEVICE_SIGNAL] = g_signal_new ("new-device", SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE);
	sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_CHANGE_DEVICE_SIGNAL] = g_signal_new ("change-device", SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE);
	sway_notification_center_widgets_pulse_daemon_signals[SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_REMOVE_DEVICE_SIGNAL] = g_signal_new ("remove-device", SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DEVICE);
}

static void
sway_notification_center_widgets_pulse_daemon_instance_init (SwayNotificationCenterWidgetsPulseDaemon * self,
                                                             gpointer klass)
{
	self->priv = sway_notification_center_widgets_pulse_daemon_get_instance_private (self);
	self->priv->quitting = FALSE;
	self->priv->default_sink = NULL;
}

static void
sway_notification_center_widgets_pulse_daemon_finalize (GObject * obj)
{
	SwayNotificationCenterWidgetsPulseDaemon * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, SwayNotificationCenterWidgetsPulseDaemon);
	sway_notification_center_widgets_pulse_daemon_close (self);
	_pa_context_unref0 (self->priv->context);
	_pa_glib_mainloop_free0 (self->priv->mainloop);
	_g_free0 (self->priv->_default_sink_name);
	_g_free0 (self->priv->_default_source_name);
	_g_object_unref0 (self->priv->default_sink);
	_g_object_unref0 (self->priv->_sinks);
	_g_object_unref0 (self->priv->_active_sinks);
	G_OBJECT_CLASS (sway_notification_center_widgets_pulse_daemon_parent_class)->finalize (obj);
}

/**
     * Loosely based off of Elementary OS switchboard-plug-sound
     * https://github.com/elementary/switchboard-plug-sound
     */
 G_GNUC_NO_INLINE static GType
sway_notification_center_widgets_pulse_daemon_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwayNotificationCenterWidgetsPulseDaemonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sway_notification_center_widgets_pulse_daemon_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwayNotificationCenterWidgetsPulseDaemon), 0, (GInstanceInitFunc) sway_notification_center_widgets_pulse_daemon_instance_init, NULL };
	GType sway_notification_center_widgets_pulse_daemon_type_id;
	sway_notification_center_widgets_pulse_daemon_type_id = g_type_register_static (G_TYPE_OBJECT, "SwayNotificationCenterWidgetsPulseDaemon", &g_define_type_info, 0);
	SwayNotificationCenterWidgetsPulseDaemon_private_offset = g_type_add_instance_private (sway_notification_center_widgets_pulse_daemon_type_id, sizeof (SwayNotificationCenterWidgetsPulseDaemonPrivate));
	return sway_notification_center_widgets_pulse_daemon_type_id;
}

GType
sway_notification_center_widgets_pulse_daemon_get_type (void)
{
	static gsize sway_notification_center_widgets_pulse_daemon_type_id__once = 0;
	if (g_once_init_enter (&sway_notification_center_widgets_pulse_daemon_type_id__once)) {
		GType sway_notification_center_widgets_pulse_daemon_type_id;
		sway_notification_center_widgets_pulse_daemon_type_id = sway_notification_center_widgets_pulse_daemon_get_type_once ();
		g_once_init_leave (&sway_notification_center_widgets_pulse_daemon_type_id__once, sway_notification_center_widgets_pulse_daemon_type_id);
	}
	return sway_notification_center_widgets_pulse_daemon_type_id__once;
}

static void
_vala_sway_notification_center_widgets_pulse_daemon_get_property (GObject * object,
                                                                  guint property_id,
                                                                  GValue * value,
                                                                  GParamSpec * pspec)
{
	SwayNotificationCenterWidgetsPulseDaemon * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, SwayNotificationCenterWidgetsPulseDaemon);
	switch (property_id) {
		case SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_RUNNING_PROPERTY:
		g_value_set_boolean (value, sway_notification_center_widgets_pulse_daemon_get_running (self));
		break;
		case SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_SINKS_PROPERTY:
		g_value_set_object (value, sway_notification_center_widgets_pulse_daemon_get_sinks (self));
		break;
		case SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_ACTIVE_SINKS_PROPERTY:
		g_value_set_object (value, sway_notification_center_widgets_pulse_daemon_get_active_sinks (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_sway_notification_center_widgets_pulse_daemon_set_property (GObject * object,
                                                                  guint property_id,
                                                                  const GValue * value,
                                                                  GParamSpec * pspec)
{
	SwayNotificationCenterWidgetsPulseDaemon * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWAY_NOTIFICATION_CENTER_WIDGETS_TYPE_PULSE_DAEMON, SwayNotificationCenterWidgetsPulseDaemon);
	switch (property_id) {
		case SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_RUNNING_PROPERTY:
		sway_notification_center_widgets_pulse_daemon_set_running (self, g_value_get_boolean (value));
		break;
		case SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_SINKS_PROPERTY:
		sway_notification_center_widgets_pulse_daemon_set_sinks (self, g_value_get_object (value));
		break;
		case SWAY_NOTIFICATION_CENTER_WIDGETS_PULSE_DAEMON_ACTIVE_SINKS_PROPERTY:
		sway_notification_center_widgets_pulse_daemon_set_active_sinks (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

