/* rygel-media-export-dvd-track.c generated by valac 0.30.0, the Vala compiler
 * generated from rygel-media-export-dvd-track.vala, do not modify */

/*
 * Copyright (C) 2015 Jens Georg <mail@jensge.org>
 *
 * Author: Jens Georg <mail@jensge.org>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <rygel-server.h>
#include <stdlib.h>
#include <string.h>
#include <libgupnp-av/gupnp-av.h>


#define RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK (rygel_media_export_dvd_track_get_type ())
#define RYGEL_MEDIA_EXPORT_DVD_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK, RygelMediaExportDVDTrack))
#define RYGEL_MEDIA_EXPORT_DVD_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK, RygelMediaExportDVDTrackClass))
#define RYGEL_MEDIA_EXPORT_IS_DVD_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK))
#define RYGEL_MEDIA_EXPORT_IS_DVD_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK))
#define RYGEL_MEDIA_EXPORT_DVD_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK, RygelMediaExportDVDTrackClass))

typedef struct _RygelMediaExportDVDTrack RygelMediaExportDVDTrack;
typedef struct _RygelMediaExportDVDTrackClass RygelMediaExportDVDTrackClass;
typedef struct _RygelMediaExportDVDTrackPrivate RygelMediaExportDVDTrackPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _RygelMediaExportDVDTrack {
	RygelVideoItem parent_instance;
	RygelMediaExportDVDTrackPrivate * priv;
};

struct _RygelMediaExportDVDTrackClass {
	RygelVideoItemClass parent_class;
};


static gpointer rygel_media_export_dvd_track_parent_class = NULL;

GType rygel_media_export_dvd_track_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_MEDIA_EXPORT_DVD_TRACK_DUMMY_PROPERTY
};
RygelMediaExportDVDTrack* rygel_media_export_dvd_track_new (const gchar* id, RygelMediaContainer* parent, const gchar* title);
RygelMediaExportDVDTrack* rygel_media_export_dvd_track_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title);
static RygelMediaResource* rygel_media_export_dvd_track_real_get_primary_resource (RygelMediaFileItem* base);


RygelMediaExportDVDTrack* rygel_media_export_dvd_track_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title) {
	RygelMediaExportDVDTrack * self = NULL;
	const gchar* _tmp0_ = NULL;
	RygelMediaContainer* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	g_return_val_if_fail (id != NULL, NULL);
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	_tmp0_ = id;
	_tmp1_ = parent;
	_tmp2_ = title;
	self = (RygelMediaExportDVDTrack*) rygel_video_item_construct (object_type, _tmp0_, _tmp1_, _tmp2_, RYGEL_VIDEO_ITEM_UPNP_CLASS);
	return self;
}


RygelMediaExportDVDTrack* rygel_media_export_dvd_track_new (const gchar* id, RygelMediaContainer* parent, const gchar* title) {
	return rygel_media_export_dvd_track_construct (RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK, id, parent, title);
}


static RygelMediaResource* rygel_media_export_dvd_track_real_get_primary_resource (RygelMediaFileItem* base) {
	RygelMediaExportDVDTrack * self;
	RygelMediaResource* result = NULL;
	RygelMediaResource* res = NULL;
	RygelMediaResource* _tmp0_ = NULL;
	self = (RygelMediaExportDVDTrack*) base;
	_tmp0_ = RYGEL_MEDIA_FILE_ITEM_CLASS (rygel_media_export_dvd_track_parent_class)->get_primary_resource ((RygelMediaFileItem*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_VIDEO_ITEM, RygelVideoItem));
	res = _tmp0_;
	rygel_media_resource_set_dlna_operation (res, GUPNP_DLNA_OPERATION_TIMESEEK);
	result = res;
	return result;
}


static void rygel_media_export_dvd_track_class_init (RygelMediaExportDVDTrackClass * klass) {
	rygel_media_export_dvd_track_parent_class = g_type_class_peek_parent (klass);
	((RygelMediaFileItemClass *) klass)->get_primary_resource = rygel_media_export_dvd_track_real_get_primary_resource;
}


static void rygel_media_export_dvd_track_instance_init (RygelMediaExportDVDTrack * self) {
}


GType rygel_media_export_dvd_track_get_type (void) {
	static volatile gsize rygel_media_export_dvd_track_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_media_export_dvd_track_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelMediaExportDVDTrackClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_media_export_dvd_track_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelMediaExportDVDTrack), 0, (GInstanceInitFunc) rygel_media_export_dvd_track_instance_init, NULL };
		GType rygel_media_export_dvd_track_type_id;
		rygel_media_export_dvd_track_type_id = g_type_register_static (RYGEL_TYPE_VIDEO_ITEM, "RygelMediaExportDVDTrack", &g_define_type_info, 0);
		g_once_init_leave (&rygel_media_export_dvd_track_type_id__volatile, rygel_media_export_dvd_track_type_id);
	}
	return rygel_media_export_dvd_track_type_id__volatile;
}



