[rygel] core,media-export: Move code to module



commit 8408bc383a25df563f6c08ef45f155083d146d4e
Author: Jens Georg <mail jensge org>
Date:   Tue Apr 27 20:55:18 2010 +0200

    core,media-export: Move code to module

 src/plugins/media-export/Makefile.am               |   10 +++++-
 .../media-export/rygel-media-export-database.vala} |    4 +-
 .../rygel-media-export-db-container.vala}          |    6 ++--
 .../rygel-media-export-db-object-factory.vala}     |   23 ++++++------
 .../rygel-media-export-dynamic-container.vala      |    6 ++--
 .../media-export/rygel-media-export-harvester.vala |   10 +++---
 .../media-export/rygel-media-export-item.vala      |   37 ++++++++++++-------
 .../rygel-media-export-media-cache.vala}           |   34 +++++++++--------
 .../rygel-media-export-metadata-extractor.vala}    |   13 +++----
 .../rygel-media-export-object-factory.vala         |   11 +++---
 .../rygel-media-export-query-container.vala        |    8 ++--
 .../rygel-media-export-root-container.vala         |    9 +++--
 .../rygel-media-export-writable-container.vala     |    8 ++--
 src/rygel/Makefile.am                              |   11 +-----
 14 files changed, 102 insertions(+), 88 deletions(-)
---
diff --git a/src/plugins/media-export/Makefile.am b/src/plugins/media-export/Makefile.am
index 2d59089..d82dd04 100644
--- a/src/plugins/media-export/Makefile.am
+++ b/src/plugins/media-export/Makefile.am
@@ -12,12 +12,18 @@ AM_CFLAGS = $(LIBGUPNP_CFLAGS) \
 	    $(LIBGUPNP_AV_CFLAGS) \
 	    $(LIBDBUS_GLIB_CFLAGS) \
 	    $(LIBGSTREAMER_CFLAGS) \
+	    $(LIBSQLITE3_CFLAGS) \
 	    $(GEE_CFLAGS) \
 	    $(UUID_CFLAGS) \
 	    -I$(top_srcdir)/src/rygel -DDATA_DIR='"$(datadir)"' \
 	    -include config.h
 
 librygel_media_export_la_SOURCES = rygel-media-export-plugin.vala \
+				   rygel-media-export-database.vala \
+				   rygel-media-export-db-container.vala \
+				   rygel-media-export-db-object-factory.vala \
+				   rygel-media-export-media-cache.vala \
+				   rygel-media-export-metadata-extractor.vala \
 				   rygel-media-export-null-container.vala \
 				   rygel-media-export-dummy-container.vala \
 				   rygel-media-export-dynamic-container.vala \
@@ -39,12 +45,14 @@ librygel_media_export_la_VALAFLAGS = --vapidir=$(top_srcdir)/src/rygel \
                                      --pkg gupnp-av-1.0 \
                                      --pkg libsoup-2.4 \
                                      --pkg gee-1.0 \
-                                     --pkg libxml-2.0 -g
+                                     --pkg libxml-2.0 \
+                                     --pkg sqlite3 -g
 
 librygel_media_export_la_LIBADD = $(LIBGUPNP_LIBS) \
 				  $(LIBGUPNP_AV_LIBS) \
 				  $(LIBDBUS_GLIB_LIBS) \
 				  $(LIBGSTREAMER_LIBS) \
+				  $(LIBSQLITE3_LIBS) \
 				  $(GEE_LIBS) \
 				  $(UUID_LIBS)
 librygel_media_export_la_LDFLAGS = -shared -fPIC -module -avoid-version
diff --git a/src/rygel/rygel-database.vala b/src/plugins/media-export/rygel-media-export-database.vala
similarity index 98%
rename from src/rygel/rygel-database.vala
rename to src/plugins/media-export/rygel-media-export-database.vala
index e4fe2cc..f279406 100644
--- a/src/rygel/rygel-database.vala
+++ b/src/plugins/media-export/rygel-media-export-database.vala
@@ -33,7 +33,7 @@ public errordomain Rygel.DatabaseError {
  * It adds statement preparation based on GValue and a cancellable exec
  * function.
  */
-internal class Rygel.Database : Object {
+internal class Rygel.MediaExportDatabase : Object {
     private Sqlite.Database db;
 
     /**
@@ -49,7 +49,7 @@ internal class Rygel.Database : Object {
      * @param name of the database, used to build full path
      * (<cache-dir>/rygel/<name>.db)
      */
-    public Database (string name) throws DatabaseError {
+    public MediaExportDatabase (string name) throws DatabaseError {
         var dirname = Path.build_filename (Environment.get_user_cache_dir (),
                                            "rygel");
         DirUtils.create_with_parents (dirname, 0750);
diff --git a/src/rygel/rygel-media-db-container.vala b/src/plugins/media-export/rygel-media-export-db-container.vala
similarity index 94%
rename from src/rygel/rygel-media-db-container.vala
rename to src/plugins/media-export/rygel-media-export-db-container.vala
index 30bc68a..6f3758f 100644
--- a/src/rygel/rygel-media-db-container.vala
+++ b/src/plugins/media-export/rygel-media-export-db-container.vala
@@ -21,10 +21,10 @@
  */
 using GUPnP;
 
-public class Rygel.MediaDBContainer : MediaContainer {
-    protected MediaDB media_db;
+public class Rygel.MediaExportDBContainer : MediaContainer {
+    protected MediaExportMediaCache media_db;
 
-    public MediaDBContainer (MediaDB media_db, string id, string title) {
+    public MediaExportDBContainer (MediaExportMediaCache media_db, string id, string title) {
         int count;
         try {
             count = media_db.get_child_count (id);
diff --git a/src/rygel/rygel-media-db-object-factory.vala b/src/plugins/media-export/rygel-media-export-db-object-factory.vala
similarity index 69%
rename from src/rygel/rygel-media-db-object-factory.vala
rename to src/plugins/media-export/rygel-media-export-db-object-factory.vala
index f2187fd..ef6e81d 100644
--- a/src/rygel/rygel-media-db-object-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-db-object-factory.vala
@@ -32,7 +32,7 @@
  * MediaDB is holding a reference to the factory; this is done to
  * prevent circular references
  */
-public class Rygel.MediaDBObjectFactory : Object {
+public class Rygel.MediaExportDBObjectFactory : Object {
     /**
      * Return a new instance of DatabaseBackedMediaContainer
      *
@@ -40,11 +40,12 @@ public class Rygel.MediaDBObjectFactory : Object {
      * @param title title of the container
      * @param child_count number of children in the container
      */
-    public virtual MediaContainer get_container (MediaDB media_db,
-                                                 string  id,
-                                                 string  title,
-                                                 uint    child_count) {
-        return new MediaDBContainer (media_db, id, title);
+    public virtual MediaContainer get_container (
+                                        MediaExportMediaCache media_db,
+                                        string                id,
+                                        string                title,
+                                        uint                  child_count) {
+        return new MediaExportDBContainer (media_db, id, title);
     }
 
     /**
@@ -55,11 +56,11 @@ public class Rygel.MediaDBObjectFactory : Object {
      * @param title title of the item
      * @param upnp_class upnp_class of the item
      */
-    public virtual MediaItem get_item (MediaDB        media_db,
-                                       MediaContainer parent,
-                                       string         id,
-                                       string         title,
-                                       string         upnp_class) {
+    public virtual MediaItem get_item (MediaExportMediaCache media_db,
+                                       MediaContainer        parent,
+                                       string                id,
+                                       string                title,
+                                       string                upnp_class) {
         return new MediaItem (id, parent, title, upnp_class);
     }
 }
diff --git a/src/plugins/media-export/rygel-media-export-dynamic-container.vala b/src/plugins/media-export/rygel-media-export-dynamic-container.vala
index edc326d..6843e15 100644
--- a/src/plugins/media-export/rygel-media-export-dynamic-container.vala
+++ b/src/plugins/media-export/rygel-media-export-dynamic-container.vala
@@ -19,11 +19,11 @@
  */
 using Gee;
 
-internal class Rygel.MediaExportDynamicContainer : Rygel.MediaDBContainer {
+internal class Rygel.MediaExportDynamicContainer : Rygel.MediaExportDBContainer {
     public const string ID = "DynamicContainerId";
 
-    public MediaExportDynamicContainer (MediaDB        media_db,
-                                        MediaContainer parent) {
+    public MediaExportDynamicContainer (MediaExportMediaCache media_db,
+                                        MediaContainer        parent) {
         base (media_db, ID, "Dynamic");
         this.parent = parent;
     }
diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala
index 7292f2f..e80b282 100644
--- a/src/plugins/media-export/rygel-media-export-harvester.vala
+++ b/src/plugins/media-export/rygel-media-export-harvester.vala
@@ -22,8 +22,8 @@ using GLib;
 using Gee;
 
 public class Rygel.MediaExportHarvester : GLib.Object {
-    private MetadataExtractor extractor;
-    private MediaDB media_db;
+    private MediaExportMetadataExtractor extractor;
+    private MediaExportMediaCache media_db;
     private GLib.Queue<MediaContainer> containers;
     private GLib.Queue<FileQueueEntry?> files;
     private File origin;
@@ -31,9 +31,9 @@ public class Rygel.MediaExportHarvester : GLib.Object {
     private MediaExportRecursiveFileMonitor monitor;
     public Cancellable cancellable;
 
-    public MediaExportHarvester (MediaContainer parent,
-                                 MediaDB media_db,
-                                 MetadataExtractor extractor,
+    public MediaExportHarvester (MediaContainer                  parent,
+                                 MediaExportMediaCache           media_db,
+                                 MediaExportMetadataExtractor    extractor,
                                  MediaExportRecursiveFileMonitor monitor) {
         this.parent = parent;
         this.extractor = extractor;
diff --git a/src/plugins/media-export/rygel-media-export-item.vala b/src/plugins/media-export/rygel-media-export-item.vala
index 63bae47..b8976aa 100644
--- a/src/plugins/media-export/rygel-media-export-item.vala
+++ b/src/plugins/media-export/rygel-media-export-item.vala
@@ -28,6 +28,12 @@ using Gst;
  * Represents MediaExport item.
  */
 public class Rygel.MediaExportItem : Rygel.MediaItem {
+    private const string TAG_WIDTH =
+                                  MediaExportMetadataExtractor.TAG_RYGEL_WIDTH;
+    private const string TAG_HEIGHT =
+                                 MediaExportMetadataExtractor.TAG_RYGEL_HEIGHT;
+    private const string TAG_DURATION =
+                               MediaExportMetadataExtractor.TAG_RYGEL_DURATION;
     public MediaExportItem (MediaContainer parent,
                             File           file,
                             FileInfo       info) {
@@ -74,15 +80,15 @@ public class Rygel.MediaExportItem : Rygel.MediaItem {
 
             if (!tag_list.get_string (TAG_VIDEO_CODEC, out codec)) {
                 if (!tag_list.get_string (TAG_AUDIO_CODEC, out codec)) {
-                    if (tag_list.get_int (MetadataExtractor.TAG_RYGEL_WIDTH, out width) ||
-                        tag_list.get_int (MetadataExtractor.TAG_RYGEL_HEIGHT, out height)) {
+                    if (tag_list.get_int (TAG_WIDTH, out width) ||
+                        tag_list.get_int (TAG_HEIGHT, out height)) {
                         class_guessed = MediaItem.PHOTO_CLASS;
                     } else {
                         // if it has width and height and a duration, assume
                         // it is a video (to capture the MPEG TS without audio
                         // case)
                         int64 duration;
-                        if (tag_list.get_int64 (MetadataExtractor.TAG_RYGEL_DURATION,
+                        if (tag_list.get_int64 (TAG_DURATION,
                                                 out duration)) {
                             class_guessed = MediaItem.VIDEO_CLASS;
                         } else {
@@ -95,8 +101,8 @@ public class Rygel.MediaExportItem : Rygel.MediaItem {
                     // MPEG TS streams seem to miss VIDEO_CODEC; so if we have
                     // an AUDIO_CODEC and width or height, assume video as
                     // well
-                    if (tag_list.get_int (MetadataExtractor.TAG_RYGEL_WIDTH, out width) ||
-                        tag_list.get_int (MetadataExtractor.TAG_RYGEL_HEIGHT, out height)) {
+                    if (tag_list.get_int (TAG_WIDTH, out width) ||
+                        tag_list.get_int (TAG_HEIGHT, out height)) {
                         class_guessed = MediaItem.VIDEO_CLASS;
                     } else {
                         class_guessed = MediaItem.AUDIO_CLASS;
@@ -136,16 +142,17 @@ public class Rygel.MediaExportItem : Rygel.MediaItem {
         }
         base (id, parent, title, upnp_class);
 
-        tag_list.get_int (MetadataExtractor.TAG_RYGEL_WIDTH, out this.width);
-        tag_list.get_int (MetadataExtractor.TAG_RYGEL_HEIGHT, out this.height);
-        tag_list.get_int (MetadataExtractor.TAG_RYGEL_DEPTH,
+        tag_list.get_int (TAG_WIDTH, out this.width);
+        tag_list.get_int (TAG_HEIGHT, out this.height);
+        tag_list.get_int (MediaExportMetadataExtractor.TAG_RYGEL_DEPTH,
                           out this.color_depth);
         int64 duration;
-        tag_list.get_int64 (MetadataExtractor.TAG_RYGEL_DURATION,
+        tag_list.get_int64 (MediaExportMetadataExtractor.TAG_RYGEL_DURATION,
                             out duration);
         this.duration = (duration == -1) ? -1 : (long) (duration / 1000000000);
 
-        tag_list.get_int (MetadataExtractor.TAG_RYGEL_CHANNELS, out this.n_audio_channels);
+        tag_list.get_int (MediaExportMetadataExtractor.TAG_RYGEL_CHANNELS,
+                          out this.n_audio_channels);
 
         tag_list.get_string (TAG_ARTIST, out this.author);
         tag_list.get_string (TAG_ALBUM, out this.album);
@@ -155,15 +162,17 @@ public class Rygel.MediaExportItem : Rygel.MediaItem {
         this.track_number = (int)tmp;
         tag_list.get_uint (TAG_BITRATE, out tmp);
         this.bitrate = (int)tmp / 8;
-        tag_list.get_int (MetadataExtractor.TAG_RYGEL_RATE, out this.sample_freq);
+        tag_list.get_int (MediaExportMetadataExtractor.TAG_RYGEL_RATE,
+                          out this.sample_freq);
 
 
         int64 size;
-        tag_list.get_int64 (MetadataExtractor.TAG_RYGEL_SIZE, out size);
+        tag_list.get_int64 (MediaExportMetadataExtractor.TAG_RYGEL_SIZE,
+                            out size);
         this.size = (long) size;
 
         uint64 mtime;
-        tag_list.get_uint64 (MetadataExtractor.TAG_RYGEL_MTIME,
+        tag_list.get_uint64 (MediaExportMetadataExtractor.TAG_RYGEL_MTIME,
                              out mtime);
         this.modified = (int64) mtime;
 
@@ -178,7 +187,7 @@ public class Rygel.MediaExportItem : Rygel.MediaItem {
         }
 
 
-        tag_list.get_string (MetadataExtractor.TAG_RYGEL_MIME,
+        tag_list.get_string (MediaExportMetadataExtractor.TAG_RYGEL_MIME,
                              out this.mime_type);
 
         this.add_uri (file.get_uri (), null);
diff --git a/src/rygel/rygel-media-db.vala b/src/plugins/media-export/rygel-media-export-media-cache.vala
similarity index 97%
rename from src/rygel/rygel-media-db.vala
rename to src/plugins/media-export/rygel-media-export-media-cache.vala
index e116e04..724f1cd 100644
--- a/src/rygel/rygel-media-db.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -40,11 +40,11 @@ public enum Rygel.MediaDBObjectType {
 /**
  * Persistent storage of media objects
  *
- * MediaDB is a sqlite3 backed persistent storage of media objects
+ *  MediaExportDB is a sqlite3 backed persistent storage of media objects
  */
-public class Rygel.MediaDB : Object {
-    private Rygel.Database db;
-    private MediaDBObjectFactory factory;
+public class Rygel.MediaExportMediaCache : Object {
+    private MediaExportDatabase db;
+    private MediaExportDBObjectFactory factory;
     private const string schema_version = "5";
     private const string CREATE_META_DATA_TABLE_STRING =
     "CREATE TABLE meta_data (size INTEGER NOT NULL, " +
@@ -84,8 +84,8 @@ public class Rygel.MediaDB : Object {
                       "uri TEXT NOT NULL);" +
     "INSERT INTO object_type (id, desc) VALUES (0, 'Container'); " +
     "INSERT INTO object_type (id, desc) VALUES (1, 'Item'); " +
-    "INSERT INTO schema_info (version) VALUES ('" + MediaDB.schema_version +
-                                                "'); ";
+    "INSERT INTO schema_info (version) VALUES ('" +
+    MediaExportMediaCache.schema_version + "'); ";
 
     private const string CREATE_CLOSURE_TABLE =
     "CREATE TABLE closure (ancestor TEXT, descendant TEXT, depth INTEGER)";
@@ -328,7 +328,7 @@ public class Rygel.MediaDB : Object {
         GLib.Value[] values = { object_id };
         MediaObject parent = null;
 
-        Rygel.Database.RowCallback cb = (statement) => {
+        MediaExportDatabase.RowCallback cb = (statement) => {
             var parent_container = parent as MediaContainer;
             var object = get_object_from_statement (parent_container,
                                                     statement.column_text (18),
@@ -413,7 +413,7 @@ public class Rygel.MediaDB : Object {
         GLib.Value[] values = { container_id,
                                 (int64) offset,
                                 (int64) max_count };
-        Rygel.Database.RowCallback callback = (statement) => {
+        MediaExportDatabase.RowCallback callback = (statement) => {
             var child_id = statement.column_text (17);
             children.add (get_object_from_statement (parent,
                                                      child_id,
@@ -482,7 +482,7 @@ public class Rygel.MediaDB : Object {
 
         debug ("Parameters to bind: %u", args.n_values);
 
-        Rygel.Database.RowCallback callback = (statement) => {
+        MediaExportDatabase.RowCallback callback = (statement) => {
             var child_id = statement.column_text (17);
             var parent_id = statement.column_text (18);
             try {
@@ -514,19 +514,21 @@ public class Rygel.MediaDB : Object {
         return children;
     }
 
-    public MediaDB (string name) throws Error {
+    public MediaExportMediaCache (string name) throws Error {
         this.open_db (name);
-        this.factory = new MediaDBObjectFactory ();
+        this.factory = new MediaExportDBObjectFactory ();
     }
 
-    public MediaDB.with_factory (string               name,
-                                 MediaDBObjectFactory factory) throws Error {
+    public MediaExportMediaCache.with_factory (
+                                        string                     name,
+                                        MediaExportDBObjectFactory factory)
+                                        throws Error {
         this.open_db (name);
         this.factory = factory;
     }
 
     private void open_db (string name) throws Error {
-        this.db = new Rygel.Database (name);
+        this.db = new MediaExportDatabase (name);
         int old_version = -1;
 
         try {
@@ -747,7 +749,7 @@ public class Rygel.MediaDB : Object {
         }
 
         if (item.parent == null) {
-            parent = Database  null ();
+            parent = MediaExportDatabase  null ();
         } else {
             parent = item.parent.id;
         }
@@ -1034,7 +1036,7 @@ public class Rygel.MediaDB : Object {
         args.append (v);
 
         var data = new ArrayList<string> ();
-        Rygel.Database.RowCallback callback = (statement) => {
+        MediaExportDatabase.RowCallback callback = (statement) => {
             data.add (statement.column_text (0));
 
             return true;
diff --git a/src/rygel/rygel-metadata-extractor.vala b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
similarity index 97%
rename from src/rygel/rygel-metadata-extractor.vala
rename to src/plugins/media-export/rygel-media-export-metadata-extractor.vala
index 6de1eb0..e8a9aac 100644
--- a/src/rygel/rygel-metadata-extractor.vala
+++ b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
@@ -40,7 +40,7 @@ private enum Gst.StreamType {
  * uri property, it will extact the metadata for you and emit signal
  * metadata_available for each key/value pair extracted.
  */
-public class Rygel.MetadataExtractor: GLib.Object {
+public class Rygel.MediaExportMetadataExtractor: GLib.Object {
     public const string TAG_RYGEL_SIZE = "rygel-size";
     public const string TAG_RYGEL_DURATION = "rygel-duration";
     public const string TAG_RYGEL_MIME = "rygel-mime";
@@ -100,8 +100,8 @@ public class Rygel.MetadataExtractor: GLib.Object {
         bus.message["error"] += this.error_cb;
     }
 
-    public static MetadataExtractor? create() {
-        if (MetadataExtractor.factory == null) {
+    public static MediaExportMetadataExtractor? create() {
+        if (MediaExportMetadataExtractor.factory == null) {
             debug (_("Checking for gstreamer playbin..."));
             var factory = ElementFactory.find("playbin2");
             if (factory != null) {
@@ -118,13 +118,13 @@ public class Rygel.MetadataExtractor: GLib.Object {
                     return null;
                 }
             }
-            MetadataExtractor.factory = factory;
+            MediaExportMetadataExtractor.factory = factory;
         }
 
-        return new MetadataExtractor ();
+        return new MediaExportMetadataExtractor ();
     }
 
-    MetadataExtractor () {
+    MediaExportMetadataExtractor () {
         this.register_custom_tag (TAG_RYGEL_SIZE, typeof (int64));
         this.register_custom_tag (TAG_RYGEL_DURATION, typeof (int64));
         this.register_custom_tag (TAG_RYGEL_MIME, typeof (string));
@@ -346,4 +346,3 @@ public class Rygel.MetadataExtractor: GLib.Object {
         }
     }
 }
-
diff --git a/src/plugins/media-export/rygel-media-export-object-factory.vala b/src/plugins/media-export/rygel-media-export-object-factory.vala
index 5a5b977..6bd89bb 100644
--- a/src/plugins/media-export/rygel-media-export-object-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-object-factory.vala
@@ -20,11 +20,12 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-internal class Rygel.MediaExportObjectFactory : MediaDBObjectFactory {
-    public override MediaContainer get_container (MediaDB media_db,
-                                                  string  id,
-                                                  string  title,
-                                                  uint    child_count) {
+internal class Rygel.MediaExportObjectFactory : MediaExportDBObjectFactory {
+    public override MediaContainer get_container (
+                                        MediaExportMediaCache media_db,
+                                        string                id,
+                                        string                title,
+                                        uint                  child_count) {
         if (id.has_prefix (MediaExportQueryContainer.PREFIX)) {
             return new MediaExportQueryContainer (media_db, id, title);
         } else {
diff --git a/src/plugins/media-export/rygel-media-export-query-container.vala b/src/plugins/media-export/rygel-media-export-query-container.vala
index 2cb8244..91a418a 100644
--- a/src/plugins/media-export/rygel-media-export-query-container.vala
+++ b/src/plugins/media-export/rygel-media-export-query-container.vala
@@ -21,7 +21,7 @@
 using Gee;
 using GUPnP;
 
-internal class Rygel.MediaExportQueryContainer : Rygel.MediaDBContainer {
+internal class Rygel.MediaExportQueryContainer : Rygel.MediaExportDBContainer {
     public static const string PREFIX = "virtual-container:";
     private string attribute;
     private SearchExpression expression;
@@ -66,9 +66,9 @@ internal class Rygel.MediaExportQueryContainer : Rygel.MediaDBContainer {
         return true;
     }
 
-    public MediaExportQueryContainer (MediaDB media_db,
-                                      string  id,
-                                      string  name = "") {
+    public MediaExportQueryContainer (MediaExportMediaCache media_db,
+                                      string                id,
+                                      string                name = "") {
         // parse the id
         // Following the schema:
         // virtual-folder:<class>,? -> get all of that class (eg. Albums)
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index aa26101..e997124 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -24,8 +24,8 @@ using GUPnP;
 /**
  * Represents the root container.
  */
-public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
-    private MetadataExtractor extractor;
+public class Rygel.MediaExportRootContainer : Rygel.MediaExportDBContainer {
+    private MediaExportMetadataExtractor extractor;
     private HashMap<File, MediaExportHarvester> harvester;
     private MediaExportRecursiveFileMonitor monitor;
     private MediaExportDBusService service;
@@ -284,11 +284,12 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
      */
     private MediaExportRootContainer () throws Error {
         var object_factory = new MediaExportObjectFactory ();
-        var db = new MediaDB.with_factory ("media-export", object_factory);
+        var db = new MediaExportMediaCache.with_factory ("media-export",
+                                                         object_factory);
 
         base (db, "0", "MediaExportRoot");
 
-        this.extractor = MetadataExtractor.create ();
+        this.extractor = MediaExportMetadataExtractor.create ();
 
         this.harvester = new HashMap<File, MediaExportHarvester> (file_hash,
                                                                   file_equal);
diff --git a/src/plugins/media-export/rygel-media-export-writable-container.vala b/src/plugins/media-export/rygel-media-export-writable-container.vala
index 8d62603..8658402 100644
--- a/src/plugins/media-export/rygel-media-export-writable-container.vala
+++ b/src/plugins/media-export/rygel-media-export-writable-container.vala
@@ -22,10 +22,10 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
-internal class Rygel.MediaExportWritableContainer : MediaDBContainer {
-    public MediaExportWritableContainer (MediaDB media_db,
-                                         string  id,
-                                         string  title) {
+internal class Rygel.MediaExportWritableContainer : MediaExportDBContainer {
+    public MediaExportWritableContainer (MediaExportMediaCache media_db,
+                                         string                id,
+                                         string                title) {
         base (media_db, id, title);
     }
 
diff --git a/src/rygel/Makefile.am b/src/rygel/Makefile.am
index b74928e..0dfb9b4 100644
--- a/src/rygel/Makefile.am
+++ b/src/rygel/Makefile.am
@@ -18,7 +18,6 @@ AM_CFLAGS = $(LIBGUPNP_CFLAGS) \
 	    $(UUID_CFLAGS) \
 	    $(LIBSOUP_CFLAGS) \
 	    $(LIBDBUS_GLIB_CFLAGS) \
-	    $(LIBSQLITE3_CFLAGS) \
 	    -I$(top_srcdir) \
 	    -DDATA_DIR='"$(shareddir)"' -DSYS_CONFIG_DIR='"$(sysconfdir)"'\
 	    -DPLUGIN_DIR='"$(plugindir)"' -DDESKTOP_DIR='"$(desktopdir)"'\
@@ -38,7 +37,6 @@ rygel_SOURCES = $(VAPI_SOURCE_FILES) \
 		rygel-dbus-service.vala \
 		rygel-root-device.vala \
 		rygel-root-device-factory.vala \
-		rygel-database.vala \
 		rygel-main.vala
 
 VAPI_SOURCE_FILES = rygel-configuration.vala \
@@ -97,17 +95,13 @@ VAPI_SOURCE_FILES = rygel-configuration.vala \
 		    rygel-wmv-transcoder.vala \
 		    rygel-wmv-transcoder-bin.vala \
 		    rygel-gst-utils.vala \
-		    rygel-media-db.vala \
-		    rygel-metadata-extractor.vala \
-		    rygel-media-db-container.vala \
-		    rygel-media-db-object-factory.vala \
 		    rygel-media-receiver-registrar.vala \
 		    rygel-log-handler.vala
 
 rygel_VALAFLAGS = \
 	-H rygel.h -C --library=rygel-1.0 --vapidir=$(srcdir) --thread \
 	--pkg cstuff --pkg gupnp-1.0 --pkg gupnp-av-1.0 --pkg dbus-glib-1 \
-	--pkg gstreamer-0.10 --pkg gio-2.0 --pkg gee-1.0 --pkg sqlite3 -g
+	--pkg gstreamer-0.10 --pkg gio-2.0 --pkg gee-1.0 -g
 
 rygel_LDADD = librygel-configuration.a \
 	      $(LIBGUPNP_LIBS) \
@@ -117,8 +111,7 @@ rygel_LDADD = librygel-configuration.a \
 	      $(GEE_LIBS) \
 	      $(UUID_LIBS) \
 	      $(LIBSOUP_LIBS) \
-	      $(LIBDBUS_GLIB_LIBS) \
-	      $(LIBSQLITE3_LIBS)
+	      $(LIBDBUS_GLIB_LIBS)
 
 rygel_LDFLAGS = -export-dynamic
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]