/* cue-sheet-track-node.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from cue-sheet-track-node.vala, do not modify */

/* This file is part of GNOME Games. License: GPL-3.0+.*/

#include "gnome-games.h"
#include <glib.h>
#include <glib-object.h>
#include <string.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	GAMES_CUE_SHEET_TRACK_NODE_0_PROPERTY,
	GAMES_CUE_SHEET_TRACK_NODE_FILE_PROPERTY,
	GAMES_CUE_SHEET_TRACK_NODE_TRACK_NUMBER_PROPERTY,
	GAMES_CUE_SHEET_TRACK_NODE_TRACK_MODE_PROPERTY,
	GAMES_CUE_SHEET_TRACK_NODE_NUM_PROPERTIES
};
static GParamSpec* games_cue_sheet_track_node_properties[GAMES_CUE_SHEET_TRACK_NODE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GamesCueSheetTrackNodePrivate {
	GamesCueSheetFileNode* _file;
	gint _track_number;
	GamesCueSheetTrackMode _track_mode;
};

static gint GamesCueSheetTrackNode_private_offset;
static gpointer games_cue_sheet_track_node_parent_class = NULL;

static void games_cue_sheet_track_node_finalize (GObject * obj);
static GType games_cue_sheet_track_node_get_type_once (void);
static void _vala_games_cue_sheet_track_node_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_games_cue_sheet_track_node_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
games_cue_sheet_track_node_get_instance_private (GamesCueSheetTrackNode* self)
{
	return G_STRUCT_MEMBER_P (self, GamesCueSheetTrackNode_private_offset);
}

GamesCueSheetTrackNode*
games_cue_sheet_track_node_construct (GType object_type,
                                      GamesCueSheetFileNode* file,
                                      gint track_number,
                                      GamesCueSheetTrackMode track_mode)
{
	GamesCueSheetTrackNode * self = NULL;
	g_return_val_if_fail (file != NULL, NULL);
	self = (GamesCueSheetTrackNode*) g_object_new (object_type, "file", file, "track-number", track_number, "track-mode", track_mode, NULL);
	return self;
}

GamesCueSheetTrackNode*
games_cue_sheet_track_node_new (GamesCueSheetFileNode* file,
                                gint track_number,
                                GamesCueSheetTrackMode track_mode)
{
	return games_cue_sheet_track_node_construct (GAMES_TYPE_CUE_SHEET_TRACK_NODE, file, track_number, track_mode);
}

GamesCueSheetFileNode*
games_cue_sheet_track_node_get_file (GamesCueSheetTrackNode* self)
{
	GamesCueSheetFileNode* result;
	GamesCueSheetFileNode* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file;
	result = _tmp0_;
	return result;
}

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

static void
games_cue_sheet_track_node_set_file (GamesCueSheetTrackNode* self,
                                     GamesCueSheetFileNode* value)
{
	GamesCueSheetFileNode* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_cue_sheet_track_node_get_file (self);
	if (old_value != value) {
		GamesCueSheetFileNode* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_file);
		self->priv->_file = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, games_cue_sheet_track_node_properties[GAMES_CUE_SHEET_TRACK_NODE_FILE_PROPERTY]);
	}
}

gint
games_cue_sheet_track_node_get_track_number (GamesCueSheetTrackNode* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_track_number;
	return result;
}

static void
games_cue_sheet_track_node_set_track_number (GamesCueSheetTrackNode* self,
                                             gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = games_cue_sheet_track_node_get_track_number (self);
	if (old_value != value) {
		self->priv->_track_number = value;
		g_object_notify_by_pspec ((GObject *) self, games_cue_sheet_track_node_properties[GAMES_CUE_SHEET_TRACK_NODE_TRACK_NUMBER_PROPERTY]);
	}
}

GamesCueSheetTrackMode
games_cue_sheet_track_node_get_track_mode (GamesCueSheetTrackNode* self)
{
	GamesCueSheetTrackMode result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_track_mode;
	return result;
}

static void
games_cue_sheet_track_node_set_track_mode (GamesCueSheetTrackNode* self,
                                           GamesCueSheetTrackMode value)
{
	GamesCueSheetTrackMode old_value;
	g_return_if_fail (self != NULL);
	old_value = games_cue_sheet_track_node_get_track_mode (self);
	if (old_value != value) {
		self->priv->_track_mode = value;
		g_object_notify_by_pspec ((GObject *) self, games_cue_sheet_track_node_properties[GAMES_CUE_SHEET_TRACK_NODE_TRACK_MODE_PROPERTY]);
	}
}

static void
games_cue_sheet_track_node_class_init (GamesCueSheetTrackNodeClass * klass,
                                       gpointer klass_data)
{
	games_cue_sheet_track_node_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesCueSheetTrackNode_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_games_cue_sheet_track_node_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_cue_sheet_track_node_set_property;
	G_OBJECT_CLASS (klass)->finalize = games_cue_sheet_track_node_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_CUE_SHEET_TRACK_NODE_FILE_PROPERTY, games_cue_sheet_track_node_properties[GAMES_CUE_SHEET_TRACK_NODE_FILE_PROPERTY] = g_param_spec_object ("file", "file", "file", GAMES_TYPE_CUE_SHEET_FILE_NODE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_CUE_SHEET_TRACK_NODE_TRACK_NUMBER_PROPERTY, games_cue_sheet_track_node_properties[GAMES_CUE_SHEET_TRACK_NODE_TRACK_NUMBER_PROPERTY] = g_param_spec_int ("track-number", "track-number", "track-number", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_CUE_SHEET_TRACK_NODE_TRACK_MODE_PROPERTY, games_cue_sheet_track_node_properties[GAMES_CUE_SHEET_TRACK_NODE_TRACK_MODE_PROPERTY] = g_param_spec_enum ("track-mode", "track-mode", "track-mode", GAMES_TYPE_CUE_SHEET_TRACK_MODE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
games_cue_sheet_track_node_instance_init (GamesCueSheetTrackNode * self,
                                          gpointer klass)
{
	self->priv = games_cue_sheet_track_node_get_instance_private (self);
}

static void
games_cue_sheet_track_node_finalize (GObject * obj)
{
	GamesCueSheetTrackNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_CUE_SHEET_TRACK_NODE, GamesCueSheetTrackNode);
	_g_object_unref0 (self->priv->_file);
	G_OBJECT_CLASS (games_cue_sheet_track_node_parent_class)->finalize (obj);
}

static GType
games_cue_sheet_track_node_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesCueSheetTrackNodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_cue_sheet_track_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesCueSheetTrackNode), 0, (GInstanceInitFunc) games_cue_sheet_track_node_instance_init, NULL };
	GType games_cue_sheet_track_node_type_id;
	games_cue_sheet_track_node_type_id = g_type_register_static (G_TYPE_OBJECT, "GamesCueSheetTrackNode", &g_define_type_info, 0);
	GamesCueSheetTrackNode_private_offset = g_type_add_instance_private (games_cue_sheet_track_node_type_id, sizeof (GamesCueSheetTrackNodePrivate));
	return games_cue_sheet_track_node_type_id;
}

GType
games_cue_sheet_track_node_get_type (void)
{
	static volatile gsize games_cue_sheet_track_node_type_id__once = 0;
	if (g_once_init_enter (&games_cue_sheet_track_node_type_id__once)) {
		GType games_cue_sheet_track_node_type_id;
		games_cue_sheet_track_node_type_id = games_cue_sheet_track_node_get_type_once ();
		g_once_init_leave (&games_cue_sheet_track_node_type_id__once, games_cue_sheet_track_node_type_id);
	}
	return games_cue_sheet_track_node_type_id__once;
}

static void
_vala_games_cue_sheet_track_node_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	GamesCueSheetTrackNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_CUE_SHEET_TRACK_NODE, GamesCueSheetTrackNode);
	switch (property_id) {
		case GAMES_CUE_SHEET_TRACK_NODE_FILE_PROPERTY:
		g_value_set_object (value, games_cue_sheet_track_node_get_file (self));
		break;
		case GAMES_CUE_SHEET_TRACK_NODE_TRACK_NUMBER_PROPERTY:
		g_value_set_int (value, games_cue_sheet_track_node_get_track_number (self));
		break;
		case GAMES_CUE_SHEET_TRACK_NODE_TRACK_MODE_PROPERTY:
		g_value_set_enum (value, games_cue_sheet_track_node_get_track_mode (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_cue_sheet_track_node_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	GamesCueSheetTrackNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_CUE_SHEET_TRACK_NODE, GamesCueSheetTrackNode);
	switch (property_id) {
		case GAMES_CUE_SHEET_TRACK_NODE_FILE_PROPERTY:
		games_cue_sheet_track_node_set_file (self, g_value_get_object (value));
		break;
		case GAMES_CUE_SHEET_TRACK_NODE_TRACK_NUMBER_PROPERTY:
		games_cue_sheet_track_node_set_track_number (self, g_value_get_int (value));
		break;
		case GAMES_CUE_SHEET_TRACK_NODE_TRACK_MODE_PROPERTY:
		games_cue_sheet_track_node_set_track_mode (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

