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

/*
 * Copyright (C) 2009-2012 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library 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
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <fsobasics.h>
#include <freesmartphone.h>
#include <fsoframework.h>
#include <fsodevice.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gio/gio.h>


#define HARDWARE_TYPE_AUDIO_MANAGER (hardware_audio_manager_get_type ())
#define HARDWARE_AUDIO_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HARDWARE_TYPE_AUDIO_MANAGER, HardwareAudioManager))
#define HARDWARE_AUDIO_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HARDWARE_TYPE_AUDIO_MANAGER, HardwareAudioManagerClass))
#define HARDWARE_IS_AUDIO_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HARDWARE_TYPE_AUDIO_MANAGER))
#define HARDWARE_IS_AUDIO_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HARDWARE_TYPE_AUDIO_MANAGER))
#define HARDWARE_AUDIO_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HARDWARE_TYPE_AUDIO_MANAGER, HardwareAudioManagerClass))

typedef struct _HardwareAudioManager HardwareAudioManager;
typedef struct _HardwareAudioManagerClass HardwareAudioManagerClass;
typedef struct _HardwareAudioManagerPrivate HardwareAudioManagerPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef struct _HardwareAudioManagerGetInfoData HardwareAudioManagerGetInfoData;
typedef struct _HardwareAudioManagerGetAvailableScenariosData HardwareAudioManagerGetAvailableScenariosData;
typedef struct _HardwareAudioManagerGetScenarioData HardwareAudioManagerGetScenarioData;
typedef struct _HardwareAudioManagerPullScenarioData HardwareAudioManagerPullScenarioData;
typedef struct _HardwareAudioManagerPushScenarioData HardwareAudioManagerPushScenarioData;
typedef struct _HardwareAudioManagerSetScenarioData HardwareAudioManagerSetScenarioData;
typedef struct _HardwareAudioManagerSaveScenarioData HardwareAudioManagerSaveScenarioData;
typedef struct _HardwareAudioManagerGetVolumeData HardwareAudioManagerGetVolumeData;
typedef struct _HardwareAudioManagerSetVolumeData HardwareAudioManagerSetVolumeData;
typedef struct _HardwareAudioManagerPlaySoundData HardwareAudioManagerPlaySoundData;
typedef struct _HardwareAudioManagerStopAllSoundsData HardwareAudioManagerStopAllSoundsData;
typedef struct _HardwareAudioManagerStopSoundData HardwareAudioManagerStopSoundData;

struct _HardwareAudioManager {
	FsoFrameworkAbstractObject parent_instance;
	HardwareAudioManagerPrivate * priv;
};

struct _HardwareAudioManagerClass {
	FsoFrameworkAbstractObjectClass parent_class;
};

struct _HardwareAudioManagerPrivate {
	FsoFrameworkSubsystem* subsystem;
	FsoDeviceAudioRouter* router;
	gchar* routertype;
	GeeHashMap* players;
	gchar* playertypes;
};

struct _HardwareAudioManagerGetInfoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	GHashTable* result;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* dict;
};

struct _HardwareAudioManagerGetAvailableScenariosData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	gchar** result;
	gint result_length1;
	FsoDeviceAudioRouter* _tmp0_;
	gint _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
};

struct _HardwareAudioManagerGetScenarioData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	gchar* result;
	FsoDeviceAudioRouter* _tmp0_;
	gchar* _tmp1_;
};

struct _HardwareAudioManagerPullScenarioData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	gchar* result;
	FsoDeviceAudioRouter* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GError * _inner_error_;
};

struct _HardwareAudioManagerPushScenarioData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	gchar* scenario;
	FsoDeviceAudioRouter* _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	GError* _tmp3_;
	FsoDeviceAudioRouter* _tmp4_;
	const gchar* _tmp5_;
	GError * _inner_error_;
};

struct _HardwareAudioManagerSetScenarioData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	gchar* scenario;
	FsoDeviceAudioRouter* _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	GError* _tmp3_;
	FsoDeviceAudioRouter* _tmp4_;
	const gchar* _tmp5_;
	GError * _inner_error_;
};

struct _HardwareAudioManagerSaveScenarioData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	gchar* scenario;
	FsoDeviceAudioRouter* _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	GError* _tmp3_;
	FsoDeviceAudioRouter* _tmp4_;
	const gchar* _tmp5_;
	GError * _inner_error_;
};

struct _HardwareAudioManagerGetVolumeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	guint8 result;
	FsoDeviceAudioRouter* _tmp0_;
	guint8 _tmp1_;
	guint8 _tmp2_;
	GError * _inner_error_;
};

struct _HardwareAudioManagerSetVolumeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	guint8 volume;
	FsoDeviceAudioRouter* _tmp0_;
	guint8 _tmp1_;
	GError * _inner_error_;
};

struct _HardwareAudioManagerPlaySoundData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	gchar* name;
	gint loop;
	gint length;
	const gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gchar** parts;
	gint parts_length1;
	gint _parts_size_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	GError* _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar** _tmp6_;
	gint _tmp6__length1;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* extension;
	GeeHashMap* _tmp9_;
	const gchar* _tmp10_;
	gpointer _tmp11_;
	FsoDeviceAudioPlayer* player;
	FsoDeviceAudioPlayer* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	GError* _tmp17_;
	GError* _tmp18_;
	FsoDeviceAudioPlayer* _tmp19_;
	const gchar* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	GError * _inner_error_;
};

struct _HardwareAudioManagerStopAllSoundsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	GeeHashMap* _tmp0_;
	GeeCollection* _tmp1_;
	GeeCollection* _tmp2_;
	GeeCollection* _tmp3_;
	GeeIterator* _tmp4_;
	GeeIterator* _tmp5_;
	GeeIterator* _player_it;
	GeeIterator* _tmp6_;
	gboolean _tmp7_;
	GeeIterator* _tmp8_;
	gpointer _tmp9_;
	FsoDeviceAudioPlayer* player;
	FsoDeviceAudioPlayer* _tmp10_;
};

struct _HardwareAudioManagerStopSoundData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	HardwareAudioManager* self;
	gchar* name;
	const gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gchar** parts;
	gint parts_length1;
	gint _parts_size_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	GError* _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar** _tmp6_;
	gint _tmp6__length1;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* extension;
	GeeHashMap* _tmp9_;
	const gchar* _tmp10_;
	gpointer _tmp11_;
	FsoDeviceAudioPlayer* player;
	FsoDeviceAudioPlayer* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	GError* _tmp17_;
	GError* _tmp18_;
	FsoDeviceAudioPlayer* _tmp19_;
	const gchar* _tmp20_;
	GError * _inner_error_;
};


static gpointer hardware_audio_manager_parent_class = NULL;
static FreeSmartphoneDeviceAudioIface* hardware_audio_manager_free_smartphone_device_audio_parent_iface = NULL;
static FreeSmartphoneInfoIface* hardware_audio_manager_free_smartphone_info_parent_iface = NULL;
static GType hardware_audio_manager_type_id = 0;
extern HardwareAudioManager* instance;
HardwareAudioManager* instance = NULL;

GType hardware_audio_manager_get_type (void) G_GNUC_CONST;
GType hardware_audio_manager_register_type (GTypeModule * module);
#define HARDWARE_AUDIO_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HARDWARE_TYPE_AUDIO_MANAGER, HardwareAudioManagerPrivate))
enum  {
	HARDWARE_AUDIO_MANAGER_DUMMY_PROPERTY
};
#define HARDWARE_AUDIO_MANAGER_MODULE_NAME "fsodevice.audio"
HardwareAudioManager* hardware_audio_manager_new (FsoFrameworkSubsystem* subsystem);
HardwareAudioManager* hardware_audio_manager_construct (GType object_type, FsoFrameworkSubsystem* subsystem);
static gchar* hardware_audio_manager_real_repr (FsoFrameworkAbstractObject* base);
static void hardware_audio_manager_real_get_info_data_free (gpointer _data);
static void hardware_audio_manager_real_get_info (FreeSmartphoneInfo* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_get_info_co (HardwareAudioManagerGetInfoData* _data_);
static void _g_free0_ (gpointer var);
static void _g_variant_unref0_ (gpointer var);
static void hardware_audio_manager_real_get_available_scenarios_data_free (gpointer _data);
static void hardware_audio_manager_real_get_available_scenarios (FreeSmartphoneDeviceAudio* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_get_available_scenarios_co (HardwareAudioManagerGetAvailableScenariosData* _data_);
static void hardware_audio_manager_real_get_scenario_data_free (gpointer _data);
static void hardware_audio_manager_real_get_scenario (FreeSmartphoneDeviceAudio* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_get_scenario_co (HardwareAudioManagerGetScenarioData* _data_);
static void hardware_audio_manager_real_pull_scenario_data_free (gpointer _data);
static void hardware_audio_manager_real_pull_scenario (FreeSmartphoneDeviceAudio* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_pull_scenario_co (HardwareAudioManagerPullScenarioData* _data_);
static void hardware_audio_manager_real_push_scenario_data_free (gpointer _data);
static void hardware_audio_manager_real_push_scenario (FreeSmartphoneDeviceAudio* base, const gchar* scenario, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_push_scenario_co (HardwareAudioManagerPushScenarioData* _data_);
static void hardware_audio_manager_real_set_scenario_data_free (gpointer _data);
static void hardware_audio_manager_real_set_scenario (FreeSmartphoneDeviceAudio* base, const gchar* scenario, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_set_scenario_co (HardwareAudioManagerSetScenarioData* _data_);
static void hardware_audio_manager_real_save_scenario_data_free (gpointer _data);
static void hardware_audio_manager_real_save_scenario (FreeSmartphoneDeviceAudio* base, const gchar* scenario, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_save_scenario_co (HardwareAudioManagerSaveScenarioData* _data_);
static void hardware_audio_manager_real_get_volume_data_free (gpointer _data);
static void hardware_audio_manager_real_get_volume (FreeSmartphoneDeviceAudio* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_get_volume_co (HardwareAudioManagerGetVolumeData* _data_);
static void hardware_audio_manager_real_set_volume_data_free (gpointer _data);
static void hardware_audio_manager_real_set_volume (FreeSmartphoneDeviceAudio* base, guint8 volume, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_set_volume_co (HardwareAudioManagerSetVolumeData* _data_);
static void hardware_audio_manager_real_play_sound_data_free (gpointer _data);
static void hardware_audio_manager_real_play_sound (FreeSmartphoneDeviceAudio* base, const gchar* name, gint loop, gint length, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_play_sound_co (HardwareAudioManagerPlaySoundData* _data_);
static void hardware_audio_manager_play_sound_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void hardware_audio_manager_real_stop_all_sounds_data_free (gpointer _data);
static void hardware_audio_manager_real_stop_all_sounds (FreeSmartphoneDeviceAudio* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_stop_all_sounds_co (HardwareAudioManagerStopAllSoundsData* _data_);
static void hardware_audio_manager_stop_all_sounds_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void hardware_audio_manager_real_stop_sound_data_free (gpointer _data);
static void hardware_audio_manager_real_stop_sound (FreeSmartphoneDeviceAudio* base, const gchar* name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean hardware_audio_manager_real_stop_sound_co (HardwareAudioManagerStopSoundData* _data_);
static void hardware_audio_manager_stop_sound_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void hardware_audio_manager_finalize (GObject* obj);
gchar* fso_factory_function (FsoFrameworkSubsystem* subsystem, GError** error);
void fso_register_function (GTypeModule* module);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


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


static const gchar* string_to_string (const gchar* self) {
	const gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}


HardwareAudioManager* hardware_audio_manager_construct (GType object_type, FsoFrameworkSubsystem* subsystem) {
	HardwareAudioManager * self = NULL;
	FsoFrameworkSubsystem* _tmp0_;
	FsoFrameworkSubsystem* _tmp1_;
	FsoFrameworkSubsystem* _tmp2_;
	FsoFrameworkSubsystem* _tmp3_;
	GeeHashMap* _tmp4_;
	FsoFrameworkSmartKeyFile* _tmp5_;
	gchar** _tmp6_ = NULL;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gint _tmp8_ = 0;
	gchar** _tmp9_ = NULL;
	gchar** _tmp10_;
	gint _tmp10__length1;
	gchar** playernames;
	gint playernames_length1;
	gint _playernames_size_;
	gchar* _tmp11_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	GeeHashMap* _tmp77_;
	gint _tmp78_;
	gint _tmp79_;
	FsoFrameworkSmartKeyFile* _tmp90_;
	gchar* _tmp91_ = NULL;
	gchar* routername;
	gchar* _tmp92_;
	gchar* typename;
	const gchar* _tmp93_;
	const gchar* _tmp94_;
	GQuark _tmp96_ = 0U;
	static GQuark _tmp95_label0 = 0;
	static GQuark _tmp95_label1 = 0;
	const gchar* _tmp100_;
	GType _tmp101_ = 0UL;
	GType routertyp;
	GType _tmp102_;
	FsoFrameworkLogger* _tmp115_;
	g_return_val_if_fail (subsystem != NULL, NULL);
	self = (HardwareAudioManager*) fso_framework_abstract_object_construct (object_type);
	_tmp0_ = subsystem;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->subsystem);
	self->priv->subsystem = _tmp1_;
	_tmp2_ = subsystem;
	fso_framework_subsystem_registerObjectForService (_tmp2_, FREE_SMARTPHONE_DEVICE_TYPE_AUDIO, (GBoxedCopyFunc) g_object_ref, g_object_unref, FSO_FRAMEWORK_DEVICE_ServiceDBusName, FSO_FRAMEWORK_DEVICE_AudioServicePath, (FreeSmartphoneDeviceAudio*) self);
	_tmp3_ = subsystem;
	fso_framework_subsystem_registerObjectForService (_tmp3_, FREE_SMARTPHONE_TYPE_INFO, (GBoxedCopyFunc) g_object_ref, g_object_unref, FSO_FRAMEWORK_DEVICE_ServiceDBusName, FSO_FRAMEWORK_DEVICE_AudioServicePath, (FreeSmartphoneInfo*) self);
	_tmp4_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FSO_DEVICE_TYPE_AUDIO_PLAYER, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->players);
	self->priv->players = _tmp4_;
	_tmp5_ = ((FsoFrameworkAbstractObject*) self)->config;
	_tmp6_ = g_new0 (gchar*, 0 + 1);
	_tmp7_ = _tmp6_;
	_tmp7__length1 = 0;
	_tmp9_ = fso_framework_smart_key_file_stringListValue (_tmp5_, HARDWARE_AUDIO_MANAGER_MODULE_NAME, "player_type", _tmp7_, 0, &_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp10__length1 = _tmp8_;
	_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
	playernames = _tmp10_;
	playernames_length1 = _tmp10__length1;
	_playernames_size_ = playernames_length1;
	_tmp11_ = g_strdup ("");
	_g_free0 (self->priv->playertypes);
	self->priv->playertypes = _tmp11_;
	_tmp12_ = playernames;
	_tmp12__length1 = playernames_length1;
	{
		gchar** playername_collection = NULL;
		gint playername_collection_length1 = 0;
		gint _playername_collection_size_ = 0;
		gint playername_it = 0;
		playername_collection = _tmp12_;
		playername_collection_length1 = _tmp12__length1;
		for (playername_it = 0; playername_it < _tmp12__length1; playername_it = playername_it + 1) {
			gchar* _tmp13_;
			gchar* playername = NULL;
			_tmp13_ = g_strdup (playername_collection[playername_it]);
			playername = _tmp13_;
			{
				gchar* _tmp14_;
				gchar* typename;
				const gchar* _tmp15_;
				const gchar* _tmp16_;
				GQuark _tmp18_ = 0U;
				static GQuark _tmp17_label0 = 0;
				static GQuark _tmp17_label1 = 0;
				static GQuark _tmp17_label2 = 0;
				const gchar* _tmp23_;
				GType _tmp24_ = 0UL;
				GType playertyp;
				GType _tmp25_;
				_tmp14_ = g_strdup ("");
				typename = _tmp14_;
				_tmp15_ = playername;
				_tmp16_ = _tmp15_;
				_tmp18_ = (NULL == _tmp16_) ? 0 : g_quark_from_string (_tmp16_);
				if (_tmp18_ == ((0 != _tmp17_label0) ? _tmp17_label0 : (_tmp17_label0 = g_quark_from_static_string ("alsa")))) {
					switch (0) {
						default:
						{
							gchar* _tmp19_;
							_tmp19_ = g_strdup ("PlayerLibAlsa");
							_g_free0 (typename);
							typename = _tmp19_;
							break;
						}
					}
				} else if (_tmp18_ == ((0 != _tmp17_label1) ? _tmp17_label1 : (_tmp17_label1 = g_quark_from_static_string ("canberra")))) {
					switch (0) {
						default:
						{
							gchar* _tmp20_;
							_tmp20_ = g_strdup ("PlayerLibCanberra");
							_g_free0 (typename);
							typename = _tmp20_;
							break;
						}
					}
				} else if (_tmp18_ == ((0 != _tmp17_label2) ? _tmp17_label2 : (_tmp17_label2 = g_quark_from_static_string ("gstreamer")))) {
					switch (0) {
						default:
						{
							gchar* _tmp21_;
							_tmp21_ = g_strdup ("PlayerGstreamer");
							_g_free0 (typename);
							typename = _tmp21_;
							break;
						}
					}
				} else {
					switch (0) {
						default:
						{
							gchar* _tmp22_;
							_tmp22_ = g_strdup ("PlayerUnknown");
							_g_free0 (typename);
							typename = _tmp22_;
							break;
						}
					}
				}
				_tmp23_ = typename;
				_tmp24_ = g_type_from_name (_tmp23_);
				playertyp = _tmp24_;
				_tmp25_ = playertyp;
				if (_tmp25_ == G_TYPE_INVALID) {
					FsoFrameworkLogger* _tmp26_;
					const gchar* _tmp27_;
					const gchar* _tmp28_ = NULL;
					gchar* _tmp29_ = NULL;
					gchar* _tmp30_;
					_tmp26_ = ((FsoFrameworkAbstractObject*) self)->logger;
					_tmp27_ = typename;
					_tmp28_ = string_to_string (_tmp27_);
					_tmp29_ = g_strconcat ("Can't instanciate requested player type ", _tmp28_, NULL);
					_tmp30_ = _tmp29_;
					fso_framework_logger_warning (_tmp26_, _tmp30_);
					_g_free0 (_tmp30_);
				} else {
					GType _tmp31_;
					GObject* _tmp32_ = NULL;
					GObject* _tmp33_;
					FsoDeviceAudioPlayer* player;
					FsoDeviceAudioPlayer* _tmp34_;
					gint _tmp35_ = 0;
					gchar** _tmp36_ = NULL;
					const gchar* _tmp66_ = NULL;
					const gchar* _tmp67_;
					const gchar* _tmp68_;
					const gchar* _tmp69_;
					const gchar* _tmp70_ = NULL;
					gchar* _tmp71_ = NULL;
					gchar* _tmp72_;
					const gchar* _tmp73_;
					gchar* _tmp74_ = NULL;
					gchar* _tmp75_;
					gchar* _tmp76_;
					_tmp31_ = playertyp;
					_tmp32_ = g_object_new (_tmp31_, NULL);
					_tmp33_ = G_IS_INITIALLY_UNOWNED (_tmp32_) ? g_object_ref_sink (_tmp32_) : _tmp32_;
					player = FSO_DEVICE_AUDIO_PLAYER (_tmp33_);
					_tmp34_ = player;
					_tmp36_ = fso_device_audio_player_supportedFormats (_tmp34_, &_tmp35_);
					{
						gchar** format_collection = NULL;
						gint format_collection_length1 = 0;
						gint _format_collection_size_ = 0;
						gint format_it = 0;
						format_collection = _tmp36_;
						format_collection_length1 = _tmp35_;
						for (format_it = 0; format_it < _tmp35_; format_it = format_it + 1) {
							gchar* _tmp37_;
							gchar* format = NULL;
							_tmp37_ = g_strdup (format_collection[format_it]);
							format = _tmp37_;
							{
								GeeHashMap* _tmp38_;
								const gchar* _tmp39_;
								gpointer _tmp40_ = NULL;
								FsoDeviceAudioPlayer* _tmp41_;
								gboolean _tmp42_;
								_tmp38_ = self->priv->players;
								_tmp39_ = format;
								_tmp40_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp38_, _tmp39_);
								_tmp41_ = (FsoDeviceAudioPlayer*) _tmp40_;
								_tmp42_ = _tmp41_ == NULL;
								_g_object_unref0 (_tmp41_);
								if (_tmp42_) {
									FsoFrameworkLogger* _tmp43_;
									const gchar* _tmp44_;
									const gchar* _tmp45_ = NULL;
									const gchar* _tmp46_;
									const gchar* _tmp47_ = NULL;
									const gchar* _tmp48_;
									const gchar* _tmp49_ = NULL;
									gchar* _tmp50_ = NULL;
									gchar* _tmp51_;
									gboolean _tmp52_ = FALSE;
									GeeHashMap* _tmp53_;
									const gchar* _tmp54_;
									FsoDeviceAudioPlayer* _tmp55_;
									_tmp43_ = ((FsoFrameworkAbstractObject*) self)->logger;
									_tmp44_ = playername;
									_tmp45_ = string_to_string (_tmp44_);
									_tmp46_ = typename;
									_tmp47_ = string_to_string (_tmp46_);
									_tmp48_ = format;
									_tmp49_ = string_to_string (_tmp48_);
									_tmp50_ = g_strconcat ("Registering ", _tmp45_, " (", _tmp47_, ") to handle format ", _tmp49_, NULL);
									_tmp51_ = _tmp50_;
									_tmp52_ = fso_framework_logger_debug (_tmp43_, _tmp51_);
									g_assert (_tmp52_);
									_g_free0 (_tmp51_);
									_tmp53_ = self->priv->players;
									_tmp54_ = format;
									_tmp55_ = player;
									gee_abstract_map_set ((GeeAbstractMap*) _tmp53_, _tmp54_, _tmp55_);
								} else {
									FsoFrameworkLogger* _tmp56_;
									const gchar* _tmp57_;
									const gchar* _tmp58_ = NULL;
									const gchar* _tmp59_;
									const gchar* _tmp60_ = NULL;
									const gchar* _tmp61_;
									const gchar* _tmp62_ = NULL;
									gchar* _tmp63_ = NULL;
									gchar* _tmp64_;
									gboolean _tmp65_ = FALSE;
									_tmp56_ = ((FsoFrameworkAbstractObject*) self)->logger;
									_tmp57_ = playername;
									_tmp58_ = string_to_string (_tmp57_);
									_tmp59_ = typename;
									_tmp60_ = string_to_string (_tmp59_);
									_tmp61_ = format;
									_tmp62_ = string_to_string (_tmp61_);
									_tmp63_ = g_strconcat ("Can't register ", _tmp58_, " (", _tmp60_, ") to handle format ", _tmp62_, " (already handled)", NULL);
									_tmp64_ = _tmp63_;
									_tmp65_ = fso_framework_logger_debug (_tmp56_, _tmp64_);
									g_assert (_tmp65_);
									_g_free0 (_tmp64_);
								}
								_g_free0 (format);
							}
						}
						format_collection = (_vala_array_free (format_collection, format_collection_length1, (GDestroyNotify) g_free), NULL);
					}
					_tmp67_ = self->priv->playertypes;
					if (g_strcmp0 (_tmp67_, "") != 0) {
						_tmp66_ = ",";
					} else {
						_tmp66_ = "";
					}
					_tmp68_ = self->priv->playertypes;
					_tmp69_ = typename;
					_tmp70_ = string_to_string (_tmp69_);
					_tmp71_ = g_strconcat ("%s", _tmp70_, NULL);
					_tmp72_ = _tmp71_;
					_tmp73_ = _tmp66_;
					_tmp74_ = g_strdup_printf (_tmp72_, _tmp73_);
					_tmp75_ = _tmp74_;
					_tmp76_ = g_strconcat (_tmp68_, _tmp75_, NULL);
					_g_free0 (self->priv->playertypes);
					self->priv->playertypes = _tmp76_;
					_g_free0 (_tmp75_);
					_g_free0 (_tmp72_);
					_g_object_unref0 (player);
				}
				_g_free0 (typename);
				_g_free0 (playername);
			}
		}
	}
	_tmp77_ = self->priv->players;
	_tmp78_ = gee_abstract_map_get_size ((GeeMap*) _tmp77_);
	_tmp79_ = _tmp78_;
	if (_tmp79_ == 0) {
		FsoFrameworkLogger* _tmp80_;
		FsoDeviceNullPlayer* _tmp81_;
		FsoDeviceNullPlayer* player;
		FsoDeviceNullPlayer* _tmp82_;
		gint _tmp83_ = 0;
		gchar** _tmp84_ = NULL;
		_tmp80_ = ((FsoFrameworkAbstractObject*) self)->logger;
		fso_framework_logger_warning (_tmp80_, "No player_type requested or available; will not be able to play audio");
		_tmp81_ = fso_device_null_player_new ();
		player = _tmp81_;
		_tmp82_ = player;
		_tmp84_ = fso_device_audio_player_supportedFormats ((FsoDeviceAudioPlayer*) _tmp82_, &_tmp83_);
		{
			gchar** format_collection = NULL;
			gint format_collection_length1 = 0;
			gint _format_collection_size_ = 0;
			gint format_it = 0;
			format_collection = _tmp84_;
			format_collection_length1 = _tmp83_;
			for (format_it = 0; format_it < _tmp83_; format_it = format_it + 1) {
				gchar* _tmp85_;
				gchar* format = NULL;
				_tmp85_ = g_strdup (format_collection[format_it]);
				format = _tmp85_;
				{
					GeeHashMap* _tmp86_;
					const gchar* _tmp87_;
					FsoDeviceNullPlayer* _tmp88_;
					gchar* _tmp89_;
					_tmp86_ = self->priv->players;
					_tmp87_ = format;
					_tmp88_ = player;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp86_, _tmp87_, (FsoDeviceAudioPlayer*) _tmp88_);
					_tmp89_ = g_strdup ("NullPlayer");
					_g_free0 (self->priv->playertypes);
					self->priv->playertypes = _tmp89_;
					_g_free0 (format);
				}
			}
			format_collection = (_vala_array_free (format_collection, format_collection_length1, (GDestroyNotify) g_free), NULL);
		}
		_g_object_unref0 (player);
	}
	_tmp90_ = ((FsoFrameworkAbstractObject*) self)->config;
	_tmp91_ = fso_framework_smart_key_file_stringValue (_tmp90_, HARDWARE_AUDIO_MANAGER_MODULE_NAME, "router_type", "(not set)");
	routername = _tmp91_;
	_tmp92_ = g_strdup ("");
	typename = _tmp92_;
	_tmp93_ = routername;
	_tmp94_ = _tmp93_;
	_tmp96_ = (NULL == _tmp94_) ? 0 : g_quark_from_string (_tmp94_);
	if (_tmp96_ == ((0 != _tmp95_label0) ? _tmp95_label0 : (_tmp95_label0 = g_quark_from_static_string ("alsa")))) {
		switch (0) {
			default:
			{
				gchar* _tmp97_;
				_tmp97_ = g_strdup ("RouterLibAlsa");
				_g_free0 (typename);
				typename = _tmp97_;
				break;
			}
		}
	} else if (_tmp96_ == ((0 != _tmp95_label1) ? _tmp95_label1 : (_tmp95_label1 = g_quark_from_static_string ("qdsp5")))) {
		switch (0) {
			default:
			{
				gchar* _tmp98_;
				_tmp98_ = g_strdup ("RouterQdsp5");
				_g_free0 (typename);
				typename = _tmp98_;
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				gchar* _tmp99_;
				_tmp99_ = g_strdup ("NullRouter");
				_g_free0 (typename);
				typename = _tmp99_;
				break;
			}
		}
	}
	_tmp100_ = typename;
	_tmp101_ = g_type_from_name (_tmp100_);
	routertyp = _tmp101_;
	_tmp102_ = routertyp;
	if (_tmp102_ == G_TYPE_INVALID) {
		FsoFrameworkLogger* _tmp103_;
		const gchar* _tmp104_;
		const gchar* _tmp105_ = NULL;
		gchar* _tmp106_ = NULL;
		gchar* _tmp107_;
		FsoDeviceNullRouter* _tmp108_;
		gchar* _tmp109_;
		_tmp103_ = ((FsoFrameworkAbstractObject*) self)->logger;
		_tmp104_ = typename;
		_tmp105_ = string_to_string (_tmp104_);
		_tmp106_ = g_strconcat ("Can't instanciate requested router type ", _tmp105_, "; will not be able to route audio", NULL);
		_tmp107_ = _tmp106_;
		fso_framework_logger_warning (_tmp103_, _tmp107_);
		_g_free0 (_tmp107_);
		_tmp108_ = fso_device_null_router_new ();
		_g_object_unref0 (self->priv->router);
		self->priv->router = (FsoDeviceAudioRouter*) _tmp108_;
		_tmp109_ = g_strdup ("NullRouter");
		_g_free0 (self->priv->routertype);
		self->priv->routertype = _tmp109_;
	} else {
		GType _tmp110_;
		GObject* _tmp111_ = NULL;
		GObject* _tmp112_;
		const gchar* _tmp113_;
		gchar* _tmp114_;
		_tmp110_ = routertyp;
		_tmp111_ = g_object_new (_tmp110_, NULL);
		_tmp112_ = G_IS_INITIALLY_UNOWNED (_tmp111_) ? g_object_ref_sink (_tmp111_) : _tmp111_;
		_g_object_unref0 (self->priv->router);
		self->priv->router = FSO_DEVICE_AUDIO_ROUTER (_tmp112_);
		_tmp113_ = typename;
		_tmp114_ = g_strdup (_tmp113_);
		_g_free0 (self->priv->routertype);
		self->priv->routertype = _tmp114_;
	}
	_tmp115_ = ((FsoFrameworkAbstractObject*) self)->logger;
	fso_framework_logger_info (_tmp115_, "Created.");
	_g_free0 (typename);
	_g_free0 (routername);
	playernames = (_vala_array_free (playernames, playernames_length1, (GDestroyNotify) g_free), NULL);
	return self;
}


HardwareAudioManager* hardware_audio_manager_new (FsoFrameworkSubsystem* subsystem) {
	return hardware_audio_manager_construct (HARDWARE_TYPE_AUDIO_MANAGER, subsystem);
}


static gchar* hardware_audio_manager_real_repr (FsoFrameworkAbstractObject* base) {
	HardwareAudioManager * self;
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* pt;
	const gchar* _tmp5_ = NULL;
	const gchar* _tmp6_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* rt;
	const gchar* _tmp10_;
	const gchar* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	self = (HardwareAudioManager*) base;
	_tmp1_ = self->priv->playertypes;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->playertypes;
		_tmp0_ = _tmp2_;
	} else {
		_tmp0_ = "";
	}
	_tmp3_ = _tmp0_;
	_tmp4_ = g_strdup (_tmp3_);
	pt = _tmp4_;
	_tmp6_ = self->priv->routertype;
	if (_tmp6_ != NULL) {
		const gchar* _tmp7_;
		_tmp7_ = self->priv->routertype;
		_tmp5_ = _tmp7_;
	} else {
		_tmp5_ = "";
	}
	_tmp8_ = _tmp5_;
	_tmp9_ = g_strdup (_tmp8_);
	rt = _tmp9_;
	_tmp10_ = pt;
	_tmp11_ = string_to_string (_tmp10_);
	_tmp12_ = string_to_string (rt);
	_tmp13_ = g_strconcat ("<", _tmp11_, "|", _tmp12_, ">", NULL);
	result = _tmp13_;
	_g_free0 (rt);
	_g_free0 (pt);
	return result;
}


static void hardware_audio_manager_real_get_info_data_free (gpointer _data) {
	HardwareAudioManagerGetInfoData* _data_;
	_data_ = _data;
	_g_hash_table_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (HardwareAudioManagerGetInfoData, _data_);
}


static void hardware_audio_manager_real_get_info (FreeSmartphoneInfo* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerGetInfoData* _data_;
	HardwareAudioManager* _tmp0_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerGetInfoData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_get_info);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_get_info_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	hardware_audio_manager_real_get_info_co (_data_);
}


static GHashTable* hardware_audio_manager_real_get_info_finish (FreeSmartphoneInfo* base, GAsyncResult* _res_, GError** error) {
	GHashTable* result;
	HardwareAudioManagerGetInfoData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


static void _g_variant_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
}


static gboolean hardware_audio_manager_real_get_info_co (HardwareAudioManagerGetInfoData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_str_hash;
	_data_->_tmp1_ = g_str_equal;
	_data_->_tmp2_ = g_hash_table_new_full (_data_->_tmp0_, _data_->_tmp1_, _g_free0_, _g_variant_unref0_);
	_data_->dict = _data_->_tmp2_;
	_data_->result = _data_->dict;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_hash_table_unref0 (_data_->dict);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void hardware_audio_manager_real_get_available_scenarios_data_free (gpointer _data) {
	HardwareAudioManagerGetAvailableScenariosData* _data_;
	_data_ = _data;
	_data_->result = (_vala_array_free (_data_->result, _data_->result_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (HardwareAudioManagerGetAvailableScenariosData, _data_);
}


static void hardware_audio_manager_real_get_available_scenarios (FreeSmartphoneDeviceAudio* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerGetAvailableScenariosData* _data_;
	HardwareAudioManager* _tmp0_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerGetAvailableScenariosData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_get_available_scenarios);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_get_available_scenarios_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	hardware_audio_manager_real_get_available_scenarios_co (_data_);
}


static gchar** hardware_audio_manager_real_get_available_scenarios_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, int* result_length1, GError** error) {
	gchar** result;
	HardwareAudioManagerGetAvailableScenariosData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	*result_length1 = _data_->result_length1;
	_data_->result = NULL;
	return result;
}


static gboolean hardware_audio_manager_real_get_available_scenarios_co (HardwareAudioManagerGetAvailableScenariosData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->router;
	_data_->_tmp1_ = 0;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = fso_device_audio_router_availableScenarios (_data_->_tmp0_, &_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp3__length1 = _data_->_tmp1_;
	_data_->result_length1 = _data_->_tmp3__length1;
	_data_->result = _data_->_tmp3_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void hardware_audio_manager_real_get_scenario_data_free (gpointer _data) {
	HardwareAudioManagerGetScenarioData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (HardwareAudioManagerGetScenarioData, _data_);
}


static void hardware_audio_manager_real_get_scenario (FreeSmartphoneDeviceAudio* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerGetScenarioData* _data_;
	HardwareAudioManager* _tmp0_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerGetScenarioData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_get_scenario);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_get_scenario_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	hardware_audio_manager_real_get_scenario_co (_data_);
}


static gchar* hardware_audio_manager_real_get_scenario_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, GError** error) {
	gchar* result;
	HardwareAudioManagerGetScenarioData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static gboolean hardware_audio_manager_real_get_scenario_co (HardwareAudioManagerGetScenarioData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->router;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = fso_device_audio_router_currentScenario (_data_->_tmp0_);
	_data_->result = _data_->_tmp1_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void hardware_audio_manager_real_pull_scenario_data_free (gpointer _data) {
	HardwareAudioManagerPullScenarioData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (HardwareAudioManagerPullScenarioData, _data_);
}


static void hardware_audio_manager_real_pull_scenario (FreeSmartphoneDeviceAudio* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerPullScenarioData* _data_;
	HardwareAudioManager* _tmp0_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerPullScenarioData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_pull_scenario);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_pull_scenario_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	hardware_audio_manager_real_pull_scenario_co (_data_);
}


static gchar* hardware_audio_manager_real_pull_scenario_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, GError** error) {
	gchar* result;
	HardwareAudioManagerPullScenarioData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static gboolean hardware_audio_manager_real_pull_scenario_co (HardwareAudioManagerPullScenarioData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->router;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = fso_device_audio_router_pullScenario (_data_->_tmp0_, &_data_->_inner_error_);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_inner_error_ != NULL) {
		if ((((_data_->_inner_error_->domain == FREE_SMARTPHONE_DEVICE_AUDIO_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->result = _data_->_tmp2_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void hardware_audio_manager_real_push_scenario_data_free (gpointer _data) {
	HardwareAudioManagerPushScenarioData* _data_;
	_data_ = _data;
	_g_free0 (_data_->scenario);
	_g_object_unref0 (_data_->self);
	g_slice_free (HardwareAudioManagerPushScenarioData, _data_);
}


static void hardware_audio_manager_real_push_scenario (FreeSmartphoneDeviceAudio* base, const gchar* scenario, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerPushScenarioData* _data_;
	HardwareAudioManager* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerPushScenarioData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_push_scenario);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_push_scenario_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = scenario;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->scenario = _tmp2_;
	hardware_audio_manager_real_push_scenario_co (_data_);
}


static void hardware_audio_manager_real_push_scenario_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, GError** error) {
	HardwareAudioManagerPushScenarioData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean hardware_audio_manager_real_push_scenario_co (HardwareAudioManagerPushScenarioData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->router;
	_data_->_tmp1_ = _data_->scenario;
	_data_->_tmp2_ = FALSE;
	_data_->_tmp2_ = fso_device_audio_router_isScenarioAvailable (_data_->_tmp0_, _data_->_tmp1_);
	if (!_data_->_tmp2_) {
		_data_->_tmp3_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INVALID_PARAMETER, "Scenario not available");
		_data_->_inner_error_ = _data_->_tmp3_;
		if (((_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp4_ = _data_->self->priv->router;
	_data_->_tmp5_ = _data_->scenario;
	fso_device_audio_router_pushScenario (_data_->_tmp4_, _data_->_tmp5_);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void hardware_audio_manager_real_set_scenario_data_free (gpointer _data) {
	HardwareAudioManagerSetScenarioData* _data_;
	_data_ = _data;
	_g_free0 (_data_->scenario);
	_g_object_unref0 (_data_->self);
	g_slice_free (HardwareAudioManagerSetScenarioData, _data_);
}


static void hardware_audio_manager_real_set_scenario (FreeSmartphoneDeviceAudio* base, const gchar* scenario, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerSetScenarioData* _data_;
	HardwareAudioManager* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerSetScenarioData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_set_scenario);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_set_scenario_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = scenario;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->scenario = _tmp2_;
	hardware_audio_manager_real_set_scenario_co (_data_);
}


static void hardware_audio_manager_real_set_scenario_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, GError** error) {
	HardwareAudioManagerSetScenarioData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean hardware_audio_manager_real_set_scenario_co (HardwareAudioManagerSetScenarioData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->router;
	_data_->_tmp1_ = _data_->scenario;
	_data_->_tmp2_ = FALSE;
	_data_->_tmp2_ = fso_device_audio_router_isScenarioAvailable (_data_->_tmp0_, _data_->_tmp1_);
	if (!_data_->_tmp2_) {
		_data_->_tmp3_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INVALID_PARAMETER, "Scenario not available");
		_data_->_inner_error_ = _data_->_tmp3_;
		if (((_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp4_ = _data_->self->priv->router;
	_data_->_tmp5_ = _data_->scenario;
	fso_device_audio_router_setScenario (_data_->_tmp4_, _data_->_tmp5_);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void hardware_audio_manager_real_save_scenario_data_free (gpointer _data) {
	HardwareAudioManagerSaveScenarioData* _data_;
	_data_ = _data;
	_g_free0 (_data_->scenario);
	_g_object_unref0 (_data_->self);
	g_slice_free (HardwareAudioManagerSaveScenarioData, _data_);
}


static void hardware_audio_manager_real_save_scenario (FreeSmartphoneDeviceAudio* base, const gchar* scenario, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerSaveScenarioData* _data_;
	HardwareAudioManager* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerSaveScenarioData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_save_scenario);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_save_scenario_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = scenario;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->scenario = _tmp2_;
	hardware_audio_manager_real_save_scenario_co (_data_);
}


static void hardware_audio_manager_real_save_scenario_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, GError** error) {
	HardwareAudioManagerSaveScenarioData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean hardware_audio_manager_real_save_scenario_co (HardwareAudioManagerSaveScenarioData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->router;
	_data_->_tmp1_ = _data_->scenario;
	_data_->_tmp2_ = FALSE;
	_data_->_tmp2_ = fso_device_audio_router_isScenarioAvailable (_data_->_tmp0_, _data_->_tmp1_);
	if (!_data_->_tmp2_) {
		_data_->_tmp3_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INVALID_PARAMETER, "Scenario not available");
		_data_->_inner_error_ = _data_->_tmp3_;
		if (((_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp4_ = _data_->self->priv->router;
	_data_->_tmp5_ = _data_->scenario;
	fso_device_audio_router_saveScenario (_data_->_tmp4_, _data_->_tmp5_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (((_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void hardware_audio_manager_real_get_volume (FreeSmartphoneDeviceAudio* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerGetVolumeData* _data_;
	HardwareAudioManager* _tmp0_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerGetVolumeData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_get_volume);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_get_volume_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	hardware_audio_manager_real_get_volume_co (_data_);
}


static guint8 hardware_audio_manager_real_get_volume_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, GError** error) {
	guint8 result;
	HardwareAudioManagerGetVolumeData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return 0U;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	return result;
}


static gboolean hardware_audio_manager_real_get_volume_co (HardwareAudioManagerGetVolumeData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->router;
	_data_->_tmp1_ = 0U;
	_data_->_tmp1_ = fso_device_audio_router_currentVolume (_data_->_tmp0_, &_data_->_inner_error_);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_inner_error_ != NULL) {
		if (((_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->result = _data_->_tmp2_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void hardware_audio_manager_real_set_volume (FreeSmartphoneDeviceAudio* base, guint8 volume, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerSetVolumeData* _data_;
	HardwareAudioManager* _tmp0_;
	guint8 _tmp1_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerSetVolumeData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_set_volume);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_set_volume_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = volume;
	_data_->volume = _tmp1_;
	hardware_audio_manager_real_set_volume_co (_data_);
}


static void hardware_audio_manager_real_set_volume_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, GError** error) {
	HardwareAudioManagerSetVolumeData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean hardware_audio_manager_real_set_volume_co (HardwareAudioManagerSetVolumeData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->router;
	_data_->_tmp1_ = _data_->volume;
	fso_device_audio_router_setVolume (_data_->_tmp0_, _data_->_tmp1_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (((_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void hardware_audio_manager_real_play_sound_data_free (gpointer _data) {
	HardwareAudioManagerPlaySoundData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->self);
	g_slice_free (HardwareAudioManagerPlaySoundData, _data_);
}


static void hardware_audio_manager_real_play_sound (FreeSmartphoneDeviceAudio* base, const gchar* name, gint loop, gint length, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerPlaySoundData* _data_;
	HardwareAudioManager* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerPlaySoundData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_play_sound);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_play_sound_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = name;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->name = _tmp2_;
	_tmp3_ = loop;
	_data_->loop = _tmp3_;
	_tmp4_ = length;
	_data_->length = _tmp4_;
	hardware_audio_manager_real_play_sound_co (_data_);
}


static void hardware_audio_manager_real_play_sound_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, GError** error) {
	HardwareAudioManagerPlaySoundData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void hardware_audio_manager_play_sound_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	HardwareAudioManagerPlaySoundData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	hardware_audio_manager_real_play_sound_co (_data_);
}


static gboolean hardware_audio_manager_real_play_sound_co (HardwareAudioManagerPlaySoundData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->name;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = _data_->_tmp1_ = g_strsplit (_data_->_tmp0_, ".", 0);
	_data_->parts = _data_->_tmp2_;
	_data_->parts_length1 = _vala_array_length (_data_->_tmp1_);
	_data_->_parts_size_ = _data_->parts_length1;
	_data_->_tmp3_ = _data_->parts;
	_data_->_tmp3__length1 = _data_->parts_length1;
	if (_data_->_tmp3__length1 == 0) {
		_data_->_tmp4_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INVALID_PARAMETER, "Could not guess media format; need an extension");
		_data_->_inner_error_ = _data_->_tmp4_;
		if ((((_data_->_inner_error_->domain == FREE_SMARTPHONE_DEVICE_AUDIO_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp5_ = _data_->parts;
	_data_->_tmp5__length1 = _data_->parts_length1;
	_data_->_tmp6_ = _data_->parts;
	_data_->_tmp6__length1 = _data_->parts_length1;
	_data_->_tmp7_ = _data_->_tmp5_[_data_->_tmp6__length1 - 1];
	_data_->_tmp8_ = g_strdup (_data_->_tmp7_);
	_data_->extension = _data_->_tmp8_;
	_data_->_tmp9_ = _data_->self->priv->players;
	_data_->_tmp10_ = _data_->extension;
	_data_->_tmp11_ = NULL;
	_data_->_tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp9_, _data_->_tmp10_);
	_data_->player = (FsoDeviceAudioPlayer*) _data_->_tmp11_;
	_data_->_tmp12_ = _data_->player;
	if (_data_->_tmp12_ == NULL) {
		_data_->_tmp13_ = _data_->extension;
		_data_->_tmp14_ = NULL;
		_data_->_tmp14_ = string_to_string (_data_->_tmp13_);
		_data_->_tmp15_ = NULL;
		_data_->_tmp15_ = g_strconcat ("Format .", _data_->_tmp14_, " not handled by any player", NULL);
		_data_->_tmp16_ = _data_->_tmp15_;
		_data_->_tmp17_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INVALID_PARAMETER, _data_->_tmp16_);
		_data_->_tmp18_ = _data_->_tmp17_;
		_g_free0 (_data_->_tmp16_);
		_data_->_inner_error_ = _data_->_tmp18_;
		if ((((_data_->_inner_error_->domain == FREE_SMARTPHONE_DEVICE_AUDIO_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->player);
			_g_free0 (_data_->extension);
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->player);
			_g_free0 (_data_->extension);
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp19_ = _data_->player;
	_data_->_tmp20_ = _data_->name;
	_data_->_tmp21_ = _data_->loop;
	_data_->_tmp22_ = _data_->length;
	_data_->_state_ = 1;
	fso_device_audio_player_play_sound (_data_->_tmp19_, _data_->_tmp20_, _data_->_tmp21_, _data_->_tmp22_, hardware_audio_manager_play_sound_ready, _data_);
	return FALSE;
	_state_1:
	fso_device_audio_player_play_sound_finish (_data_->_tmp19_, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if ((((_data_->_inner_error_->domain == FREE_SMARTPHONE_DEVICE_AUDIO_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->player);
			_g_free0 (_data_->extension);
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->player);
			_g_free0 (_data_->extension);
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_g_object_unref0 (_data_->player);
	_g_free0 (_data_->extension);
	_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void hardware_audio_manager_real_stop_all_sounds (FreeSmartphoneDeviceAudio* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerStopAllSoundsData* _data_;
	HardwareAudioManager* _tmp0_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerStopAllSoundsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_stop_all_sounds);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_stop_all_sounds_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	hardware_audio_manager_real_stop_all_sounds_co (_data_);
}


static void hardware_audio_manager_real_stop_all_sounds_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, GError** error) {
	HardwareAudioManagerStopAllSoundsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void hardware_audio_manager_stop_all_sounds_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	HardwareAudioManagerStopAllSoundsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	hardware_audio_manager_real_stop_all_sounds_co (_data_);
}


static gboolean hardware_audio_manager_real_stop_all_sounds_co (HardwareAudioManagerStopAllSoundsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->self->priv->players;
		_data_->_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _data_->_tmp0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_g_object_unref0 (_data_->_tmp3_);
		_data_->_player_it = _data_->_tmp5_;
		while (TRUE) {
			_data_->_tmp6_ = _data_->_player_it;
			_data_->_tmp7_ = FALSE;
			_data_->_tmp7_ = gee_iterator_next (_data_->_tmp6_);
			if (!_data_->_tmp7_) {
				break;
			}
			_data_->_tmp8_ = _data_->_player_it;
			_data_->_tmp9_ = NULL;
			_data_->_tmp9_ = gee_iterator_get (_data_->_tmp8_);
			_data_->player = (FsoDeviceAudioPlayer*) _data_->_tmp9_;
			_data_->_tmp10_ = _data_->player;
			_data_->_state_ = 1;
			fso_device_audio_player_stop_all_sounds (_data_->_tmp10_, hardware_audio_manager_stop_all_sounds_ready, _data_);
			return FALSE;
			_state_1:
			fso_device_audio_player_stop_all_sounds_finish (_data_->_tmp10_, _data_->_res_);
			_g_object_unref0 (_data_->player);
		}
		_g_object_unref0 (_data_->_player_it);
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void hardware_audio_manager_real_stop_sound_data_free (gpointer _data) {
	HardwareAudioManagerStopSoundData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->self);
	g_slice_free (HardwareAudioManagerStopSoundData, _data_);
}


static void hardware_audio_manager_real_stop_sound (FreeSmartphoneDeviceAudio* base, const gchar* name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HardwareAudioManager * self;
	HardwareAudioManagerStopSoundData* _data_;
	HardwareAudioManager* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	self = (HardwareAudioManager*) base;
	_data_ = g_slice_new0 (HardwareAudioManagerStopSoundData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, hardware_audio_manager_real_stop_sound);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, hardware_audio_manager_real_stop_sound_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = name;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->name = _tmp2_;
	hardware_audio_manager_real_stop_sound_co (_data_);
}


static void hardware_audio_manager_real_stop_sound_finish (FreeSmartphoneDeviceAudio* base, GAsyncResult* _res_, GError** error) {
	HardwareAudioManagerStopSoundData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void hardware_audio_manager_stop_sound_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	HardwareAudioManagerStopSoundData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	hardware_audio_manager_real_stop_sound_co (_data_);
}


static gboolean hardware_audio_manager_real_stop_sound_co (HardwareAudioManagerStopSoundData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->name;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = _data_->_tmp1_ = g_strsplit (_data_->_tmp0_, ".", 0);
	_data_->parts = _data_->_tmp2_;
	_data_->parts_length1 = _vala_array_length (_data_->_tmp1_);
	_data_->_parts_size_ = _data_->parts_length1;
	_data_->_tmp3_ = _data_->parts;
	_data_->_tmp3__length1 = _data_->parts_length1;
	if (_data_->_tmp3__length1 == 0) {
		_data_->_tmp4_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INVALID_PARAMETER, "Could not guess media format; need an extension");
		_data_->_inner_error_ = _data_->_tmp4_;
		if (((_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp5_ = _data_->parts;
	_data_->_tmp5__length1 = _data_->parts_length1;
	_data_->_tmp6_ = _data_->parts;
	_data_->_tmp6__length1 = _data_->parts_length1;
	_data_->_tmp7_ = _data_->_tmp5_[_data_->_tmp6__length1 - 1];
	_data_->_tmp8_ = g_strdup (_data_->_tmp7_);
	_data_->extension = _data_->_tmp8_;
	_data_->_tmp9_ = _data_->self->priv->players;
	_data_->_tmp10_ = _data_->extension;
	_data_->_tmp11_ = NULL;
	_data_->_tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp9_, _data_->_tmp10_);
	_data_->player = (FsoDeviceAudioPlayer*) _data_->_tmp11_;
	_data_->_tmp12_ = _data_->player;
	if (_data_->_tmp12_ == NULL) {
		_data_->_tmp13_ = _data_->extension;
		_data_->_tmp14_ = NULL;
		_data_->_tmp14_ = string_to_string (_data_->_tmp13_);
		_data_->_tmp15_ = NULL;
		_data_->_tmp15_ = g_strconcat ("Format .", _data_->_tmp14_, " not handled by any player", NULL);
		_data_->_tmp16_ = _data_->_tmp15_;
		_data_->_tmp17_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INVALID_PARAMETER, _data_->_tmp16_);
		_data_->_tmp18_ = _data_->_tmp17_;
		_g_free0 (_data_->_tmp16_);
		_data_->_inner_error_ = _data_->_tmp18_;
		if (((_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->player);
			_g_free0 (_data_->extension);
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->player);
			_g_free0 (_data_->extension);
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp19_ = _data_->player;
	_data_->_tmp20_ = _data_->name;
	_data_->_state_ = 1;
	fso_device_audio_player_stop_sound (_data_->_tmp19_, _data_->_tmp20_, hardware_audio_manager_stop_sound_ready, _data_);
	return FALSE;
	_state_1:
	fso_device_audio_player_stop_sound_finish (_data_->_tmp19_, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (((_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR) || (_data_->_inner_error_->domain == G_DBUS_ERROR)) || (_data_->_inner_error_->domain == G_IO_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->player);
			_g_free0 (_data_->extension);
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->player);
			_g_free0 (_data_->extension);
			_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_g_object_unref0 (_data_->player);
	_g_free0 (_data_->extension);
	_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void hardware_audio_manager_class_init (HardwareAudioManagerClass * klass) {
	hardware_audio_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (HardwareAudioManagerPrivate));
	FSO_FRAMEWORK_ABSTRACT_OBJECT_CLASS (klass)->repr = hardware_audio_manager_real_repr;
	G_OBJECT_CLASS (klass)->finalize = hardware_audio_manager_finalize;
}


static void hardware_audio_manager_free_smartphone_device_audio_interface_init (FreeSmartphoneDeviceAudioIface * iface) {
	hardware_audio_manager_free_smartphone_device_audio_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_available_scenarios = (gchar** (*)(FreeSmartphoneDeviceAudio*, int*, GError**)) hardware_audio_manager_real_get_available_scenarios;
	iface->get_available_scenarios_finish = hardware_audio_manager_real_get_available_scenarios_finish;
	iface->get_scenario = (gchar* (*)(FreeSmartphoneDeviceAudio*, GError**)) hardware_audio_manager_real_get_scenario;
	iface->get_scenario_finish = hardware_audio_manager_real_get_scenario_finish;
	iface->pull_scenario = (gchar* (*)(FreeSmartphoneDeviceAudio*, GError**)) hardware_audio_manager_real_pull_scenario;
	iface->pull_scenario_finish = hardware_audio_manager_real_pull_scenario_finish;
	iface->push_scenario = (void (*)(FreeSmartphoneDeviceAudio*, const gchar*, GError**)) hardware_audio_manager_real_push_scenario;
	iface->push_scenario_finish = hardware_audio_manager_real_push_scenario_finish;
	iface->set_scenario = (void (*)(FreeSmartphoneDeviceAudio*, const gchar*, GError**)) hardware_audio_manager_real_set_scenario;
	iface->set_scenario_finish = hardware_audio_manager_real_set_scenario_finish;
	iface->save_scenario = (void (*)(FreeSmartphoneDeviceAudio*, const gchar*, GError**)) hardware_audio_manager_real_save_scenario;
	iface->save_scenario_finish = hardware_audio_manager_real_save_scenario_finish;
	iface->get_volume = (guint8 (*)(FreeSmartphoneDeviceAudio*, GError**)) hardware_audio_manager_real_get_volume;
	iface->get_volume_finish = hardware_audio_manager_real_get_volume_finish;
	iface->set_volume = (void (*)(FreeSmartphoneDeviceAudio*, guint8, GError**)) hardware_audio_manager_real_set_volume;
	iface->set_volume_finish = hardware_audio_manager_real_set_volume_finish;
	iface->play_sound = (void (*)(FreeSmartphoneDeviceAudio*, const gchar*, gint, gint, GError**)) hardware_audio_manager_real_play_sound;
	iface->play_sound_finish = hardware_audio_manager_real_play_sound_finish;
	iface->stop_all_sounds = (void (*)(FreeSmartphoneDeviceAudio*, GError**)) hardware_audio_manager_real_stop_all_sounds;
	iface->stop_all_sounds_finish = hardware_audio_manager_real_stop_all_sounds_finish;
	iface->stop_sound = (void (*)(FreeSmartphoneDeviceAudio*, const gchar*, GError**)) hardware_audio_manager_real_stop_sound;
	iface->stop_sound_finish = hardware_audio_manager_real_stop_sound_finish;
}


static void hardware_audio_manager_free_smartphone_info_interface_init (FreeSmartphoneInfoIface * iface) {
	hardware_audio_manager_free_smartphone_info_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_info = (GHashTable* (*)(FreeSmartphoneInfo*, GError**)) hardware_audio_manager_real_get_info;
	iface->get_info_finish = hardware_audio_manager_real_get_info_finish;
}


static void hardware_audio_manager_instance_init (HardwareAudioManager * self) {
	self->priv = HARDWARE_AUDIO_MANAGER_GET_PRIVATE (self);
}


static void hardware_audio_manager_finalize (GObject* obj) {
	HardwareAudioManager * self;
	self = HARDWARE_AUDIO_MANAGER (obj);
	_g_object_unref0 (self->priv->subsystem);
	_g_object_unref0 (self->priv->router);
	_g_free0 (self->priv->routertype);
	_g_object_unref0 (self->priv->players);
	_g_free0 (self->priv->playertypes);
	G_OBJECT_CLASS (hardware_audio_manager_parent_class)->finalize (obj);
}


/**
 * Audio Manager
 **/
GType hardware_audio_manager_get_type (void) {
	return hardware_audio_manager_type_id;
}


GType hardware_audio_manager_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (HardwareAudioManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) hardware_audio_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (HardwareAudioManager), 0, (GInstanceInitFunc) hardware_audio_manager_instance_init, NULL };
	static const GInterfaceInfo free_smartphone_device_audio_info = { (GInterfaceInitFunc) hardware_audio_manager_free_smartphone_device_audio_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo free_smartphone_info_info = { (GInterfaceInitFunc) hardware_audio_manager_free_smartphone_info_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	hardware_audio_manager_type_id = g_type_module_register_type (module, FSO_FRAMEWORK_TYPE_ABSTRACT_OBJECT, "HardwareAudioManager", &g_define_type_info, 0);
	g_type_module_add_interface (module, hardware_audio_manager_type_id, FREE_SMARTPHONE_DEVICE_TYPE_AUDIO, &free_smartphone_device_audio_info);
	g_type_module_add_interface (module, hardware_audio_manager_type_id, FREE_SMARTPHONE_TYPE_INFO, &free_smartphone_info_info);
	return hardware_audio_manager_type_id;
}


/**
 * This function gets called on plugin initialization time.
 * @return the name of your plugin here
 * @note that it needs to be a name in the format <subsystem>.<plugin>
 * else your module will be unloaded immediately.
 **/
gchar* fso_factory_function (FsoFrameworkSubsystem* subsystem, GError** error) {
	gchar* result = NULL;
	FsoFrameworkSubsystem* _tmp0_;
	HardwareAudioManager* _tmp1_;
	gchar* _tmp2_;
	g_return_val_if_fail (subsystem != NULL, NULL);
	_tmp0_ = subsystem;
	_tmp1_ = hardware_audio_manager_new (_tmp0_);
	_g_object_unref0 (instance);
	instance = _tmp1_;
	_tmp2_ = g_strdup ("fsodevice.audio");
	result = _tmp2_;
	return result;
}


void fso_register_function (GTypeModule* module) {
	FsoFrameworkLogger* _tmp0_;
	g_return_if_fail (module != NULL);
	hardware_audio_manager_register_type (module);
	_tmp0_ = fso_framework_theLogger;
	fso_framework_logger_debug (_tmp0_, "fsodevice.audio fso_register_function()");
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



