[grilo] core: add GRL_METADATA_KEY_MB_RECORDING_ID
- From: Victor Toso de Carvalho <victortoso src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: add GRL_METADATA_KEY_MB_RECORDING_ID
- Date: Tue, 9 Dec 2014 18:43:30 +0000 (UTC)
commit 5c1eb9e5340cbfe57fc63cc0cdf882f9e4850c9e
Author: Victor Toso <me victortoso com>
Date: Sat Nov 29 18:19:36 2014 +0100
core: add GRL_METADATA_KEY_MB_RECORDING_ID
MusicBrainz recording identifier. From its documentation:
A recording is an entity in MusicBrainz which can be linked to tracks
on releases. Each track must always be associated with a single
recording, but a recording can be linked to any number of tracks.
https://bugzilla.gnome.org/show_bug.cgi?id=741230
bindings/vala/grilo-0.2-custom.vala | 2 ++
doc/grilo/grilo-sections.txt | 3 +++
src/data/grl-media-audio.c | 29 +++++++++++++++++++++++++++++
src/data/grl-media-audio.h | 4 ++++
src/grl-metadata-key.c | 9 +++++++++
src/grl-metadata-key.h | 1 +
6 files changed, 48 insertions(+), 0 deletions(-)
---
diff --git a/bindings/vala/grilo-0.2-custom.vala b/bindings/vala/grilo-0.2-custom.vala
index a27e78a..b22d9c3 100644
--- a/bindings/vala/grilo-0.2-custom.vala
+++ b/bindings/vala/grilo-0.2-custom.vala
@@ -105,6 +105,8 @@ namespace Grl {
public static Grl.KeyID MB_TRACK_ID;
[CCode (cname ="GRL_METADATA_KEY_MB_ARTIST_ID")]
public static Grl.KeyID MB_ARTIST_ID;
+ [CCode (cname ="GRL_METADATA_KEY_MB_RECORDING_ID")]
+ public static Grl.KeyID MB_RECORDING_ID;
public static GLib.List list_new (Grl.KeyID p, ...);
}
diff --git a/doc/grilo/grilo-sections.txt b/doc/grilo/grilo-sections.txt
index 7fb71a3..43234ba 100644
--- a/doc/grilo/grilo-sections.txt
+++ b/doc/grilo/grilo-sections.txt
@@ -562,6 +562,7 @@ grl_media_audio_get_lyrics_nth
grl_media_audio_get_mb_album_id
grl_media_audio_get_mb_artist_id
grl_media_audio_get_mb_artist_id_nth
+grl_media_audio_get_mb_recording_id
grl_media_audio_get_mb_track_id
grl_media_audio_get_track_number
grl_media_audio_get_url_data
@@ -573,6 +574,7 @@ grl_media_audio_set_genre
grl_media_audio_set_lyrics
grl_media_audio_set_mb_album_id
grl_media_audio_set_mb_artist_id
+grl_media_audio_set_mb_recording_id
grl_media_audio_set_mb_track_id
grl_media_audio_set_track_number
grl_media_audio_set_url_data
@@ -661,6 +663,7 @@ GRL_METADATA_KEY_LICENSE
GRL_METADATA_KEY_LYRICS
GRL_METADATA_KEY_MB_ALBUM_ID
GRL_METADATA_KEY_MB_ARTIST_ID
+GRL_METADATA_KEY_MB_RECORDING_ID
GRL_METADATA_KEY_MB_TRACK_ID
GRL_METADATA_KEY_MIME
GRL_METADATA_KEY_MODIFICATION_DATE
diff --git a/src/data/grl-media-audio.c b/src/data/grl-media-audio.c
index 5dad9ad..6fc3ae3 100644
--- a/src/data/grl-media-audio.c
+++ b/src/data/grl-media-audio.c
@@ -175,6 +175,22 @@ grl_media_audio_set_mb_artist_id (GrlMediaAudio *audio, const gchar *mb_artist_i
}
/**
+ * grl_media_audio_set_mb_recording_id:
+ * @audio: the media instance
+ * @mb_track_id: the MusicBrainz recording identifier
+ *
+ * Set the MusicBrainz recording identifier of the audio
+ */
+void
+grl_media_audio_set_mb_recording_id (GrlMediaAudio *audio,
+ const gchar *mb_recording_id)
+{
+ g_return_if_fail (GRL_IS_MEDIA_AUDIO (audio));
+ grl_data_set_string (GRL_DATA (audio), GRL_METADATA_KEY_MB_RECORDING_ID,
+ mb_recording_id);
+}
+
+/**
* grl_media_audio_set_mb_track_id:
* @audio: the media instance
* @mb_track_id: the MusicBrainz track identifier
@@ -538,6 +554,19 @@ grl_media_audio_get_mb_artist_id_nth (GrlMediaAudio *audio, guint index)
}
/**
+ * grl_media_audio_get_mb_recording_id:
+ * @audio: the media instance
+ *
+ * Returns: the MusicBrainz recording identifier
+ */
+const gchar *
+grl_media_audio_get_mb_recording_id (GrlMediaAudio *audio)
+{
+ g_return_val_if_fail (GRL_IS_MEDIA_AUDIO (audio), NULL);
+ return grl_data_get_string (GRL_DATA (audio), GRL_METADATA_KEY_MB_RECORDING_ID);
+}
+
+/**
* grl_media_audio_get_mb_track_id:
* @audio: the media instance
*
diff --git a/src/data/grl-media-audio.h b/src/data/grl-media-audio.h
index a52b90e..2259f39 100644
--- a/src/data/grl-media-audio.h
+++ b/src/data/grl-media-audio.h
@@ -97,6 +97,8 @@ void grl_media_audio_set_mb_album_id (GrlMediaAudio *audio, const gchar *mb_albu
void grl_media_audio_set_mb_artist_id (GrlMediaAudio *audio, const gchar *mb_artist_id);
+void grl_media_audio_set_mb_recording_id (GrlMediaAudio *audio, const gchar *mb_recording_id);
+
void grl_media_audio_set_mb_track_id (GrlMediaAudio *audio, const gchar *mb_track_id);
void grl_media_audio_set_bitrate (GrlMediaAudio *audio, gint bitrate);
@@ -135,6 +137,8 @@ const gchar *grl_media_audio_get_mb_artist_id (GrlMediaAudio *audio);
const gchar *grl_media_audio_get_mb_artist_id_nth (GrlMediaAudio *audio, guint index);
+const gchar *grl_media_audio_get_mb_recording_id (GrlMediaAudio *audio);
+
const gchar *grl_media_audio_get_mb_track_id (GrlMediaAudio *audio);
gint grl_media_audio_get_bitrate (GrlMediaAudio *audio);
diff --git a/src/grl-metadata-key.c b/src/grl-metadata-key.c
index 4edf85f..55aecdf 100644
--- a/src/grl-metadata-key.c
+++ b/src/grl-metadata-key.c
@@ -557,6 +557,15 @@ grl_metadata_key_setup_system_keys (GrlRegistry *registry)
GRL_METADATA_KEY_MB_ARTIST_ID,
NULL);
+ grl_registry_register_metadata_key_system (registry,
+ g_param_spec_string ("mb-recording-id",
+ "MusicBrainz Recording Id",
+ "The record entity identifier in
MusicBrainz",
+ NULL,
+ G_PARAM_STATIC_STRINGS |
G_PARAM_READWRITE),
+ GRL_METADATA_KEY_MB_RECORDING_ID,
+ NULL);
+
/* Create the relations */
grl_registry_register_metadata_key_relation (registry,
GRL_METADATA_KEY_TITLE,
diff --git a/src/grl-metadata-key.h b/src/grl-metadata-key.h
index e66db45..1fbfa77 100644
--- a/src/grl-metadata-key.h
+++ b/src/grl-metadata-key.h
@@ -101,6 +101,7 @@ typedef guint32 GrlKeyID;
#define GRL_METADATA_KEY_MB_ALBUM_ID 52
#define GRL_METADATA_KEY_MB_TRACK_ID 53
#define GRL_METADATA_KEY_MB_ARTIST_ID 54
+#define GRL_METADATA_KEY_MB_RECORDING_ID 55
G_BEGIN_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]