/* example-root-container-vala.c generated by valac 0.24.0.112-bbf5, the Vala compiler
 * generated from example-root-container-vala.vala, do not modify */

/*
 * Copyright (C) 2012 Intel Corporation
 *
 * 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>


#define RYGEL_EXAMPLE_TYPE_ROOT_CONTAINER_VALA (rygel_example_root_container_vala_get_type ())
#define RYGEL_EXAMPLE_ROOT_CONTAINER_VALA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXAMPLE_TYPE_ROOT_CONTAINER_VALA, RygelExampleRootContainerVala))
#define RYGEL_EXAMPLE_ROOT_CONTAINER_VALA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_EXAMPLE_TYPE_ROOT_CONTAINER_VALA, RygelExampleRootContainerValaClass))
#define RYGEL_EXAMPLE_IS_ROOT_CONTAINER_VALA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXAMPLE_TYPE_ROOT_CONTAINER_VALA))
#define RYGEL_EXAMPLE_IS_ROOT_CONTAINER_VALA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_EXAMPLE_TYPE_ROOT_CONTAINER_VALA))
#define RYGEL_EXAMPLE_ROOT_CONTAINER_VALA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_EXAMPLE_TYPE_ROOT_CONTAINER_VALA, RygelExampleRootContainerValaClass))

typedef struct _RygelExampleRootContainerVala RygelExampleRootContainerVala;
typedef struct _RygelExampleRootContainerValaClass RygelExampleRootContainerValaClass;
typedef struct _RygelExampleRootContainerValaPrivate RygelExampleRootContainerValaPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _RygelExampleRootContainerVala {
	RygelSimpleContainer parent_instance;
	RygelExampleRootContainerValaPrivate * priv;
};

struct _RygelExampleRootContainerValaClass {
	RygelSimpleContainerClass parent_class;
};


static gpointer rygel_example_root_container_vala_parent_class = NULL;

GType rygel_example_root_container_vala_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_EXAMPLE_ROOT_CONTAINER_VALA_DUMMY_PROPERTY
};
RygelExampleRootContainerVala* rygel_example_root_container_vala_new (const gchar* title);
RygelExampleRootContainerVala* rygel_example_root_container_vala_construct (GType object_type, const gchar* title);


RygelExampleRootContainerVala* rygel_example_root_container_vala_construct (GType object_type, const gchar* title) {
	RygelExampleRootContainerVala * self = NULL;
	const gchar* _tmp0_ = NULL;
	RygelMusicItem* item = NULL;
	RygelMusicItem* _tmp1_ = NULL;
	RygelMusicItem* _tmp2_ = NULL;
	RygelMusicItem* _tmp3_ = NULL;
	RygelMusicItem* _tmp4_ = NULL;
	RygelMusicItem* _tmp5_ = NULL;
	RygelMusicItem* _tmp6_ = NULL;
	RygelMusicItem* _tmp7_ = NULL;
	RygelMusicItem* _tmp8_ = NULL;
	g_return_val_if_fail (title != NULL, NULL);
	_tmp0_ = title;
	self = (RygelExampleRootContainerVala*) rygel_simple_container_construct_root (object_type, _tmp0_);
	_tmp1_ = rygel_music_item_new ("test 1", (RygelMediaContainer*) self, "Test 1", RYGEL_MUSIC_ITEM_UPNP_CLASS);
	item = _tmp1_;
	_tmp2_ = item;
	rygel_media_item_add_uri ((RygelMediaItem*) _tmp2_, "file:///home/murrayc/Music/Madness/05_Baggy_Trousers.mp3");
	_tmp3_ = item;
	rygel_media_item_set_mime_type ((RygelMediaItem*) _tmp3_, "audio/mpeg");
	_tmp4_ = item;
	rygel_simple_container_add_child_item ((RygelSimpleContainer*) self, (RygelMediaItem*) _tmp4_);
	_tmp5_ = rygel_music_item_new ("test 2", (RygelMediaContainer*) self, "Test 2", RYGEL_MUSIC_ITEM_UPNP_CLASS);
	_g_object_unref0 (item);
	item = _tmp5_;
	_tmp6_ = item;
	rygel_media_item_add_uri ((RygelMediaItem*) _tmp6_, "file:///home/murrayc/Music/08%20Busload%20of%20Faith.mp3");
	_tmp7_ = item;
	rygel_media_item_set_mime_type ((RygelMediaItem*) _tmp7_, "audio/mpeg");
	_tmp8_ = item;
	rygel_simple_container_add_child_item ((RygelSimpleContainer*) self, (RygelMediaItem*) _tmp8_);
	_g_object_unref0 (item);
	return self;
}


RygelExampleRootContainerVala* rygel_example_root_container_vala_new (const gchar* title) {
	return rygel_example_root_container_vala_construct (RYGEL_EXAMPLE_TYPE_ROOT_CONTAINER_VALA, title);
}


static void rygel_example_root_container_vala_class_init (RygelExampleRootContainerValaClass * klass) {
	rygel_example_root_container_vala_parent_class = g_type_class_peek_parent (klass);
}


static void rygel_example_root_container_vala_instance_init (RygelExampleRootContainerVala * self) {
}


/**
 * Our derived MediaContainer.
 * In this example, we just derive from the SimpleContainer,
 * but a real-world server plugin might need something more sophisticated.
 */
GType rygel_example_root_container_vala_get_type (void) {
	static volatile gsize rygel_example_root_container_vala_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_example_root_container_vala_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelExampleRootContainerValaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_example_root_container_vala_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelExampleRootContainerVala), 0, (GInstanceInitFunc) rygel_example_root_container_vala_instance_init, NULL };
		GType rygel_example_root_container_vala_type_id;
		rygel_example_root_container_vala_type_id = g_type_register_static (RYGEL_TYPE_SIMPLE_CONTAINER, "RygelExampleRootContainerVala", &g_define_type_info, 0);
		g_once_init_leave (&rygel_example_root_container_vala_type_id__volatile, rygel_example_root_container_vala_type_id);
	}
	return rygel_example_root_container_vala_type_id__volatile;
}



