/* cue-sheet-file-node.c generated by valac 0.36.12.13-3ae08, the Vala compiler
 * generated from cue-sheet-file-node.vala, do not modify */

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

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>


#define GAMES_TYPE_CUE_SHEET_FILE_NODE (games_cue_sheet_file_node_get_type ())
#define GAMES_CUE_SHEET_FILE_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_CUE_SHEET_FILE_NODE, GamesCueSheetFileNode))
#define GAMES_CUE_SHEET_FILE_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_CUE_SHEET_FILE_NODE, GamesCueSheetFileNodeClass))
#define GAMES_IS_CUE_SHEET_FILE_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_CUE_SHEET_FILE_NODE))
#define GAMES_IS_CUE_SHEET_FILE_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_CUE_SHEET_FILE_NODE))
#define GAMES_CUE_SHEET_FILE_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_CUE_SHEET_FILE_NODE, GamesCueSheetFileNodeClass))

typedef struct _GamesCueSheetFileNode GamesCueSheetFileNode;
typedef struct _GamesCueSheetFileNodeClass GamesCueSheetFileNodeClass;
typedef struct _GamesCueSheetFileNodePrivate GamesCueSheetFileNodePrivate;

#define GAMES_TYPE_CUE_SHEET_FILE_FORMAT (games_cue_sheet_file_format_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GamesCueSheetFileNode {
	GObject parent_instance;
	GamesCueSheetFileNodePrivate * priv;
};

struct _GamesCueSheetFileNodeClass {
	GObjectClass parent_class;
};

typedef enum  {
	GAMES_CUE_SHEET_FILE_FORMAT_INVALID,
	GAMES_CUE_SHEET_FILE_FORMAT_AIFF,
	GAMES_CUE_SHEET_FILE_FORMAT_BINARY,
	GAMES_CUE_SHEET_FILE_FORMAT_MOTOROLA,
	GAMES_CUE_SHEET_FILE_FORMAT_MP3,
	GAMES_CUE_SHEET_FILE_FORMAT_VORBIS,
	GAMES_CUE_SHEET_FILE_FORMAT_WAVE,
	GAMES_CUE_SHEET_FILE_FORMAT_UNKNOWN
} GamesCueSheetFileFormat;

struct _GamesCueSheetFileNodePrivate {
	gchar* _file_name;
	GamesCueSheetFileFormat _file_format;
	GFile* _file;
};


static gpointer games_cue_sheet_file_node_parent_class = NULL;

GType games_cue_sheet_file_node_get_type (void) G_GNUC_CONST;
GType games_cue_sheet_file_format_get_type (void) G_GNUC_CONST;
#define GAMES_CUE_SHEET_FILE_NODE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_CUE_SHEET_FILE_NODE, GamesCueSheetFileNodePrivate))
enum  {
	GAMES_CUE_SHEET_FILE_NODE_0_PROPERTY,
	GAMES_CUE_SHEET_FILE_NODE_FILE_NAME_PROPERTY,
	GAMES_CUE_SHEET_FILE_NODE_FILE_FORMAT_PROPERTY,
	GAMES_CUE_SHEET_FILE_NODE_FILE_PROPERTY
};
GamesCueSheetFileNode* games_cue_sheet_file_node_new (GFile* file, GamesCueSheetFileFormat file_format);
GamesCueSheetFileNode* games_cue_sheet_file_node_construct (GType object_type, GFile* file, GamesCueSheetFileFormat file_format);
const gchar* games_cue_sheet_file_node_get_file_name (GamesCueSheetFileNode* self);
static void games_cue_sheet_file_node_set_file_name (GamesCueSheetFileNode* self, const gchar* value);
GamesCueSheetFileFormat games_cue_sheet_file_node_get_file_format (GamesCueSheetFileNode* self);
static void games_cue_sheet_file_node_set_file_format (GamesCueSheetFileNode* self, GamesCueSheetFileFormat value);
GFile* games_cue_sheet_file_node_get_file (GamesCueSheetFileNode* self);
static void games_cue_sheet_file_node_set_file (GamesCueSheetFileNode* self, GFile* value);
static void games_cue_sheet_file_node_finalize (GObject * obj);
static void _vala_games_cue_sheet_file_node_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_games_cue_sheet_file_node_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


GamesCueSheetFileNode* games_cue_sheet_file_node_construct (GType object_type, GFile* file, GamesCueSheetFileFormat file_format) {
	GamesCueSheetFileNode * self = NULL;
	GFile* _tmp0_;
	GamesCueSheetFileFormat _tmp1_;
	g_return_val_if_fail (file != NULL, NULL);
	_tmp0_ = file;
	_tmp1_ = file_format;
	self = (GamesCueSheetFileNode*) g_object_new (object_type, "file", _tmp0_, "file-format", _tmp1_, NULL);
	return self;
}


GamesCueSheetFileNode* games_cue_sheet_file_node_new (GFile* file, GamesCueSheetFileFormat file_format) {
	return games_cue_sheet_file_node_construct (GAMES_TYPE_CUE_SHEET_FILE_NODE, file, file_format);
}


const gchar* games_cue_sheet_file_node_get_file_name (GamesCueSheetFileNode* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_name;
	result = _tmp0_;
	return result;
}


static void games_cue_sheet_file_node_set_file_name (GamesCueSheetFileNode* self, const gchar* value) {
	g_return_if_fail (self != NULL);
	if (g_strcmp0 (value, games_cue_sheet_file_node_get_file_name (self)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_file_name);
		self->priv->_file_name = _tmp1_;
		g_object_notify ((GObject *) self, "file-name");
	}
}


GamesCueSheetFileFormat games_cue_sheet_file_node_get_file_format (GamesCueSheetFileNode* self) {
	GamesCueSheetFileFormat result;
	GamesCueSheetFileFormat _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_file_format;
	result = _tmp0_;
	return result;
}


static void games_cue_sheet_file_node_set_file_format (GamesCueSheetFileNode* self, GamesCueSheetFileFormat value) {
	g_return_if_fail (self != NULL);
	if (games_cue_sheet_file_node_get_file_format (self) != value) {
		GamesCueSheetFileFormat _tmp0_;
		_tmp0_ = value;
		self->priv->_file_format = _tmp0_;
		g_object_notify ((GObject *) self, "file-format");
	}
}


GFile* games_cue_sheet_file_node_get_file (GamesCueSheetFileNode* self) {
	GFile* result;
	GFile* _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_file_node_set_file (GamesCueSheetFileNode* self, GFile* value) {
	g_return_if_fail (self != NULL);
	if (games_cue_sheet_file_node_get_file (self) != value) {
		GFile* _tmp0_;
		GFile* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_g_object_unref0 (self->priv->_file);
		self->priv->_file = _tmp1_;
		g_object_notify ((GObject *) self, "file");
	}
}


static void games_cue_sheet_file_node_class_init (GamesCueSheetFileNodeClass * klass) {
	games_cue_sheet_file_node_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesCueSheetFileNodePrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_games_cue_sheet_file_node_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_cue_sheet_file_node_set_property;
	G_OBJECT_CLASS (klass)->finalize = games_cue_sheet_file_node_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_CUE_SHEET_FILE_NODE_FILE_NAME_PROPERTY, g_param_spec_string ("file-name", "file-name", "file-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_CUE_SHEET_FILE_NODE_FILE_FORMAT_PROPERTY, g_param_spec_enum ("file-format", "file-format", "file-format", GAMES_TYPE_CUE_SHEET_FILE_FORMAT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_CUE_SHEET_FILE_NODE_FILE_PROPERTY, g_param_spec_object ("file", "file", "file", g_file_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void games_cue_sheet_file_node_instance_init (GamesCueSheetFileNode * self) {
	self->priv = GAMES_CUE_SHEET_FILE_NODE_GET_PRIVATE (self);
}


static void games_cue_sheet_file_node_finalize (GObject * obj) {
	GamesCueSheetFileNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_CUE_SHEET_FILE_NODE, GamesCueSheetFileNode);
	_g_free0 (self->priv->_file_name);
	_g_object_unref0 (self->priv->_file);
	G_OBJECT_CLASS (games_cue_sheet_file_node_parent_class)->finalize (obj);
}


GType games_cue_sheet_file_node_get_type (void) {
	static volatile gsize games_cue_sheet_file_node_type_id__volatile = 0;
	if (g_once_init_enter (&games_cue_sheet_file_node_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GamesCueSheetFileNodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_cue_sheet_file_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesCueSheetFileNode), 0, (GInstanceInitFunc) games_cue_sheet_file_node_instance_init, NULL };
		GType games_cue_sheet_file_node_type_id;
		games_cue_sheet_file_node_type_id = g_type_register_static (G_TYPE_OBJECT, "GamesCueSheetFileNode", &g_define_type_info, 0);
		g_once_init_leave (&games_cue_sheet_file_node_type_id__volatile, games_cue_sheet_file_node_type_id);
	}
	return games_cue_sheet_file_node_type_id__volatile;
}


static void _vala_games_cue_sheet_file_node_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GamesCueSheetFileNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_CUE_SHEET_FILE_NODE, GamesCueSheetFileNode);
	switch (property_id) {
		case GAMES_CUE_SHEET_FILE_NODE_FILE_NAME_PROPERTY:
		g_value_set_string (value, games_cue_sheet_file_node_get_file_name (self));
		break;
		case GAMES_CUE_SHEET_FILE_NODE_FILE_FORMAT_PROPERTY:
		g_value_set_enum (value, games_cue_sheet_file_node_get_file_format (self));
		break;
		case GAMES_CUE_SHEET_FILE_NODE_FILE_PROPERTY:
		g_value_set_object (value, games_cue_sheet_file_node_get_file (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_games_cue_sheet_file_node_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GamesCueSheetFileNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_CUE_SHEET_FILE_NODE, GamesCueSheetFileNode);
	switch (property_id) {
		case GAMES_CUE_SHEET_FILE_NODE_FILE_NAME_PROPERTY:
		games_cue_sheet_file_node_set_file_name (self, g_value_get_string (value));
		break;
		case GAMES_CUE_SHEET_FILE_NODE_FILE_FORMAT_PROPERTY:
		games_cue_sheet_file_node_set_file_format (self, g_value_get_enum (value));
		break;
		case GAMES_CUE_SHEET_FILE_NODE_FILE_PROPERTY:
		games_cue_sheet_file_node_set_file (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



