[rhythmbox] grilo: Port to the grilo 0.2 API
- From: Jasper Lievisse Adriaanse <jasperla src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] grilo: Port to the grilo 0.2 API
- Date: Fri, 17 Aug 2012 13:29:19 +0000 (UTC)
commit 86eb47f705b2f0e6e8ba8d90073c961d47dbfb95
Author: Jasper Lievisse Adriaanse <jasper humppa nl>
Date: Fri Aug 17 15:28:05 2012 +0200
grilo: Port to the grilo 0.2 API
Signed-off-by: Jonathan Matthew <jmatthew src gnome org>
INSTALL.quick | 2 +-
configure.ac | 4 +-
plugins/grilo/rb-grilo-plugin.c | 6 ++--
plugins/grilo/rb-grilo-source.c | 52 +++++++++++++++++++-------------------
plugins/grilo/rb-grilo-source.h | 2 +-
5 files changed, 33 insertions(+), 33 deletions(-)
---
diff --git a/INSTALL.quick b/INSTALL.quick
index 3f59801..805d28b 100644
--- a/INSTALL.quick
+++ b/INSTALL.quick
@@ -22,7 +22,7 @@ Rhythmbox can also make use of the following packages:
- libbrasero-media 2.31.5 or newer
- libdmapsharing 2.9.11 or newer
- libmtp 0.3.0 or newer
-- grilo 0.1.17 or newer
+- grilo 0.2.0 or newer
- webkit-gtk 1.3.9 or newer
- clutter 1.8, clutter-gst 1.4, clutter-gtk 1.0 and mx 1.0.1 or newer
for music visualization
diff --git a/configure.ac b/configure.ac
index 3efd88c..cc43e48 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,7 +58,7 @@ LIBSOUP_REQS=2.26.0
GUDEV_REQS=143
LIBMTP_REQS=0.3.0
LIBPEAS_REQS=0.7.3
-GRILO_REQS=0.1.17
+GRILO_REQS=0.2.0
LIBXML2_REQS=2.7.8
LIBNOTIFY_REQS=0.7.0
@@ -775,7 +775,7 @@ AC_ARG_ENABLE(grilo,
[Disable Grilo support]),,
enable_grilo=auto)
if test "x$enable_grilo" != "xno"; then
- PKG_CHECK_MODULES(GRILO, grilo-0.1 >= $GRILO_REQS, have_grilo=yes, have_grilo=no)
+ PKG_CHECK_MODULES(GRILO, grilo-0.2 >= $GRILO_REQS, have_grilo=yes, have_grilo=no)
if test "x$have_grilo" = "xno" -a "x$enable_grilo" = "xyes"; then
AC_MSG_ERROR([Grilo support explicitly requested, but grilo couldn not be found])
fi
diff --git a/plugins/grilo/rb-grilo-plugin.c b/plugins/grilo/rb-grilo-plugin.c
index c750bd6..212ef4d 100644
--- a/plugins/grilo/rb-grilo-plugin.c
+++ b/plugins/grilo/rb-grilo-plugin.c
@@ -67,7 +67,7 @@ typedef struct
{
PeasExtensionBase parent;
- GrlPluginRegistry *registry;
+ GrlRegistry *registry;
GHashTable *sources;
RBShellPlayer *shell_player;
gulong emit_cover_art_id;
@@ -95,7 +95,7 @@ rb_grilo_plugin_init (RBGriloPlugin *plugin)
static void
rb_grilo_plugin_source_deleted (RBGriloSource *source, RBGriloPlugin *plugin)
{
- GrlMediaSource *media_source;
+ GrlSource *media_source;
g_object_get (source, "media-source", &media_source, NULL);
g_hash_table_remove (plugin->sources, media_source);
@@ -103,7 +103,7 @@ rb_grilo_plugin_source_deleted (RBGriloSource *source, RBGriloPlugin *plugin)
}
static void
-grilo_source_added_cb (GrlPluginRegistry *registry, GrlMediaPlugin *grilo_plugin, RBGriloPlugin *plugin)
+grilo_source_added_cb (GrlRegistry *registry, GrlPlugin *grilo_plugin, RBGriloPlugin *plugin)
{
RBSource *grilo_source;
RBShell *shell;
diff --git a/plugins/grilo/rb-grilo-source.c b/plugins/grilo/rb-grilo-source.c
index 5e6be8d..42b4cb5 100644
--- a/plugins/grilo/rb-grilo-source.c
+++ b/plugins/grilo/rb-grilo-source.c
@@ -91,7 +91,7 @@ static RBEntryView *impl_get_entry_view (RBSource *source);
struct _RBGriloSourcePrivate
{
- GrlMediaSource *grilo_source;
+ GrlSource *grilo_source;
GList *grilo_keys;
RhythmDBEntryType *entry_type;
@@ -189,7 +189,7 @@ rb_grilo_source_class_init (RBGriloSourceClass *klass)
g_param_spec_object ("grilo-source",
"grilo source",
"grilo source object",
- GRL_TYPE_MEDIA_SOURCE,
+ GRL_TYPE_SOURCE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_type_class_add_private (klass, sizeof (RBGriloSourcePrivate));
@@ -288,49 +288,49 @@ rb_grilo_source_constructed (GObject *object)
source_keys = grl_metadata_source_supported_keys (GRL_METADATA_SOURCE (source->priv->grilo_source));
- if (g_list_find ((GList *)source_keys, GRL_METADATA_KEY_TRACK_NUMBER)) {
+ if (g_list_find ((GList *)source_keys, GUINT_TO_POINTER(GRL_METADATA_KEY_TRACK_NUMBER))) {
rb_entry_view_append_column (source->priv->entry_view, RB_ENTRY_VIEW_COL_TRACK_NUMBER, FALSE);
source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys,
- GRL_METADATA_KEY_TRACK_NUMBER);
+ GUINT_TO_POINTER(GRL_METADATA_KEY_TRACK_NUMBER));
}
- if (g_list_find ((GList *)source_keys, GRL_METADATA_KEY_TITLE)) {
+ if (g_list_find ((GList *)source_keys, GUINT_TO_POINTER(GRL_METADATA_KEY_TITLE))) {
rb_entry_view_append_column (source->priv->entry_view, RB_ENTRY_VIEW_COL_TITLE, TRUE);
source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys,
- GRL_METADATA_KEY_TITLE);
+ GUINT_TO_POINTER(GRL_METADATA_KEY_TITLE));
}
- if (g_list_find ((GList *)source_keys, GRL_METADATA_KEY_GENRE)) {
+ if (g_list_find ((GList *)source_keys, GUINT_TO_POINTER(GRL_METADATA_KEY_GENRE))) {
rb_entry_view_append_column (source->priv->entry_view, RB_ENTRY_VIEW_COL_GENRE, FALSE);
source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys,
- GRL_METADATA_KEY_GENRE);
+ GUINT_TO_POINTER(GRL_METADATA_KEY_GENRE));
}
- if (g_list_find ((GList *)source_keys, GRL_METADATA_KEY_ARTIST)) {
+ if (g_list_find ((GList *)source_keys, GUINT_TO_POINTER(GRL_METADATA_KEY_ARTIST))) {
rb_entry_view_append_column (source->priv->entry_view, RB_ENTRY_VIEW_COL_ARTIST, FALSE);
source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys,
- GRL_METADATA_KEY_ARTIST);
+ GUINT_TO_POINTER(GRL_METADATA_KEY_ARTIST));
}
- if (g_list_find ((GList *)source_keys, GRL_METADATA_KEY_ALBUM)) {
+ if (g_list_find ((GList *)source_keys, GUINT_TO_POINTER(GRL_METADATA_KEY_ALBUM))) {
rb_entry_view_append_column (source->priv->entry_view, RB_ENTRY_VIEW_COL_ALBUM, FALSE);
source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys,
- GRL_METADATA_KEY_ALBUM);
+ GUINT_TO_POINTER(GRL_METADATA_KEY_ALBUM));
}
/*
- if (g_list_find ((GList *)source_keys, GRL_METADATA_KEY_DATE)) {
+ if (g_list_find ((GList *)source_keys, GUINT_TO_POINTER(GRL_METADATA_KEY_DATE))) {
rb_entry_view_append_column (source->priv->entry_view, RB_ENTRY_VIEW_COL_YEAR, FALSE);
source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys,
- GRL_METADATA_KEY_DATE);
+ GUINT_TO_POINTER(GRL_METADATA_KEY_DATE));
}
*/
- if (g_list_find ((GList *)source_keys, GRL_METADATA_KEY_DURATION)) {
+ if (g_list_find ((GList *)source_keys, GUINT_TO_POINTER(GRL_METADATA_KEY_DURATION))) {
rb_entry_view_append_column (source->priv->entry_view, RB_ENTRY_VIEW_COL_DURATION, FALSE);
source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys,
- GRL_METADATA_KEY_DURATION);
+ GUINT_TO_POINTER(GRL_METADATA_KEY_DURATION));
}
- source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys, GRL_METADATA_KEY_CHILDCOUNT);
- source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys, GRL_METADATA_KEY_URL);
- source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys, GRL_METADATA_KEY_THUMBNAIL);
+ source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys, GUINT_TO_POINTER(GRL_METADATA_KEY_CHILDCOUNT));
+ source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys, GUINT_TO_POINTER(GRL_METADATA_KEY_URL));
+ source->priv->grilo_keys = g_list_prepend (source->priv->grilo_keys, GUINT_TO_POINTER(GRL_METADATA_KEY_THUMBNAIL));
/* probably add an image column too? */
source->priv->browser_model = gtk_tree_store_new (4, GRL_TYPE_MEDIA, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT);
@@ -405,7 +405,7 @@ rb_grilo_source_constructed (GObject *object)
}
RBSource *
-rb_grilo_source_new (GObject *plugin, GrlMediaSource *grilo_source)
+rb_grilo_source_new (GObject *plugin, GrlSource *grilo_source)
{
GObject *source;
RBShell *shell;
@@ -546,7 +546,7 @@ create_entry_for_media (RhythmDB *db, RhythmDBEntryType *entry_type, GrlData *da
set_string_prop_from_key (db, entry, RHYTHMDB_PROP_GENRE, data, GRL_METADATA_KEY_GENRE);
set_string_prop_from_key (db, entry, RHYTHMDB_PROP_TITLE, data, GRL_METADATA_KEY_TITLE);
- if (grl_data_has_key (data, GRL_METADATA_KEY_DATE)) {
+ if (grl_data_has_key (data, GRL_METADATA_KEY_PUBLICATION_DATE)) {
/* something - grilo has this as a string? */
}
@@ -643,7 +643,7 @@ set_container_type (RBGriloSource *source, GtkTreeIter *iter, gboolean has_media
}
static void
-grilo_browse_cb (GrlMediaSource *grilo_source, guint operation_id, GrlMedia *media, guint remaining, RBGriloSource *source, const GError *error)
+grilo_browse_cb (GrlSource *grilo_source, guint operation_id, GrlMedia *media, guint remaining, RBGriloSource *source, const GError *error)
{
if (operation_id != source->priv->browse_op) {
return;
@@ -751,7 +751,7 @@ browse_next (RBGriloSource *source)
source->priv->browse_position,
CONTAINER_FETCH_SIZE,
GRL_RESOLVE_NORMAL,
- (GrlMediaSourceResultCb) grilo_browse_cb,
+ (GrlSourceResultCb) grilo_browse_cb,
source);
}
@@ -784,7 +784,7 @@ start_browse (RBGriloSource *source, GrlMedia *container, GtkTreeIter *container
static void media_browse_next (RBGriloSource *source);
static void
-grilo_media_browse_cb (GrlMediaSource *grilo_source, guint operation_id, GrlMedia *media, guint remaining, RBGriloSource *source, const GError *error)
+grilo_media_browse_cb (GrlSource *grilo_source, guint operation_id, GrlMedia *media, guint remaining, RBGriloSource *source, const GError *error)
{
if (operation_id != source->priv->media_browse_op) {
return;
@@ -871,7 +871,7 @@ media_browse_next (RBGriloSource *source)
source->priv->media_browse_position,
CONTAINER_FETCH_SIZE,
GRL_RESOLVE_NORMAL,
- (GrlMediaSourceResultCb) grilo_media_browse_cb,
+ (GrlSourceResultCb) grilo_media_browse_cb,
source);
} else {
source->priv->media_browse_op =
@@ -881,7 +881,7 @@ media_browse_next (RBGriloSource *source)
source->priv->media_browse_position,
CONTAINER_FETCH_SIZE,
GRL_RESOLVE_NORMAL,
- (GrlMediaSourceResultCb) grilo_media_browse_cb,
+ (GrlSourceResultCb) grilo_media_browse_cb,
source);
}
}
diff --git a/plugins/grilo/rb-grilo-source.h b/plugins/grilo/rb-grilo-source.h
index 0ba0f0a..72c3538 100644
--- a/plugins/grilo/rb-grilo-source.h
+++ b/plugins/grilo/rb-grilo-source.h
@@ -72,7 +72,7 @@ typedef struct
} RBGriloEntryData;
RBSource * rb_grilo_source_new (GObject *plugin,
- GrlMediaSource *grilo_source);
+ GrlSource *grilo_source);
GType rb_grilo_source_get_type (void);
void _rb_grilo_source_register_type (GTypeModule *module);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]