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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>

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

#define TUBA_WIDGETS_AUDIO_TYPE_CONTROLS (tuba_widgets_audio_controls_get_type ())
#define TUBA_WIDGETS_AUDIO_CONTROLS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_AUDIO_TYPE_CONTROLS, TubaWidgetsAudioControls))
#define TUBA_WIDGETS_AUDIO_CONTROLS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_AUDIO_TYPE_CONTROLS, TubaWidgetsAudioControlsClass))
#define TUBA_WIDGETS_AUDIO_IS_CONTROLS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_AUDIO_TYPE_CONTROLS))
#define TUBA_WIDGETS_AUDIO_IS_CONTROLS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_AUDIO_TYPE_CONTROLS))
#define TUBA_WIDGETS_AUDIO_CONTROLS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_AUDIO_TYPE_CONTROLS, TubaWidgetsAudioControlsClass))

typedef struct _TubaWidgetsAudioControls TubaWidgetsAudioControls;
typedef struct _TubaWidgetsAudioControlsClass TubaWidgetsAudioControlsClass;
typedef struct _TubaWidgetsAudioControlsPrivate TubaWidgetsAudioControlsPrivate;
enum  {
	TUBA_WIDGETS_AUDIO_CONTROLS_0_PROPERTY,
	TUBA_WIDGETS_AUDIO_CONTROLS_VOLUME_PROPERTY,
	TUBA_WIDGETS_AUDIO_CONTROLS_PROGRESS_PROPERTY,
	TUBA_WIDGETS_AUDIO_CONTROLS_READY_PROPERTY,
	TUBA_WIDGETS_AUDIO_CONTROLS_PLAYING_PROPERTY,
	TUBA_WIDGETS_AUDIO_CONTROLS_DURATION_PROPERTY,
	TUBA_WIDGETS_AUDIO_CONTROLS_CURRENT_PROPERTY,
	TUBA_WIDGETS_AUDIO_CONTROLS_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	TUBA_WIDGETS_AUDIO_CONTROLS_STATE_BUTTON_CLICKED_SIGNAL,
	TUBA_WIDGETS_AUDIO_CONTROLS_NUM_SIGNALS
};
static guint tuba_widgets_audio_controls_signals[TUBA_WIDGETS_AUDIO_CONTROLS_NUM_SIGNALS] = {0};

struct _TubaWidgetsAudioControls {
	GtkBox parent_instance;
	TubaWidgetsAudioControlsPrivate * priv;
};

struct _TubaWidgetsAudioControlsClass {
	GtkBoxClass parent_class;
};

struct _TubaWidgetsAudioControlsPrivate {
	GtkAdjustment* time_adjustment;
	GtkButton* play_button;
	GtkLabel* time_label;
	GtkLabel* duration_label;
	GtkVolumeButton* volume_button;
	GtkBox* time_box;
	gdouble _volume;
	gdouble _progress;
	gboolean _ready;
	gboolean _playing;
	gint64 _duration;
	gint64 _current;
	gulong time_adjustment_changed_id;
};

static gint TubaWidgetsAudioControls_private_offset;
static gpointer tuba_widgets_audio_controls_parent_class = NULL;

VALA_EXTERN GType tuba_widgets_audio_controls_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAudioControls, g_object_unref)
static gchar* tuba_widgets_audio_controls_nanoseconds_to_string (TubaWidgetsAudioControls* self,
                                                          gint64 nanoseconds);
static void tuba_widgets_audio_controls_update_scale (TubaWidgetsAudioControls* self);
VALA_EXTERN gint64 tuba_widgets_audio_controls_get_duration (TubaWidgetsAudioControls* self);
VALA_EXTERN gint64 tuba_widgets_audio_controls_get_current (TubaWidgetsAudioControls* self);
static void tuba_widgets_audio_controls_time_adjustment_changed (TubaWidgetsAudioControls* self);
VALA_EXTERN gdouble tuba_widgets_audio_controls_get_progress (TubaWidgetsAudioControls* self);
VALA_EXTERN void tuba_widgets_audio_controls_set_progress (TubaWidgetsAudioControls* self,
                                               gdouble value);
static void tuba_widgets_audio_controls_play_button_clicked (TubaWidgetsAudioControls* self);
VALA_EXTERN gboolean tuba_widgets_audio_controls_get_playing (TubaWidgetsAudioControls* self);
VALA_EXTERN void tuba_widgets_audio_controls_set_playing (TubaWidgetsAudioControls* self,
                                              gboolean value);
static void _tuba_widgets_audio_controls_play_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self);
VALA_EXTERN TubaWidgetsAudioControls* tuba_widgets_audio_controls_new (void);
VALA_EXTERN TubaWidgetsAudioControls* tuba_widgets_audio_controls_construct (GType object_type);
VALA_EXTERN gdouble tuba_widgets_audio_controls_get_volume (TubaWidgetsAudioControls* self);
VALA_EXTERN void tuba_widgets_audio_controls_set_volume (TubaWidgetsAudioControls* self,
                                             gdouble value);
VALA_EXTERN gboolean tuba_widgets_audio_controls_get_ready (TubaWidgetsAudioControls* self);
VALA_EXTERN void tuba_widgets_audio_controls_set_ready (TubaWidgetsAudioControls* self,
                                            gboolean value);
VALA_EXTERN void tuba_widgets_audio_controls_set_duration (TubaWidgetsAudioControls* self,
                                               gint64 value);
VALA_EXTERN void tuba_widgets_audio_controls_set_current (TubaWidgetsAudioControls* self,
                                              gint64 value);
static GObject * tuba_widgets_audio_controls_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void _tuba_widgets_audio_controls_time_adjustment_changed_gtk_adjustment_value_changed (GtkAdjustment* _sender,
                                                                                        gpointer self);
static void tuba_widgets_audio_controls_finalize (GObject * obj);
static GType tuba_widgets_audio_controls_get_type_once (void);
static void _vala_tuba_widgets_audio_controls_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_tuba_widgets_audio_controls_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);

static inline gpointer
tuba_widgets_audio_controls_get_instance_private (TubaWidgetsAudioControls* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsAudioControls_private_offset);
}

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

static gchar*
tuba_widgets_audio_controls_nanoseconds_to_string (TubaWidgetsAudioControls* self,
                                                   gint64 nanoseconds)
{
	gdouble seconds_total = 0.0;
	gint seconds = 0;
	gint minutes = 0;
	gint hours = 0;
	const gchar* _tmp0_ = NULL;
	gchar* seconds_prefix = NULL;
	gchar* _tmp1_;
	const gchar* _tmp2_ = NULL;
	gchar* minutes_prefix = NULL;
	gchar* _tmp3_;
	gchar* _tmp4_ = NULL;
	gchar* hours_s = NULL;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	seconds_total = ((gdouble) nanoseconds) / ((1000 * 1000) * 1000);
	seconds = (gint) fmod (seconds_total, 60);
	minutes = (gint) fmod (seconds_total / 60, 60);
	hours = (gint) fmod (seconds_total / (60 * 60), 24);
	if (seconds > 9) {
		_tmp0_ = "";
	} else {
		_tmp0_ = "0";
	}
	_tmp1_ = g_strdup (_tmp0_);
	seconds_prefix = _tmp1_;
	if (minutes > 9) {
		_tmp2_ = "";
	} else {
		_tmp2_ = "0";
	}
	_tmp3_ = g_strdup (_tmp2_);
	minutes_prefix = _tmp3_;
	if (hours > 0) {
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp5_ = g_strdup_printf ("%i", hours);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strconcat (_tmp6_, ":", NULL);
		_g_free0 (_tmp4_);
		_tmp4_ = _tmp7_;
		_g_free0 (_tmp6_);
	} else {
		gchar* _tmp8_;
		_tmp8_ = g_strdup ("");
		_g_free0 (_tmp4_);
		_tmp4_ = _tmp8_;
	}
	_tmp9_ = _tmp4_;
	_tmp4_ = NULL;
	hours_s = _tmp9_;
	_tmp10_ = string_to_string (hours_s);
	_tmp11_ = minutes_prefix;
	_tmp12_ = string_to_string (_tmp11_);
	_tmp13_ = g_strdup_printf ("%i", minutes);
	_tmp14_ = _tmp13_;
	_tmp15_ = seconds_prefix;
	_tmp16_ = string_to_string (_tmp15_);
	_tmp17_ = g_strdup_printf ("%i", seconds);
	_tmp18_ = _tmp17_;
	_tmp19_ = g_strconcat (_tmp10_, _tmp12_, _tmp14_, ":", _tmp16_, _tmp18_, NULL);
	_tmp20_ = _tmp19_;
	_g_free0 (_tmp18_);
	_g_free0 (_tmp14_);
	result = _tmp20_;
	_g_free0 (hours_s);
	_g_free0 (_tmp4_);
	_g_free0 (minutes_prefix);
	_g_free0 (seconds_prefix);
	return result;
}

static void
tuba_widgets_audio_controls_update_scale (TubaWidgetsAudioControls* self)
{
	gint64 _tmp0_;
	gint64 _tmp1_;
	GtkAdjustment* _tmp2_;
	GtkAdjustment* _tmp3_;
	gint64 _tmp4_;
	gint64 _tmp5_;
	gint64 _tmp6_;
	gint64 _tmp7_;
	GtkAdjustment* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_widgets_audio_controls_get_duration (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == ((gint64) 0)) {
		return;
	}
	_tmp2_ = self->priv->time_adjustment;
	g_signal_handler_block (_tmp2_, self->priv->time_adjustment_changed_id);
	_tmp3_ = self->priv->time_adjustment;
	_tmp4_ = tuba_widgets_audio_controls_get_current (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = tuba_widgets_audio_controls_get_duration (self);
	_tmp7_ = _tmp6_;
	gtk_adjustment_set_value (_tmp3_, (((gdouble) _tmp5_) / ((gdouble) _tmp7_)) * 10);
	_tmp8_ = self->priv->time_adjustment;
	g_signal_handler_unblock (_tmp8_, self->priv->time_adjustment_changed_id);
}

static void
tuba_widgets_audio_controls_time_adjustment_changed (TubaWidgetsAudioControls* self)
{
	GtkAdjustment* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	GtkAdjustment* _tmp4_;
	gdouble _tmp5_;
	gdouble _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->time_adjustment;
	_tmp1_ = gtk_adjustment_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->_progress;
	if (_tmp2_ == _tmp3_) {
		return;
	}
	_tmp4_ = self->priv->time_adjustment;
	_tmp5_ = gtk_adjustment_get_value (_tmp4_);
	_tmp6_ = _tmp5_;
	tuba_widgets_audio_controls_set_progress (self, _tmp6_);
}

static void
tuba_widgets_audio_controls_play_button_clicked (TubaWidgetsAudioControls* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_widgets_audio_controls_get_playing (self);
	_tmp1_ = _tmp0_;
	tuba_widgets_audio_controls_set_playing (self, !_tmp1_);
}

static void
_tuba_widgets_audio_controls_play_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self)
{
	tuba_widgets_audio_controls_play_button_clicked ((TubaWidgetsAudioControls*) self);
}

TubaWidgetsAudioControls*
tuba_widgets_audio_controls_construct (GType object_type)
{
	TubaWidgetsAudioControls * self = NULL;
	self = (TubaWidgetsAudioControls*) g_object_new (object_type, NULL);
	return self;
}

TubaWidgetsAudioControls*
tuba_widgets_audio_controls_new (void)
{
	return tuba_widgets_audio_controls_construct (TUBA_WIDGETS_AUDIO_TYPE_CONTROLS);
}

gdouble
tuba_widgets_audio_controls_get_volume (TubaWidgetsAudioControls* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_volume;
	return result;
}

void
tuba_widgets_audio_controls_set_volume (TubaWidgetsAudioControls* self,
                                        gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_audio_controls_get_volume (self);
	if (old_value != value) {
		self->priv->_volume = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_VOLUME_PROPERTY]);
	}
}

gdouble
tuba_widgets_audio_controls_get_progress (TubaWidgetsAudioControls* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_progress;
	return result;
}

void
tuba_widgets_audio_controls_set_progress (TubaWidgetsAudioControls* self,
                                          gdouble value)
{
	gdouble old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_audio_controls_get_progress (self);
	if (old_value != value) {
		self->priv->_progress = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_PROGRESS_PROPERTY]);
	}
}

gboolean
tuba_widgets_audio_controls_get_ready (TubaWidgetsAudioControls* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_ready;
	return result;
}

void
tuba_widgets_audio_controls_set_ready (TubaWidgetsAudioControls* self,
                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_audio_controls_get_ready (self);
	if (old_value != value) {
		self->priv->_ready = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_READY_PROPERTY]);
	}
}

gboolean
tuba_widgets_audio_controls_get_playing (TubaWidgetsAudioControls* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_playing;
	return result;
}

void
tuba_widgets_audio_controls_set_playing (TubaWidgetsAudioControls* self,
                                         gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		GtkButton* _tmp0_;
		GtkButton* _tmp1_;
		_tmp0_ = self->priv->play_button;
		gtk_button_set_icon_name (_tmp0_, "media-playback-pause-symbolic");
		_tmp1_ = self->priv->play_button;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp1_, C_ ("media controls tooltip", "Stop"));
	} else {
		GtkButton* _tmp2_;
		GtkButton* _tmp3_;
		_tmp2_ = self->priv->play_button;
		gtk_button_set_icon_name (_tmp2_, "media-playback-start-symbolic");
		_tmp3_ = self->priv->play_button;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp3_, C_ ("media controls tooltip", "Play"));
	}
	self->priv->_playing = value;
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_PLAYING_PROPERTY]);
}

gint64
tuba_widgets_audio_controls_get_duration (TubaWidgetsAudioControls* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_duration;
	return result;
}

void
tuba_widgets_audio_controls_set_duration (TubaWidgetsAudioControls* self,
                                          gint64 value)
{
	GtkLabel* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	self->priv->_duration = value;
	_tmp0_ = self->priv->duration_label;
	_tmp1_ = tuba_widgets_audio_controls_nanoseconds_to_string (self, value);
	_tmp2_ = _tmp1_;
	gtk_label_set_label (_tmp0_, _tmp2_);
	_g_free0 (_tmp2_);
	tuba_widgets_audio_controls_update_scale (self);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_DURATION_PROPERTY]);
}

gint64
tuba_widgets_audio_controls_get_current (TubaWidgetsAudioControls* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_current;
	return result;
}

void
tuba_widgets_audio_controls_set_current (TubaWidgetsAudioControls* self,
                                         gint64 value)
{
	gint64 safe_val = 0LL;
	GtkLabel* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	safe_val = MIN (value, self->priv->_duration);
	self->priv->_current = safe_val;
	_tmp0_ = self->priv->time_label;
	_tmp1_ = tuba_widgets_audio_controls_nanoseconds_to_string (self, safe_val);
	_tmp2_ = _tmp1_;
	gtk_label_set_label (_tmp0_, _tmp2_);
	_g_free0 (_tmp2_);
	tuba_widgets_audio_controls_update_scale (self);
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_CURRENT_PROPERTY]);
}

static void
_tuba_widgets_audio_controls_time_adjustment_changed_gtk_adjustment_value_changed (GtkAdjustment* _sender,
                                                                                   gpointer self)
{
	tuba_widgets_audio_controls_time_adjustment_changed ((TubaWidgetsAudioControls*) self);
}

static GObject *
tuba_widgets_audio_controls_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsAudioControls * self;
	GtkVolumeButton* _tmp0_;
	GtkAdjustment* _tmp1_;
	gulong _tmp2_;
	GtkBox* _tmp3_;
	parent_class = G_OBJECT_CLASS (tuba_widgets_audio_controls_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_AUDIO_TYPE_CONTROLS, TubaWidgetsAudioControls);
	_tmp0_ = self->priv->volume_button;
	g_object_bind_property_with_closures ((GObject*) _tmp0_, "value", (GObject*) self, "volume", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp1_ = self->priv->time_adjustment;
	_tmp2_ = g_signal_connect_object (_tmp1_, "value-changed", (GCallback) _tuba_widgets_audio_controls_time_adjustment_changed_gtk_adjustment_value_changed, self, 0);
	self->priv->time_adjustment_changed_id = _tmp2_;
	_tmp3_ = self->priv->time_box;
	g_object_bind_property_with_closures ((GObject*) self, "ready", (GObject*) _tmp3_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	return obj;
}

static void
tuba_widgets_audio_controls_class_init (TubaWidgetsAudioControlsClass * klass,
                                        gpointer klass_data)
{
	tuba_widgets_audio_controls_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsAudioControls_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_audio_controls_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_audio_controls_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_audio_controls_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_audio_controls_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_AUDIO_CONTROLS_VOLUME_PROPERTY, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_VOLUME_PROPERTY] = g_param_spec_double ("volume", "volume", "volume", -G_MAXDOUBLE, G_MAXDOUBLE, 1.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_AUDIO_CONTROLS_PROGRESS_PROPERTY, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_PROGRESS_PROPERTY] = g_param_spec_double ("progress", "progress", "progress", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_AUDIO_CONTROLS_READY_PROPERTY, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_READY_PROPERTY] = g_param_spec_boolean ("ready", "ready", "ready", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_AUDIO_CONTROLS_PLAYING_PROPERTY, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_PLAYING_PROPERTY] = g_param_spec_boolean ("playing", "playing", "playing", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_AUDIO_CONTROLS_DURATION_PROPERTY, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_DURATION_PROPERTY] = g_param_spec_int64 ("duration", "duration", "duration", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_AUDIO_CONTROLS_CURRENT_PROPERTY, tuba_widgets_audio_controls_properties[TUBA_WIDGETS_AUDIO_CONTROLS_CURRENT_PROPERTY] = g_param_spec_int64 ("current", "current", "current", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/widgets/audiocontrols.ui");
	tuba_widgets_audio_controls_signals[TUBA_WIDGETS_AUDIO_CONTROLS_STATE_BUTTON_CLICKED_SIGNAL] = g_signal_new ("state-button-clicked", TUBA_WIDGETS_AUDIO_TYPE_CONTROLS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "time_adjustment", FALSE, TubaWidgetsAudioControls_private_offset + G_STRUCT_OFFSET (TubaWidgetsAudioControlsPrivate, time_adjustment));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "play_button", FALSE, TubaWidgetsAudioControls_private_offset + G_STRUCT_OFFSET (TubaWidgetsAudioControlsPrivate, play_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "time_label", FALSE, TubaWidgetsAudioControls_private_offset + G_STRUCT_OFFSET (TubaWidgetsAudioControlsPrivate, time_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "duration_label", FALSE, TubaWidgetsAudioControls_private_offset + G_STRUCT_OFFSET (TubaWidgetsAudioControlsPrivate, duration_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "volume_button", FALSE, TubaWidgetsAudioControls_private_offset + G_STRUCT_OFFSET (TubaWidgetsAudioControlsPrivate, volume_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "time_box", FALSE, TubaWidgetsAudioControls_private_offset + G_STRUCT_OFFSET (TubaWidgetsAudioControlsPrivate, time_box));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "play_button_clicked", G_CALLBACK(_tuba_widgets_audio_controls_play_button_clicked_gtk_button_clicked));
}

static void
tuba_widgets_audio_controls_instance_init (TubaWidgetsAudioControls * self,
                                           gpointer klass)
{
	self->priv = tuba_widgets_audio_controls_get_instance_private (self);
	self->priv->_volume = 1.0;
	self->priv->_progress = 0.0;
	self->priv->_ready = FALSE;
	self->priv->_playing = FALSE;
	self->priv->_duration = (gint64) 0;
	self->priv->_current = (gint64) 0;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_widgets_audio_controls_finalize (GObject * obj)
{
	TubaWidgetsAudioControls * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_AUDIO_TYPE_CONTROLS, TubaWidgetsAudioControls);
	g_debug ("Controls.vala:99: Destroying AudioControls");
	G_OBJECT_CLASS (tuba_widgets_audio_controls_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_audio_controls_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsAudioControlsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_audio_controls_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsAudioControls), 0, (GInstanceInitFunc) tuba_widgets_audio_controls_instance_init, NULL };
	GType tuba_widgets_audio_controls_type_id;
	tuba_widgets_audio_controls_type_id = g_type_register_static (gtk_box_get_type (), "TubaWidgetsAudioControls", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsAudioControls_private_offset = g_type_add_instance_private (tuba_widgets_audio_controls_type_id, sizeof (TubaWidgetsAudioControlsPrivate));
	return tuba_widgets_audio_controls_type_id;
}

GType
tuba_widgets_audio_controls_get_type (void)
{
	static GType tuba_widgets_audio_controls_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_audio_controls_type_id__once)) {
		GType tuba_widgets_audio_controls_type_id;
		tuba_widgets_audio_controls_type_id = tuba_widgets_audio_controls_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_audio_controls_type_id__once, tuba_widgets_audio_controls_type_id);
	}
	return tuba_widgets_audio_controls_type_id__once;
}

static void
_vala_tuba_widgets_audio_controls_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	TubaWidgetsAudioControls * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_AUDIO_TYPE_CONTROLS, TubaWidgetsAudioControls);
	switch (property_id) {
		case TUBA_WIDGETS_AUDIO_CONTROLS_VOLUME_PROPERTY:
		g_value_set_double (value, tuba_widgets_audio_controls_get_volume (self));
		break;
		case TUBA_WIDGETS_AUDIO_CONTROLS_PROGRESS_PROPERTY:
		g_value_set_double (value, tuba_widgets_audio_controls_get_progress (self));
		break;
		case TUBA_WIDGETS_AUDIO_CONTROLS_READY_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_audio_controls_get_ready (self));
		break;
		case TUBA_WIDGETS_AUDIO_CONTROLS_PLAYING_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_audio_controls_get_playing (self));
		break;
		case TUBA_WIDGETS_AUDIO_CONTROLS_DURATION_PROPERTY:
		g_value_set_int64 (value, tuba_widgets_audio_controls_get_duration (self));
		break;
		case TUBA_WIDGETS_AUDIO_CONTROLS_CURRENT_PROPERTY:
		g_value_set_int64 (value, tuba_widgets_audio_controls_get_current (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_audio_controls_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	TubaWidgetsAudioControls * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_AUDIO_TYPE_CONTROLS, TubaWidgetsAudioControls);
	switch (property_id) {
		case TUBA_WIDGETS_AUDIO_CONTROLS_VOLUME_PROPERTY:
		tuba_widgets_audio_controls_set_volume (self, g_value_get_double (value));
		break;
		case TUBA_WIDGETS_AUDIO_CONTROLS_PROGRESS_PROPERTY:
		tuba_widgets_audio_controls_set_progress (self, g_value_get_double (value));
		break;
		case TUBA_WIDGETS_AUDIO_CONTROLS_READY_PROPERTY:
		tuba_widgets_audio_controls_set_ready (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_AUDIO_CONTROLS_PLAYING_PROPERTY:
		tuba_widgets_audio_controls_set_playing (self, g_value_get_boolean (value));
		break;
		case TUBA_WIDGETS_AUDIO_CONTROLS_DURATION_PROPERTY:
		tuba_widgets_audio_controls_set_duration (self, g_value_get_int64 (value));
		break;
		case TUBA_WIDGETS_AUDIO_CONTROLS_CURRENT_PROPERTY:
		tuba_widgets_audio_controls_set_current (self, g_value_get_int64 (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

