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

/*
 * SPDX-License-Identifier: LGPL-3.0-or-later
 * SPDX-FileCopyrightText: 2021 elementary, Inc. (https://elementary.io)
 */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk/gdk.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 MUSIC_TYPE_AUDIO_OBJECT (music_audio_object_get_type ())
#define MUSIC_AUDIO_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUSIC_TYPE_AUDIO_OBJECT, MusicAudioObject))
#define MUSIC_AUDIO_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUSIC_TYPE_AUDIO_OBJECT, MusicAudioObjectClass))
#define MUSIC_IS_AUDIO_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUSIC_TYPE_AUDIO_OBJECT))
#define MUSIC_IS_AUDIO_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUSIC_TYPE_AUDIO_OBJECT))
#define MUSIC_AUDIO_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUSIC_TYPE_AUDIO_OBJECT, MusicAudioObjectClass))

typedef struct _MusicAudioObject MusicAudioObject;
typedef struct _MusicAudioObjectClass MusicAudioObjectClass;
typedef struct _MusicAudioObjectPrivate MusicAudioObjectPrivate;
enum  {
	MUSIC_AUDIO_OBJECT_0_PROPERTY,
	MUSIC_AUDIO_OBJECT_URI_PROPERTY,
	MUSIC_AUDIO_OBJECT_TEXTURE_PROPERTY,
	MUSIC_AUDIO_OBJECT_ALBUM_PROPERTY,
	MUSIC_AUDIO_OBJECT_ARTIST_PROPERTY,
	MUSIC_AUDIO_OBJECT_TITLE_PROPERTY,
	MUSIC_AUDIO_OBJECT_DURATION_PROPERTY,
	MUSIC_AUDIO_OBJECT_ART_URL_PROPERTY,
	MUSIC_AUDIO_OBJECT_NUM_PROPERTIES
};
static GParamSpec* music_audio_object_properties[MUSIC_AUDIO_OBJECT_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _MusicAudioObject {
	GObject parent_instance;
	MusicAudioObjectPrivate * priv;
};

struct _MusicAudioObjectClass {
	GObjectClass parent_class;
};

struct _MusicAudioObjectPrivate {
	gchar* _uri;
	GdkTexture* _texture;
	gchar* _album;
	gchar* _artist;
	gchar* _title;
	gint64 _duration;
	gchar* _art_url;
};

static gint MusicAudioObject_private_offset;
static gpointer music_audio_object_parent_class = NULL;

VALA_EXTERN GType music_audio_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MusicAudioObject, g_object_unref)
VALA_EXTERN MusicAudioObject* music_audio_object_new (const gchar* uri);
VALA_EXTERN MusicAudioObject* music_audio_object_construct (GType object_type,
                                                const gchar* uri);
VALA_EXTERN gboolean music_audio_object_equal_func (MusicAudioObject* a,
                                        MusicAudioObject* b);
VALA_EXTERN const gchar* music_audio_object_get_uri (MusicAudioObject* self);
static void music_audio_object_set_uri (MusicAudioObject* self,
                                 const gchar* value);
VALA_EXTERN GdkTexture* music_audio_object_get_texture (MusicAudioObject* self);
VALA_EXTERN void music_audio_object_set_texture (MusicAudioObject* self,
                                     GdkTexture* value);
VALA_EXTERN const gchar* music_audio_object_get_album (MusicAudioObject* self);
VALA_EXTERN void music_audio_object_set_album (MusicAudioObject* self,
                                   const gchar* value);
VALA_EXTERN const gchar* music_audio_object_get_artist (MusicAudioObject* self);
VALA_EXTERN void music_audio_object_set_artist (MusicAudioObject* self,
                                    const gchar* value);
VALA_EXTERN const gchar* music_audio_object_get_title (MusicAudioObject* self);
VALA_EXTERN void music_audio_object_set_title (MusicAudioObject* self,
                                   const gchar* value);
VALA_EXTERN gint64 music_audio_object_get_duration (MusicAudioObject* self);
VALA_EXTERN void music_audio_object_set_duration (MusicAudioObject* self,
                                      gint64 value);
VALA_EXTERN const gchar* music_audio_object_get_art_url (MusicAudioObject* self);
VALA_EXTERN void music_audio_object_set_art_url (MusicAudioObject* self,
                                     const gchar* value);
static void music_audio_object_finalize (GObject * obj);
static GType music_audio_object_get_type_once (void);
static void _vala_music_audio_object_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_music_audio_object_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);

static inline gpointer
music_audio_object_get_instance_private (MusicAudioObject* self)
{
	return G_STRUCT_MEMBER_P (self, MusicAudioObject_private_offset);
}

MusicAudioObject*
music_audio_object_construct (GType object_type,
                              const gchar* uri)
{
	MusicAudioObject * self = NULL;
	g_return_val_if_fail (uri != NULL, NULL);
	self = (MusicAudioObject*) g_object_new (object_type, "uri", uri, NULL);
	return self;
}

MusicAudioObject*
music_audio_object_new (const gchar* uri)
{
	return music_audio_object_construct (MUSIC_TYPE_AUDIO_OBJECT, uri);
}

gboolean
music_audio_object_equal_func (MusicAudioObject* a,
                               MusicAudioObject* b)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gboolean result;
	g_return_val_if_fail (a != NULL, FALSE);
	g_return_val_if_fail (b != NULL, FALSE);
	_tmp0_ = a->priv->_uri;
	_tmp1_ = b->priv->_uri;
	result = g_strcmp0 (_tmp0_, _tmp1_) == 0;
	return result;
}

const gchar*
music_audio_object_get_uri (MusicAudioObject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_uri;
	result = _tmp0_;
	return result;
}

static void
music_audio_object_set_uri (MusicAudioObject* self,
                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = music_audio_object_get_uri (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_uri);
		self->priv->_uri = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, music_audio_object_properties[MUSIC_AUDIO_OBJECT_URI_PROPERTY]);
	}
}

GdkTexture*
music_audio_object_get_texture (MusicAudioObject* self)
{
	GdkTexture* result;
	GdkTexture* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_texture;
	result = _tmp0_;
	return result;
}

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

void
music_audio_object_set_texture (MusicAudioObject* self,
                                GdkTexture* value)
{
	GdkTexture* old_value;
	g_return_if_fail (self != NULL);
	old_value = music_audio_object_get_texture (self);
	if (old_value != value) {
		GdkTexture* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_texture);
		self->priv->_texture = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, music_audio_object_properties[MUSIC_AUDIO_OBJECT_TEXTURE_PROPERTY]);
	}
}

const gchar*
music_audio_object_get_album (MusicAudioObject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_album;
	result = _tmp0_;
	return result;
}

void
music_audio_object_set_album (MusicAudioObject* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = music_audio_object_get_album (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_album);
		self->priv->_album = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, music_audio_object_properties[MUSIC_AUDIO_OBJECT_ALBUM_PROPERTY]);
	}
}

const gchar*
music_audio_object_get_artist (MusicAudioObject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_artist;
	result = _tmp0_;
	return result;
}

void
music_audio_object_set_artist (MusicAudioObject* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = music_audio_object_get_artist (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_artist);
		self->priv->_artist = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, music_audio_object_properties[MUSIC_AUDIO_OBJECT_ARTIST_PROPERTY]);
	}
}

const gchar*
music_audio_object_get_title (MusicAudioObject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

void
music_audio_object_set_title (MusicAudioObject* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = music_audio_object_get_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_title);
		self->priv->_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, music_audio_object_properties[MUSIC_AUDIO_OBJECT_TITLE_PROPERTY]);
	}
}

gint64
music_audio_object_get_duration (MusicAudioObject* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, 0LL);
	result = self->priv->_duration;
	return result;
}

void
music_audio_object_set_duration (MusicAudioObject* self,
                                 gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = music_audio_object_get_duration (self);
	if (old_value != value) {
		self->priv->_duration = value;
		g_object_notify_by_pspec ((GObject *) self, music_audio_object_properties[MUSIC_AUDIO_OBJECT_DURATION_PROPERTY]);
	}
}

const gchar*
music_audio_object_get_art_url (MusicAudioObject* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_art_url;
	result = _tmp0_;
	return result;
}

void
music_audio_object_set_art_url (MusicAudioObject* self,
                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = music_audio_object_get_art_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_art_url);
		self->priv->_art_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, music_audio_object_properties[MUSIC_AUDIO_OBJECT_ART_URL_PROPERTY]);
	}
}

static void
music_audio_object_class_init (MusicAudioObjectClass * klass,
                               gpointer klass_data)
{
	music_audio_object_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &MusicAudioObject_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_music_audio_object_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_music_audio_object_set_property;
	G_OBJECT_CLASS (klass)->finalize = music_audio_object_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_AUDIO_OBJECT_URI_PROPERTY, music_audio_object_properties[MUSIC_AUDIO_OBJECT_URI_PROPERTY] = g_param_spec_string ("uri", "uri", "uri", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_AUDIO_OBJECT_TEXTURE_PROPERTY, music_audio_object_properties[MUSIC_AUDIO_OBJECT_TEXTURE_PROPERTY] = g_param_spec_object ("texture", "texture", "texture", gdk_texture_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_AUDIO_OBJECT_ALBUM_PROPERTY, music_audio_object_properties[MUSIC_AUDIO_OBJECT_ALBUM_PROPERTY] = g_param_spec_string ("album", "album", "album", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_AUDIO_OBJECT_ARTIST_PROPERTY, music_audio_object_properties[MUSIC_AUDIO_OBJECT_ARTIST_PROPERTY] = g_param_spec_string ("artist", "artist", "artist", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_AUDIO_OBJECT_TITLE_PROPERTY, music_audio_object_properties[MUSIC_AUDIO_OBJECT_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_AUDIO_OBJECT_DURATION_PROPERTY, music_audio_object_properties[MUSIC_AUDIO_OBJECT_DURATION_PROPERTY] = g_param_spec_int64 ("duration", "duration", "duration", G_MININT64, G_MAXINT64, (gint64) 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MUSIC_AUDIO_OBJECT_ART_URL_PROPERTY, music_audio_object_properties[MUSIC_AUDIO_OBJECT_ART_URL_PROPERTY] = g_param_spec_string ("art-url", "art-url", "art-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
music_audio_object_instance_init (MusicAudioObject * self,
                                  gpointer klass)
{
	gchar* _tmp0_;
	self->priv = music_audio_object_get_instance_private (self);
	self->priv->_texture = NULL;
	self->priv->_duration = (gint64) 0;
	_tmp0_ = g_strdup ("");
	self->priv->_art_url = _tmp0_;
}

static void
music_audio_object_finalize (GObject * obj)
{
	MusicAudioObject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MUSIC_TYPE_AUDIO_OBJECT, MusicAudioObject);
	_g_free0 (self->priv->_uri);
	_g_object_unref0 (self->priv->_texture);
	_g_free0 (self->priv->_album);
	_g_free0 (self->priv->_artist);
	_g_free0 (self->priv->_title);
	_g_free0 (self->priv->_art_url);
	G_OBJECT_CLASS (music_audio_object_parent_class)->finalize (obj);
}

static GType
music_audio_object_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MusicAudioObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) music_audio_object_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MusicAudioObject), 0, (GInstanceInitFunc) music_audio_object_instance_init, NULL };
	GType music_audio_object_type_id;
	music_audio_object_type_id = g_type_register_static (G_TYPE_OBJECT, "MusicAudioObject", &g_define_type_info, 0);
	MusicAudioObject_private_offset = g_type_add_instance_private (music_audio_object_type_id, sizeof (MusicAudioObjectPrivate));
	return music_audio_object_type_id;
}

GType
music_audio_object_get_type (void)
{
	static volatile gsize music_audio_object_type_id__once = 0;
	if (g_once_init_enter (&music_audio_object_type_id__once)) {
		GType music_audio_object_type_id;
		music_audio_object_type_id = music_audio_object_get_type_once ();
		g_once_init_leave (&music_audio_object_type_id__once, music_audio_object_type_id);
	}
	return music_audio_object_type_id__once;
}

static void
_vala_music_audio_object_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	MusicAudioObject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MUSIC_TYPE_AUDIO_OBJECT, MusicAudioObject);
	switch (property_id) {
		case MUSIC_AUDIO_OBJECT_URI_PROPERTY:
		g_value_set_string (value, music_audio_object_get_uri (self));
		break;
		case MUSIC_AUDIO_OBJECT_TEXTURE_PROPERTY:
		g_value_set_object (value, music_audio_object_get_texture (self));
		break;
		case MUSIC_AUDIO_OBJECT_ALBUM_PROPERTY:
		g_value_set_string (value, music_audio_object_get_album (self));
		break;
		case MUSIC_AUDIO_OBJECT_ARTIST_PROPERTY:
		g_value_set_string (value, music_audio_object_get_artist (self));
		break;
		case MUSIC_AUDIO_OBJECT_TITLE_PROPERTY:
		g_value_set_string (value, music_audio_object_get_title (self));
		break;
		case MUSIC_AUDIO_OBJECT_DURATION_PROPERTY:
		g_value_set_int64 (value, music_audio_object_get_duration (self));
		break;
		case MUSIC_AUDIO_OBJECT_ART_URL_PROPERTY:
		g_value_set_string (value, music_audio_object_get_art_url (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_music_audio_object_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	MusicAudioObject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MUSIC_TYPE_AUDIO_OBJECT, MusicAudioObject);
	switch (property_id) {
		case MUSIC_AUDIO_OBJECT_URI_PROPERTY:
		music_audio_object_set_uri (self, g_value_get_string (value));
		break;
		case MUSIC_AUDIO_OBJECT_TEXTURE_PROPERTY:
		music_audio_object_set_texture (self, g_value_get_object (value));
		break;
		case MUSIC_AUDIO_OBJECT_ALBUM_PROPERTY:
		music_audio_object_set_album (self, g_value_get_string (value));
		break;
		case MUSIC_AUDIO_OBJECT_ARTIST_PROPERTY:
		music_audio_object_set_artist (self, g_value_get_string (value));
		break;
		case MUSIC_AUDIO_OBJECT_TITLE_PROPERTY:
		music_audio_object_set_title (self, g_value_get_string (value));
		break;
		case MUSIC_AUDIO_OBJECT_DURATION_PROPERTY:
		music_audio_object_set_duration (self, g_value_get_int64 (value));
		break;
		case MUSIC_AUDIO_OBJECT_ART_URL_PROPERTY:
		music_audio_object_set_art_url (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

