/* audio-options-group.c generated by valac 0.56.19, the Vala compiler
 * generated from audio-options-group.vala, do not modify */

#include "protonplus_core.h"
#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <gtk/gtk.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

#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE (proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_SPIN_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_SPIN_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass;

#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE (proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_AUDIO_OPTIONS_GROUP_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_AUDIO_OPTIONS_GROUP_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_AUDIO_OPTIONS_GROUP_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroupPrivate {
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _pulse_latency_tile;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _winealsa_channels_tile;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _winealsa_spacial_tile;
};

static gint ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup_private_offset;
static gpointer proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_parent_class = NULL;

VALA_EXTERN GType proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_spin_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                                                                                           const gchar* title,
                                                                                                                                                           const gchar* subtitle,
                                                                                                                                                           const gchar* value_label,
                                                                                                                                                           gdouble lower,
                                                                                                                                                           gdouble upper,
                                                                                                                                                           gint default_value,
                                                                                                                                                           const gchar* env_prefix,
                                                                                                                                                           gboolean is_advanced,
                                                                                                                                                           ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType type,
                                                                                                                                                           const gchar* id);
static void proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_pulse_latency_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self,
                                                                                                        ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* value);
static void proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_winealsa_channels_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self,
                                                                                                            ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* value);
static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_winealsa_channels_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self);
static void __lambda130_ (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self);
static void proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_refresh_winealsa_spacial_state (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self);
static void ___lambda130__proton_plus_widgets_games_launch_options_editor_launch_option_env_combo_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _sender,
                                                                                                    gpointer self);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                                                                                  const gchar* title,
                                                                                                                                                  const gchar* subtitle,
                                                                                                                                                  gchar** tokens,
                                                                                                                                                  gint tokens_length1,
                                                                                                                                                  gboolean is_advanced,
                                                                                                                                                  ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType type,
                                                                                                                                                  const gchar* id);
static void proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_winealsa_spacial_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self,
                                                                                                           ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* value);
static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_pulse_latency_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self);
static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_winealsa_spacial_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self);
static gboolean proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_is_winealsa_spacial_supported (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self);
VALA_EXTERN GtkSwitch* proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self);
static void proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_finalize (GObject * obj);
static GType proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_type_once (void);
static void _vala_proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_property (GObject * object,
                                                                                                    guint property_id,
                                                                                                    GValue * value,
                                                                                                    GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_property (GObject * object,
                                                                                                    guint property_id,
                                                                                                    const GValue * value,
                                                                                                    GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_instance_private (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup_private_offset);
}

static void
__lambda130_ (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self)
{
	proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_refresh_winealsa_spacial_state (self);
	g_signal_emit_by_name ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) self, "changed");
}

static void
___lambda130__proton_plus_widgets_games_launch_options_editor_launch_option_env_combo_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _sender,
                                                                                               gpointer self)
{
	__lambda130_ ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup*) self);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup*
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_construct (GType object_type,
                                                                                      ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* launch_option_handlers,
                                                                                      ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* presentation_registry)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup * self = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp1_;
	gchar** winealsa_channel_display_opts = NULL;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	gint winealsa_channel_display_opts_length1;
	gint _winealsa_channel_display_opts_size_;
	gchar** winealsa_channel_value_opts = NULL;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar** _tmp13_;
	gint winealsa_channel_value_opts_length1;
	gint _winealsa_channel_value_opts_size_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _tmp14_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _tmp15_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _tmp16_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _tmp17_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _tmp18_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _tmp19_;
	gchar* _tmp20_;
	gchar** _tmp21_;
	gchar** _tmp22_;
	gint _tmp22__length1;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp23_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp24_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp25_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _tmp26_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp27_;
	g_return_val_if_fail (launch_option_handlers != NULL, NULL);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup*) proton_plus_widgets_games_launch_options_editor_groups_base_options_group_construct (object_type, launch_option_handlers, TRUE, presentation_registry, TRUE);
	adw_preferences_group_set_title ((AdwPreferencesGroup*) self, _ ("Audio options"));
	adw_preferences_group_set_description ((AdwPreferencesGroup*) self, _ ("Audio-related launch options."));
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_spin_tile ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) self, _ ("PulseAudio latency"), _ ("Enables low latency mode in PulseAudio which can reduce audio latency " \
"in some games (60, 90, 120)."), _ ("MSEC"), (gdouble) 30, (gdouble) 360, 90, "PULSE_LATENCY_MSEC=", FALSE, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_LINE_TYPE_ENVIRONMENT, "pulse-latency");
	_tmp1_ = _tmp0_;
	proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_pulse_latency_tile (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = g_strdup (_ ("Disabled"));
	_tmp3_ = g_strdup ("2 (stereo)");
	_tmp4_ = g_strdup ("4 (2 front, 2 rear)");
	_tmp5_ = g_strdup ("6 (5.1)");
	_tmp6_ = g_strdup ("8 (7.1)");
	_tmp7_ = g_new0 (gchar*, 5 + 1);
	_tmp7_[0] = _tmp2_;
	_tmp7_[1] = _tmp3_;
	_tmp7_[2] = _tmp4_;
	_tmp7_[3] = _tmp5_;
	_tmp7_[4] = _tmp6_;
	winealsa_channel_display_opts = _tmp7_;
	winealsa_channel_display_opts_length1 = 5;
	_winealsa_channel_display_opts_size_ = winealsa_channel_display_opts_length1;
	_tmp8_ = g_strdup ("");
	_tmp9_ = g_strdup ("2");
	_tmp10_ = g_strdup ("4");
	_tmp11_ = g_strdup ("6");
	_tmp12_ = g_strdup ("8");
	_tmp13_ = g_new0 (gchar*, 5 + 1);
	_tmp13_[0] = _tmp8_;
	_tmp13_[1] = _tmp9_;
	_tmp13_[2] = _tmp10_;
	_tmp13_[3] = _tmp11_;
	_tmp13_[4] = _tmp12_;
	winealsa_channel_value_opts = _tmp13_;
	winealsa_channel_value_opts_length1 = 5;
	_winealsa_channel_value_opts_size_ = winealsa_channel_value_opts_length1;
	_tmp14_ = proton_plus_widgets_games_launch_options_editor_launch_option_env_combo_new ("WINEALSA_CHANNELS", _ ("WINEALSA Channels"), _ ("Sets the number of ALSA output channels used by Wine. Available from G" \
"E-Proton11-1."), winealsa_channel_display_opts, winealsa_channel_display_opts_length1, winealsa_channel_value_opts, winealsa_channel_value_opts_length1);
	g_object_ref_sink (_tmp14_);
	_tmp15_ = _tmp14_;
	proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_winealsa_channels_tile (self, _tmp15_);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = self->priv->_winealsa_channels_tile;
	g_signal_connect_object (_tmp16_, "changed", (GCallback) ___lambda130__proton_plus_widgets_games_launch_options_editor_launch_option_env_combo_changed, self, 0);
	_tmp17_ = self->priv->_winealsa_channels_tile;
	proton_plus_widgets_games_launch_options_editor_launch_options_list_add (launch_option_handlers, (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp17_);
	_tmp18_ = self->priv->_winealsa_channels_tile;
	_tmp19_ = self->priv->_winealsa_channels_tile;
	proton_plus_widgets_games_launch_options_editor_groups_base_options_group_register_option ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) self, "winealsa-channels", (GtkWidget*) _tmp18_, (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp19_);
	_tmp20_ = g_strdup ("WINEALSA_SPACIAL=1");
	_tmp21_ = g_new0 (gchar*, 1 + 1);
	_tmp21_[0] = _tmp20_;
	_tmp22_ = _tmp21_;
	_tmp22__length1 = 1;
	_tmp23_ = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_tile ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) self, _ ("Wine ALSA spatial downmix"), _ ("Enables spatial mixing in Wine ALSA audio output. Requires WINEALSA Ch" \
"annels set to 4, 6, or 8. Available from GE-Proton11-1."), _tmp22_, (gint) 1, FALSE, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_LINE_TYPE_ENVIRONMENT, "winealsa-spatial");
	_tmp24_ = _tmp23_;
	proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_winealsa_spacial_tile (self, _tmp24_);
	_g_object_unref0 (_tmp24_);
	_tmp22_ = (_vala_array_free (_tmp22_, _tmp22__length1, (GDestroyNotify) g_free), NULL);
	proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_refresh_winealsa_spacial_state (self);
	_tmp25_ = self->priv->_pulse_latency_tile;
	adw_preferences_group_add ((AdwPreferencesGroup*) self, (GtkWidget*) _tmp25_);
	_tmp26_ = self->priv->_winealsa_channels_tile;
	adw_preferences_group_add ((AdwPreferencesGroup*) self, (GtkWidget*) _tmp26_);
	_tmp27_ = self->priv->_winealsa_spacial_tile;
	adw_preferences_group_add ((AdwPreferencesGroup*) self, (GtkWidget*) _tmp27_);
	winealsa_channel_value_opts = (_vala_array_free (winealsa_channel_value_opts, winealsa_channel_value_opts_length1, (GDestroyNotify) g_free), NULL);
	winealsa_channel_display_opts = (_vala_array_free (winealsa_channel_display_opts, winealsa_channel_display_opts_length1, (GDestroyNotify) g_free), NULL);
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup*
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_new (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* launch_option_handlers,
                                                                                ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* presentation_registry)
{
	return proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_AUDIO_OPTIONS_GROUP, launch_option_handlers, presentation_registry);
}

static gboolean
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_is_winealsa_spacial_supported (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self)
{
	gchar* channels = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	const gchar* _tmp6_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_winealsa_channels_tile;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_option_env_combo_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	channels = _tmp3_;
	_tmp6_ = channels;
	if (g_strcmp0 (_tmp6_, "4") == 0) {
		_tmp5_ = TRUE;
	} else {
		const gchar* _tmp7_;
		_tmp7_ = channels;
		_tmp5_ = g_strcmp0 (_tmp7_, "6") == 0;
	}
	if (_tmp5_) {
		_tmp4_ = TRUE;
	} else {
		const gchar* _tmp8_;
		_tmp8_ = channels;
		_tmp4_ = g_strcmp0 (_tmp8_, "8") == 0;
	}
	result = _tmp4_;
	_g_free0 (channels);
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_refresh_winealsa_spacial_state (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self)
{
	gboolean spacial_supported = FALSE;
	gboolean _tmp0_ = FALSE;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp4_;
	g_return_if_fail (self != NULL);
	spacial_supported = proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_is_winealsa_spacial_supported (self);
	if (spacial_supported) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp1_;
		GtkSwitch* _tmp2_;
		GtkSwitch* _tmp3_;
		_tmp1_ = self->priv->_winealsa_spacial_tile;
		_tmp2_ = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_toggle (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = gtk_switch_get_active (_tmp3_);
	}
	_tmp4_ = self->priv->_winealsa_spacial_tile;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, _tmp0_);
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_pulse_latency_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_pulse_latency_tile;
	result = _tmp0_;
	return result;
}

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

static void
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_pulse_latency_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self,
                                                                                                   ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_pulse_latency_tile);
	self->priv->_pulse_latency_tile = _tmp0_;
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo*
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_winealsa_channels_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_winealsa_channels_tile;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_winealsa_channels_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self,
                                                                                                       ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEnvCombo* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_winealsa_channels_tile);
	self->priv->_winealsa_channels_tile = _tmp0_;
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_winealsa_spacial_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_winealsa_spacial_tile;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_winealsa_spacial_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup* self,
                                                                                                      ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_winealsa_spacial_tile);
	self->priv->_winealsa_spacial_tile = _tmp0_;
}

static void
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroupClass * klass,
                                                                                       gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_finalize;
}

static void
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup * self,
                                                                                          gpointer klass)
{
	self->priv = proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_instance_private (self);
}

static void
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_AUDIO_OPTIONS_GROUP, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup);
	_g_object_unref0 (self->priv->_pulse_latency_tile);
	_g_object_unref0 (self->priv->_winealsa_channels_tile);
	_g_object_unref0 (self->priv->_winealsa_spacial_tile);
	G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_instance_init, NULL };
	GType proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id;
	proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id = g_type_register_static (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_BASE_OPTIONS_GROUP, "ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup", &g_define_type_info, 0);
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup_private_offset = g_type_add_instance_private (proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroupPrivate));
	return proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id;
		proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id = proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id__once, proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_type_id__once;
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_get_property (GObject * object,
                                                                                               guint property_id,
                                                                                               GValue * value,
                                                                                               GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_AUDIO_OPTIONS_GROUP, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_groups_audio_options_group_set_property (GObject * object,
                                                                                               guint property_id,
                                                                                               const GValue * value,
                                                                                               GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_AUDIO_OPTIONS_GROUP, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAudioOptionsGroup);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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;
}

