[rygel] tracker: Provide more information for music items
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] tracker: Provide more information for music items
- Date: Fri, 24 Sep 2010 18:04:52 +0000 (UTC)
commit b6fe97d3b7a29d97a77a5f11d93ceb3d6dc3efbe
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Fri Sep 24 20:48:10 2010 +0300
tracker: Provide more information for music items
* sample rate
* number of channels
* bits per sample
* bitrate
.../tracker/rygel-tracker-music-item-factory.vala | 26 ++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-music-item-factory.vala b/src/plugins/tracker/rygel-tracker-music-item-factory.vala
index 899fcf0..8b5e9e9 100644
--- a/src/plugins/tracker/rygel-tracker-music-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-music-item-factory.vala
@@ -33,6 +33,10 @@ public class Rygel.Tracker.MusicItemFactory : ItemFactory {
AUDIO_ARTIST,
AUDIO_TRACK_NUM,
AUDIO_GENRE,
+ SAMPLE_RATE,
+ CHANNELS,
+ BITS_PER_SAMPLE,
+ BITRATE,
LAST_KEY
}
@@ -56,6 +60,11 @@ public class Rygel.Tracker.MusicItemFactory : ItemFactory {
this.key_chains[MusicMetadata.AUDIO_ALBUM].add ("nmm:albumTitle");
this.key_chains[MusicMetadata.AUDIO_TRACK_NUM].add ("nmm:trackNumber");
this.key_chains[MusicMetadata.AUDIO_GENRE].add ("nfo:genre");
+ this.key_chains[MusicMetadata.SAMPLE_RATE].add ("nfo:sampleRate");
+ this.key_chains[MusicMetadata.CHANNELS].add ("nfo:channels");
+ this.key_chains[MusicMetadata.BITS_PER_SAMPLE].add (
+ "nfo:bitsPerSample");
+ this.key_chains[MusicMetadata.BITRATE].add ("nfo:averageBitrate");
}
public override MediaItem create (string id,
@@ -83,6 +92,23 @@ public class Rygel.Tracker.MusicItemFactory : ItemFactory {
music.duration = metadata[MusicMetadata.DURATION].to_int ();
}
+ if (metadata[MusicMetadata.SAMPLE_RATE] != "") {
+ music.sample_freq = metadata[MusicMetadata.SAMPLE_RATE].to_int ();
+ }
+
+ if (metadata[MusicMetadata.CHANNELS] != "") {
+ music.channels = metadata[MusicMetadata.CHANNELS].to_int ();
+ }
+
+ if (metadata[MusicMetadata.BITS_PER_SAMPLE] != "") {
+ var bits_per_sample = metadata[MusicMetadata.BITS_PER_SAMPLE];
+ music.bits_per_sample = bits_per_sample.to_int ();
+ }
+
+ if (metadata[MusicMetadata.BITRATE] != "") {
+ music.bitrate = metadata[MusicMetadata.BITRATE].to_int () / 8;
+ }
+
if (metadata[MusicMetadata.AUDIO_TRACK_NUM] != "") {
var track_number = metadata[MusicMetadata.AUDIO_TRACK_NUM];
music.track_number = track_number.to_int ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]