/* rygel-playspeed-request.c generated by valac 0.40.8, the Vala compiler
 * generated from rygel-playspeed-request.vala, do not modify */

/*
 * Copyright (C) 2013  Cable Television Laboratories, Inc.
 *
 * Author: Craig Pratt <craig@ecaspia.com>
 *
 * 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 <stdlib.h>
#include <string.h>
#include <rygel-core.h>
#include <gio/gio.h>
#include <libsoup/soup.h>


#define RYGEL_TYPE_PLAY_SPEED_REQUEST (rygel_play_speed_request_get_type ())
#define RYGEL_PLAY_SPEED_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_PLAY_SPEED_REQUEST, RygelPlaySpeedRequest))
#define RYGEL_PLAY_SPEED_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_PLAY_SPEED_REQUEST, RygelPlaySpeedRequestClass))
#define RYGEL_IS_PLAY_SPEED_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_PLAY_SPEED_REQUEST))
#define RYGEL_IS_PLAY_SPEED_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_PLAY_SPEED_REQUEST))
#define RYGEL_PLAY_SPEED_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_PLAY_SPEED_REQUEST, RygelPlaySpeedRequestClass))

typedef struct _RygelPlaySpeedRequest RygelPlaySpeedRequest;
typedef struct _RygelPlaySpeedRequestClass RygelPlaySpeedRequestClass;
typedef struct _RygelPlaySpeedRequestPrivate RygelPlaySpeedRequestPrivate;

#define RYGEL_TYPE_PLAY_SPEED (rygel_play_speed_get_type ())
#define RYGEL_PLAY_SPEED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_PLAY_SPEED, RygelPlaySpeed))
#define RYGEL_PLAY_SPEED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_PLAY_SPEED, RygelPlaySpeedClass))
#define RYGEL_IS_PLAY_SPEED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_PLAY_SPEED))
#define RYGEL_IS_PLAY_SPEED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_PLAY_SPEED))
#define RYGEL_PLAY_SPEED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_PLAY_SPEED, RygelPlaySpeedClass))

typedef struct _RygelPlaySpeed RygelPlaySpeed;
typedef struct _RygelPlaySpeedClass RygelPlaySpeedClass;
enum  {
	RYGEL_PLAY_SPEED_REQUEST_0_PROPERTY,
	RYGEL_PLAY_SPEED_REQUEST_SPEED_PROPERTY,
	RYGEL_PLAY_SPEED_REQUEST_NUM_PROPERTIES
};
static GParamSpec* rygel_play_speed_request_properties[RYGEL_PLAY_SPEED_REQUEST_NUM_PROPERTIES];
#define _rygel_play_speed_unref0(var) ((var == NULL) ? NULL : (var = (rygel_play_speed_unref (var), NULL)))

#define RYGEL_TYPE_HTTP_REQUEST (rygel_http_request_get_type ())
#define RYGEL_HTTP_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_REQUEST, RygelHTTPRequest))
#define RYGEL_HTTP_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_REQUEST, RygelHTTPRequestClass))
#define RYGEL_IS_HTTP_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_REQUEST))
#define RYGEL_IS_HTTP_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_REQUEST))
#define RYGEL_HTTP_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_REQUEST, RygelHTTPRequestClass))

typedef struct _RygelHTTPRequest RygelHTTPRequest;
typedef struct _RygelHTTPRequestClass RygelHTTPRequestClass;

#define RYGEL_TYPE_HTTP_GET (rygel_http_get_get_type ())
#define RYGEL_HTTP_GET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_GET, RygelHTTPGet))
#define RYGEL_HTTP_GET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_GET, RygelHTTPGetClass))
#define RYGEL_IS_HTTP_GET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_GET))
#define RYGEL_IS_HTTP_GET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_GET))
#define RYGEL_HTTP_GET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_GET, RygelHTTPGetClass))

typedef struct _RygelHTTPGet RygelHTTPGet;
typedef struct _RygelHTTPGetClass RygelHTTPGetClass;
typedef struct _RygelHTTPRequestPrivate RygelHTTPRequestPrivate;

#define RYGEL_TYPE_HTTP_SERVER (rygel_http_server_get_type ())
#define RYGEL_HTTP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_SERVER, RygelHTTPServer))
#define RYGEL_HTTP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_SERVER, RygelHTTPServerClass))
#define RYGEL_IS_HTTP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_SERVER))
#define RYGEL_IS_HTTP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_SERVER))
#define RYGEL_HTTP_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_SERVER, RygelHTTPServerClass))

typedef struct _RygelHTTPServer RygelHTTPServer;
typedef struct _RygelHTTPServerClass RygelHTTPServerClass;

#define RYGEL_TYPE_HTTP_ITEM_URI (rygel_http_item_uri_get_type ())
#define RYGEL_HTTP_ITEM_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_ITEM_URI, RygelHTTPItemURI))
#define RYGEL_HTTP_ITEM_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_ITEM_URI, RygelHTTPItemURIClass))
#define RYGEL_IS_HTTP_ITEM_URI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_ITEM_URI))
#define RYGEL_IS_HTTP_ITEM_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_ITEM_URI))
#define RYGEL_HTTP_ITEM_URI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_ITEM_URI, RygelHTTPItemURIClass))

typedef struct _RygelHTTPItemURI RygelHTTPItemURI;
typedef struct _RygelHTTPItemURIClass RygelHTTPItemURIClass;

#define RYGEL_TYPE_MEDIA_OBJECT (rygel_media_object_get_type ())
#define RYGEL_MEDIA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_MEDIA_OBJECT, RygelMediaObject))
#define RYGEL_MEDIA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_MEDIA_OBJECT, RygelMediaObjectClass))
#define RYGEL_IS_MEDIA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_MEDIA_OBJECT))
#define RYGEL_IS_MEDIA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_MEDIA_OBJECT))
#define RYGEL_MEDIA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_MEDIA_OBJECT, RygelMediaObjectClass))

typedef struct _RygelMediaObject RygelMediaObject;
typedef struct _RygelMediaObjectClass RygelMediaObjectClass;

#define RYGEL_TYPE_CLIENT_HACKS (rygel_client_hacks_get_type ())
#define RYGEL_CLIENT_HACKS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_CLIENT_HACKS, RygelClientHacks))
#define RYGEL_CLIENT_HACKS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_CLIENT_HACKS, RygelClientHacksClass))
#define RYGEL_IS_CLIENT_HACKS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_CLIENT_HACKS))
#define RYGEL_IS_CLIENT_HACKS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_CLIENT_HACKS))
#define RYGEL_CLIENT_HACKS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_CLIENT_HACKS, RygelClientHacksClass))

typedef struct _RygelClientHacks RygelClientHacks;
typedef struct _RygelClientHacksClass RygelClientHacksClass;
typedef struct _RygelHTTPGetPrivate RygelHTTPGetPrivate;

#define RYGEL_TYPE_HTTP_SEEK_REQUEST (rygel_http_seek_request_get_type ())
#define RYGEL_HTTP_SEEK_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_SEEK_REQUEST, RygelHTTPSeekRequest))
#define RYGEL_HTTP_SEEK_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_SEEK_REQUEST, RygelHTTPSeekRequestClass))
#define RYGEL_IS_HTTP_SEEK_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_SEEK_REQUEST))
#define RYGEL_IS_HTTP_SEEK_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_SEEK_REQUEST))
#define RYGEL_HTTP_SEEK_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_SEEK_REQUEST, RygelHTTPSeekRequestClass))

typedef struct _RygelHTTPSeekRequest RygelHTTPSeekRequest;
typedef struct _RygelHTTPSeekRequestClass RygelHTTPSeekRequestClass;

#define RYGEL_TYPE_HTTP_GET_HANDLER (rygel_http_get_handler_get_type ())
#define RYGEL_HTTP_GET_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_GET_HANDLER, RygelHTTPGetHandler))
#define RYGEL_HTTP_GET_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_GET_HANDLER, RygelHTTPGetHandlerClass))
#define RYGEL_IS_HTTP_GET_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_GET_HANDLER))
#define RYGEL_IS_HTTP_GET_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_GET_HANDLER))
#define RYGEL_HTTP_GET_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_GET_HANDLER, RygelHTTPGetHandlerClass))

typedef struct _RygelHTTPGetHandler RygelHTTPGetHandler;
typedef struct _RygelHTTPGetHandlerClass RygelHTTPGetHandlerClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define RYGEL_TYPE_HTTP_MEDIA_RESOURCE_HANDLER (rygel_http_media_resource_handler_get_type ())
#define RYGEL_HTTP_MEDIA_RESOURCE_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_MEDIA_RESOURCE_HANDLER, RygelHTTPMediaResourceHandler))
#define RYGEL_HTTP_MEDIA_RESOURCE_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_MEDIA_RESOURCE_HANDLER, RygelHTTPMediaResourceHandlerClass))
#define RYGEL_IS_HTTP_MEDIA_RESOURCE_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_MEDIA_RESOURCE_HANDLER))
#define RYGEL_IS_HTTP_MEDIA_RESOURCE_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_MEDIA_RESOURCE_HANDLER))
#define RYGEL_HTTP_MEDIA_RESOURCE_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_MEDIA_RESOURCE_HANDLER, RygelHTTPMediaResourceHandlerClass))

typedef struct _RygelHTTPMediaResourceHandler RygelHTTPMediaResourceHandler;
typedef struct _RygelHTTPMediaResourceHandlerClass RygelHTTPMediaResourceHandlerClass;

#define RYGEL_TYPE_MEDIA_RESOURCE (rygel_media_resource_get_type ())
#define RYGEL_MEDIA_RESOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_MEDIA_RESOURCE, RygelMediaResource))
#define RYGEL_MEDIA_RESOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_MEDIA_RESOURCE, RygelMediaResourceClass))
#define RYGEL_IS_MEDIA_RESOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_MEDIA_RESOURCE))
#define RYGEL_IS_MEDIA_RESOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_MEDIA_RESOURCE))
#define RYGEL_MEDIA_RESOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_MEDIA_RESOURCE, RygelMediaResourceClass))

typedef struct _RygelMediaResource RygelMediaResource;
typedef struct _RygelMediaResourceClass RygelMediaResourceClass;
typedef struct _RygelHTTPGetHandlerPrivate RygelHTTPGetHandlerPrivate;

#define RYGEL_TYPE_HTTP_RESPONSE (rygel_http_response_get_type ())
#define RYGEL_HTTP_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_RESPONSE, RygelHTTPResponse))
#define RYGEL_HTTP_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_RESPONSE, RygelHTTPResponseClass))
#define RYGEL_IS_HTTP_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_RESPONSE))
#define RYGEL_IS_HTTP_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_RESPONSE))
#define RYGEL_HTTP_RESPONSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_RESPONSE, RygelHTTPResponseClass))

typedef struct _RygelHTTPResponse RygelHTTPResponse;
typedef struct _RygelHTTPResponseClass RygelHTTPResponseClass;
typedef struct _RygelHTTPMediaResourceHandlerPrivate RygelHTTPMediaResourceHandlerPrivate;
typedef struct _RygelMediaResourcePrivate RygelMediaResourcePrivate;

typedef enum  {
	RYGEL_PLAY_SPEED_ERROR_INVALID_SPEED_FORMAT,
	RYGEL_PLAY_SPEED_ERROR_SPEED_NOT_PRESENT
} RygelPlaySpeedError;
#define RYGEL_PLAY_SPEED_ERROR rygel_play_speed_error_quark ()
struct _RygelPlaySpeedRequest {
	GObject parent_instance;
	RygelPlaySpeedRequestPrivate * priv;
};

struct _RygelPlaySpeedRequestClass {
	GObjectClass parent_class;
};

struct _RygelPlaySpeedRequestPrivate {
	RygelPlaySpeed* _speed;
};

struct _RygelHTTPRequest {
	GObject parent_instance;
	RygelHTTPRequestPrivate * priv;
	RygelHTTPServer* http_server;
	SoupServer* server;
	SoupMessage* msg;
	RygelHTTPItemURI* uri;
	RygelMediaObject* object;
	RygelClientHacks* hack;
};

struct _RygelHTTPRequestClass {
	GObjectClass parent_class;
	void (*handle) (RygelHTTPRequest* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*handle_finish) (RygelHTTPRequest* self, GAsyncResult* _res_, GError** error);
	void (*find_item) (RygelHTTPRequest* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*find_item_finish) (RygelHTTPRequest* self, GAsyncResult* _res_, GError** error);
};

struct _RygelHTTPGet {
	RygelHTTPRequest parent_instance;
	RygelHTTPGetPrivate * priv;
	RygelHTTPSeekRequest* seek;
	RygelPlaySpeedRequest* speed_request;
	RygelHTTPGetHandler* handler;
};

struct _RygelHTTPGetClass {
	RygelHTTPRequestClass parent_class;
};

typedef enum  {
	RYGEL_HTTP_REQUEST_ERROR_UNACCEPTABLE = SOUP_STATUS_NOT_ACCEPTABLE,
	RYGEL_HTTP_REQUEST_ERROR_BAD_REQUEST = SOUP_STATUS_BAD_REQUEST,
	RYGEL_HTTP_REQUEST_ERROR_NOT_FOUND = SOUP_STATUS_NOT_FOUND,
	RYGEL_HTTP_REQUEST_ERROR_INTERNAL_SERVER_ERROR = SOUP_STATUS_INTERNAL_SERVER_ERROR
} RygelHTTPRequestError;
#define RYGEL_HTTP_REQUEST_ERROR rygel_http_request_error_quark ()
struct _RygelHTTPGetHandler {
	GObject parent_instance;
	RygelHTTPGetHandlerPrivate * priv;
};

struct _RygelHTTPGetHandlerClass {
	GObjectClass parent_class;
	void (*add_response_headers) (RygelHTTPGetHandler* self, RygelHTTPGet* request, GError** error);
	gchar* (*get_default_transfer_mode) (RygelHTTPGetHandler* self);
	gboolean (*supports_transfer_mode) (RygelHTTPGetHandler* self, const gchar* mode);
	gint64 (*get_resource_size) (RygelHTTPGetHandler* self);
	gint64 (*get_resource_duration) (RygelHTTPGetHandler* self);
	gboolean (*supports_byte_seek) (RygelHTTPGetHandler* self);
	gboolean (*supports_time_seek) (RygelHTTPGetHandler* self);
	gboolean (*supports_playspeed) (RygelHTTPGetHandler* self);
	RygelHTTPResponse* (*render_body) (RygelHTTPGetHandler* self, RygelHTTPGet* request, GError** error);
};

struct _RygelHTTPMediaResourceHandler {
	RygelHTTPGetHandler parent_instance;
	RygelHTTPMediaResourceHandlerPrivate * priv;
	RygelMediaResource* media_resource;
};

struct _RygelHTTPMediaResourceHandlerClass {
	RygelHTTPGetHandlerClass parent_class;
};

struct _RygelMediaResource {
	GObject parent_instance;
	RygelMediaResourcePrivate * priv;
	gchar** play_speeds;
	gint play_speeds_length1;
};

struct _RygelMediaResourceClass {
	GObjectClass parent_class;
};


static gpointer rygel_play_speed_request_parent_class = NULL;

GQuark rygel_play_speed_error_quark (void);
GType rygel_play_speed_request_get_type (void) G_GNUC_CONST;
gpointer rygel_play_speed_ref (gpointer instance);
void rygel_play_speed_unref (gpointer instance);
GParamSpec* rygel_param_spec_play_speed (const gchar* name,
                                         const gchar* nick,
                                         const gchar* blurb,
                                         GType object_type,
                                         GParamFlags flags);
void rygel_value_set_play_speed (GValue* value,
                                 gpointer v_object);
void rygel_value_take_play_speed (GValue* value,
                                  gpointer v_object);
gpointer rygel_value_get_play_speed (const GValue* value);
GType rygel_play_speed_get_type (void) G_GNUC_CONST;
#define RYGEL_PLAY_SPEED_REQUEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_TYPE_PLAY_SPEED_REQUEST, RygelPlaySpeedRequestPrivate))
#define RYGEL_PLAY_SPEED_REQUEST_PLAYSPEED_HEADER "PlaySpeed.dlna.org"
GType rygel_http_request_get_type (void) G_GNUC_CONST;
GType rygel_http_get_get_type (void) G_GNUC_CONST;
gboolean rygel_play_speed_request_supported (RygelHTTPGet* request);
GType rygel_http_server_get_type (void) G_GNUC_CONST;
GType rygel_http_item_uri_get_type (void) G_GNUC_CONST;
GType rygel_media_object_get_type (void) G_GNUC_CONST;
GType rygel_client_hacks_get_type (void) G_GNUC_CONST;
GType rygel_http_seek_request_get_type (void) G_GNUC_CONST;
GType rygel_http_get_handler_get_type (void) G_GNUC_CONST;
gboolean rygel_http_get_handler_supports_playspeed (RygelHTTPGetHandler* self);
gboolean rygel_play_speed_request_requested (RygelHTTPGet* request);
RygelPlaySpeedRequest* rygel_play_speed_request_new (gint numerator,
                                                     guint denominator);
RygelPlaySpeedRequest* rygel_play_speed_request_construct (GType object_type,
                                                           gint numerator,
                                                           guint denominator);
RygelPlaySpeed* rygel_play_speed_new (gint numerator,
                                      guint denominator);
RygelPlaySpeed* rygel_play_speed_construct (GType object_type,
                                            gint numerator,
                                            guint denominator);
static void rygel_play_speed_request_set_speed (RygelPlaySpeedRequest* self,
                                         RygelPlaySpeed* value);
RygelPlaySpeedRequest* rygel_play_speed_request_new_from_string (const gchar* speed,
                                                                 GError** error);
RygelPlaySpeedRequest* rygel_play_speed_request_construct_from_string (GType object_type,
                                                                       const gchar* speed,
                                                                       GError** error);
RygelPlaySpeed* rygel_play_speed_new_from_string (const gchar* speed,
                                                  GError** error);
RygelPlaySpeed* rygel_play_speed_construct_from_string (GType object_type,
                                                        const gchar* speed,
                                                        GError** error);
RygelPlaySpeedRequest* rygel_play_speed_request_new_from_request (RygelHTTPGet* request,
                                                                  GError** error);
RygelPlaySpeedRequest* rygel_play_speed_request_construct_from_request (GType object_type,
                                                                        RygelHTTPGet* request,
                                                                        GError** error);
RygelPlaySpeed* rygel_play_speed_request_get_speed (RygelPlaySpeedRequest* self);
gboolean rygel_play_speed_is_normal_rate (RygelPlaySpeed* self);
GType rygel_http_media_resource_handler_get_type (void) G_GNUC_CONST;
GType rygel_media_resource_get_type (void) G_GNUC_CONST;
GQuark rygel_http_request_error_quark (void);
GType rygel_http_response_get_type (void) G_GNUC_CONST;
static gchar** _vala_array_dup6 (gchar** self,
                          int length);
gboolean rygel_play_speed_request_equals (RygelPlaySpeedRequest* self,
                                          RygelPlaySpeedRequest* that);
gboolean rygel_play_speed_equals (RygelPlaySpeed* self,
                                  RygelPlaySpeed* that);
static void rygel_play_speed_request_finalize (GObject * obj);
static void _vala_rygel_play_speed_request_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_rygel_play_speed_request_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gint array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gint array_length,
                       GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


GQuark
rygel_play_speed_error_quark (void)
{
	return g_quark_from_static_string ("rygel_play_speed_error-quark");
}


/**
     * Return true if playspeed is supported
     *
     * This method utilizes elements associated with the request to determine
     * if a PlaySpeed request is supported for the given request/resource.
     */
gboolean
rygel_play_speed_request_supported (RygelHTTPGet* request)
{
	gboolean result = FALSE;
	RygelHTTPGetHandler* _tmp0_;
	g_return_val_if_fail (request != NULL, FALSE);
	_tmp0_ = request->handler;
	result = rygel_http_get_handler_supports_playspeed (_tmp0_);
	return result;
}


gboolean
rygel_play_speed_request_requested (RygelHTTPGet* request)
{
	gboolean result = FALSE;
	SoupMessage* _tmp0_;
	SoupMessageHeaders* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (request != NULL, FALSE);
	_tmp0_ = ((RygelHTTPRequest*) request)->msg;
	_tmp1_ = _tmp0_->request_headers;
	_tmp2_ = soup_message_headers_get_one (_tmp1_, RYGEL_PLAY_SPEED_REQUEST_PLAYSPEED_HEADER);
	result = _tmp2_ != NULL;
	return result;
}


RygelPlaySpeedRequest*
rygel_play_speed_request_construct (GType object_type,
                                    gint numerator,
                                    guint denominator)
{
	RygelPlaySpeedRequest * self = NULL;
	RygelPlaySpeed* _tmp0_;
	RygelPlaySpeed* _tmp1_;
	self = (RygelPlaySpeedRequest*) g_object_new (object_type, NULL);
	_tmp0_ = rygel_play_speed_new (numerator, denominator);
	_tmp1_ = _tmp0_;
	rygel_play_speed_request_set_speed (self, _tmp1_);
	_rygel_play_speed_unref0 (_tmp1_);
	return self;
}


RygelPlaySpeedRequest*
rygel_play_speed_request_new (gint numerator,
                              guint denominator)
{
	return rygel_play_speed_request_construct (RYGEL_TYPE_PLAY_SPEED_REQUEST, numerator, denominator);
}


RygelPlaySpeedRequest*
rygel_play_speed_request_construct_from_string (GType object_type,
                                                const gchar* speed,
                                                GError** error)
{
	RygelPlaySpeedRequest * self = NULL;
	RygelPlaySpeed* _tmp0_ = NULL;
	RygelPlaySpeed* _tmp1_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (speed != NULL, NULL);
	self = (RygelPlaySpeedRequest*) g_object_new (object_type, NULL);
	_tmp1_ = rygel_play_speed_new_from_string (speed, &_inner_error_);
	_tmp0_ = _tmp1_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		if (_inner_error_->domain == RYGEL_PLAY_SPEED_ERROR) {
			g_propagate_error (error, _inner_error_);
			_g_object_unref0 (self);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	rygel_play_speed_request_set_speed (self, _tmp0_);
	_rygel_play_speed_unref0 (_tmp0_);
	return self;
}


RygelPlaySpeedRequest*
rygel_play_speed_request_new_from_string (const gchar* speed,
                                          GError** error)
{
	return rygel_play_speed_request_construct_from_string (RYGEL_TYPE_PLAY_SPEED_REQUEST, speed, error);
}


static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}


static gchar**
_vala_array_dup6 (gchar** self,
                  int length)
{
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


RygelPlaySpeedRequest*
rygel_play_speed_request_construct_from_request (GType object_type,
                                                 RygelHTTPGet* request,
                                                 GError** error)
{
	RygelPlaySpeedRequest * self = NULL;
	gchar* speed_string = NULL;
	SoupMessage* _tmp0_;
	SoupMessageHeaders* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar** elements = NULL;
	const gchar* _tmp8_;
	gchar** _tmp9_;
	gchar** _tmp10_;
	gint elements_length1;
	gint _elements_size_;
	gboolean _tmp11_ = FALSE;
	gchar** _tmp12_;
	gint _tmp12__length1;
	RygelPlaySpeed* _tmp19_ = NULL;
	gchar** _tmp20_;
	gint _tmp20__length1;
	const gchar* _tmp21_;
	RygelPlaySpeed* _tmp22_;
	RygelPlaySpeed* _tmp23_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (request != NULL, NULL);
	self = (RygelPlaySpeedRequest*) g_object_new (object_type, NULL);
	_tmp0_ = ((RygelHTTPRequest*) request)->msg;
	_tmp1_ = _tmp0_->request_headers;
	_tmp2_ = soup_message_headers_get_one (_tmp1_, RYGEL_PLAY_SPEED_REQUEST_PLAYSPEED_HEADER);
	_tmp3_ = g_strdup (_tmp2_);
	speed_string = _tmp3_;
	_tmp4_ = speed_string;
	if (_tmp4_ == NULL) {
		gchar* msg = NULL;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		GError* _tmp7_;
		_tmp5_ = g_strdup ("Could not find playspeed header %s");
		msg = _tmp5_;
		_tmp6_ = msg;
		_tmp7_ = g_error_new (RYGEL_PLAY_SPEED_ERROR, RYGEL_PLAY_SPEED_ERROR_SPEED_NOT_PRESENT, _tmp6_, RYGEL_PLAY_SPEED_REQUEST_PLAYSPEED_HEADER);
		_inner_error_ = _tmp7_;
		if (_inner_error_->domain == RYGEL_PLAY_SPEED_ERROR) {
			g_propagate_error (error, _inner_error_);
			_g_free0 (msg);
			_g_free0 (speed_string);
			_g_object_unref0 (self);
			return NULL;
		} else {
			_g_free0 (msg);
			_g_free0 (speed_string);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_g_free0 (msg);
	}
	_tmp8_ = speed_string;
	_tmp10_ = _tmp9_ = g_strsplit (_tmp8_, "=", 0);
	elements = _tmp10_;
	elements_length1 = _vala_array_length (_tmp9_);
	_elements_size_ = elements_length1;
	_tmp12_ = elements;
	_tmp12__length1 = elements_length1;
	if (_tmp12__length1 != 2) {
		_tmp11_ = TRUE;
	} else {
		gchar** _tmp13_;
		gint _tmp13__length1;
		const gchar* _tmp14_;
		_tmp13_ = elements;
		_tmp13__length1 = elements_length1;
		_tmp14_ = _tmp13_[0];
		_tmp11_ = g_strcmp0 (_tmp14_, "speed") != 0;
	}
	if (_tmp11_) {
		gchar* msg = NULL;
		gchar* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		GError* _tmp18_;
		_tmp15_ = g_strdup ("Ill-formed value for header %s: %s");
		msg = _tmp15_;
		_tmp16_ = msg;
		_tmp17_ = speed_string;
		_tmp18_ = g_error_new (RYGEL_PLAY_SPEED_ERROR, RYGEL_PLAY_SPEED_ERROR_INVALID_SPEED_FORMAT, _tmp16_, RYGEL_PLAY_SPEED_REQUEST_PLAYSPEED_HEADER, _tmp17_);
		_inner_error_ = _tmp18_;
		if (_inner_error_->domain == RYGEL_PLAY_SPEED_ERROR) {
			g_propagate_error (error, _inner_error_);
			_g_free0 (msg);
			elements = (_vala_array_free (elements, elements_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (speed_string);
			_g_object_unref0 (self);
			return NULL;
		} else {
			_g_free0 (msg);
			elements = (_vala_array_free (elements, elements_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (speed_string);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_g_free0 (msg);
	}
	_tmp20_ = elements;
	_tmp20__length1 = elements_length1;
	_tmp21_ = _tmp20_[1];
	_tmp22_ = rygel_play_speed_new_from_string (_tmp21_, &_inner_error_);
	_tmp19_ = _tmp22_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		if (_inner_error_->domain == RYGEL_PLAY_SPEED_ERROR) {
			g_propagate_error (error, _inner_error_);
			elements = (_vala_array_free (elements, elements_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (speed_string);
			_g_object_unref0 (self);
			return NULL;
		} else {
			elements = (_vala_array_free (elements, elements_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (speed_string);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	rygel_play_speed_request_set_speed (self, _tmp19_);
	_tmp23_ = self->priv->_speed;
	if (!rygel_play_speed_is_normal_rate (_tmp23_)) {
		RygelHTTPGetHandler* _tmp24_;
		_tmp24_ = request->handler;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, RYGEL_TYPE_HTTP_MEDIA_RESOURCE_HANDLER)) {
			RygelMediaResource* resource = NULL;
			RygelHTTPGetHandler* _tmp25_;
			RygelMediaResource* _tmp26_;
			RygelMediaResource* _tmp27_;
			gchar** speeds = NULL;
			RygelMediaResource* _tmp28_;
			gchar** _tmp29_;
			gint _tmp29__length1;
			gchar** _tmp30_;
			gint _tmp30__length1;
			gint speeds_length1;
			gint _speeds_size_;
			gboolean found_speed = FALSE;
			gchar** _tmp31_;
			gint _tmp31__length1;
			gboolean _tmp36_;
			_tmp25_ = request->handler;
			_tmp26_ = (G_TYPE_CHECK_INSTANCE_TYPE (_tmp25_, RYGEL_TYPE_HTTP_MEDIA_RESOURCE_HANDLER) ? ((RygelHTTPMediaResourceHandler*) _tmp25_) : NULL)->media_resource;
			_tmp27_ = _g_object_ref0 (_tmp26_);
			resource = _tmp27_;
			_tmp28_ = resource;
			_tmp29_ = _tmp28_->play_speeds;
			_tmp29__length1 = _tmp28_->play_speeds_length1;
			_tmp30_ = (_tmp29_ != NULL) ? _vala_array_dup6 (_tmp29_, _tmp29__length1) : ((gpointer) _tmp29_);
			_tmp30__length1 = _tmp29__length1;
			speeds = _tmp30_;
			speeds_length1 = _tmp30__length1;
			_speeds_size_ = speeds_length1;
			found_speed = FALSE;
			_tmp31_ = speeds;
			_tmp31__length1 = speeds_length1;
			{
				gchar** speed_collection = NULL;
				gint speed_collection_length1 = 0;
				gint _speed_collection_size_ = 0;
				gint speed_it = 0;
				speed_collection = _tmp31_;
				speed_collection_length1 = _tmp31__length1;
				for (speed_it = 0; speed_it < _tmp31__length1; speed_it = speed_it + 1) {
					gchar* _tmp32_;
					gchar* speed = NULL;
					_tmp32_ = g_strdup (speed_collection[speed_it]);
					speed = _tmp32_;
					{
						RygelPlaySpeedRequest* cur_speed = NULL;
						const gchar* _tmp33_;
						RygelPlaySpeedRequest* _tmp34_;
						RygelPlaySpeedRequest* _tmp35_;
						_tmp33_ = speed;
						_tmp34_ = rygel_play_speed_request_new_from_string (_tmp33_, &_inner_error_);
						cur_speed = _tmp34_;
						if (G_UNLIKELY (_inner_error_ != NULL)) {
							if (_inner_error_->domain == RYGEL_PLAY_SPEED_ERROR) {
								g_propagate_error (error, _inner_error_);
								_g_free0 (speed);
								speeds = (_vala_array_free (speeds, speeds_length1, (GDestroyNotify) g_free), NULL);
								_g_object_unref0 (resource);
								_rygel_play_speed_unref0 (_tmp19_);
								elements = (_vala_array_free (elements, elements_length1, (GDestroyNotify) g_free), NULL);
								_g_free0 (speed_string);
								_g_object_unref0 (self);
								return NULL;
							} else {
								_g_free0 (speed);
								speeds = (_vala_array_free (speeds, speeds_length1, (GDestroyNotify) g_free), NULL);
								_g_object_unref0 (resource);
								_rygel_play_speed_unref0 (_tmp19_);
								elements = (_vala_array_free (elements, elements_length1, (GDestroyNotify) g_free), NULL);
								_g_free0 (speed_string);
								g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
								g_clear_error (&_inner_error_);
								return NULL;
							}
						}
						_tmp35_ = cur_speed;
						if (rygel_play_speed_request_equals (self, _tmp35_)) {
							found_speed = TRUE;
							_g_object_unref0 (cur_speed);
							_g_free0 (speed);
							break;
						}
						_g_object_unref0 (cur_speed);
						_g_free0 (speed);
					}
				}
			}
			_tmp36_ = found_speed;
			if (!_tmp36_) {
				const gchar* _tmp37_;
				GError* _tmp38_;
				_tmp37_ = speed_string;
				_tmp38_ = g_error_new (RYGEL_PLAY_SPEED_ERROR, RYGEL_PLAY_SPEED_ERROR_SPEED_NOT_PRESENT, "Unknown playspeed requested (%s)", _tmp37_);
				_inner_error_ = _tmp38_;
				if (_inner_error_->domain == RYGEL_PLAY_SPEED_ERROR) {
					g_propagate_error (error, _inner_error_);
					speeds = (_vala_array_free (speeds, speeds_length1, (GDestroyNotify) g_free), NULL);
					_g_object_unref0 (resource);
					_rygel_play_speed_unref0 (_tmp19_);
					elements = (_vala_array_free (elements, elements_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (speed_string);
					_g_object_unref0 (self);
					return NULL;
				} else {
					speeds = (_vala_array_free (speeds, speeds_length1, (GDestroyNotify) g_free), NULL);
					_g_object_unref0 (resource);
					_rygel_play_speed_unref0 (_tmp19_);
					elements = (_vala_array_free (elements, elements_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (speed_string);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
					g_clear_error (&_inner_error_);
					return NULL;
				}
			}
			speeds = (_vala_array_free (speeds, speeds_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (resource);
		}
	}
	_rygel_play_speed_unref0 (_tmp19_);
	elements = (_vala_array_free (elements, elements_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (speed_string);
	return self;
}


RygelPlaySpeedRequest*
rygel_play_speed_request_new_from_request (RygelHTTPGet* request,
                                           GError** error)
{
	return rygel_play_speed_request_construct_from_request (RYGEL_TYPE_PLAY_SPEED_REQUEST, request, error);
}


gboolean
rygel_play_speed_request_equals (RygelPlaySpeedRequest* self,
                                 RygelPlaySpeedRequest* that)
{
	gboolean result = FALSE;
	RygelPlaySpeed* _tmp0_;
	RygelPlaySpeed* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (that != NULL, FALSE);
	if (that == NULL) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->_speed;
	_tmp1_ = that->priv->_speed;
	result = rygel_play_speed_equals (_tmp0_, _tmp1_);
	return result;
}


RygelPlaySpeed*
rygel_play_speed_request_get_speed (RygelPlaySpeedRequest* self)
{
	RygelPlaySpeed* result;
	RygelPlaySpeed* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_speed;
	result = _tmp0_;
	return result;
}


static gpointer
_rygel_play_speed_ref0 (gpointer self)
{
	return self ? rygel_play_speed_ref (self) : NULL;
}


static void
rygel_play_speed_request_set_speed (RygelPlaySpeedRequest* self,
                                    RygelPlaySpeed* value)
{
	g_return_if_fail (self != NULL);
	if (rygel_play_speed_request_get_speed (self) != value) {
		RygelPlaySpeed* _tmp0_;
		_tmp0_ = _rygel_play_speed_ref0 (value);
		_rygel_play_speed_unref0 (self->priv->_speed);
		self->priv->_speed = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, rygel_play_speed_request_properties[RYGEL_PLAY_SPEED_REQUEST_SPEED_PROPERTY]);
	}
}


static void
rygel_play_speed_request_class_init (RygelPlaySpeedRequestClass * klass)
{
	rygel_play_speed_request_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (RygelPlaySpeedRequestPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_rygel_play_speed_request_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_rygel_play_speed_request_set_property;
	G_OBJECT_CLASS (klass)->finalize = rygel_play_speed_request_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_PLAY_SPEED_REQUEST_SPEED_PROPERTY, rygel_play_speed_request_properties[RYGEL_PLAY_SPEED_REQUEST_SPEED_PROPERTY] = rygel_param_spec_play_speed ("speed", "speed", "speed", RYGEL_TYPE_PLAY_SPEED, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}


static void
rygel_play_speed_request_instance_init (RygelPlaySpeedRequest * self)
{
	self->priv = RYGEL_PLAY_SPEED_REQUEST_GET_PRIVATE (self);
}


static void
rygel_play_speed_request_finalize (GObject * obj)
{
	RygelPlaySpeedRequest * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_PLAY_SPEED_REQUEST, RygelPlaySpeedRequest);
	_rygel_play_speed_unref0 (self->priv->_speed);
	G_OBJECT_CLASS (rygel_play_speed_request_parent_class)->finalize (obj);
}


/**
 * This class represents a DLNA PlaySpeed request (PlaySpeed.dlna.org)
 */
GType
rygel_play_speed_request_get_type (void)
{
	static volatile gsize rygel_play_speed_request_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_play_speed_request_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelPlaySpeedRequestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_play_speed_request_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelPlaySpeedRequest), 0, (GInstanceInitFunc) rygel_play_speed_request_instance_init, NULL };
		GType rygel_play_speed_request_type_id;
		rygel_play_speed_request_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelPlaySpeedRequest", &g_define_type_info, 0);
		g_once_init_leave (&rygel_play_speed_request_type_id__volatile, rygel_play_speed_request_type_id);
	}
	return rygel_play_speed_request_type_id__volatile;
}


static void
_vala_rygel_play_speed_request_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	RygelPlaySpeedRequest * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, RYGEL_TYPE_PLAY_SPEED_REQUEST, RygelPlaySpeedRequest);
	switch (property_id) {
		case RYGEL_PLAY_SPEED_REQUEST_SPEED_PROPERTY:
		rygel_value_set_play_speed (value, rygel_play_speed_request_get_speed (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void
_vala_rygel_play_speed_request_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	RygelPlaySpeedRequest * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, RYGEL_TYPE_PLAY_SPEED_REQUEST, RygelPlaySpeedRequest);
	switch (property_id) {
		case RYGEL_PLAY_SPEED_REQUEST_SPEED_PROPERTY:
		rygel_play_speed_request_set_speed (self, rygel_value_get_play_speed (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void
_vala_array_destroy (gpointer array,
                     gint array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void
_vala_array_free (gpointer array,
                  gint array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint
_vala_array_length (gpointer array)
{
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



