/* Manager.c generated by valac 0.56.19, the Vala compiler
 * generated from Manager.vala, do not modify */

/*
 * Copyright 2015-2017 elementary, Inc. (http://launchpad.net/wingpanel-indicator-sound)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "sound.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <gee.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

enum  {
	SOUND_SERVICES_OBJECT_MANAGER_0_PROPERTY,
	SOUND_SERVICES_OBJECT_MANAGER_HAS_OBJECT_PROPERTY,
	SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_STATUS_PROPERTY,
	SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_TITLE_PROPERTY,
	SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_ARTIST_PROPERTY,
	SOUND_SERVICES_OBJECT_MANAGER_NUM_PROPERTIES
};
static GParamSpec* sound_services_object_manager_properties[SOUND_SERVICES_OBJECT_MANAGER_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block11Data Block11Data;
typedef struct _Block12Data Block12Data;
typedef struct _Block13Data Block13Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _SoundServicesObjectManagerCreateManagerData SoundServicesObjectManagerCreateManagerData;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _Block14Data Block14Data;
enum  {
	SOUND_SERVICES_OBJECT_MANAGER_GLOBAL_STATE_CHANGED_SIGNAL,
	SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_ADDED_SIGNAL,
	SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_REMOVED_SIGNAL,
	SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_STATUS_CHANGED_SIGNAL,
	SOUND_SERVICES_OBJECT_MANAGER_NUM_SIGNALS
};
static guint sound_services_object_manager_signals[SOUND_SERVICES_OBJECT_MANAGER_NUM_SIGNALS] = {0};

struct _SoundServicesObjectManagerPrivate {
	gboolean _has_object;
	gchar* _media_player_status;
	gchar* _current_track_title;
	gchar* _current_track_artist;
	GDBusObjectManagerClient* object_manager;
};

struct _Block11Data {
	int _ref_count_;
	SoundServicesObjectManager* self;
	GDBusObject* object;
};

struct _Block12Data {
	int _ref_count_;
	SoundServicesObjectManager* self;
	GDBusObject* object;
};

struct _Block13Data {
	int _ref_count_;
	SoundServicesObjectManager* self;
	GDBusObject* object;
};

struct _SoundServicesObjectManagerCreateManagerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SoundServicesObjectManager* self;
	GDBusObjectManagerClient* _tmp0_;
	GDBusObjectManagerClient* _tmp1_;
	GDBusObjectManagerClient* _tmp2_;
	GDBusObjectManagerClient* _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
	GDBusObjectManagerClient* _tmp6_;
	GDBusObjectManagerClient* _tmp7_;
	GDBusObjectManagerClient* _tmp8_;
	GDBusObjectManagerClient* _tmp9_;
	GError* e;
	GError* _tmp10_;
	const gchar* _tmp11_;
	GError* _inner_error0_;
};

struct _Block14Data {
	int _ref_count_;
	SoundServicesObjectManager* self;
	GeeLinkedList* players;
};

static gint SoundServicesObjectManager_private_offset;
static gpointer sound_services_object_manager_parent_class = NULL;

static void sound_services_object_manager_create_manager_data_free (gpointer _data);
static void sound_services_object_manager_create_manager (SoundServicesObjectManager* self,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void sound_services_object_manager_create_manager_finish (SoundServicesObjectManager* self,
                                                          GAsyncResult* _res_);
static gboolean sound_services_object_manager_create_manager_co (SoundServicesObjectManagerCreateManagerData* _data_);
static GType sound_services_object_manager_object_manager_proxy_get_type (SoundServicesObjectManager* self,
                                                                   GDBusObjectManagerClient* manager,
                                                                   const gchar* object_path,
                                                                   const gchar* interface_name);
static GType _sound_services_object_manager_object_manager_proxy_get_type_gd_bus_proxy_type_func (GDBusObjectManagerClient* manager,
                                                                                           const gchar* object_path,
                                                                                           const gchar* interface_name,
                                                                                           gpointer self);
static void sound_services_object_manager_create_manager_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void ___lambda9_ (SoundServicesObjectManager* self,
                  GDBusObject* object);
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
static void __lambda10_ (Block11Data* _data11_,
                  GDBusInterface* iface);
static void sound_services_object_manager_on_interface_added (SoundServicesObjectManager* self,
                                                       GDBusObject* object,
                                                       GDBusInterface* iface);
static void ___lambda10__gfunc (gconstpointer data,
                         gpointer self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void ____lambda9__gfunc (gconstpointer data,
                         gpointer self);
static void _sound_services_object_manager_on_interface_added_g_dbus_object_manager_interface_added (GDBusObjectManager* _sender,
                                                                                              GDBusObject* object,
                                                                                              GDBusInterface* interface_,
                                                                                              gpointer self);
static void sound_services_object_manager_on_interface_removed (SoundServicesObjectManager* self,
                                                         GDBusObject* object,
                                                         GDBusInterface* iface);
static void _sound_services_object_manager_on_interface_removed_g_dbus_object_manager_interface_removed (GDBusObjectManager* _sender,
                                                                                                  GDBusObject* object,
                                                                                                  GDBusInterface* interface_,
                                                                                                  gpointer self);
static void ___lambda13_ (SoundServicesObjectManager* self,
                   GDBusObject* object);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
static void __lambda14_ (Block12Data* _data12_,
                  GDBusInterface* iface);
static void ___lambda14__gfunc (gconstpointer data,
                         gpointer self);
static void ____lambda13__g_dbus_object_manager_object_added (GDBusObjectManager* _sender,
                                                       GDBusObject* object,
                                                       gpointer self);
static void ___lambda15_ (SoundServicesObjectManager* self,
                   GDBusObject* object);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
static void __lambda16_ (Block13Data* _data13_,
                  GDBusInterface* iface);
static void ___lambda16__gfunc (gconstpointer data,
                         gpointer self);
static void ____lambda15__g_dbus_object_manager_object_removed (GDBusObjectManager* _sender,
                                                         GDBusObject* object,
                                                         gpointer self);
GType sound_services_device_proxy_get_type (void);
GType sound_services_media_player_proxy_get_type (void);
static void sound_services_object_manager_set_has_object (SoundServicesObjectManager* self,
                                                   gboolean value);
static void sound_services_object_manager_set_media_player_status (SoundServicesObjectManager* self,
                                                            const gchar* value);
static void ___lambda11_ (SoundServicesObjectManager* self,
                   GVariant* changed,
                   gchar** invalid);
static void sound_services_object_manager_set_current_track_title (SoundServicesObjectManager* self,
                                                            const gchar* value);
static void sound_services_object_manager_set_current_track_artist (SoundServicesObjectManager* self,
                                                             const gchar* value);
static void ____lambda11__g_dbus_proxy_g_properties_changed (GDBusProxy* _sender,
                                                      GVariant* changed_properties,
                                                      gchar** invalidated_properties,
                                                      gpointer self);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static void __lambda12_ (Block14Data* _data14_,
                  GDBusObject* object);
static void ___lambda12__gfunc (gconstpointer data,
                         gpointer self);
static void g_cclosure_user_marshal_VOID__BOOLEAN_BOOLEAN (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_STRING_STRING (GClosure * closure,
                                                         GValue * return_value,
                                                         guint n_param_values,
                                                         const GValue * param_values,
                                                         gpointer invocation_hint,
                                                         gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__STRING_STRING_STRING (GClosure * closure,
                                                         GValue * return_value,
                                                         guint n_param_values,
                                                         const GValue * param_values,
                                                         gpointer invocation_hint,
                                                         gpointer marshal_data);
static GObject * sound_services_object_manager_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
static void sound_services_object_manager_finalize (GObject * obj);
static GType sound_services_object_manager_get_type_once (void);
static void _vala_sound_services_object_manager_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_sound_services_object_manager_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
sound_services_object_manager_get_instance_private (SoundServicesObjectManager* self)
{
	return G_STRUCT_MEMBER_P (self, SoundServicesObjectManager_private_offset);
}

SoundServicesObjectManager*
sound_services_object_manager_construct (GType object_type)
{
	SoundServicesObjectManager * self = NULL;
	self = (SoundServicesObjectManager*) g_object_new (object_type, NULL);
	return self;
}

SoundServicesObjectManager*
sound_services_object_manager_new (void)
{
	return sound_services_object_manager_construct (SOUND_SERVICES_TYPE_OBJECT_MANAGER);
}

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

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

static void
sound_services_object_manager_create_manager (SoundServicesObjectManager* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	SoundServicesObjectManagerCreateManagerData* _data_;
	SoundServicesObjectManager* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (SoundServicesObjectManagerCreateManagerData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, sound_services_object_manager_create_manager_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	sound_services_object_manager_create_manager_co (_data_);
}

static void
sound_services_object_manager_create_manager_finish (SoundServicesObjectManager* self,
                                                     GAsyncResult* _res_)
{
	SoundServicesObjectManagerCreateManagerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static GType
_sound_services_object_manager_object_manager_proxy_get_type_gd_bus_proxy_type_func (GDBusObjectManagerClient* manager,
                                                                                     const gchar* object_path,
                                                                                     const gchar* interface_name,
                                                                                     gpointer self)
{
	GType result;
	result = sound_services_object_manager_object_manager_proxy_get_type ((SoundServicesObjectManager*) self, manager, object_path, interface_name);
	return result;
}

static void
sound_services_object_manager_create_manager_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	SoundServicesObjectManagerCreateManagerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	sound_services_object_manager_create_manager_co (_data_);
}

static Block11Data*
block11_data_ref (Block11Data* _data11_)
{
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}

static void
block11_data_unref (void * _userdata_)
{
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		SoundServicesObjectManager* self;
		self = _data11_->self;
		_g_object_unref0 (_data11_->object);
		_g_object_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}

static void
__lambda10_ (Block11Data* _data11_,
             GDBusInterface* iface)
{
	SoundServicesObjectManager* self;
	self = _data11_->self;
	g_return_if_fail (iface != NULL);
	sound_services_object_manager_on_interface_added (self, _data11_->object, iface);
}

static void
___lambda10__gfunc (gconstpointer data,
                    gpointer self)
{
	__lambda10_ (self, (GDBusInterface*) data);
}

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

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static void
___lambda9_ (SoundServicesObjectManager* self,
             GDBusObject* object)
{
	Block11Data* _data11_;
	GDBusObject* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	g_return_if_fail (object != NULL);
	_data11_ = g_slice_new0 (Block11Data);
	_data11_->_ref_count_ = 1;
	_data11_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (object);
	_g_object_unref0 (_data11_->object);
	_data11_->object = _tmp0_;
	_tmp1_ = g_dbus_object_get_interfaces (_data11_->object);
	_tmp2_ = _tmp1_;
	g_list_foreach (_tmp2_, ___lambda10__gfunc, _data11_);
	(_tmp2_ == NULL) ? NULL : (_tmp2_ = (_g_list_free__g_object_unref0_ (_tmp2_), NULL));
	block11_data_unref (_data11_);
	_data11_ = NULL;
}

static void
____lambda9__gfunc (gconstpointer data,
                    gpointer self)
{
	___lambda9_ ((SoundServicesObjectManager*) self, (GDBusObject*) data);
}

static void
_sound_services_object_manager_on_interface_added_g_dbus_object_manager_interface_added (GDBusObjectManager* _sender,
                                                                                         GDBusObject* object,
                                                                                         GDBusInterface* interface_,
                                                                                         gpointer self)
{
	sound_services_object_manager_on_interface_added ((SoundServicesObjectManager*) self, object, interface_);
}

static void
_sound_services_object_manager_on_interface_removed_g_dbus_object_manager_interface_removed (GDBusObjectManager* _sender,
                                                                                             GDBusObject* object,
                                                                                             GDBusInterface* interface_,
                                                                                             gpointer self)
{
	sound_services_object_manager_on_interface_removed ((SoundServicesObjectManager*) self, object, interface_);
}

static Block12Data*
block12_data_ref (Block12Data* _data12_)
{
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}

static void
block12_data_unref (void * _userdata_)
{
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		SoundServicesObjectManager* self;
		self = _data12_->self;
		_g_object_unref0 (_data12_->object);
		_g_object_unref0 (self);
		g_slice_free (Block12Data, _data12_);
	}
}

static void
__lambda14_ (Block12Data* _data12_,
             GDBusInterface* iface)
{
	SoundServicesObjectManager* self;
	self = _data12_->self;
	g_return_if_fail (iface != NULL);
	sound_services_object_manager_on_interface_added (self, _data12_->object, iface);
}

static void
___lambda14__gfunc (gconstpointer data,
                    gpointer self)
{
	__lambda14_ (self, (GDBusInterface*) data);
}

static void
___lambda13_ (SoundServicesObjectManager* self,
              GDBusObject* object)
{
	Block12Data* _data12_;
	GDBusObject* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	g_return_if_fail (object != NULL);
	_data12_ = g_slice_new0 (Block12Data);
	_data12_->_ref_count_ = 1;
	_data12_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (object);
	_g_object_unref0 (_data12_->object);
	_data12_->object = _tmp0_;
	_tmp1_ = g_dbus_object_get_interfaces (_data12_->object);
	_tmp2_ = _tmp1_;
	g_list_foreach (_tmp2_, ___lambda14__gfunc, _data12_);
	(_tmp2_ == NULL) ? NULL : (_tmp2_ = (_g_list_free__g_object_unref0_ (_tmp2_), NULL));
	block12_data_unref (_data12_);
	_data12_ = NULL;
}

static void
____lambda13__g_dbus_object_manager_object_added (GDBusObjectManager* _sender,
                                                  GDBusObject* object,
                                                  gpointer self)
{
	___lambda13_ ((SoundServicesObjectManager*) self, object);
}

static Block13Data*
block13_data_ref (Block13Data* _data13_)
{
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}

static void
block13_data_unref (void * _userdata_)
{
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		SoundServicesObjectManager* self;
		self = _data13_->self;
		_g_object_unref0 (_data13_->object);
		_g_object_unref0 (self);
		g_slice_free (Block13Data, _data13_);
	}
}

static void
__lambda16_ (Block13Data* _data13_,
             GDBusInterface* iface)
{
	SoundServicesObjectManager* self;
	self = _data13_->self;
	g_return_if_fail (iface != NULL);
	sound_services_object_manager_on_interface_removed (self, _data13_->object, iface);
}

static void
___lambda16__gfunc (gconstpointer data,
                    gpointer self)
{
	__lambda16_ (self, (GDBusInterface*) data);
}

static void
___lambda15_ (SoundServicesObjectManager* self,
              GDBusObject* object)
{
	Block13Data* _data13_;
	GDBusObject* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	g_return_if_fail (object != NULL);
	_data13_ = g_slice_new0 (Block13Data);
	_data13_->_ref_count_ = 1;
	_data13_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (object);
	_g_object_unref0 (_data13_->object);
	_data13_->object = _tmp0_;
	_tmp1_ = g_dbus_object_get_interfaces (_data13_->object);
	_tmp2_ = _tmp1_;
	g_list_foreach (_tmp2_, ___lambda16__gfunc, _data13_);
	(_tmp2_ == NULL) ? NULL : (_tmp2_ = (_g_list_free__g_object_unref0_ (_tmp2_), NULL));
	block13_data_unref (_data13_);
	_data13_ = NULL;
}

static void
____lambda15__g_dbus_object_manager_object_removed (GDBusObjectManager* _sender,
                                                    GDBusObject* object,
                                                    gpointer self)
{
	___lambda15_ ((SoundServicesObjectManager*) self, object);
}

static gboolean
sound_services_object_manager_create_manager_co (SoundServicesObjectManagerCreateManagerData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		g_dbus_object_manager_client_new_for_bus (G_BUS_TYPE_SYSTEM, G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE, "org.bluez", "/", _sound_services_object_manager_object_manager_proxy_get_type_gd_bus_proxy_type_func, g_object_ref (_data_->self), g_object_unref, NULL, sound_services_object_manager_create_manager_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = g_dbus_object_manager_client_new_for_bus_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp0_ = _data_->_tmp1_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp2_ = _data_->_tmp0_;
		_data_->_tmp0_ = NULL;
		_g_object_unref0 (_data_->self->priv->object_manager);
		_data_->self->priv->object_manager = _data_->_tmp2_;
		_data_->_tmp3_ = _data_->self->priv->object_manager;
		_data_->_tmp4_ = g_dbus_object_manager_get_objects ((GDBusObjectManager*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		g_list_foreach (_data_->_tmp5_, ____lambda9__gfunc, _data_->self);
		(_data_->_tmp5_ == NULL) ? NULL : (_data_->_tmp5_ = (_g_list_free__g_object_unref0_ (_data_->_tmp5_), NULL));
		_data_->_tmp6_ = _data_->self->priv->object_manager;
		g_signal_connect_object ((GDBusObjectManager*) _data_->_tmp6_, "interface-added", (GCallback) _sound_services_object_manager_on_interface_added_g_dbus_object_manager_interface_added, _data_->self, 0);
		_data_->_tmp7_ = _data_->self->priv->object_manager;
		g_signal_connect_object ((GDBusObjectManager*) _data_->_tmp7_, "interface-removed", (GCallback) _sound_services_object_manager_on_interface_removed_g_dbus_object_manager_interface_removed, _data_->self, 0);
		_data_->_tmp8_ = _data_->self->priv->object_manager;
		g_signal_connect_object ((GDBusObjectManager*) _data_->_tmp8_, "object-added", (GCallback) ____lambda13__g_dbus_object_manager_object_added, _data_->self, 0);
		_data_->_tmp9_ = _data_->self->priv->object_manager;
		g_signal_connect_object ((GDBusObjectManager*) _data_->_tmp9_, "object-removed", (GCallback) ____lambda15__g_dbus_object_manager_object_removed, _data_->self, 0);
		_g_object_unref0 (_data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp10_ = _data_->e;
		_data_->_tmp11_ = _data_->_tmp10_->message;
		g_critical ("Manager.vala:60: %s", _data_->_tmp11_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 GType
sound_services_object_manager_object_manager_proxy_get_type (SoundServicesObjectManager* self,
                                                             GDBusObjectManagerClient* manager,
                                                             const gchar* object_path,
                                                             const gchar* interface_name)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	GType result;
	g_return_val_if_fail (self != NULL, G_TYPE_INVALID);
	g_return_val_if_fail (manager != NULL, G_TYPE_INVALID);
	g_return_val_if_fail (object_path != NULL, G_TYPE_INVALID);
	if (interface_name == NULL) {
		result = g_dbus_object_proxy_get_type ();
		return result;
	}
	_tmp0_ = interface_name;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("org.bluez.Device1")))) {
		switch (0) {
			default:
			{
				result = sound_services_device_proxy_get_type ();
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("org.bluez.MediaPlayer1")))) {
		switch (0) {
			default:
			{
				result = sound_services_media_player_proxy_get_type ();
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				result = g_dbus_proxy_get_type ();
				return result;
			}
		}
	}
}

static void
___lambda11_ (SoundServicesObjectManager* self,
              GVariant* changed,
              gchar** invalid)
{
	GVariant* track = NULL;
	const GVariantType* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	GVariant* status_v = NULL;
	const GVariantType* _tmp11_;
	GVariant* _tmp12_;
	GVariant* _tmp13_;
	g_return_if_fail (changed != NULL);
	_tmp0_ = G_VARIANT_TYPE_DICTIONARY;
	_tmp1_ = g_variant_lookup_value (changed, "Track", _tmp0_);
	track = _tmp1_;
	_tmp2_ = track;
	if (_tmp2_ != NULL) {
		gchar* title = NULL;
		gchar* artist = NULL;
		GVariant* _tmp3_;
		gchar* _tmp4_ = NULL;
		GVariant* _tmp5_;
		gchar* _tmp6_ = NULL;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp3_ = track;
		g_variant_lookup (_tmp3_, "Title", "s", &_tmp4_, NULL);
		_g_free0 (title);
		title = _tmp4_;
		_tmp5_ = track;
		g_variant_lookup (_tmp5_, "Artist", "s", &_tmp6_, NULL);
		_g_free0 (artist);
		artist = _tmp6_;
		_tmp7_ = title;
		sound_services_object_manager_set_current_track_title (self, _tmp7_);
		_tmp8_ = artist;
		sound_services_object_manager_set_current_track_artist (self, _tmp8_);
		_tmp9_ = title;
		_tmp10_ = artist;
		g_signal_emit (self, sound_services_object_manager_signals[SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_STATUS_CHANGED_SIGNAL], 0, "", _tmp9_, _tmp10_);
		_g_free0 (artist);
		_g_free0 (title);
	}
	_tmp11_ = G_VARIANT_TYPE_STRING;
	_tmp12_ = g_variant_lookup_value (changed, "Status", _tmp11_);
	status_v = _tmp12_;
	_tmp13_ = status_v;
	if (_tmp13_ != NULL) {
		gchar* status = NULL;
		GVariant* _tmp14_;
		gchar* _tmp15_ = NULL;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		_tmp14_ = status_v;
		g_variant_get (_tmp14_, "s", &_tmp15_, NULL);
		_g_free0 (status);
		status = _tmp15_;
		_tmp16_ = status;
		sound_services_object_manager_set_media_player_status (self, _tmp16_);
		_tmp17_ = status;
		g_signal_emit (self, sound_services_object_manager_signals[SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_STATUS_CHANGED_SIGNAL], 0, _tmp17_, "", "");
		_g_free0 (status);
	}
	_g_variant_unref0 (status_v);
	_g_variant_unref0 (track);
}

static void
____lambda11__g_dbus_proxy_g_properties_changed (GDBusProxy* _sender,
                                                 GVariant* changed_properties,
                                                 gchar** invalidated_properties,
                                                 gpointer self)
{
	___lambda11_ ((SoundServicesObjectManager*) self, changed_properties, invalidated_properties);
}

static void
sound_services_object_manager_on_interface_added (SoundServicesObjectManager* self,
                                                  GDBusObject* object,
                                                  GDBusInterface* iface)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	g_return_if_fail (iface != NULL);
	if (SOUND_SERVICES_IS_MEDIA_PLAYER (iface)) {
		SoundServicesMediaPlayer* media_player = NULL;
		GDBusObject* device_object = NULL;
		GDBusObjectManagerClient* _tmp0_;
		SoundServicesMediaPlayer* _tmp1_;
		char* _tmp2_;
		char* _tmp3_;
		char* _tmp4_;
		GDBusObject* _tmp5_;
		GDBusObject* _tmp6_;
		SoundServicesDevice* cur_device = NULL;
		GDBusObject* _tmp7_;
		GDBusInterface* _tmp8_;
		SoundServicesMediaPlayer* _tmp9_;
		GHashTable* _tmp10_;
		GHashTable* _tmp11_;
		GHashTable* _tmp12_;
		gconstpointer _tmp13_;
		const gchar* _tmp14_;
		SoundServicesMediaPlayer* _tmp15_;
		SoundServicesDevice* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		SoundServicesDevice* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		SoundServicesMediaPlayer* _tmp24_;
		media_player = G_TYPE_CHECK_INSTANCE_CAST (iface, SOUND_SERVICES_TYPE_MEDIA_PLAYER, SoundServicesMediaPlayer);
		sound_services_object_manager_set_has_object (self, TRUE);
		_tmp0_ = self->priv->object_manager;
		_tmp1_ = media_player;
		_tmp2_ = sound_services_media_player_get_device (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = g_dbus_object_manager_get_object ((GDBusObjectManager*) _tmp0_, (const gchar*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		device_object = _tmp6_;
		_tmp7_ = device_object;
		_tmp8_ = g_dbus_object_get_interface (_tmp7_, "org.bluez.Device1");
		cur_device = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, SOUND_SERVICES_TYPE_DEVICE, SoundServicesDevice);
		_tmp9_ = media_player;
		_tmp10_ = sound_services_media_player_get_track (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = _tmp11_;
		_tmp13_ = g_hash_table_lookup (_tmp12_, "Title");
		_tmp14_ = g_variant_get_string ((GVariant*) _tmp13_, NULL);
		sound_services_object_manager_set_media_player_status (self, _tmp14_);
		_g_hash_table_unref0 (_tmp12_);
		_tmp15_ = media_player;
		_tmp16_ = cur_device;
		_tmp17_ = sound_services_device_get_name (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = _tmp18_;
		_tmp20_ = cur_device;
		_tmp21_ = sound_services_device_get_icon (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = _tmp22_;
		g_signal_emit (self, sound_services_object_manager_signals[SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_ADDED_SIGNAL], 0, _tmp15_, _tmp19_, _tmp23_);
		_g_free0 (_tmp23_);
		_g_free0 (_tmp19_);
		_tmp24_ = media_player;
		g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, g_dbus_proxy_get_type (), GDBusProxy), "g-properties-changed", (GCallback) ____lambda11__g_dbus_proxy_g_properties_changed, self, 0);
		_g_object_unref0 (cur_device);
		_g_object_unref0 (device_object);
	}
}

static void
sound_services_object_manager_on_interface_removed (SoundServicesObjectManager* self,
                                                    GDBusObject* object,
                                                    GDBusInterface* iface)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	g_return_if_fail (iface != NULL);
	if (SOUND_SERVICES_IS_MEDIA_PLAYER (iface)) {
		GeeCollection* _tmp0_;
		GeeCollection* _tmp1_;
		gboolean _tmp2_;
		gboolean _tmp3_;
		g_signal_emit (self, sound_services_object_manager_signals[SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_REMOVED_SIGNAL], 0, G_TYPE_CHECK_INSTANCE_CAST (iface, SOUND_SERVICES_TYPE_MEDIA_PLAYER, SoundServicesMediaPlayer));
		_tmp0_ = sound_services_object_manager_get_media_players (self);
		_tmp1_ = _tmp0_;
		_tmp2_ = gee_collection_get_is_empty (_tmp1_);
		_tmp3_ = _tmp2_;
		sound_services_object_manager_set_has_object (self, !_tmp3_);
		_g_object_unref0 (_tmp1_);
	}
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		SoundServicesObjectManager* self;
		self = _data14_->self;
		_g_object_unref0 (_data14_->players);
		_g_object_unref0 (self);
		g_slice_free (Block14Data, _data14_);
	}
}

static void
__lambda12_ (Block14Data* _data14_,
             GDBusObject* object)
{
	SoundServicesObjectManager* self;
	GDBusInterface* iface = NULL;
	GDBusInterface* _tmp0_;
	GDBusInterface* _tmp1_;
	GeeLinkedList* _tmp2_;
	GDBusInterface* _tmp3_;
	self = _data14_->self;
	g_return_if_fail (object != NULL);
	_tmp0_ = g_dbus_object_get_interface (object, "org.bluez.MediaPlayer1");
	iface = _tmp0_;
	_tmp1_ = iface;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (iface);
		return;
	}
	_tmp2_ = _data14_->players;
	_tmp3_ = iface;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp2_, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, SOUND_SERVICES_TYPE_MEDIA_PLAYER, SoundServicesMediaPlayer));
	_g_object_unref0 (iface);
}

static void
___lambda12__gfunc (gconstpointer data,
                    gpointer self)
{
	__lambda12_ (self, (GDBusObject*) data);
}

GeeCollection*
sound_services_object_manager_get_media_players (SoundServicesObjectManager* self)
{
	Block14Data* _data14_;
	GeeLinkedList* _tmp0_;
	GDBusObjectManagerClient* _tmp1_;
	GList* _tmp2_;
	GList* _tmp3_;
	GeeLinkedList* _tmp4_;
	GeeCollection* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data14_ = g_slice_new0 (Block14Data);
	_data14_->_ref_count_ = 1;
	_data14_->self = g_object_ref (self);
	_tmp0_ = gee_linked_list_new (SOUND_SERVICES_TYPE_MEDIA_PLAYER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_data14_->players = _tmp0_;
	_tmp1_ = self->priv->object_manager;
	_tmp2_ = g_dbus_object_manager_get_objects ((GDBusObjectManager*) _tmp1_);
	_tmp3_ = _tmp2_;
	g_list_foreach (_tmp3_, ___lambda12__gfunc, _data14_);
	(_tmp3_ == NULL) ? NULL : (_tmp3_ = (_g_list_free__g_object_unref0_ (_tmp3_), NULL));
	_tmp4_ = _data14_->players;
	_data14_->players = NULL;
	result = (GeeCollection*) _tmp4_;
	block14_data_unref (_data14_);
	_data14_ = NULL;
	return result;
}

gboolean
sound_services_object_manager_get_has_object (SoundServicesObjectManager* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_has_object;
	return result;
}

static void
sound_services_object_manager_set_has_object (SoundServicesObjectManager* self,
                                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sound_services_object_manager_get_has_object (self);
	if (old_value != value) {
		self->priv->_has_object = value;
		g_object_notify_by_pspec ((GObject *) self, sound_services_object_manager_properties[SOUND_SERVICES_OBJECT_MANAGER_HAS_OBJECT_PROPERTY]);
	}
}

const gchar*
sound_services_object_manager_get_media_player_status (SoundServicesObjectManager* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_media_player_status;
	result = _tmp0_;
	return result;
}

static void
sound_services_object_manager_set_media_player_status (SoundServicesObjectManager* self,
                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = sound_services_object_manager_get_media_player_status (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_media_player_status);
		self->priv->_media_player_status = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, sound_services_object_manager_properties[SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_STATUS_PROPERTY]);
	}
}

const gchar*
sound_services_object_manager_get_current_track_title (SoundServicesObjectManager* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_current_track_title;
	result = _tmp0_;
	return result;
}

static void
sound_services_object_manager_set_current_track_title (SoundServicesObjectManager* self,
                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = sound_services_object_manager_get_current_track_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_current_track_title);
		self->priv->_current_track_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, sound_services_object_manager_properties[SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_TITLE_PROPERTY]);
	}
}

const gchar*
sound_services_object_manager_get_current_track_artist (SoundServicesObjectManager* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_current_track_artist;
	result = _tmp0_;
	return result;
}

static void
sound_services_object_manager_set_current_track_artist (SoundServicesObjectManager* self,
                                                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = sound_services_object_manager_get_current_track_artist (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_current_track_artist);
		self->priv->_current_track_artist = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, sound_services_object_manager_properties[SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_ARTIST_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_VOID__BOOLEAN_BOOLEAN (GClosure * closure,
                                               GValue * return_value,
                                               guint n_param_values,
                                               const GValue * param_values,
                                               gpointer invocation_hint,
                                               gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__BOOLEAN_BOOLEAN) (gpointer data1, gboolean arg_1, gboolean arg_2, gpointer data2);
	register GMarshalFunc_VOID__BOOLEAN_BOOLEAN callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__BOOLEAN_BOOLEAN) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_boolean (param_values + 1), g_value_get_boolean (param_values + 2), data2);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_STRING_STRING (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_STRING_STRING) (gpointer data1, gpointer arg_1, const char* arg_2, const char* arg_3, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_STRING_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_string (param_values + 2), g_value_get_string (param_values + 3), data2);
}

static void
g_cclosure_user_marshal_VOID__STRING_STRING_STRING (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING) (gpointer data1, const char* arg_1, const char* arg_2, const char* arg_3, gpointer data2);
	register GMarshalFunc_VOID__STRING_STRING_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), g_value_get_string (param_values + 3), data2);
}

static GObject *
sound_services_object_manager_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SoundServicesObjectManager * self;
	parent_class = G_OBJECT_CLASS (sound_services_object_manager_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SOUND_SERVICES_TYPE_OBJECT_MANAGER, SoundServicesObjectManager);
	sound_services_object_manager_create_manager (self, NULL, NULL);
	return obj;
}

static void
sound_services_object_manager_class_init (SoundServicesObjectManagerClass * klass,
                                          gpointer klass_data)
{
	sound_services_object_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SoundServicesObjectManager_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_sound_services_object_manager_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_sound_services_object_manager_set_property;
	G_OBJECT_CLASS (klass)->constructor = sound_services_object_manager_constructor;
	G_OBJECT_CLASS (klass)->finalize = sound_services_object_manager_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SOUND_SERVICES_OBJECT_MANAGER_HAS_OBJECT_PROPERTY, sound_services_object_manager_properties[SOUND_SERVICES_OBJECT_MANAGER_HAS_OBJECT_PROPERTY] = g_param_spec_boolean ("has-object", "has-object", "has-object", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_STATUS_PROPERTY, sound_services_object_manager_properties[SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_STATUS_PROPERTY] = g_param_spec_string ("media-player-status", "media-player-status", "media-player-status", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_TITLE_PROPERTY, sound_services_object_manager_properties[SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_TITLE_PROPERTY] = g_param_spec_string ("current-track-title", "current-track-title", "current-track-title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_ARTIST_PROPERTY, sound_services_object_manager_properties[SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_ARTIST_PROPERTY] = g_param_spec_string ("current-track-artist", "current-track-artist", "current-track-artist", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	sound_services_object_manager_signals[SOUND_SERVICES_OBJECT_MANAGER_GLOBAL_STATE_CHANGED_SIGNAL] = g_signal_new ("global-state-changed", SOUND_SERVICES_TYPE_OBJECT_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOOLEAN_BOOLEAN, G_TYPE_NONE, 2, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
	sound_services_object_manager_signals[SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_ADDED_SIGNAL] = g_signal_new ("media-player-added", SOUND_SERVICES_TYPE_OBJECT_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_STRING_STRING, G_TYPE_NONE, 3, SOUND_SERVICES_TYPE_MEDIA_PLAYER, G_TYPE_STRING, G_TYPE_STRING);
	sound_services_object_manager_signals[SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_REMOVED_SIGNAL] = g_signal_new ("media-player-removed", SOUND_SERVICES_TYPE_OBJECT_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SOUND_SERVICES_TYPE_MEDIA_PLAYER);
	sound_services_object_manager_signals[SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_STATUS_CHANGED_SIGNAL] = g_signal_new ("media-player-status-changed", SOUND_SERVICES_TYPE_OBJECT_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
}

static void
sound_services_object_manager_instance_init (SoundServicesObjectManager * self,
                                             gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	self->priv = sound_services_object_manager_get_instance_private (self);
	self->priv->_has_object = FALSE;
	_tmp0_ = g_strdup ("stopped");
	self->priv->_media_player_status = _tmp0_;
	_tmp1_ = g_strdup ("Not playing");
	self->priv->_current_track_title = _tmp1_;
}

static void
sound_services_object_manager_finalize (GObject * obj)
{
	SoundServicesObjectManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SOUND_SERVICES_TYPE_OBJECT_MANAGER, SoundServicesObjectManager);
	_g_free0 (self->priv->_media_player_status);
	_g_free0 (self->priv->_current_track_title);
	_g_free0 (self->priv->_current_track_artist);
	_g_object_unref0 (self->priv->object_manager);
	G_OBJECT_CLASS (sound_services_object_manager_parent_class)->finalize (obj);
}

static GType
sound_services_object_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SoundServicesObjectManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sound_services_object_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SoundServicesObjectManager), 0, (GInstanceInitFunc) sound_services_object_manager_instance_init, NULL };
	GType sound_services_object_manager_type_id;
	sound_services_object_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "SoundServicesObjectManager", &g_define_type_info, 0);
	SoundServicesObjectManager_private_offset = g_type_add_instance_private (sound_services_object_manager_type_id, sizeof (SoundServicesObjectManagerPrivate));
	return sound_services_object_manager_type_id;
}

GType
sound_services_object_manager_get_type (void)
{
	static volatile gsize sound_services_object_manager_type_id__once = 0;
	if (g_once_init_enter (&sound_services_object_manager_type_id__once)) {
		GType sound_services_object_manager_type_id;
		sound_services_object_manager_type_id = sound_services_object_manager_get_type_once ();
		g_once_init_leave (&sound_services_object_manager_type_id__once, sound_services_object_manager_type_id);
	}
	return sound_services_object_manager_type_id__once;
}

static void
_vala_sound_services_object_manager_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	SoundServicesObjectManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOUND_SERVICES_TYPE_OBJECT_MANAGER, SoundServicesObjectManager);
	switch (property_id) {
		case SOUND_SERVICES_OBJECT_MANAGER_HAS_OBJECT_PROPERTY:
		g_value_set_boolean (value, sound_services_object_manager_get_has_object (self));
		break;
		case SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_STATUS_PROPERTY:
		g_value_set_string (value, sound_services_object_manager_get_media_player_status (self));
		break;
		case SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_TITLE_PROPERTY:
		g_value_set_string (value, sound_services_object_manager_get_current_track_title (self));
		break;
		case SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_ARTIST_PROPERTY:
		g_value_set_string (value, sound_services_object_manager_get_current_track_artist (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_sound_services_object_manager_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	SoundServicesObjectManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOUND_SERVICES_TYPE_OBJECT_MANAGER, SoundServicesObjectManager);
	switch (property_id) {
		case SOUND_SERVICES_OBJECT_MANAGER_HAS_OBJECT_PROPERTY:
		sound_services_object_manager_set_has_object (self, g_value_get_boolean (value));
		break;
		case SOUND_SERVICES_OBJECT_MANAGER_MEDIA_PLAYER_STATUS_PROPERTY:
		sound_services_object_manager_set_media_player_status (self, g_value_get_string (value));
		break;
		case SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_TITLE_PROPERTY:
		sound_services_object_manager_set_current_track_title (self, g_value_get_string (value));
		break;
		case SOUND_SERVICES_OBJECT_MANAGER_CURRENT_TRACK_ARTIST_PROPERTY:
		sound_services_object_manager_set_current_track_artist (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

