[rygel-gst-0-10-plugins] SqlFactory: Some cleanup
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel-gst-0-10-plugins] SqlFactory: Some cleanup
- Date: Fri, 1 Feb 2013 12:48:46 +0000 (UTC)
commit bcb660ce0824d80d4bf31c4f61dec459eb8d98f5
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Feb 1 13:48:40 2013 +0100
SqlFactory: Some cleanup
src/media-export/rygel-media-export-sql-factory.c | 482 +++++++++++++--------
1 files changed, 311 insertions(+), 171 deletions(-)
---
diff --git a/src/media-export/rygel-media-export-sql-factory.c b/src/media-export/rygel-media-export-sql-factory.c
index ed9e32f..538ba7c 100644
--- a/src/media-export/rygel-media-export-sql-factory.c
+++ b/src/media-export/rygel-media-export-sql-factory.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010,2011 Jens Georg <mail jensge org>.
+ * Copyright (C) 2013 Intel Corporation
*
* Author: Jens Georg <mail jensge org>
*
@@ -32,194 +33,333 @@ G_DEFINE_TYPE (RygelMediaExportSQLFactory, rygel_media_export_sql_factory, G_TYP
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_SAVE_META_DATA_STRING "INSERT OR REPLACE INTO meta_data " "(size, mime_type, width, height, class, " "author, album, date, bitrate, " "sample_freq, bits_per_sample, channels, " "track, color_depth, duration, object_fk, dlna_profile, genre, disc) VA" \
-"LUES " "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_INSERT_OBJECT_STRING "INSERT OR REPLACE INTO Object (upnp_id, title, type_fk, parent, timest" \
-"amp, uri) " "VALUES (?,?,?,?,?,?)"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_DELETE_BY_ID_STRING "DELETE FROM Object WHERE upnp_id IN " "(SELECT descendant FROM closure WHERE ancestor = ?)"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING "o.type_fk, o.title, m.size, m.mime_type, m.width, " "m.height, m.class, m.author, m.album, m.date, m.bitrate, " "m.sample_freq, m.bits_per_sample, m.channels, m.track, " "m.color_depth, m.duration, o.upnp_id, o.parent, o.timestamp, " "o.uri, m.dlna_profile, m.genre, m.disc "
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_WITH_PATH "SELECT DISTINCT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING "FROM Object o " "JOIN Closure c ON (o.upnp_id = c.ancestor) " "LEFT OUTER JOIN meta_data m ON (o.upnp_id = m.object_fk) " "WHERE c.descendant = ? ORDER BY c.depth DESC"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILDREN_STRING "SELECT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING "FROM Object o " "JOIN Closure c ON (o.upnp_id = c.descendant) " "LEFT OUTER JOIN meta_data m " "ON c.descendant = m.object_fk " "WHERE c.ancestor = ? AND c.depth = 1 %s" "LIMIT ?,?"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING_WITH_ANCESTOR "SELECT DISTINCT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING "FROM Object o " "JOIN Closure c ON o.upnp_id = c.descendant AND c.ancestor = ? " "LEFT OUTER JOIN meta_data m " "ON o.upnp_id = m.object_fk %s %s " "LIMIT ?,?"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING "SELECT DISTINCT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING "FROM Object o " "LEFT OUTER JOIN meta_data m " "ON o.upnp_id = m.object_fk %s %s " "LIMIT ?,?"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING_WITH_ANCESTOR "SELECT COUNT(o.type_fk) FROM Object o " "JOIN Closure c ON o.upnp_id = c.descendant AND c.ancestor = ? " "LEFT OUTER JOIN meta_data m " "ON o.upnp_id = m.object_fk %s"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING "SELECT COUNT(1) FROM meta_data m %s"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CHILDREN_COUNT_STRING "SELECT COUNT(upnp_id) FROM Object WHERE Object.parent = ?"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_OBJECT_EXISTS_STRING "SELECT COUNT(1), timestamp, m.size FROM Object " "JOIN meta_data m ON m.object_fk = upnp_id " "WHERE Object.uri = ?"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILD_ID_STRING "SELECT upnp_id FROM OBJECT WHERE parent = ?"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_META_DATA_COLUMN_STRING "SELECT DISTINCT %s AS _column FROM meta_data AS m " "WHERE _column IS NOT NULL %s ORDER BY _column COLLATE CASEFOLD " "LIMIT ?,?"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_META_DATA_TABLE_STRING "CREATE TABLE meta_data (size INTEGER NOT NULL, " "mime_type TEXT NOT NULL, " "dlna_profile TEXT, " "duration INTEGER, " "width INTEGER, " "height INTEGER, " "class TEXT NOT NULL, " "author TEXT, " "album TEXT, " "genre TEXT, " "date TEXT, " "bitrate INTEGER, " "sample_freq INTEGER, " "bits_per_sample INTEGER, " "channels INTEGER, " "track INTEGER, " "disc INTEGER, " "color_depth INTEGER, " "object_fk TEXT UNIQUE CONSTRAINT " "object_fk_id REFERENCES Object(upnp_id) " "ON DELETE CASCADE);"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_SCHEMA_STRING "CREATE TABLE schema_info (version TEXT NOT NULL); " RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_META_DATA_TABLE_STRING "CREATE TABLE object (parent TEXT CONSTRAINT parent_fk_id " "REFERENCES Object(upnp_id), " "upnp_id TEXT PRIMARY KEY, " "type_fk INTEGER, " "title TEXT NOT NULL, " "timestamp INTEGER NOT NULL, " "uri TEXT, " "flags TEXT);" "INSERT INTO schema_info (version) VALUES ('" RYGEL_MEDIA_EXPORT_SQL_FACTORY_SCHEMA_VERSION "'); "
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TABLE "CREATE TABLE closure (ancestor TEXT, descendant TEXT, depth INTEGER)"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TRIGGER_STRING "CREATE TRIGGER trgr_update_closure " "AFTER INSERT ON Object " "FOR EACH ROW BEGIN " "SELECT RAISE(IGNORE) WHERE (SELECT COUNT(*) FROM Closure " "WHERE ancestor = NEW.upnp_id " "AND descendant = NEW.upnp_id " "AND depth = 0) != 0;" "INSERT INTO Closure (ancestor, descendant, depth) " "VALUES (NEW.upnp_id, NEW.upnp_id, 0); " "INSERT INTO Closure (ancestor, descendant, depth) " "SELECT ancestor, NEW.upnp_id, depth + 1 FROM Closure " "WHERE descendant = NEW.parent;" "END;" "CREATE TRIGGER trgr_delete_closure " "AFTER DELETE ON Object " "FOR EACH ROW BEGIN " "DELETE FROM Closure WHERE descendant = OLD.upnp_id;" "END;"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_TRIGGER_STRING "CREATE TRIGGER trgr_delete_metadata " "BEFORE DELETE ON Object " "FOR EACH ROW BEGIN " "DELETE FROM meta_data WHERE meta_data.object_fk = OLD.upnp_id; " "END;"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_INDICES_STRING "CREATE INDEX IF NOT EXISTS idx_parent on Object(parent);" "CREATE INDEX IF NOT EXISTS idx_object_upnp_id on Object(upnp_id);" "CREATE INDEX IF NOT EXISTS idx_meta_data_fk on meta_data(object_fk);" "CREATE INDEX IF NOT EXISTS idx_closure on Closure(descendant,depth);" "CREATE INDEX IF NOT EXISTS idx_closure_descendant on Closure(descendan" \
-"t);" "CREATE INDEX IF NOT EXISTS idx_closure_ancestor on Closure(ancestor);" "CREATE INDEX IF NOT EXISTS idx_uri on Object(uri);" "CREATE INDEX IF NOT EXISTS idx_meta_data_date on meta_data(date);" "CREATE INDEX IF NOT EXISTS idx_meta_data_genre on meta_data(genre);" "CREATE INDEX IF NOT EXISTS idx_meta_data_album on meta_data(album);" "CREATE INDEX IF NOT EXISTS idx_meta_data_artist_album on " "meta_data(author, album);"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_EXISTS_CACHE_STRING "SELECT m.size, o.timestamp, o.uri FROM Object o " "JOIN meta_data m ON o.upnp_id = m.object_fk"
-#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_STATISTICS_STRING "SELECT class, count(1) FROM meta_data GROUP BY class"
-const gchar* rygel_media_export_sql_factory_make (RygelMediaExportSQLFactory* self, RygelMediaExportSQLString query);
-
-RygelMediaExportSQLFactory* rygel_media_export_sql_factory_construct (GType object_type);
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_SAVE_META_DATA_STRING \
+ "INSERT OR REPLACE INTO meta_data " \
+ "(size, mime_type, width, height, class, " \
+ "author, album, date, bitrate, " \
+ "sample_freq, bits_per_sample, channels, " \
+ "track, color_depth, duration, object_fk, dlna_profile, genre, disc) VALUES " \
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_INSERT_OBJECT_STRING \
+ "INSERT OR REPLACE INTO Object " \
+ "(upnp_id, title, type_fk, parent, timestamp, uri, " \
+ " object_update_id, deleted_child_count, container_update_id) " \
+ "VALUES (?,?,?,?,?,?,?,?,?)"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_DELETE_BY_ID_STRING \
+ "DELETE FROM Object WHERE upnp_id IN " \
+ "(SELECT descendant FROM closure WHERE ancestor = ?)"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING \
+ "o.type_fk, o.title, m.size, m.mime_type, m.width, " \
+ "m.height, m.class, m.author, m.album, m.date, m.bitrate, " \
+ "m.sample_freq, m.bits_per_sample, m.channels, m.track, " \
+ "m.color_depth, m.duration, o.upnp_id, o.parent, o.timestamp, " \
+ "o.uri, m.dlna_profile, m.genre, m.disc, o.object_update_id, " \
+ "o.deleted_child_count, o.container_update_id "
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_WITH_PATH \
+ "SELECT DISTINCT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING \
+ "FROM Object o " \
+ "JOIN Closure c ON (o.upnp_id = c.ancestor) " \
+ "LEFT OUTER JOIN meta_data m ON (o.upnp_id = m.object_fk) " \
+ "WHERE c.descendant = ? ORDER BY c.depth DESC"
+
+/**
+ * This is the database query used to retrieve the children for a
+ * given object.
+ *
+ * Sorting is as follows:
+ * - by type: containers first, then items if both are present
+ * - by upnp_class: items are sorted according to their class
+ * - by track: sorted by track
+ * - and after that alphabetically
+ */
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILDREN_STRING \
+ "SELECT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING \
+ "FROM Object o " \
+ "JOIN Closure c ON (o.upnp_id = c.descendant) " \
+ "LEFT OUTER JOIN meta_data m " \
+ "ON c.descendant = m.object_fk " \
+ "WHERE c.ancestor = ? AND c.depth = 1 %s" \
+ "LIMIT ?,?"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING_WITH_ANCESTOR \
+ "SELECT DISTINCT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING \
+ "FROM Object o " \
+ "JOIN Closure c ON o.upnp_id = c.descendant AND c.ancestor = ? " \
+ "LEFT OUTER JOIN meta_data m " \
+ "ON o.upnp_id = m.object_fk %s %s " \
+ "LIMIT ?,?"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING \
+ "SELECT DISTINCT " RYGEL_MEDIA_EXPORT_SQL_FACTORY_ALL_DETAILS_STRING \
+ "FROM Object o " \
+ "LEFT OUTER JOIN meta_data m " \
+ "ON o.upnp_id = m.object_fk %s %s " \
+ "LIMIT ?,?"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING_WITH_ANCESTOR \
+ "SELECT COUNT(o.type_fk) FROM Object o " \
+ "JOIN Closure c ON o.upnp_id = c.descendant AND c.ancestor = ? " \
+ "LEFT OUTER JOIN meta_data m " \
+ "ON o.upnp_id = m.object_fk %s"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING \
+ "SELECT COUNT(1) FROM meta_data m %s"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CHILDREN_COUNT_STRING \
+ "SELECT COUNT(upnp_id) FROM Object WHERE Object.parent = ?"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_OBJECT_EXISTS_STRING \
+ "SELECT COUNT(1), timestamp, m.size FROM Object " \
+ "JOIN meta_data m ON m.object_fk = upnp_id " \
+ "WHERE Object.uri = ?"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILD_ID_STRING \
+ "SELECT upnp_id FROM OBJECT WHERE parent = ?"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_META_DATA_COLUMN_STRING \
+ "SELECT DISTINCT %s AS _column FROM meta_data AS m " \
+ "WHERE _column IS NOT NULL %s ORDER BY _column COLLATE CASEFOLD " \
+ "LIMIT ?,?"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_META_DATA_TABLE_STRING \
+ "CREATE TABLE meta_data (size INTEGER NOT NULL, " \
+ "mime_type TEXT NOT NULL, " \
+ "dlna_profile TEXT, " \
+ "duration INTEGER, " \
+ "width INTEGER, " \
+ "height INTEGER, " \
+ "class TEXT NOT NULL, " \
+ "author TEXT, " \
+ "album TEXT, " \
+ "genre TEXT, " \
+ "date TEXT, " \
+ "bitrate INTEGER, " \
+ "sample_freq INTEGER, " \
+ "bits_per_sample INTEGER, " \
+ "channels INTEGER, " \
+ "track INTEGER, " \
+ "disc INTEGER, " \
+ "color_depth INTEGER, " \
+ "object_fk TEXT UNIQUE CONSTRAINT " \
+ "object_fk_id REFERENCES Object(upnp_id) " \
+ "ON DELETE CASCADE);"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_SCHEMA_STRING \
+ "CREATE TABLE schema_info (version TEXT NOT NULL, " \
+ "reset_token TEXT); " \
+ RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_META_DATA_TABLE_STRING \
+ "CREATE TABLE object (parent TEXT CONSTRAINT parent_fk_id " \
+ "REFERENCES Object(upnp_id), " \
+ "upnp_id TEXT PRIMARY KEY, " \
+ "type_fk INTEGER, " \
+ "title TEXT NOT NULL, " \
+ "timestamp INTEGER NOT NULL, " \
+ "uri TEXT, " \
+ "flags TEXT, " \
+ "object_update_id INTEGER, " \
+ "deleted_child_count INTEGER, " \
+ "container_update_id INTEGER);" \
+ "INSERT INTO schema_info (version) VALUES ('" \
+ RYGEL_MEDIA_EXPORT_SQL_FACTORY_SCHEMA_VERSION "'); "
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TABLE \
+ "CREATE TABLE closure (ancestor TEXT, descendant TEXT, depth INTEGER)"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TRIGGER_STRING \
+ "CREATE TRIGGER trgr_update_closure " \
+ "AFTER INSERT ON Object " \
+ "FOR EACH ROW BEGIN " \
+ "SELECT RAISE(IGNORE) WHERE (SELECT COUNT(*) FROM Closure " \
+ "WHERE ancestor = NEW.upnp_id " \
+ "AND descendant = NEW.upnp_id " \
+ "AND depth = 0) != 0;" \
+ "INSERT INTO Closure (ancestor, descendant, depth) " \
+ "VALUES (NEW.upnp_id, NEW.upnp_id, 0); " \
+ "INSERT INTO Closure (ancestor, descendant, depth) " \
+ "SELECT ancestor, NEW.upnp_id, depth + 1 FROM Closure " \
+ "WHERE descendant = NEW.parent;" \
+ "END;" \
+ "CREATE TRIGGER trgr_delete_closure " \
+ "AFTER DELETE ON Object " \
+ "FOR EACH ROW BEGIN " \
+ "DELETE FROM Closure WHERE descendant = OLD.upnp_id;" \
+ "END;"
+
+// these triggers emulate ON DELETE CASCADE
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_TRIGGER_STRING \
+ "CREATE TRIGGER trgr_delete_metadata " \
+ "BEFORE DELETE ON Object " \
+ "FOR EACH ROW BEGIN " \
+ "DELETE FROM meta_data WHERE meta_data.object_fk = OLD.upnp_id; " \
+ "END;"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_INDICES_STRING \
+ "CREATE INDEX IF NOT EXISTS idx_parent on Object(parent);" \
+ "CREATE INDEX IF NOT EXISTS idx_object_upnp_id on Object(upnp_id);" \
+ "CREATE INDEX IF NOT EXISTS idx_meta_data_fk on meta_data(object_fk);" \
+ "CREATE INDEX IF NOT EXISTS idx_closure on Closure(descendant,depth);" \
+ "CREATE INDEX IF NOT EXISTS idx_closure_descendant on Closure(descendant);" \
+ "CREATE INDEX IF NOT EXISTS idx_closure_ancestor on Closure(ancestor);" \
+ "CREATE INDEX IF NOT EXISTS idx_uri on Object(uri);" \
+ "CREATE INDEX IF NOT EXISTS idx_meta_data_date on meta_data(date);" \
+ "CREATE INDEX IF NOT EXISTS idx_meta_data_genre on meta_data(genre);" \
+ "CREATE INDEX IF NOT EXISTS idx_meta_data_album on meta_data(album);" \
+ "CREATE INDEX IF NOT EXISTS idx_meta_data_artist_album on " \
+ "meta_data(author, album);"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_EXISTS_CACHE_STRING \
+ "SELECT m.size, o.timestamp, o.uri FROM Object o " \
+ "JOIN meta_data m ON o.upnp_id = m.object_fk"
+
+#define RYGEL_MEDIA_EXPORT_SQL_FACTORY_STATISTICS_STRING \
+ "SELECT class, count(1) FROM meta_data GROUP BY class"
+
+const gchar *rygel_media_export_sql_factory_make (RygelMediaExportSQLFactory *self, RygelMediaExportSQLString query);
+
+RygelMediaExportSQLFactory *rygel_media_export_sql_factory_construct (GType object_type);
GType rygel_media_export_detail_column_get_type (void) {
- static volatile gsize rygel_media_export_detail_column_type_id__volatile = 0;
- if (g_once_init_enter (&rygel_media_export_detail_column_type_id__volatile)) {
- static const GEnumValue values[] = {{RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TYPE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TYPE", "type"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TITLE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TITLE", "title"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SIZE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SIZE", "size"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_MIME_TYPE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_MIME_TYPE", "mime-type"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_WIDTH, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_WIDTH", "width"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_HEIGHT, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_HEIGHT", "height"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CLASS, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CLASS", "class"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_AUTHOR, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_AUTHOR", "author"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ALBUM, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ALBUM", "album"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DATE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DATE", "date"}, {RYGEL_MEDIA
_EXPORT_DETAIL_COLUMN_BITRATE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITRATE", "bitrate"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SAMPLE_FREQ, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SAMPLE_FREQ", "sample-freq"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITS_PER_SAMPLE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITS_PER_SAMPLE", "bits-per-sample"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CHANNELS, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CHANNELS", "channels"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TRACK, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TRACK", "track"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_COLOR_DEPTH, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_COLOR_DEPTH", "color-depth"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DURATION, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DURATION", "duration"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ID, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ID", "id"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_PARENT, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_PARENT", "parent"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TIMESTAMP, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_T
IMESTAMP", "timestamp"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_URI, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_URI", "uri"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DLNA_PROFILE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DLNA_PROFILE", "dlna-profile"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_GENRE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_GENRE", "genre"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DISC, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DISC", "disc"}, {0, NULL, NULL}};
- GType rygel_media_export_detail_column_type_id;
- rygel_media_export_detail_column_type_id = g_enum_register_static ("RygelMediaExportDetailColumn", values);
- g_once_init_leave (&rygel_media_export_detail_column_type_id__volatile, rygel_media_export_detail_column_type_id);
- }
- return rygel_media_export_detail_column_type_id__volatile;
+ static volatile gsize rygel_media_export_detail_column_type_id__volatile = 0;
+ if (g_once_init_enter (&rygel_media_export_detail_column_type_id__volatile)) {
+ static const GEnumValue values[] = {{RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TYPE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TYPE", "type"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TITLE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TITLE", "title"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SIZE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SIZE", "size"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_MIME_TYPE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_MIME_TYPE", "mime-type"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_WIDTH, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_WIDTH", "width"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_HEIGHT, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_HEIGHT", "height"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CLASS, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CLASS", "class"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_AUTHOR, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_AUTHOR", "author"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ALBUM, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ALBUM", "album"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DATE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DATE", "date"}, {RYGEL_MED
IA_EXPORT_DETAIL_COLUMN_BITRATE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITRATE", "bitrate"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SAMPLE_FREQ, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SAMPLE_FREQ", "sample-freq"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITS_PER_SAMPLE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITS_PER_SAMPLE", "bits-per-sample"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CHANNELS, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CHANNELS", "channels"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TRACK, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TRACK", "track"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_COLOR_DEPTH, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_COLOR_DEPTH", "color-depth"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DURATION, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DURATION", "duration"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ID, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ID", "id"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_PARENT, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_PARENT", "parent"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TIMESTAMP, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN
_TIMESTAMP", "timestamp"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_URI, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_URI", "uri"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DLNA_PROFILE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DLNA_PROFILE", "dlna-profile"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_GENRE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_GENRE", "genre"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DISC, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DISC", "disc"}, {0, NULL, NULL}};
+ GType rygel_media_export_detail_column_type_id;
+ rygel_media_export_detail_column_type_id = g_enum_register_static ("RygelMediaExportDetailColumn", values);
+ g_once_init_leave (&rygel_media_export_detail_column_type_id__volatile, rygel_media_export_detail_column_type_id);
+ }
+ return rygel_media_export_detail_column_type_id__volatile;
}
GType rygel_media_export_sql_string_get_type (void) {
- static volatile gsize rygel_media_export_sql_string_type_id__volatile = 0;
- if (g_once_init_enter (&rygel_media_export_sql_string_type_id__volatile)) {
- static const GEnumValue values[] = {{RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA, "RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA", "save-metadata"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT, "RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT", "insert"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE, "RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE", "delete"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT", "get-object"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN", "get-children"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER", "get-objects-by-filter"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR", "get-objects-by-filter-with-ancestor"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER", "get-object-count-b
y-filter"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR", "get-object-count-by-filter-with-ancestor"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN", "get-meta-data-column"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT, "RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT", "child-count"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS, "RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS", "exists"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS, "RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS", "child-ids"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA, "RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA", "table-metadata"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE, "RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE", "table-closure"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE, "RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE", "trigger-closure"}, {RYGEL_MEDIA_EXPO
RT_SQL_STRING_TRIGGER_COMMON, "RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_COMMON", "trigger-common"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON, "RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON", "index-common"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA, "RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA", "schema"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE, "RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE", "exists-cache"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS, "RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS", "statistics"}, {0, NULL, NULL}};
- GType rygel_media_export_sql_string_type_id;
- rygel_media_export_sql_string_type_id = g_enum_register_static ("RygelMediaExportSQLString", values);
- g_once_init_leave (&rygel_media_export_sql_string_type_id__volatile, rygel_media_export_sql_string_type_id);
- }
- return rygel_media_export_sql_string_type_id__volatile;
+ static volatile gsize rygel_media_export_sql_string_type_id__volatile = 0;
+ if (g_once_init_enter (&rygel_media_export_sql_string_type_id__volatile)) {
+ static const GEnumValue values[] = {{RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA, "RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA", "save-metadata"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT, "RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT", "insert"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE, "RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE", "delete"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT", "get-object"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN", "get-children"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER", "get-objects-by-filter"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR", "get-objects-by-filter-with-ancestor"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER", "get-object-count
-by-filter"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR", "get-object-count-by-filter-with-ancestor"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN", "get-meta-data-column"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT, "RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT", "child-count"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS, "RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS", "exists"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS, "RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS", "child-ids"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA, "RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA", "table-metadata"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE, "RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE", "table-closure"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE, "RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE", "trigger-closure"}, {RYGEL_MEDIA_EX
PORT_SQL_STRING_TRIGGER_COMMON, "RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_COMMON", "trigger-common"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON, "RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON", "index-common"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA, "RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA", "schema"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE, "RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE", "exists-cache"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS, "RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS", "statistics"}, {0, NULL, NULL}};
+ GType rygel_media_export_sql_string_type_id;
+ rygel_media_export_sql_string_type_id = g_enum_register_static ("RygelMediaExportSQLString", values);
+ g_once_init_leave (&rygel_media_export_sql_string_type_id__volatile, rygel_media_export_sql_string_type_id);
+ }
+ return rygel_media_export_sql_string_type_id__volatile;
}
-const gchar* rygel_media_export_sql_factory_make (RygelMediaExportSQLFactory* self, RygelMediaExportSQLString query) {
- const gchar* result = NULL;
- RygelMediaExportSQLString _tmp0_;
- g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = query;
- switch (_tmp0_) {
- case RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_SAVE_META_DATA_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_INSERT_OBJECT_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_DELETE_BY_ID_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_WITH_PATH;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILDREN_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING_WITH_ANCESTOR;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING_WITH_ANCESTOR;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_META_DATA_COLUMN_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CHILDREN_COUNT_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_OBJECT_EXISTS_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILD_ID_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_META_DATA_TABLE_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_COMMON:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_TRIGGER_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TRIGGER_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_INDICES_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_SCHEMA_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_EXISTS_CACHE_STRING;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TABLE;
- return result;
- }
- case RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS:
- {
- result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_STATISTICS_STRING;
- return result;
- }
- default:
- {
- g_assert_not_reached ();
- }
- }
-}
+const gchar*
+rygel_media_export_sql_factory_make (RygelMediaExportSQLFactory *self, RygelMediaExportSQLString query) {
+ const gchar *result = NULL;
+ g_return_val_if_fail (self, NULL);
-RygelMediaExportSQLFactory* rygel_media_export_sql_factory_construct (GType object_type) {
- RygelMediaExportSQLFactory * self = NULL;
- self = (RygelMediaExportSQLFactory*) g_object_new (object_type, NULL);
- return self;
+ switch (query) {
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_SAVE_META_DATA_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_INSERT_OBJECT_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_DELETE_BY_ID_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_WITH_PATH;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILDREN_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECTS_BY_FILTER_STRING_WITH_ANCESTOR;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_OBJECT_COUNT_BY_FILTER_STRING_WITH_ANCESTOR;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_META_DATA_COLUMN_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_CHILDREN_COUNT_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_OBJECT_EXISTS_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_GET_CHILD_ID_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_META_DATA_TABLE_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_COMMON:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_TRIGGER_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TRIGGER_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_INDICES_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_SCHEMA_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_EXISTS_CACHE_STRING;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE:
+ {
+ result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TABLE;
+ return result;
+ }
+ case RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS:
+ {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY_STATISTICS_STRING;
+ }
+ default:
+ {
+ g_assert_not_reached ();
+ }
+ }
}
-
-RygelMediaExportSQLFactory* rygel_media_export_sql_factory_new (void) {
- return rygel_media_export_sql_factory_construct (RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY);
+RygelMediaExportSQLFactory*
+rygel_media_export_sql_factory_construct (GType object_type) {
+ return RYGEL_MEDIA_EXPORT_SQL_FACTORY (g_object_new (object_type, NULL));
}
-
-static void rygel_media_export_sql_factory_class_init (RygelMediaExportSQLFactoryClass * klass G_GNUC_UNUSED) {
+RygelMediaExportSQLFactory*
+rygel_media_export_sql_factory_new (void) {
+ return rygel_media_export_sql_factory_construct (RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY);
}
+static void
+rygel_media_export_sql_factory_class_init (RygelMediaExportSQLFactoryClass *klass G_GNUC_UNUSED) {
+}
-static void rygel_media_export_sql_factory_init (RygelMediaExportSQLFactory * self G_GNUC_UNUSED) {
+static void
+rygel_media_export_sql_factory_init (RygelMediaExportSQLFactory *self G_GNUC_UNUSED) {
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]