[grilo] core: Add GRL_METADATA_KEY_ALBUM_ARTIST



commit e9be9114df766627595e6b89f3996cf6d0b4a9da
Author: Marinus Schraal <mschraal src gnome org>
Date:   Wed Mar 2 19:56:38 2016 +0100

    core: Add GRL_METADATA_KEY_ALBUM_ARTIST
    
    Add GRL_METADATA_KEY_ALBUM_ARTIST, defines the main artist of the album
    from which the media originates.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763009

 src/data/grl-media.c   |   32 ++++++++++++++++++++++++++++++++
 src/data/grl-media.h   |    4 ++++
 src/grl-metadata-key.c |   10 ++++++++++
 src/grl-metadata-key.h |    1 +
 4 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/src/data/grl-media.c b/src/data/grl-media.c
index 5073484..0164efd 100644
--- a/src/data/grl-media.c
+++ b/src/data/grl-media.c
@@ -1745,6 +1745,23 @@ grl_media_set_album (GrlMedia *media, const gchar *album)
 }
 
 /**
+ * grl_media_set_album_artist:
+ * @media: the media instance
+ * @album: the audio's album main artist
+ *
+ * Set the main artist of the album of the media
+ *
+ * Since: 0.3.1
+ */
+void
+grl_media_set_album_artist (GrlMedia *media, const gchar *album_artist)
+{
+  g_return_if_fail (GRL_IS_MEDIA (media));
+  grl_data_set_string (GRL_DATA (media), GRL_METADATA_KEY_ALBUM_ARTIST,
+                       album_artist);
+}
+
+/**
  * grl_media_set_album_disc_number:
  * @media: the media instance
  * @disc_number: the disc number within an album
@@ -3172,6 +3189,21 @@ grl_media_get_album (GrlMedia *media)
 }
 
 /**
+ * grl_media_get_album_artist:
+ * @media: the media instance
+ *
+ * Returns: the main artist of the album of the media
+ *
+ * Since: 0.3.1
+ */
+const gchar *
+grl_media_get_album_artist (GrlMedia *media)
+{
+  g_return_val_if_fail (GRL_MEDIA (media), NULL);
+  return grl_data_get_string (GRL_DATA (media), GRL_METADATA_KEY_ALBUM_ARTIST);
+}
+
+/**
  * grl_media_get_album_disc_number:
  * @media: the media instance
  *
diff --git a/src/data/grl-media.h b/src/data/grl-media.h
index 3c6ef76..1ce4653 100644
--- a/src/data/grl-media.h
+++ b/src/data/grl-media.h
@@ -191,6 +191,8 @@ void grl_media_set_genre (GrlMedia *media, const gchar *genre);
 
 void grl_media_set_album (GrlMedia *media, const gchar *album);
 
+void grl_media_set_album_artist (GrlMedia *media, const gchar *album_artist);
+
 void grl_media_set_album_disc_number (GrlMedia *media, gint disc_number);
 
 void grl_media_set_artist (GrlMedia *media, const gchar *artist);
@@ -364,6 +366,8 @@ const gchar *grl_media_get_genre_nth (GrlMedia *media, guint index);
 
 const gchar *grl_media_get_album (GrlMedia *media);
 
+const gchar *grl_media_get_album_artist (GrlMedia *media);
+
 gint grl_media_get_album_disc_number (GrlMedia *media);
 
 const gchar *grl_media_get_artist (GrlMedia *media);
diff --git a/src/grl-metadata-key.c b/src/grl-metadata-key.c
index 8a810de..99ba123 100644
--- a/src/grl-metadata-key.c
+++ b/src/grl-metadata-key.c
@@ -48,6 +48,16 @@ grl_metadata_key_setup_system_keys (GrlRegistry *registry)
                                              NULL);
 
   grl_registry_register_metadata_key_system (registry,
+                                             g_param_spec_string ("album-artist",
+                                                                  "Main album artist",
+                                                                  "Main artist of the album the media 
belongs to",
+                                                                  NULL,
+                                                                  G_PARAM_STATIC_STRINGS | 
G_PARAM_READWRITE),
+                                             GRL_METADATA_KEY_ALBUM_ARTIST,
+                                             GRL_METADATA_KEY_INVALID,
+                                             NULL);
+
+  grl_registry_register_metadata_key_system (registry,
                                              g_param_spec_string ("artist",
                                                                   "Artist",
                                                                   "Main artist",
diff --git a/src/grl-metadata-key.h b/src/grl-metadata-key.h
index d1ed6e3..4a8c592 100644
--- a/src/grl-metadata-key.h
+++ b/src/grl-metadata-key.h
@@ -122,6 +122,7 @@ typedef enum {
 #define GRL_METADATA_KEY_AUDIO_TRACK          57
 #define GRL_METADATA_KEY_ALBUM_DISC_NUMBER    58
 #define GRL_METADATA_KEY_COMPOSER             59
+#define GRL_METADATA_KEY_ALBUM_ARTIST         60
 
 G_BEGIN_DECLS
 


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