[rygel] tracker: Special classes for albums & artists
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] tracker: Special classes for albums & artists
- Date: Wed, 18 Aug 2010 12:13:09 +0000 (UTC)
commit cf44be559b287a82e60bed96085731c9a5ec9463
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Aug 18 13:43:22 2010 +0300
tracker: Special classes for albums & artists
Add special container classes for albums and artists.
src/plugins/tracker/Makefile.am | 2 +
src/plugins/tracker/rygel-tracker-albums.vala | 40 ++++++++++++++++++++++++
src/plugins/tracker/rygel-tracker-artists.vala | 40 ++++++++++++++++++++++++
src/plugins/tracker/rygel-tracker-music.vala | 17 +---------
4 files changed, 84 insertions(+), 15 deletions(-)
---
diff --git a/src/plugins/tracker/Makefile.am b/src/plugins/tracker/Makefile.am
index 315e6e4..5ee9124 100644
--- a/src/plugins/tracker/Makefile.am
+++ b/src/plugins/tracker/Makefile.am
@@ -19,6 +19,8 @@ librygel_media_tracker_la_SOURCES = rygel-tracker-root-container.vala \
rygel-tracker-metadata-values.vala \
rygel-tracker-tags.vala \
rygel-tracker-years.vala \
+ rygel-tracker-albums.vala \
+ rygel-tracker-artists.vala \
rygel-tracker-search-container.vala \
rygel-tracker-category-all-container.vala \
rygel-tracker-query.vala \
diff --git a/src/plugins/tracker/rygel-tracker-albums.vala b/src/plugins/tracker/rygel-tracker-albums.vala
new file mode 100644
index 0000000..a9e5d23
--- /dev/null
+++ b/src/plugins/tracker/rygel-tracker-albums.vala
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2009,2010 Nokia Corporation.
+ *
+ * Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
+ * <zeeshan ali nokia 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 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.
+ */
+
+/**
+ * Container listing Music albums as containers.
+ */
+public class Rygel.Tracker.Albums : MetadataValues {
+ public Albums (Music parent) {
+ var key_chain = new string[] { "nmm:musicAlbum",
+ "nmm:albumTitle",
+ null };
+
+ base (parent.id + "Albums",
+ parent,
+ _("Albums"),
+ parent.item_factory,
+ key_chain);
+ }
+}
+
diff --git a/src/plugins/tracker/rygel-tracker-artists.vala b/src/plugins/tracker/rygel-tracker-artists.vala
new file mode 100644
index 0000000..451800a
--- /dev/null
+++ b/src/plugins/tracker/rygel-tracker-artists.vala
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2009,2010 Nokia Corporation.
+ *
+ * Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
+ * <zeeshan ali nokia 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 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.
+ */
+
+/**
+ * Container listing artists as containers.
+ */
+public class Rygel.Tracker.Artists : MetadataValues {
+ public Artists (Music parent) {
+ var key_chain = new string[] { "nmm:performer",
+ "nmm:artistName",
+ null };
+
+ base (parent.id + "Artists",
+ parent,
+ _("Artists"),
+ parent.item_factory,
+ key_chain);
+ }
+}
+
diff --git a/src/plugins/tracker/rygel-tracker-music.vala b/src/plugins/tracker/rygel-tracker-music.vala
index d2fbc03..c8edb20 100644
--- a/src/plugins/tracker/rygel-tracker-music.vala
+++ b/src/plugins/tracker/rygel-tracker-music.vala
@@ -30,21 +30,8 @@ public class Rygel.Tracker.Music : CategoryContainer {
public Music (string id, MediaContainer parent, string title) {
base (id, parent, title, new MusicItemFactory ());
- var key_chain = new string[] { "nmm:performer",
- "nmm:artistName",
- null };
- this.add_child (new MetadataValues (id + "Artists",
- this,
- _("Artists"),
- this.item_factory,
- key_chain));
-
- key_chain = new string[] { "nmm:musicAlbum", "nmm:albumTitle", null };
- this.add_child (new MetadataValues (id + "Albums",
- this,
- _("Albums"),
- this.item_factory,
- key_chain));
+ this.add_child (new Artists (this));
+ this.add_child (new Albums (this));
this.add_child (new Tags (this, item_factory));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]