[rygel] media-export: Put auxiliary classes into own files
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Put auxiliary classes into own files
- Date: Sun, 14 Mar 2010 23:30:10 +0000 (UTC)
commit d1599e0a0b4aebe24694e9b29eb1dce3aef3be73
Author: Jens Georg <mail jensge org>
Date: Sat Jan 30 20:17:38 2010 +0100
media-export: Put auxiliary classes into own files
src/plugins/media-export/Makefile.am | 3 +
.../rygel-media-export-dummy-container.vala | 42 ++++++++++++++++++
.../rygel-media-export-dynamic-container.vala | 45 ++++++++++++++++++++
.../rygel-media-export-file-queue-entry.vala | 29 +++++++++++++
.../media-export/rygel-media-export-harvester.vala | 32 --------------
.../rygel-media-export-root-container.vala | 25 -----------
6 files changed, 119 insertions(+), 57 deletions(-)
---
diff --git a/src/plugins/media-export/Makefile.am b/src/plugins/media-export/Makefile.am
index e19f78b..ad35640 100644
--- a/src/plugins/media-export/Makefile.am
+++ b/src/plugins/media-export/Makefile.am
@@ -17,10 +17,13 @@ AM_CFLAGS = $(LIBGUPNP_CFLAGS) \
librygel_media_export_la_SOURCES = rygel-media-export-plugin.vala \
rygel-media-export-null-container.vala \
+ rygel-media-export-dummy-container.vala \
+ rygel-media-export-dynamic-container.vala \
rygel-media-export-root-container.vala \
rygel-media-export-dbus-service.vala \
rygel-media-export-recursive-file-monitor.vala \
rygel-media-export-harvester.vala \
+ rygel-media-export-file-queue-entry.vala \
rygel-media-export-item.vala \
rygel-media-export-writable-container.vala \
rygel-media-export-object-factory.vala
diff --git a/src/plugins/media-export/rygel-media-export-dummy-container.vala b/src/plugins/media-export/rygel-media-export-dummy-container.vala
new file mode 100644
index 0000000..d69caa0
--- /dev/null
+++ b/src/plugins/media-export/rygel-media-export-dummy-container.vala
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2009,2010 Jens Georg <mail jensge org>.
+ *
+ * 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 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 program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+using Gee;
+
+internal class Rygel.DummyContainer : NullContainer {
+ public File file;
+ public ArrayList<string> seen_children;
+
+ public DummyContainer (File file, MediaContainer parent) {
+ var id = Checksum.compute_for_string (ChecksumType.MD5,
+ file.get_uri ());
+ this.id = id;
+ this.parent = parent;
+ this.title = file.get_basename ();
+ this.child_count = 0;
+ this.parent_ref = parent;
+ this.file = file;
+ this.uris.add (file.get_uri ());
+ this.seen_children = new ArrayList<string> (str_equal);
+ }
+
+ public void seen (string id) {
+ seen_children.add (id);
+ }
+}
diff --git a/src/plugins/media-export/rygel-media-export-dynamic-container.vala b/src/plugins/media-export/rygel-media-export-dynamic-container.vala
new file mode 100644
index 0000000..edc326d
--- /dev/null
+++ b/src/plugins/media-export/rygel-media-export-dynamic-container.vala
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2009 Jens Georg <mail jensge org>.
+ *
+ * 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 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 program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+using Gee;
+
+internal class Rygel.MediaExportDynamicContainer : Rygel.MediaDBContainer {
+ public const string ID = "DynamicContainerId";
+
+ public MediaExportDynamicContainer (MediaDB media_db,
+ MediaContainer parent) {
+ base (media_db, ID, "Dynamic");
+ this.parent = parent;
+ }
+
+ public Gee.List<string> get_uris () {
+ var result = new ArrayList<string> ();
+
+ try {
+ var children = this.media_db.get_children (this.id, -1, -1);
+ if (children != null) {
+ foreach (var child in children) {
+ result.add_all (child.uris);
+ }
+ }
+ } catch (Error err) {}
+
+ return result;
+ }
+}
diff --git a/src/plugins/media-export/rygel-media-export-file-queue-entry.vala b/src/plugins/media-export/rygel-media-export-file-queue-entry.vala
new file mode 100644
index 0000000..c838aab
--- /dev/null
+++ b/src/plugins/media-export/rygel-media-export-file-queue-entry.vala
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2010 Jens Georg <mail jensge org>.
+ *
+ * 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 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 program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+internal class Rygel.FileQueueEntry {
+ public File file;
+ public bool update;
+
+ public FileQueueEntry (File file, bool update) {
+ this.file = file;
+ this.update = update;
+ }
+}
diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala
index 4632db8..4bcca08 100644
--- a/src/plugins/media-export/rygel-media-export-harvester.vala
+++ b/src/plugins/media-export/rygel-media-export-harvester.vala
@@ -21,38 +21,6 @@
using GLib;
using Gee;
-internal class Rygel.DummyContainer : NullContainer {
- public File file;
- public ArrayList<string> seen_children;
-
- public DummyContainer (File file, MediaContainer parent) {
- var id = Checksum.compute_for_string (ChecksumType.MD5,
- file.get_uri ());
- this.id = id;
- this.parent = parent;
- this.title = file.get_basename ();
- this.child_count = 0;
- this.parent_ref = parent;
- this.file = file;
- this.uris.add (file.get_uri ());
- this.seen_children = new ArrayList<string> (str_equal);
- }
-
- public void seen (string id) {
- seen_children.add (id);
- }
-}
-
-internal class Rygel.FileQueueEntry {
- public File file;
- public bool update;
-
- public FileQueueEntry (File file, bool update) {
- this.file = file;
- this.update = update;
- }
-}
-
public class Rygel.MediaExportHarvester : GLib.Object {
private MetadataExtractor extractor;
private MediaDB media_db;
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 6eeecb2..d3f31a1 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -20,31 +20,6 @@
using Gee;
-internal class Rygel.MediaExportDynamicContainer : Rygel.MediaDBContainer {
- public const string ID = "DynamicContainerId";
-
- public MediaExportDynamicContainer (MediaDB media_db,
- MediaContainer parent) {
- base (media_db, ID, "Dynamic");
- this.parent = parent;
- }
-
- public Gee.List<string> get_uris () {
- var result = new ArrayList<string> ();
-
- try {
- var children = this.media_db.get_children (this.id, -1, -1);
- if (children != null) {
- foreach (var child in children) {
- result.add_all (child.uris);
- }
- }
- } catch (Error err) {}
-
- return result;
- }
-}
-
/**
* Represents the root container.
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]