/* example-renderer-plugin-vala.c generated by valac 0.42.2, the Vala compiler
 * generated from example-renderer-plugin-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-core.h>
#include <stdlib.h>
#include <string.h>
#include <rygel-renderer.h>


#define RYGEL_EXAMPLE_TYPE_RENDERER_PLUGIN_VALA (rygel_example_renderer_plugin_vala_get_type ())
#define RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXAMPLE_TYPE_RENDERER_PLUGIN_VALA, RygelExampleRendererPluginVala))
#define RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_EXAMPLE_TYPE_RENDERER_PLUGIN_VALA, RygelExampleRendererPluginValaClass))
#define RYGEL_EXAMPLE_IS_RENDERER_PLUGIN_VALA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXAMPLE_TYPE_RENDERER_PLUGIN_VALA))
#define RYGEL_EXAMPLE_IS_RENDERER_PLUGIN_VALA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_EXAMPLE_TYPE_RENDERER_PLUGIN_VALA))
#define RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_EXAMPLE_TYPE_RENDERER_PLUGIN_VALA, RygelExampleRendererPluginValaClass))

typedef struct _RygelExampleRendererPluginVala RygelExampleRendererPluginVala;
typedef struct _RygelExampleRendererPluginValaClass RygelExampleRendererPluginValaClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _RygelExampleRendererPluginValaPrivate RygelExampleRendererPluginValaPrivate;
enum  {
	RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_0_PROPERTY,
	RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_NUM_PROPERTIES
};
static GParamSpec* rygel_example_renderer_plugin_vala_properties[RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_NUM_PROPERTIES];

#define RYGEL_EXAMPLE_TYPE_PLAYER_VALA (rygel_example_player_vala_get_type ())
#define RYGEL_EXAMPLE_PLAYER_VALA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_EXAMPLE_TYPE_PLAYER_VALA, RygelExamplePlayerVala))
#define RYGEL_EXAMPLE_PLAYER_VALA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_EXAMPLE_TYPE_PLAYER_VALA, RygelExamplePlayerValaClass))
#define RYGEL_EXAMPLE_IS_PLAYER_VALA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_EXAMPLE_TYPE_PLAYER_VALA))
#define RYGEL_EXAMPLE_IS_PLAYER_VALA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_EXAMPLE_TYPE_PLAYER_VALA))
#define RYGEL_EXAMPLE_PLAYER_VALA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_EXAMPLE_TYPE_PLAYER_VALA, RygelExamplePlayerValaClass))

typedef struct _RygelExamplePlayerVala RygelExamplePlayerVala;
typedef struct _RygelExamplePlayerValaClass RygelExamplePlayerValaClass;

struct _RygelExampleRendererPluginVala {
	RygelMediaRendererPlugin parent_instance;
	RygelExampleRendererPluginValaPrivate * priv;
};

struct _RygelExampleRendererPluginValaClass {
	RygelMediaRendererPluginClass parent_class;
};


static gpointer rygel_example_renderer_plugin_vala_parent_class = NULL;

void module_init (RygelPluginLoader* loader);
#define RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_NAME "ExampleRendererPluginVala"
GType rygel_example_renderer_plugin_vala_get_type (void) G_GNUC_CONST;
RygelExampleRendererPluginVala* rygel_example_renderer_plugin_vala_new (void);
RygelExampleRendererPluginVala* rygel_example_renderer_plugin_vala_construct (GType object_type);
#define RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_TITLE "Example Renderer Plugin Vala"
#define RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_DESCRIPTION "An example Rygel renderer plugin implemented in vala."
static void rygel_example_renderer_plugin_vala_real_constructed (GObject* base);
static void _rygel_dlna_profile_unref0_ (gpointer var);
static inline void _g_list_free__rygel_dlna_profile_unref0_ (GList* self);
static RygelMediaPlayer* rygel_example_renderer_plugin_vala_real_get_player (RygelMediaRendererPlugin* base);
GType rygel_example_player_vala_get_type (void) G_GNUC_CONST;
RygelExamplePlayerVala* rygel_example_player_vala_get_default (void);


void
module_init (RygelPluginLoader* loader)
{
	RygelExampleRendererPluginVala* plugin = NULL;
	RygelExampleRendererPluginVala* _tmp0_;
	RygelExampleRendererPluginVala* _tmp1_;
	g_return_if_fail (loader != NULL);
	if (rygel_plugin_loader_plugin_disabled (loader, RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_NAME)) {
		g_message ("example-renderer-plugin-vala.vala:26: Plugin '%s' disabled by user, ig" \
"noring..", RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_NAME);
		return;
	}
	_tmp0_ = rygel_example_renderer_plugin_vala_new ();
	plugin = _tmp0_;
	_tmp1_ = plugin;
	rygel_plugin_loader_add_plugin (loader, (RygelPlugin*) _tmp1_);
	_g_object_unref0 (plugin);
}


RygelExampleRendererPluginVala*
rygel_example_renderer_plugin_vala_construct (GType object_type)
{
	RygelExampleRendererPluginVala * self = NULL;
	self = (RygelExampleRendererPluginVala*) rygel_media_renderer_plugin_construct (object_type, RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_NAME, RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_TITLE, RYGEL_EXAMPLE_RENDERER_PLUGIN_VALA_DESCRIPTION, RYGEL_PLUGIN_CAPABILITIES_NONE);
	return self;
}


RygelExampleRendererPluginVala*
rygel_example_renderer_plugin_vala_new (void)
{
	return rygel_example_renderer_plugin_vala_construct (RYGEL_EXAMPLE_TYPE_RENDERER_PLUGIN_VALA);
}


static void
_rygel_dlna_profile_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (rygel_dlna_profile_unref (var), NULL));
}


static inline void
_g_list_free__rygel_dlna_profile_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _rygel_dlna_profile_unref0_);
}


static void
rygel_example_renderer_plugin_vala_real_constructed (GObject* base)
{
	RygelExampleRendererPluginVala * self;
	GList* l = NULL;
	RygelDLNAProfile* _tmp0_;
	RygelDLNAProfile* _tmp1_;
	self = (RygelExampleRendererPluginVala*) base;
	G_OBJECT_CLASS (rygel_example_renderer_plugin_vala_parent_class)->constructed ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_MEDIA_RENDERER_PLUGIN, RygelMediaRendererPlugin));
	l = NULL;
	_tmp0_ = rygel_dlna_profile_new ("JPEG_SM", "image/jpeg");
	l = g_list_prepend (l, _tmp0_);
	_tmp1_ = rygel_dlna_profile_new ("MP3", "audio/mpeg");
	l = g_list_prepend (l, _tmp1_);
	rygel_media_renderer_plugin_set_supported_profiles ((RygelMediaRendererPlugin*) self, l);
	(l == NULL) ? NULL : (l = (_g_list_free__rygel_dlna_profile_unref0_ (l), NULL));
}


static RygelMediaPlayer*
rygel_example_renderer_plugin_vala_real_get_player (RygelMediaRendererPlugin* base)
{
	RygelExampleRendererPluginVala * self;
	RygelMediaPlayer* result = NULL;
	RygelExamplePlayerVala* _tmp0_;
	self = (RygelExampleRendererPluginVala*) base;
	_tmp0_ = rygel_example_player_vala_get_default ();
	result = (RygelMediaPlayer*) _tmp0_;
	return result;
}


static void
rygel_example_renderer_plugin_vala_class_init (RygelExampleRendererPluginValaClass * klass)
{
	rygel_example_renderer_plugin_vala_parent_class = g_type_class_peek_parent (klass);
	((GObjectClass *) klass)->constructed = (void (*) (GObject *)) rygel_example_renderer_plugin_vala_real_constructed;
	((RygelMediaRendererPluginClass *) klass)->get_player = (RygelMediaPlayer* (*) (RygelMediaRendererPlugin *)) rygel_example_renderer_plugin_vala_real_get_player;
}


static void
rygel_example_renderer_plugin_vala_instance_init (RygelExampleRendererPluginVala * self)
{
}


GType
rygel_example_renderer_plugin_vala_get_type (void)
{
	static volatile gsize rygel_example_renderer_plugin_vala_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_example_renderer_plugin_vala_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelExampleRendererPluginValaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_example_renderer_plugin_vala_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelExampleRendererPluginVala), 0, (GInstanceInitFunc) rygel_example_renderer_plugin_vala_instance_init, NULL };
		GType rygel_example_renderer_plugin_vala_type_id;
		rygel_example_renderer_plugin_vala_type_id = g_type_register_static (RYGEL_TYPE_MEDIA_RENDERER_PLUGIN, "RygelExampleRendererPluginVala", &g_define_type_info, 0);
		g_once_init_leave (&rygel_example_renderer_plugin_vala_type_id__volatile, rygel_example_renderer_plugin_vala_type_id);
	}
	return rygel_example_renderer_plugin_vala_type_id__volatile;
}



