/* rygel-lms-all-videos.c generated by valac 0.40.8, the Vala compiler
 * generated from rygel-lms-all-videos.vala, do not modify */

/*
 * Copyright (C) 2013 Intel Corporation.
 *
 * Author: Jussi Kukkonen <jussi.kukkonen@intel.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 <rygel-server.h>
#include <sqlite3.h>
#include <stdlib.h>
#include <string.h>
#include <rygel-db.h>
#include <gio/gio.h>


#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))

typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;

#define RYGEL_LMS_TYPE_ALL_VIDEOS (rygel_lms_all_videos_get_type ())
#define RYGEL_LMS_ALL_VIDEOS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALL_VIDEOS, RygelLMSAllVideos))
#define RYGEL_LMS_ALL_VIDEOS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALL_VIDEOS, RygelLMSAllVideosClass))
#define RYGEL_LMS_IS_ALL_VIDEOS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALL_VIDEOS))
#define RYGEL_LMS_IS_ALL_VIDEOS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALL_VIDEOS))
#define RYGEL_LMS_ALL_VIDEOS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALL_VIDEOS, RygelLMSAllVideosClass))

typedef struct _RygelLMSAllVideos RygelLMSAllVideos;
typedef struct _RygelLMSAllVideosClass RygelLMSAllVideosClass;
typedef struct _RygelLMSAllVideosPrivate RygelLMSAllVideosPrivate;
enum  {
	RYGEL_LMS_ALL_VIDEOS_0_PROPERTY,
	RYGEL_LMS_ALL_VIDEOS_NUM_PROPERTIES
};
static GParamSpec* rygel_lms_all_videos_properties[RYGEL_LMS_ALL_VIDEOS_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))

typedef struct _RygelLMSDatabase RygelLMSDatabase;
typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _rygel_database_cursor_iterator_unref0(var) ((var == NULL) ? NULL : (var = (rygel_database_cursor_iterator_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _RygelLMSCategoryContainer {
	RygelMediaContainer parent_instance;
	RygelLMSCategoryContainerPrivate * priv;
	RygelDatabaseCursor* cursor_all;
	RygelDatabaseCursor* cursor_find_object;
	RygelDatabaseCursor* cursor_added;
	RygelDatabaseCursor* cursor_removed;
	gchar* child_prefix;
	gchar* ref_prefix;
};

struct _RygelLMSCategoryContainerClass {
	RygelMediaContainerClass parent_class;
	RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
	gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
	gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
	guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
	RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
};

struct _RygelLMSAllVideos {
	RygelLMSCategoryContainer parent_instance;
	RygelLMSAllVideosPrivate * priv;
};

struct _RygelLMSAllVideosClass {
	RygelLMSCategoryContainerClass parent_class;
};


static gpointer rygel_lms_all_videos_parent_class = NULL;

GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
GType rygel_lms_all_videos_get_type (void) G_GNUC_CONST;
#define RYGEL_LMS_ALL_VIDEOS_SQL_ALL "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profi" \
"le, dlna_mime " "FROM videos, files " "WHERE dtime = 0 AND videos.id = files.id " "LIMIT ? OFFSET ?;"
#define RYGEL_LMS_ALL_VIDEOS_SQL_COUNT "SELECT count(videos.id) " "FROM videos, files " "WHERE dtime = 0 AND videos.id = files.id;"
#define RYGEL_LMS_ALL_VIDEOS_SQL_FIND_OBJECT "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profi" \
"le, dlna_mime " "FROM videos, files " "WHERE dtime = 0 AND files.id = ? AND videos.id = files.id;"
#define RYGEL_LMS_ALL_VIDEOS_SQL_ADDED "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profi" \
"le, dlna_mime " "FROM videos, files " "WHERE dtime = 0 AND videos.id = files.id " "AND update_id > ? AND update_id <= ?;"
#define RYGEL_LMS_ALL_VIDEOS_SQL_REMOVED "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profi" \
"le, dlna_mime " "FROM videos, files " "WHERE dtime <> 0 AND videos.id = files.id " "AND update_id > ? AND update_id <= ?;"
static RygelMediaObject* rygel_lms_all_videos_real_object_from_statement (RygelLMSCategoryContainer* base,
                                                                   sqlite3_stmt* statement);
gchar* rygel_lms_category_container_build_child_id (RygelLMSCategoryContainer* self,
                                                    gint db_id);
GType rygel_lms_database_get_type (void) G_GNUC_CONST;
RygelLMSDatabase* rygel_lms_category_container_get_lms_db (RygelLMSCategoryContainer* self);
static void _vala_GValue_array_free (GValue * array,
                              gint array_length);
RygelLMSAllVideos* rygel_lms_all_videos_new (const gchar* id,
                                             RygelMediaContainer* parent,
                                             const gchar* title,
                                             RygelLMSDatabase* lms_db);
RygelLMSAllVideos* rygel_lms_all_videos_construct (GType object_type,
                                                   const gchar* id,
                                                   RygelMediaContainer* parent,
                                                   const gchar* title,
                                                   RygelLMSDatabase* lms_db);
RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type,
                                                                   const gchar* db_id,
                                                                   RygelMediaContainer* parent,
                                                                   const gchar* title,
                                                                   RygelLMSDatabase* lms_db,
                                                                   const gchar* sql_all,
                                                                   const gchar* sql_find_object,
                                                                   const gchar* sql_count,
                                                                   const gchar* sql_added,
                                                                   const gchar* sql_removed);


static void
_vala_GValue_array_free (GValue * array,
                         gint array_length)
{
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			g_value_unset (&array[i]);
		}
	}
	g_free (array);
}


static RygelMediaObject*
rygel_lms_all_videos_real_object_from_statement (RygelLMSCategoryContainer* base,
                                                 sqlite3_stmt* statement)
{
	RygelLMSAllVideos * self;
	RygelMediaObject* result = NULL;
	gint id = 0;
	gchar* mime_type = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* path = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GFile* file = NULL;
	const gchar* _tmp4_;
	GFile* _tmp5_;
	gboolean _tmp6_ = FALSE;
	const gchar* _tmp7_;
	gchar* title = NULL;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	RygelVideoItem* video = NULL;
	gint _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	const gchar* _tmp18_;
	RygelVideoItem* _tmp19_;
	RygelVideoItem* _tmp20_;
	RygelVideoItem* _tmp21_;
	const gchar* _tmp22_;
	RygelVideoItem* _tmp23_;
	GTimeVal tv = {0};
	GTimeVal _tmp24_ = {0};
	RygelVideoItem* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	RygelVideoItem* _tmp28_;
	RygelVideoItem* _tmp29_;
	const gchar* _tmp30_;
	RygelVideoItem* _tmp31_;
	const gchar* _tmp32_;
	RygelVideoItem* _tmp33_;
	GFile* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* video_data = NULL;
	gchar* _tmp37_;
	GError * _inner_error_ = NULL;
	self = (RygelLMSAllVideos*) base;
	g_return_val_if_fail (statement != NULL, NULL);
	id = sqlite3_column_int (statement, 0);
	_tmp0_ = sqlite3_column_text (statement, 8);
	_tmp1_ = g_strdup (_tmp0_);
	mime_type = _tmp1_;
	_tmp2_ = sqlite3_column_text (statement, 4);
	_tmp3_ = g_strdup (_tmp2_);
	path = _tmp3_;
	_tmp4_ = path;
	_tmp5_ = g_file_new_for_path (_tmp4_);
	file = _tmp5_;
	_tmp7_ = mime_type;
	if (_tmp7_ == NULL) {
		_tmp6_ = TRUE;
	} else {
		const gchar* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		_tmp8_ = mime_type;
		_tmp9_ = strlen (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp6_ = _tmp10_ == 0;
	}
	if (_tmp6_) {
		gint _tmp11_;
		const gchar* _tmp12_;
		_tmp11_ = id;
		_tmp12_ = path;
		g_debug ("rygel-lms-all-videos.vala:77: Video item %d (%s) has no MIME type", _tmp11_, _tmp12_);
	}
	_tmp13_ = sqlite3_column_text (statement, 1);
	_tmp14_ = g_strdup (_tmp13_);
	title = _tmp14_;
	_tmp15_ = id;
	_tmp16_ = rygel_lms_category_container_build_child_id ((RygelLMSCategoryContainer*) self, _tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = title;
	_tmp19_ = rygel_video_item_new (_tmp17_, (RygelMediaContainer*) self, _tmp18_, RYGEL_VIDEO_ITEM_UPNP_CLASS);
	_tmp20_ = _tmp19_;
	_g_free0 (_tmp17_);
	video = _tmp20_;
	_tmp21_ = video;
	_tmp22_ = sqlite3_column_text (statement, 2);
	rygel_media_object_set_creator ((RygelMediaObject*) _tmp21_, _tmp22_);
	_tmp23_ = video;
	rygel_audio_item_set_duration ((RygelAudioItem*) _tmp23_, (glong) sqlite3_column_int (statement, 3));
	_tmp24_.tv_sec = (glong) sqlite3_column_int (statement, 5);
	_tmp24_.tv_usec = (glong) 0;
	tv = _tmp24_;
	_tmp25_ = video;
	_tmp26_ = g_time_val_to_iso8601 (&tv);
	_tmp27_ = _tmp26_;
	rygel_media_object_set_date ((RygelMediaObject*) _tmp25_, _tmp27_);
	_g_free0 (_tmp27_);
	_tmp28_ = video;
	rygel_media_file_item_set_size ((RygelMediaFileItem*) _tmp28_, (gint64) sqlite3_column_int (statement, 6));
	_tmp29_ = video;
	_tmp30_ = sqlite3_column_text (statement, 7);
	rygel_media_file_item_set_dlna_profile ((RygelMediaFileItem*) _tmp29_, _tmp30_);
	_tmp31_ = video;
	_tmp32_ = mime_type;
	rygel_media_file_item_set_mime_type ((RygelMediaFileItem*) _tmp31_, _tmp32_);
	_tmp33_ = video;
	_tmp34_ = file;
	_tmp35_ = g_file_get_uri (_tmp34_);
	_tmp36_ = _tmp35_;
	rygel_media_object_add_uri ((RygelMediaObject*) _tmp33_, _tmp36_);
	_g_free0 (_tmp36_);
	_tmp37_ = g_strdup ("select videos_videos.bitrate + videos_audios.bitrate, width, height, c" \
"hannels, sampling_rate " "from videos, videos_audios, videos_videos where videos.id = ? " "and videos.id = videos_audios.video_id and videos.id = videos_videos.v" \
"ideo_id;");
	video_data = _tmp37_;
	{
		GValue* args = NULL;
		gint _tmp38_;
		GValue _tmp39_ = {0};
		GValue* _tmp40_;
		gint args_length1;
		gint _args_size_;
		RygelDatabaseCursor* cursor = NULL;
		RygelLMSDatabase* _tmp41_;
		RygelLMSDatabase* _tmp42_;
		const gchar* _tmp43_;
		GValue* _tmp44_;
		gint _tmp44__length1;
		RygelDatabaseCursor* _tmp45_;
		_tmp38_ = id;
		g_value_init (&_tmp39_, G_TYPE_INT);
		g_value_set_int (&_tmp39_, _tmp38_);
		_tmp40_ = g_new0 (GValue, 1);
		_tmp40_[0] = _tmp39_;
		args = _tmp40_;
		args_length1 = 1;
		_args_size_ = args_length1;
		_tmp41_ = rygel_lms_category_container_get_lms_db ((RygelLMSCategoryContainer*) self);
		_tmp42_ = _tmp41_;
		_tmp43_ = video_data;
		_tmp44_ = args;
		_tmp44__length1 = args_length1;
		_tmp45_ = rygel_database_database_exec_cursor ((RygelDatabaseDatabase*) _tmp42_, _tmp43_, _tmp44_, _tmp44__length1, &_inner_error_);
		cursor = _tmp45_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			args = (_vala_GValue_array_free (args, args_length1), NULL);
			if (_inner_error_->domain == RYGEL_DATABASE_DATABASE_ERROR) {
				goto __catch10_rygel_database_database_error;
			}
			args = (_vala_GValue_array_free (args, args_length1), NULL);
			_g_free0 (video_data);
			_g_object_unref0 (video);
			_g_free0 (title);
			_g_object_unref0 (file);
			_g_free0 (path);
			_g_free0 (mime_type);
			g_critical ("file %s: line %d: unexpected 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;
		}
		{
			RygelDatabaseCursorIterator* _stmt_it = NULL;
			RygelDatabaseCursor* _tmp46_;
			RygelDatabaseCursorIterator* _tmp47_;
			_tmp46_ = cursor;
			_tmp47_ = rygel_database_cursor_iterator (_tmp46_);
			_stmt_it = _tmp47_;
			while (TRUE) {
				gboolean _tmp48_ = FALSE;
				RygelDatabaseCursorIterator* _tmp49_;
				sqlite3_stmt* stmt = NULL;
				RygelDatabaseCursorIterator* _tmp50_;
				sqlite3_stmt* _tmp51_;
				RygelVideoItem* _tmp52_;
				sqlite3_stmt* _tmp53_;
				RygelVideoItem* _tmp54_;
				sqlite3_stmt* _tmp55_;
				RygelVideoItem* _tmp56_;
				sqlite3_stmt* _tmp57_;
				RygelVideoItem* _tmp58_;
				sqlite3_stmt* _tmp59_;
				RygelVideoItem* _tmp60_;
				sqlite3_stmt* _tmp61_;
				_tmp49_ = _stmt_it;
				_tmp48_ = rygel_database_cursor_iterator_next (_tmp49_, &_inner_error_);
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					_rygel_database_cursor_iterator_unref0 (_stmt_it);
					_g_object_unref0 (cursor);
					args = (_vala_GValue_array_free (args, args_length1), NULL);
					if (_inner_error_->domain == RYGEL_DATABASE_DATABASE_ERROR) {
						goto __catch10_rygel_database_database_error;
					}
					_rygel_database_cursor_iterator_unref0 (_stmt_it);
					_g_object_unref0 (cursor);
					args = (_vala_GValue_array_free (args, args_length1), NULL);
					_g_free0 (video_data);
					_g_object_unref0 (video);
					_g_free0 (title);
					_g_object_unref0 (file);
					_g_free0 (path);
					_g_free0 (mime_type);
					g_critical ("file %s: line %d: unexpected 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;
				}
				if (!_tmp48_) {
					break;
				}
				_tmp50_ = _stmt_it;
				_tmp51_ = rygel_database_cursor_iterator_get (_tmp50_, &_inner_error_);
				stmt = _tmp51_;
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					_rygel_database_cursor_iterator_unref0 (_stmt_it);
					_g_object_unref0 (cursor);
					args = (_vala_GValue_array_free (args, args_length1), NULL);
					if (_inner_error_->domain == RYGEL_DATABASE_DATABASE_ERROR) {
						goto __catch10_rygel_database_database_error;
					}
					_rygel_database_cursor_iterator_unref0 (_stmt_it);
					_g_object_unref0 (cursor);
					args = (_vala_GValue_array_free (args, args_length1), NULL);
					_g_free0 (video_data);
					_g_object_unref0 (video);
					_g_free0 (title);
					_g_object_unref0 (file);
					_g_free0 (path);
					_g_free0 (mime_type);
					g_critical ("file %s: line %d: unexpected 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;
				}
				_tmp52_ = video;
				_tmp53_ = stmt;
				rygel_audio_item_set_bitrate ((RygelAudioItem*) _tmp52_, sqlite3_column_int (_tmp53_, 0) / 8);
				_tmp54_ = video;
				_tmp55_ = stmt;
				rygel_visual_item_set_width ((RygelVisualItem*) _tmp54_, sqlite3_column_int (_tmp55_, 1));
				_tmp56_ = video;
				_tmp57_ = stmt;
				rygel_visual_item_set_height ((RygelVisualItem*) _tmp56_, sqlite3_column_int (_tmp57_, 2));
				_tmp58_ = video;
				_tmp59_ = stmt;
				rygel_audio_item_set_channels ((RygelAudioItem*) _tmp58_, sqlite3_column_int (_tmp59_, 3));
				_tmp60_ = video;
				_tmp61_ = stmt;
				rygel_audio_item_set_sample_freq ((RygelAudioItem*) _tmp60_, sqlite3_column_int (_tmp61_, 4));
			}
			_rygel_database_cursor_iterator_unref0 (_stmt_it);
		}
		_g_object_unref0 (cursor);
		args = (_vala_GValue_array_free (args, args_length1), NULL);
	}
	goto __finally10;
	__catch10_rygel_database_database_error:
	{
		GError* e = NULL;
		GError* _tmp62_;
		const gchar* _tmp63_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp62_ = e;
		_tmp63_ = _tmp62_->message;
		g_warning ("rygel-lms-all-videos.vala:109: Query failed: %s", _tmp63_);
		_g_error_free0 (e);
	}
	__finally10:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_free0 (video_data);
		_g_object_unref0 (video);
		_g_free0 (title);
		_g_object_unref0 (file);
		_g_free0 (path);
		_g_free0 (mime_type);
		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;
	}
	result = (RygelMediaObject*) video;
	_g_free0 (video_data);
	_g_free0 (title);
	_g_object_unref0 (file);
	_g_free0 (path);
	_g_free0 (mime_type);
	return result;
}


RygelLMSAllVideos*
rygel_lms_all_videos_construct (GType object_type,
                                const gchar* id,
                                RygelMediaContainer* parent,
                                const gchar* title,
                                RygelLMSDatabase* lms_db)
{
	RygelLMSAllVideos * self = NULL;
	g_return_val_if_fail (id != NULL, NULL);
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (lms_db != NULL, NULL);
	self = (RygelLMSAllVideos*) rygel_lms_category_container_construct (object_type, id, parent, title, lms_db, RYGEL_LMS_ALL_VIDEOS_SQL_ALL, RYGEL_LMS_ALL_VIDEOS_SQL_FIND_OBJECT, RYGEL_LMS_ALL_VIDEOS_SQL_COUNT, RYGEL_LMS_ALL_VIDEOS_SQL_ADDED, RYGEL_LMS_ALL_VIDEOS_SQL_REMOVED);
	return self;
}


RygelLMSAllVideos*
rygel_lms_all_videos_new (const gchar* id,
                          RygelMediaContainer* parent,
                          const gchar* title,
                          RygelLMSDatabase* lms_db)
{
	return rygel_lms_all_videos_construct (RYGEL_LMS_TYPE_ALL_VIDEOS, id, parent, title, lms_db);
}


static void
rygel_lms_all_videos_class_init (RygelLMSAllVideosClass * klass)
{
	rygel_lms_all_videos_parent_class = g_type_class_peek_parent (klass);
	((RygelLMSCategoryContainerClass *) klass)->object_from_statement = (RygelMediaObject* (*) (RygelLMSCategoryContainer *, sqlite3_stmt*)) rygel_lms_all_videos_real_object_from_statement;
}


static void
rygel_lms_all_videos_instance_init (RygelLMSAllVideos * self)
{
}


GType
rygel_lms_all_videos_get_type (void)
{
	static volatile gsize rygel_lms_all_videos_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_lms_all_videos_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelLMSAllVideosClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_all_videos_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSAllVideos), 0, (GInstanceInitFunc) rygel_lms_all_videos_instance_init, NULL };
		GType rygel_lms_all_videos_type_id;
		rygel_lms_all_videos_type_id = g_type_register_static (RYGEL_LMS_TYPE_CATEGORY_CONTAINER, "RygelLMSAllVideos", &g_define_type_info, 0);
		g_once_init_leave (&rygel_lms_all_videos_type_id__volatile, rygel_lms_all_videos_type_id);
	}
	return rygel_lms_all_videos_type_id__volatile;
}



