/* example-root-container-vala.c generated by valac 0.56.1, 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 "rygel-example-server-plugin-vala.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "rygel-server.h"

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)))

static gpointer rygel_example_root_container_vala_parent_class = NULL;

static GType rygel_example_root_container_vala_get_type_once (void);

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,
                                              gpointer klass_data)
{
	rygel_example_root_container_vala_parent_class = g_type_class_peek_parent (klass);
}

static void
rygel_example_root_container_vala_instance_init (RygelExampleRootContainerVala * self,
                                                 gpointer klass)
{
}

/**
 * Our derived MediaContainer.
 * In this example, we just derive from the SimpleContainer,
 * but a real-world server plugin might need something more sophisticated.
 */
static GType
rygel_example_root_container_vala_get_type_once (void)
{
	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);
	return rygel_example_root_container_vala_type_id;
}

GType
rygel_example_root_container_vala_get_type (void)
{
	static volatile gsize rygel_example_root_container_vala_type_id__once = 0;
	if (g_once_init_enter (&rygel_example_root_container_vala_type_id__once)) {
		GType rygel_example_root_container_vala_type_id;
		rygel_example_root_container_vala_type_id = rygel_example_root_container_vala_get_type_once ();
		g_once_init_leave (&rygel_example_root_container_vala_type_id__once, rygel_example_root_container_vala_type_id);
	}
	return rygel_example_root_container_vala_type_id__once;
}

