/* example-root-container-vala.c generated by valac 0.40.8, 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.1 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 library; 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;
enum  {
	RYGEL_EXAMPLE_ROOT_CONTAINER_VALA_0_PROPERTY,
	RYGEL_EXAMPLE_ROOT_CONTAINER_VALA_NUM_PROPERTIES
};
static GParamSpec* rygel_example_root_container_vala_properties[RYGEL_EXAMPLE_ROOT_CONTAINER_VALA_NUM_PROPERTIES];
#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;
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;
	RygelMusicItem* item = NULL;
	RygelMusicItem* _tmp0_;
	RygelMusicItem* _tmp1_;
	RygelMusicItem* _tmp2_;
	RygelMusicItem* _tmp3_;
	RygelMusicItem* _tmp4_;
	RygelMusicItem* _tmp5_;
	RygelMusicItem* _tmp6_;
	RygelMusicItem* _tmp7_;
	RygelMusicItem* _tmp8_;
	RygelMusicItem* _tmp9_;
	g_return_val_if_fail (title != NULL, NULL);
	self = (RygelExampleRootContainerVala*) rygel_simple_container_construct_root (object_type, title);
	_tmp0_ = rygel_music_item_new ("test 1", (RygelMediaContainer*) self, "Test 1", RYGEL_MUSIC_ITEM_UPNP_CLASS);
	item = _tmp0_;
	_tmp1_ = item;
	rygel_media_object_add_uri ((RygelMediaObject*) _tmp1_, "file:///home/murrayc/Music/Madness/05_Baggy_Trousers.mp3");
	_tmp2_ = item;
	rygel_media_file_item_set_mime_type ((RygelMediaFileItem*) _tmp2_, "audio/mpeg");
	_tmp3_ = item;
	rygel_media_file_item_add_engine_resources ((RygelMediaFileItem*) _tmp3_, NULL, NULL);
	_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_object_add_uri ((RygelMediaObject*) _tmp6_, "file:///home/murrayc/Music/08%20Busload%20of%20Faith.mp3");
	_tmp7_ = item;
	rygel_media_file_item_set_mime_type ((RygelMediaFileItem*) _tmp7_, "audio/mpeg");
	_tmp8_ = item;
	rygel_media_file_item_add_engine_resources ((RygelMediaFileItem*) _tmp8_, NULL, NULL);
	_tmp9_ = item;
	rygel_simple_container_add_child_item ((RygelSimpleContainer*) self, (RygelMediaItem*) _tmp9_);
	_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;
}



