[rygel-grilo] Rename MediaServer2 to MS2Server



commit 1d3e416c7f2a1721fecaa251b9d0f7ac37bb4c32
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri Apr 9 13:11:49 2010 +0200

    Rename MediaServer2 to MS2Server
    
    Short server name.

 lib/Makefile.am                    |    4 +-
 lib/media-server2-common.h         |    7 ++
 lib/media-server2-server-glue.h    |   74 +++++++-------
 lib/media-server2-server-private.h |   24 ++--
 lib/media-server2-server.h         |  173 +++++++++++++++----------------
 lib/media-server2.c                |  203 ++++++++++++++++++------------------
 src/rygel-grilo.c                  |   70 ++++++------
 7 files changed, 277 insertions(+), 278 deletions(-)
---
diff --git a/lib/Makefile.am b/lib/Makefile.am
index df717cd..4fd7cbd 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -11,14 +11,14 @@ INCLUDES = @DEPS_CFLAGS@
 	$(AM_V_GEN) $(DBUSBINDINGTOOL)	\
 	--mode=glib-server		\
 	--output=$@			\
-	--prefix=$(subst -,_,$*)_server	\
+	--prefix=ms2_server		\
 	$^
 
 %-client-glue.h: $(top_srcdir)/data/%.xml
 	$(AM_V_GEN) $(DBUSBINDINGTOOL)	\
 	--mode=glib-client		\
 	--output=$@			\
-	--prefix=$(subst -,_,$*)_client	\
+	--prefix=ms2_client		\
 	$^
 
 lib_LTLIBRARIES = libmediaserver2.la
diff --git a/lib/media-server2-common.h b/lib/media-server2-common.h
index be7e6df..ea51d10 100644
--- a/lib/media-server2-common.h
+++ b/lib/media-server2-common.h
@@ -23,6 +23,9 @@
 #ifndef _MEDIA_SERVER2_COMMON_H_
 #define _MEDIA_SERVER2_COMMON_H_
 
+#define MS2_ERROR                                       \
+  g_quark_from_static_string("media_server2_error")
+
 /* Common properties */
 #define MS2_PROP_ID           "id"
 #define MS2_PROP_PARENT       "parent"
@@ -72,6 +75,10 @@
 #define MS2_UNKNOWN_INT -1
 #define MS2_UNKNOWN_STR ""
 
+typedef enum {
+  MS2_ERROR_GENERAL = 1
+} MS2Error;
+
 #endif /* _MEDIA_SERVER2_COMMON_H_ */
 
 
diff --git a/lib/media-server2-server-glue.h b/lib/media-server2-server-glue.h
index 7b6ba93..921eb18 100644
--- a/lib/media-server2-server-glue.h
+++ b/lib/media-server2-server-glue.h
@@ -1,8 +1,8 @@
 /* Generated by dbus-binding-tool; do not edit! */
 
 
-#ifndef __dbus_glib_marshal_media_server2_server_MARSHAL_H__
-#define __dbus_glib_marshal_media_server2_server_MARSHAL_H__
+#ifndef __dbus_glib_marshal_ms2_server_MARSHAL_H__
+#define __dbus_glib_marshal_ms2_server_MARSHAL_H__
 
 #include	<glib-object.h>
 
@@ -53,20 +53,20 @@ G_BEGIN_DECLS
 #endif /* !G_ENABLE_DEBUG */
 
 
-/* NONE:STRING,UINT,INT,BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.ZNEHAV:1) */
-extern void dbus_glib_marshal_media_server2_server_VOID__STRING_UINT_INT_BOXED_POINTER (GClosure     *closure,
-                                                                                        GValue       *return_value,
-                                                                                        guint         n_param_values,
-                                                                                        const GValue *param_values,
-                                                                                        gpointer      invocation_hint,
-                                                                                        gpointer      marshal_data);
+/* NONE:STRING,UINT,INT,BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.9MVLAV:1) */
+extern void dbus_glib_marshal_ms2_server_VOID__STRING_UINT_INT_BOXED_POINTER (GClosure     *closure,
+                                                                              GValue       *return_value,
+                                                                              guint         n_param_values,
+                                                                              const GValue *param_values,
+                                                                              gpointer      invocation_hint,
+                                                                              gpointer      marshal_data);
 void
-dbus_glib_marshal_media_server2_server_VOID__STRING_UINT_INT_BOXED_POINTER (GClosure     *closure,
-                                                                            GValue       *return_value G_GNUC_UNUSED,
-                                                                            guint         n_param_values,
-                                                                            const GValue *param_values,
-                                                                            gpointer      invocation_hint G_GNUC_UNUSED,
-                                                                            gpointer      marshal_data)
+dbus_glib_marshal_ms2_server_VOID__STRING_UINT_INT_BOXED_POINTER (GClosure     *closure,
+                                                                  GValue       *return_value G_GNUC_UNUSED,
+                                                                  guint         n_param_values,
+                                                                  const GValue *param_values,
+                                                                  gpointer      invocation_hint G_GNUC_UNUSED,
+                                                                  gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__STRING_UINT_INT_BOXED_POINTER) (gpointer     data1,
                                                                     gpointer     arg_1,
@@ -101,22 +101,22 @@ dbus_glib_marshal_media_server2_server_VOID__STRING_UINT_INT_BOXED_POINTER (GClo
             g_marshal_value_peek_pointer (param_values + 5),
             data2);
 }
-#define dbus_glib_marshal_media_server2_server_NONE__STRING_UINT_INT_BOXED_POINTER	dbus_glib_marshal_media_server2_server_VOID__STRING_UINT_INT_BOXED_POINTER
-
-/* NONE:STRING,BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.ZNEHAV:2) */
-extern void dbus_glib_marshal_media_server2_server_VOID__STRING_BOXED_POINTER (GClosure     *closure,
-                                                                               GValue       *return_value,
-                                                                               guint         n_param_values,
-                                                                               const GValue *param_values,
-                                                                               gpointer      invocation_hint,
-                                                                               gpointer      marshal_data);
+#define dbus_glib_marshal_ms2_server_NONE__STRING_UINT_INT_BOXED_POINTER	dbus_glib_marshal_ms2_server_VOID__STRING_UINT_INT_BOXED_POINTER
+
+/* NONE:STRING,BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.9MVLAV:2) */
+extern void dbus_glib_marshal_ms2_server_VOID__STRING_BOXED_POINTER (GClosure     *closure,
+                                                                     GValue       *return_value,
+                                                                     guint         n_param_values,
+                                                                     const GValue *param_values,
+                                                                     gpointer      invocation_hint,
+                                                                     gpointer      marshal_data);
 void
-dbus_glib_marshal_media_server2_server_VOID__STRING_BOXED_POINTER (GClosure     *closure,
-                                                                   GValue       *return_value G_GNUC_UNUSED,
-                                                                   guint         n_param_values,
-                                                                   const GValue *param_values,
-                                                                   gpointer      invocation_hint G_GNUC_UNUSED,
-                                                                   gpointer      marshal_data)
+dbus_glib_marshal_ms2_server_VOID__STRING_BOXED_POINTER (GClosure     *closure,
+                                                         GValue       *return_value G_GNUC_UNUSED,
+                                                         guint         n_param_values,
+                                                         const GValue *param_values,
+                                                         gpointer      invocation_hint G_GNUC_UNUSED,
+                                                         gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__STRING_BOXED_POINTER) (gpointer     data1,
                                                            gpointer     arg_1,
@@ -147,21 +147,21 @@ dbus_glib_marshal_media_server2_server_VOID__STRING_BOXED_POINTER (GClosure
             g_marshal_value_peek_pointer (param_values + 3),
             data2);
 }
-#define dbus_glib_marshal_media_server2_server_NONE__STRING_BOXED_POINTER	dbus_glib_marshal_media_server2_server_VOID__STRING_BOXED_POINTER
+#define dbus_glib_marshal_ms2_server_NONE__STRING_BOXED_POINTER	dbus_glib_marshal_ms2_server_VOID__STRING_BOXED_POINTER
 
 G_END_DECLS
 
-#endif /* __dbus_glib_marshal_media_server2_server_MARSHAL_H__ */
+#endif /* __dbus_glib_marshal_ms2_server_MARSHAL_H__ */
 
 #include <dbus/dbus-glib.h>
-static const DBusGMethodInfo dbus_glib_media_server2_server_methods[] = {
-  { (GCallback) media_server2_server_get_children, dbus_glib_marshal_media_server2_server_NONE__STRING_UINT_INT_BOXED_POINTER, 0 },
-  { (GCallback) media_server2_server_get_properties, dbus_glib_marshal_media_server2_server_NONE__STRING_BOXED_POINTER, 109 },
+static const DBusGMethodInfo dbus_glib_ms2_server_methods[] = {
+  { (GCallback) ms2_server_get_children, dbus_glib_marshal_ms2_server_NONE__STRING_UINT_INT_BOXED_POINTER, 0 },
+  { (GCallback) ms2_server_get_properties, dbus_glib_marshal_ms2_server_NONE__STRING_BOXED_POINTER, 109 },
 };
 
-const DBusGObjectInfo dbus_glib_media_server2_server_object_info = {
+const DBusGObjectInfo dbus_glib_ms2_server_object_info = {
   0,
-  dbus_glib_media_server2_server_methods,
+  dbus_glib_ms2_server_methods,
   2,
 "org.gnome.UPnP.MediaServer2\0GetChildren\0A\0id\0I\0s\0offset\0I\0u\0max_count\0I\0i\0filter\0I\0as\0children\0O\0F\0N\0a{sav}\0\0org.gnome.UPnP.MediaServer2\0GetProperties\0A\0id\0I\0s\0filter\0I\0as\0properties\0O\0F\0N\0av\0\0\0",
 "\0",
diff --git a/lib/media-server2-server-private.h b/lib/media-server2-server-private.h
index 20760a4..9de4d02 100644
--- a/lib/media-server2-server-private.h
+++ b/lib/media-server2-server-private.h
@@ -25,18 +25,18 @@
 
 #include "media-server2-server.h"
 
-gboolean media_server2_server_get_properties (MediaServer2 *server,
-                                              const gchar *id,
-                                              const gchar **filter,
-                                              DBusGMethodInvocation *context,
-                                              GError **error);
+gboolean ms2_server_get_properties (MS2Server *server,
+                                    const gchar *id,
+                                    const gchar **filter,
+                                    DBusGMethodInvocation *context,
+                                    GError **error);
 
-gboolean media_server2_server_get_children (MediaServer2 *server,
-                                            const gchar *id,
-                                            guint offset,
-                                            gint max_count,
-                                            const gchar **filter,
-                                            DBusGMethodInvocation *context,
-                                            GError **error);
+gboolean ms2_server_get_children (MS2Server *server,
+                                  const gchar *id,
+                                  guint offset,
+                                  gint max_count,
+                                  const gchar **filter,
+                                  DBusGMethodInvocation *context,
+                                  GError **error);
 
 #endif /* _MEDIA_SERVER2_SERVER_PRIVATE_H_ */
diff --git a/lib/media-server2-server.h b/lib/media-server2-server.h
index bd7ada3..1a7dc05 100644
--- a/lib/media-server2-server.h
+++ b/lib/media-server2-server.h
@@ -28,34 +28,31 @@
 
 #include "media-server2-common.h"
 
-#define MEDIA_SERVER2_ERROR                             \
-  g_quark_from_static_string("media_server2_error")
+#define MS2_TYPE_SERVER                         \
+  (ms2_server_get_type ())
 
-#define MEDIA_SERVER2_TYPE                      \
-  (media_server2_get_type ())
+#define MS2_SERVER(obj)                         \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj),           \
+                               MS2_TYPE_SERVER, \
+                               MS2Server))
 
-#define MEDIA_SERVER2(obj)                                      \
-  (G_TYPE_CHECK_INSTANCE_CAST ((obj),                           \
-                               MEDIA_SERVER2_TYPE,              \
-                               MediaServer2))
+#define MS2_IS_SERVER(obj)                              \
+  (G_TYPE_CHECK_INSTANCE_TYPE ((obj),                   \
+                               MS2_TYPE_SERVER))
 
-#define IS_MEDIA_SERVER2(obj)                                           \
-  (G_TYPE_CHECK_INSTANCE_TYPE ((obj),                                   \
-                               MEDIA_SERVER2_TYPE))
+#define MS2_SERVER_CLASS(klass)                 \
+  (G_TYPE_CHECK_CLASS_CAST((klass),             \
+                           MS2_TYPE_SERVER,     \
+                           MS2ServerClass))
 
-#define MEDIA_SERVER2_CLASS(klass)                                \
-  (G_TYPE_CHECK_CLASS_CAST((klass),                               \
-                           MEDIA_SERVER2_TYPE,                    \
-                           MediaServer2Class))
+#define MS2_IS_SERVER_CLASS(klass)              \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),             \
+                           MS2_TYPE_SERVER))
 
-#define IS_MEDIA_SERVER2_CLASS(klass)                           \
-  (G_TYPE_CHECK_CLASS_TYPE((klass),                             \
-                           MEDIA_SERVER2_TYPE))
-
-#define MEDIA_SERVER2_GET_CLASS(obj)                            \
-  (G_TYPE_INSTANCE_GET_CLASS ((obj),                            \
-                              MEDIA_SERVER2_TYPE,               \
-                              MediaServer2Class))
+#define MS2_SERVER_GET_CLASS(obj)               \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj),            \
+                              MS2_TYPE_SERVER,  \
+                              MS2ServerClass))
 
 typedef GHashTable * (*GetPropertiesFunc) (const gchar *id,
                                            const gchar **properties,
@@ -69,116 +66,112 @@ typedef GList * (*GetChildrenFunc) (const gchar *id,
                                     gpointer data,
                                     GError **error);
 
-typedef struct _MediaServer2        MediaServer2;
-typedef struct _MediaServer2Private MediaServer2Private;
+typedef struct _MS2Server        MS2Server;
+typedef struct _MS2ServerPrivate MS2ServerPrivate;
 
-struct _MediaServer2 {
+struct _MS2Server {
 
   GObject parent;
 
   /*< private >*/
-  MediaServer2Private *priv;
+  MS2ServerPrivate *priv;
 };
 
-typedef struct _MediaServer2Class MediaServer2Class;
+typedef struct _MS2ServerClass MS2ServerClass;
 
-struct _MediaServer2Class {
+struct _MS2ServerClass {
 
   GObjectClass parent_class;
 };
 
-typedef enum {
-  MEDIA_SERVER2_ERROR_GENERAL = 1
-} MediaServer2Error;
-
-GType media_server2_get_type (void);
+GType ms2_server_get_type (void);
 
-MediaServer2 *media_server2_new (const gchar *name,
-                                 gpointer data);
+MS2Server *ms2_server_new (const gchar *name,
+                           gpointer data);
 
-void media_server2_set_get_properties_func (MediaServer2 *server,
-                                            GetPropertiesFunc get_properties_func);
+void ms2_server_set_get_properties_func (MS2Server *server,
+                                         GetPropertiesFunc get_properties_func);
 
-void media_server2_set_get_children_func (MediaServer2 *server,
-                                          GetChildrenFunc get_children_func);
+void ms2_server_set_get_children_func (MS2Server *server,
+                                       GetChildrenFunc get_children_func);
 
-GHashTable *media_server2_new_properties_hashtable (const gchar *id);
+GHashTable *ms2_server_new_properties_hashtable (const gchar *id);
 
-void media_server2_set_parent (GHashTable *properties,
-                               const gchar *parent);
+void ms2_server_set_parent (GHashTable *properties,
+                            const gchar *parent);
 
-void media_server2_set_display_name (GHashTable *properties,
-                                     const gchar *display_name);
+void ms2_server_set_display_name (GHashTable *properties,
+                                  const gchar *display_name);
 
-void media_server2_set_type_container (GHashTable *properties);
+void ms2_server_set_type_container (GHashTable *properties);
 
-void media_server2_set_type_video (GHashTable *properties);
+void ms2_server_set_type_video (GHashTable *properties);
 
-void media_server2_set_type_movie (GHashTable *properties);
+void ms2_server_set_type_movie (GHashTable *properties);
 
-void media_server2_set_type_audio (GHashTable *properties);
+void ms2_server_set_type_audio (GHashTable *properties);
 
-void media_server2_set_type_music (GHashTable *properties);
+void ms2_server_set_type_music (GHashTable *properties);
 
-void media_server2_set_type_image (GHashTable *properties);
+void ms2_server_set_type_image (GHashTable *properties);
 
-void media_server2_set_type_photo (GHashTable *properties);
+void ms2_server_set_type_photo (GHashTable *properties);
 
-void media_server2_set_icon (GHashTable *properties,
-                             const gchar *icon);
+void ms2_server_set_icon (GHashTable *properties,
+                          const gchar *icon);
 
-void media_server2_set_mime_type (GHashTable *properties,
-                                  const gchar *mime_type);
+void ms2_server_set_mime_type (GHashTable *properties,
+                               const gchar *mime_type);
 
-void media_server2_set_artist (GHashTable *properties,
-                               const gchar *artist);
+void ms2_server_set_artist (GHashTable *properties,
+                            const gchar *artist);
 
-void media_server2_set_album (GHashTable *properties,
-                              const gchar *album);
+void ms2_server_set_album (GHashTable *properties,
+                           const gchar *album);
 
-void media_server2_set_date (GHashTable *properties,
-                             const gchar *date);
+void ms2_server_set_date (GHashTable *properties,
+                          const gchar *date);
 
-void media_server2_set_dlna_profile (GHashTable *properties,
-                                     const gchar *dlna_profile);
+void ms2_server_set_dlna_profile (GHashTable *properties,
+                                  const gchar *dlna_profile);
 
-void media_server2_set_thumbnail (GHashTable *properties,
-                                  const gchar *thumbnail);
+void ms2_server_set_thumbnail (GHashTable *properties,
+                               const gchar *thumbnail);
 
-void media_server2_set_genre (GHashTable *properties,
-                              const gchar *genre);
+void ms2_server_set_genre (GHashTable *properties,
+                           const gchar *genre);
 
-void media_server2_set_child_count (GHashTable *properties,
-                                    gint child_count);
+void ms2_server_set_child_count (GHashTable *properties,
+                                 gint child_count);
 
-void media_server2_set_size (GHashTable *properties,
-                             gint size);
+void ms2_server_set_size (GHashTable *properties,
+                          gint size);
 
-void media_server2_set_duration (GHashTable *properties,
-                                 gint duration);
+void ms2_server_set_duration (GHashTable *properties,
+                              gint duration);
 
-void media_server2_set_bitrate (GHashTable *properties,
-                                gint bitrate);
+void ms2_server_set_bitrate (GHashTable *properties,
+                             gint bitrate);
 
-void media_server2_set_sample_rate (GHashTable *properties,
-                                    gint sample_rate);
+void ms2_server_set_sample_rate (GHashTable *properties,
+                                 gint sample_rate);
 
-void media_server2_set_bits_per_sample (GHashTable *properties,
-                                        gint bits_per_sample);
+void ms2_server_set_bits_per_sample (GHashTable *properties,
+                                     gint bits_per_sample);
 
-void media_server2_set_width (GHashTable *properties,
-                              gint width);
+void ms2_server_set_width (GHashTable *properties,
+                           gint width);
 
-void media_server2_set_height (GHashTable *properties,
-                               gint height);
+void ms2_server_set_height (GHashTable *properties,
+                            gint height);
 
-void media_server2_set_pixel_width (GHashTable *properties,
-                                    gint pixel_width);
+void ms2_server_set_pixel_width (GHashTable *properties,
+                                 gint pixel_width);
 
-void media_server2_set_pixel_height (GHashTable *properties,
-                                     gint pixel_height);
+void ms2_server_set_pixel_height (GHashTable *properties,
+                                  gint pixel_height);
 
-void media_server2_set_urls (GHashTable *properties,
-                             gchar **urls);
+void ms2_server_set_urls (GHashTable *properties,
+                          gchar **urls);
 
 #endif /* _MEDIA_SERVER2_SERVER_H_ */
diff --git a/lib/media-server2.c b/lib/media-server2.c
index 6a9421d..4192b9e 100644
--- a/lib/media-server2.c
+++ b/lib/media-server2.c
@@ -62,26 +62,26 @@
 #define DBUS_TYPE_G_ARRAY_OF_STRING                             \
   (dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING))
 
-#define MEDIA_SERVER2_GET_PRIVATE(o)                                    \
-  G_TYPE_INSTANCE_GET_PRIVATE((o), MEDIA_SERVER2_TYPE, MediaServer2Private)
+#define MS2_SERVER_GET_PRIVATE(o)                                    \
+  G_TYPE_INSTANCE_GET_PRIVATE((o), MS2_TYPE_SERVER, MS2ServerPrivate)
 
 /*
- * Private MediaServer2 structure
+ * Private MS2Server structure
  *   data: holds stuff for owner
  *   get_children: function to get children
  *   get_properties: function to get properties
  */
-struct _MediaServer2Private {
+struct _MS2ServerPrivate {
   gpointer *data;
   GetChildrenFunc get_children;
   GetPropertiesFunc get_properties;
 };
 
-G_DEFINE_TYPE (MediaServer2, media_server2, G_TYPE_OBJECT);
+G_DEFINE_TYPE (MS2Server, ms2_server, G_TYPE_OBJECT);
 
-/* Registers the MediaServer2 object in dbus */
+/* Registers the MS2Server object in dbus */
 static gboolean
-media_server2_dbus_register (MediaServer2 *server,
+ms2_server_dbus_register (MS2Server *server,
                              const gchar *name)
 {
   DBusGConnection *connection;
@@ -127,20 +127,20 @@ media_server2_dbus_register (MediaServer2 *server,
 
 /* Class init function */
 static void
-media_server2_class_init (MediaServer2Class *klass)
+ms2_server_class_init (MS2ServerClass *klass)
 {
-  g_type_class_add_private (klass, sizeof (MediaServer2Private));
+  g_type_class_add_private (klass, sizeof (MS2ServerPrivate));
 
   /* Register introspection */
-  dbus_g_object_type_install_info (MEDIA_SERVER2_TYPE,
-                                   &dbus_glib_media_server2_server_object_info);
+  dbus_g_object_type_install_info (MS2_TYPE_SERVER,
+                                   &dbus_glib_ms2_server_object_info);
 }
 
 /* Object init function */
 static void
-media_server2_init (MediaServer2 *server)
+ms2_server_init (MS2Server *server)
 {
-  server->priv = MEDIA_SERVER2_GET_PRIVATE (server);
+  server->priv = MS2_SERVER_GET_PRIVATE (server);
 }
 
 /* Free gvalue */
@@ -292,7 +292,7 @@ get_hash_children (GList *children,
 }
 
 /**
- * media_server2_server_get_properties:
+ * ms2_server_server_get_properties:
  * @server: 
  * @id: 
  * @filter: 
@@ -304,11 +304,11 @@ get_hash_children (GList *children,
  * Returns: 
  **/
 gboolean
-media_server2_server_get_properties (MediaServer2 *server,
-                                     const gchar *id,
-                                     const gchar **filter,
-                                     DBusGMethodInvocation *context,
-                                     GError **error)
+ms2_server_get_properties (MS2Server *server,
+                           const gchar *id,
+                           const gchar **filter,
+                           DBusGMethodInvocation *context,
+                           GError **error)
 {
   GError *prop_error = NULL;
   GHashTable *properties = NULL;
@@ -322,8 +322,8 @@ media_server2_server_get_properties (MediaServer2 *server,
 
     if (prop_error) {
       if (error) {
-        *error = g_error_new_literal (MEDIA_SERVER2_ERROR,
-                                      MEDIA_SERVER2_ERROR_GENERAL,
+        *error = g_error_new_literal (MS2_ERROR,
+                                      MS2_ERROR_GENERAL,
                                       prop_error->message);
         dbus_g_method_return_error (context, *error);
       }
@@ -349,7 +349,7 @@ media_server2_server_get_properties (MediaServer2 *server,
 }
 
 /**
- * media_server2_server_get_children:
+ * ms2_server_server_get_children:
  * @server: 
  * @id: 
  * @offset: 
@@ -363,14 +363,13 @@ media_server2_server_get_properties (MediaServer2 *server,
  * Returns: 
  **/
 gboolean
-media_server2_server_get_children (MediaServer2 *server,
-                                   const gchar *id,
-                                   guint offset,
-                                   gint max_count,
-                                   const gchar **filter,
-                                   DBusGMethodInvocation *context,
-                                   GError **error)
-
+ms2_server_get_children (MS2Server *server,
+                         const gchar *id,
+                         guint offset,
+                         gint max_count,
+                         const gchar **filter,
+                         DBusGMethodInvocation *context,
+                         GError **error)
 {
   GError *child_error = NULL;
   GHashTable *children_hash = NULL;
@@ -386,8 +385,8 @@ media_server2_server_get_children (MediaServer2 *server,
 
     if (child_error) {
       if (error) {
-        *error = g_error_new_literal (MEDIA_SERVER2_ERROR,
-                                      MEDIA_SERVER2_ERROR_GENERAL,
+        *error = g_error_new_literal (MS2_ERROR,
+                                      MS2_ERROR_GENERAL,
                                       child_error->message);
         dbus_g_method_return_error (context, *error);
       }
@@ -412,7 +411,7 @@ media_server2_server_get_children (MediaServer2 *server,
 /*********** PUBLIC API ***********/
 
 /**
- * media_server2_new:
+ * ms2_server_new:
  * @name: 
  * @data: 
  *
@@ -420,17 +419,17 @@ media_server2_server_get_children (MediaServer2 *server,
  *
  * Returns: 
  **/
-MediaServer2 *
-media_server2_new (const gchar *name,
+MS2Server *
+ms2_server_new (const gchar *name,
                    gpointer data)
 {
-  MediaServer2 *server;
+  MS2Server *server;
 
-  server = g_object_new (MEDIA_SERVER2_TYPE, NULL);
+  server = g_object_new (MS2_TYPE_SERVER, NULL);
 
   server->priv->data = data;
 
-  if (!media_server2_dbus_register (server, name)) {
+  if (!ms2_server_dbus_register (server, name)) {
     g_object_unref (server);
     return NULL;
   } else {
@@ -439,39 +438,39 @@ media_server2_new (const gchar *name,
 }
 
 /**
- * media_server2_set_get_properties_func:
+ * ms2_server_set_get_properties_func:
  * @server: 
  * @f: 
  *
  * 
  **/
 void
-media_server2_set_get_properties_func (MediaServer2 *server,
+ms2_server_set_get_properties_func (MS2Server *server,
                                        GetPropertiesFunc get_properties_func)
 {
-  g_return_if_fail (IS_MEDIA_SERVER2 (server));
+  g_return_if_fail (MS2_IS_SERVER (server));
 
   server->priv->get_properties = get_properties_func;
 }
 
 /**
- * media_server2_set_get_children_func:
+ * ms2_server_set_get_children_func:
  * @server: 
  * @f: 
  *
  * 
  **/
 void
-media_server2_set_get_children_func (MediaServer2 *server,
+ms2_server_set_get_children_func (MS2Server *server,
                                      GetChildrenFunc get_children_func)
 {
-  g_return_if_fail (IS_MEDIA_SERVER2 (server));
+  g_return_if_fail (MS2_IS_SERVER (server));
 
   server->priv->get_children = get_children_func;
 }
 
 /**
- * media_server2_new_properties_hashtable:
+ * ms2_server_new_properties_hashtable:
  * @id: 
  *
  * 
@@ -479,7 +478,7 @@ media_server2_set_get_children_func (MediaServer2 *server,
  * Returns: 
  **/
 GHashTable *
-media_server2_new_properties_hashtable (const gchar *id)
+ms2_server_new_properties_hashtable (const gchar *id)
 {
   GHashTable *properties;
 
@@ -495,14 +494,14 @@ media_server2_new_properties_hashtable (const gchar *id)
 }
 
 /**
- * media_server2_set_parent:
+ * ms2_server_set_parent:
  * @properties: 
  * @parent: 
  *
  * 
  **/
 void
-media_server2_set_parent (GHashTable *properties,
+ms2_server_set_parent (GHashTable *properties,
                           const gchar *parent)
 {
   g_return_if_fail (properties);
@@ -515,14 +514,14 @@ media_server2_set_parent (GHashTable *properties,
 }
 
 /**
- * media_server2_set_display_name:
+ * ms2_server_set_display_name:
  * @properties: 
  * @display_name: 
  *
  * 
  **/
 void
-media_server2_set_display_name (GHashTable *properties,
+ms2_server_set_display_name (GHashTable *properties,
                                 const gchar *display_name)
 {
   g_return_if_fail (properties);
@@ -535,13 +534,13 @@ media_server2_set_display_name (GHashTable *properties,
 }
 
 /**
- * media_server2_set_type_container:
+ * ms2_server_set_type_container:
  * @properties: 
  *
  * 
  **/
 void
-media_server2_set_type_container (GHashTable *properties)
+ms2_server_set_type_container (GHashTable *properties)
 {
   g_return_if_fail (properties);
 
@@ -551,13 +550,13 @@ media_server2_set_type_container (GHashTable *properties)
 }
 
 /**
- * media_server2_set_type_video:
+ * ms2_server_set_type_video:
  * @properties: 
  *
  * 
  **/
 void
-media_server2_set_type_video (GHashTable *properties)
+ms2_server_set_type_video (GHashTable *properties)
 {
   g_return_if_fail (properties);
 
@@ -567,13 +566,13 @@ media_server2_set_type_video (GHashTable *properties)
 }
 
 /**
- * media_server2_set_type_movie:
+ * ms2_server_set_type_movie:
  * @properties: 
  *
  * 
  **/
 void
-media_server2_set_type_movie (GHashTable *properties)
+ms2_server_set_type_movie (GHashTable *properties)
 {
   g_return_if_fail (properties);
 
@@ -583,13 +582,13 @@ media_server2_set_type_movie (GHashTable *properties)
 }
 
 /**
- * media_server2_set_type_audio:
+ * ms2_server_set_type_audio:
  * @properties: 
  *
  * 
  **/
 void
-media_server2_set_type_audio (GHashTable *properties)
+ms2_server_set_type_audio (GHashTable *properties)
 {
   g_return_if_fail (properties);
 
@@ -599,13 +598,13 @@ media_server2_set_type_audio (GHashTable *properties)
 }
 
 /**
- * media_server2_set_type_music:
+ * ms2_server_set_type_music:
  * @properties: 
  *
  * 
  **/
 void
-media_server2_set_type_music (GHashTable *properties)
+ms2_server_set_type_music (GHashTable *properties)
 {
   g_return_if_fail (properties);
 
@@ -615,13 +614,13 @@ media_server2_set_type_music (GHashTable *properties)
 }
 
 /**
- * media_server2_set_type_image:
+ * ms2_server_set_type_image:
  * @properties: 
  *
  * 
  **/
 void
-media_server2_set_type_image (GHashTable *properties)
+ms2_server_set_type_image (GHashTable *properties)
 {
   g_return_if_fail (properties);
 
@@ -631,13 +630,13 @@ media_server2_set_type_image (GHashTable *properties)
 }
 
 /**
- * media_server2_set_type_photo:
+ * ms2_server_set_type_photo:
  * @properties: 
  *
  * 
  **/
 void
-media_server2_set_type_photo (GHashTable *properties)
+ms2_server_set_type_photo (GHashTable *properties)
 {
   g_return_if_fail (properties);
 
@@ -647,14 +646,14 @@ media_server2_set_type_photo (GHashTable *properties)
 }
 
 /**
- * media_server2_set_icon:
+ * ms2_server_set_icon:
  * @properties: 
  * @icon: 
  *
  * 
  **/
 void
-media_server2_set_icon (GHashTable *properties,
+ms2_server_set_icon (GHashTable *properties,
                         const gchar *icon)
 {
   g_return_if_fail (properties);
@@ -667,14 +666,14 @@ media_server2_set_icon (GHashTable *properties,
 }
 
 /**
- * media_server2_set_mime_type:
+ * ms2_server_set_mime_type:
  * @properties: 
  * @mime_type: 
  *
  * 
  **/
 void
-media_server2_set_mime_type (GHashTable *properties,
+ms2_server_set_mime_type (GHashTable *properties,
                              const gchar *mime_type)
 {
   g_return_if_fail (properties);
@@ -687,14 +686,14 @@ media_server2_set_mime_type (GHashTable *properties,
 }
 
 /**
- * media_server2_set_artist:
+ * ms2_server_set_artist:
  * @properties: 
  * @artist: 
  *
  * 
  **/
 void
-media_server2_set_artist (GHashTable *properties,
+ms2_server_set_artist (GHashTable *properties,
                           const gchar *artist)
 {
   g_return_if_fail (properties);
@@ -707,14 +706,14 @@ media_server2_set_artist (GHashTable *properties,
 }
 
 /**
- * media_server2_set_album:
+ * ms2_server_set_album:
  * @properties: 
  * @album: 
  *
  * 
  **/
 void
-media_server2_set_album (GHashTable *properties,
+ms2_server_set_album (GHashTable *properties,
                          const gchar *album)
 {
   g_return_if_fail (properties);
@@ -727,14 +726,14 @@ media_server2_set_album (GHashTable *properties,
 }
 
 /**
- * media_server2_set_date:
+ * ms2_server_set_date:
  * @properties: 
  * @date: 
  *
  * 
  **/
 void
-media_server2_set_date (GHashTable *properties,
+ms2_server_set_date (GHashTable *properties,
                         const gchar *date)
 {
   g_return_if_fail (properties);
@@ -747,14 +746,14 @@ media_server2_set_date (GHashTable *properties,
 }
 
 /**
- * media_server2_set_dlna_profile:
+ * ms2_server_set_dlna_profile:
  * @properties: 
  * @dlna_profile: 
  *
  * 
  **/
 void
-media_server2_set_dlna_profile (GHashTable *properties,
+ms2_server_set_dlna_profile (GHashTable *properties,
                                 const gchar *dlna_profile)
 {
   g_return_if_fail (properties);
@@ -767,14 +766,14 @@ media_server2_set_dlna_profile (GHashTable *properties,
 }
 
 /**
- * media_server2_set_thumbnail:
+ * ms2_server_set_thumbnail:
  * @properties: 
  * @thumbnail: 
  *
  * 
  **/
 void
-media_server2_set_thumbnail (GHashTable *properties,
+ms2_server_set_thumbnail (GHashTable *properties,
                              const gchar *thumbnail)
 {
   g_return_if_fail (properties);
@@ -787,14 +786,14 @@ media_server2_set_thumbnail (GHashTable *properties,
 }
 
 /**
- * media_server2_set_genre:
+ * ms2_server_set_genre:
  * @properties: 
  * @genre: 
  *
  * 
  **/
 void
-media_server2_set_genre (GHashTable *properties,
+ms2_server_set_genre (GHashTable *properties,
                          const gchar *genre)
 {
   g_return_if_fail (properties);
@@ -807,14 +806,14 @@ media_server2_set_genre (GHashTable *properties,
 }
 
 /**
- * media_server2_set_child_count:
+ * ms2_server_set_child_count:
  * @properties: 
  * @child_count: 
  *
  * 
  **/
 void
-media_server2_set_child_count (GHashTable *properties,
+ms2_server_set_child_count (GHashTable *properties,
                                gint child_count)
 {
   g_return_if_fail (properties);
@@ -825,14 +824,14 @@ media_server2_set_child_count (GHashTable *properties,
 }
 
 /**
- * media_server2_set_size:
+ * ms2_server_set_size:
  * @properties: 
  * @size: 
  *
  * 
  **/
 void
-media_server2_set_size (GHashTable *properties,
+ms2_server_set_size (GHashTable *properties,
                         gint size)
 {
   g_return_if_fail (properties);
@@ -843,14 +842,14 @@ media_server2_set_size (GHashTable *properties,
 }
 
 /**
- * media_server2_set_duration:
+ * ms2_server_set_duration:
  * @properties: 
  * @duration: 
  *
  * 
  **/
 void
-media_server2_set_duration (GHashTable *properties,
+ms2_server_set_duration (GHashTable *properties,
                             gint duration)
 {
   g_return_if_fail (properties);
@@ -861,14 +860,14 @@ media_server2_set_duration (GHashTable *properties,
 }
 
 /**
- * media_server2_set_bitrate:
+ * ms2_server_set_bitrate:
  * @properties: 
  * @bitrate: 
  *
  * 
  **/
 void
-media_server2_set_bitrate (GHashTable *properties,
+ms2_server_set_bitrate (GHashTable *properties,
                            gint bitrate)
 {
   g_return_if_fail (properties);
@@ -879,14 +878,14 @@ media_server2_set_bitrate (GHashTable *properties,
 }
 
 /**
- * media_server2_set_sample_rate:
+ * ms2_server_set_sample_rate:
  * @properties: 
  * @sample_rate: 
  *
  * 
  **/
 void
-media_server2_set_sample_rate (GHashTable *properties,
+ms2_server_set_sample_rate (GHashTable *properties,
                                gint sample_rate)
 {
   g_return_if_fail (properties);
@@ -897,14 +896,14 @@ media_server2_set_sample_rate (GHashTable *properties,
 }
 
 /**
- * media_server2_set_bits_per_sample:
+ * ms2_server_set_bits_per_sample:
  * @properties: 
  * @bits_per_sample: 
  *
  * 
  **/
 void
-media_server2_set_bits_per_sample (GHashTable *properties,
+ms2_server_set_bits_per_sample (GHashTable *properties,
                                    gint bits_per_sample)
 {
   g_return_if_fail (properties);
@@ -915,14 +914,14 @@ media_server2_set_bits_per_sample (GHashTable *properties,
 }
 
 /**
- * media_server2_set_width:
+ * ms2_server_set_width:
  * @properties: 
  * @width: 
  *
  * 
  **/
 void
-media_server2_set_width (GHashTable *properties,
+ms2_server_set_width (GHashTable *properties,
                          gint width)
 {
   g_return_if_fail (properties);
@@ -933,14 +932,14 @@ media_server2_set_width (GHashTable *properties,
 }
 
 /**
- * media_server2_set_height:
+ * ms2_server_set_height:
  * @properties: 
  * @height: 
  *
  * 
  **/
 void
-media_server2_set_height (GHashTable *properties,
+ms2_server_set_height (GHashTable *properties,
                           gint height)
 {
   g_return_if_fail (properties);
@@ -951,14 +950,14 @@ media_server2_set_height (GHashTable *properties,
 }
 
 /**
- * media_server2_set_pixel_width:
+ * ms2_server_set_pixel_width:
  * @properties: 
  * @pixel_width: 
  *
  * 
  **/
 void
-media_server2_set_pixel_width (GHashTable *properties,
+ms2_server_set_pixel_width (GHashTable *properties,
                                gint pixel_width)
 {
   g_return_if_fail (properties);
@@ -969,14 +968,14 @@ media_server2_set_pixel_width (GHashTable *properties,
 }
 
 /**
- * media_server2_set_pixel_height:
+ * ms2_server_set_pixel_height:
  * @properties: 
  * @pixel_height: 
  *
  * 
  **/
 void
-media_server2_set_pixel_height (GHashTable *properties,
+ms2_server_set_pixel_height (GHashTable *properties,
                                 gint pixel_height)
 {
   g_return_if_fail (properties);
@@ -987,14 +986,14 @@ media_server2_set_pixel_height (GHashTable *properties,
 }
 
 /**
- * media_server2_set_urls:
+ * ms2_server_set_urls:
  * @properties: 
  * @urls: 
  *
  * 
  **/
 void
-media_server2_set_urls (GHashTable *properties,
+ms2_server_set_urls (GHashTable *properties,
                         gchar **urls)
 {
   GPtrArray *url_array;
diff --git a/src/rygel-grilo.c b/src/rygel-grilo.c
index 3b28b7d..f60d487 100644
--- a/src/rygel-grilo.c
+++ b/src/rygel-grilo.c
@@ -245,62 +245,62 @@ fill_properties_table (GHashTable *properties_table,
     if (grl_data_key_is_known (GRL_DATA (media), key)) {
       switch (key) {
       case GRL_METADATA_KEY_TITLE:
-        media_server2_set_display_name (properties_table,
-                                        grl_media_get_title (media));
+        ms2_server_set_display_name (properties_table,
+                                     grl_media_get_title (media));
         break;
       case GRL_METADATA_KEY_ALBUM:
-        media_server2_set_album (properties_table,
-                                 grl_data_get_string (GRL_DATA (media),
-                                                      GRL_METADATA_KEY_ALBUM));
+        ms2_server_set_album (properties_table,
+                              grl_data_get_string (GRL_DATA (media),
+                                                   GRL_METADATA_KEY_ALBUM));
         break;
       case GRL_METADATA_KEY_ARTIST:
-        media_server2_set_artist (properties_table,
-                                  grl_data_get_string (GRL_DATA (media),
-                                                       GRL_METADATA_KEY_ARTIST));
+        ms2_server_set_artist (properties_table,
+                               grl_data_get_string (GRL_DATA (media),
+                                                    GRL_METADATA_KEY_ARTIST));
         break;
       case GRL_METADATA_KEY_GENRE:
-        media_server2_set_genre (properties_table,
-                                 grl_data_get_string (GRL_DATA (media),
-                                                      GRL_METADATA_KEY_GENRE));
+        ms2_server_set_genre (properties_table,
+                              grl_data_get_string (GRL_DATA (media),
+                                                   GRL_METADATA_KEY_GENRE));
         break;
       case GRL_METADATA_KEY_MIME:
-        media_server2_set_mime_type (properties_table,
-                                     grl_media_get_mime (media));
+        ms2_server_set_mime_type (properties_table,
+                                  grl_media_get_mime (media));
         break;
       case GRL_METADATA_KEY_CHILDCOUNT:
-        media_server2_set_child_count (properties_table,
-                                       grl_data_get_int (GRL_DATA (media),
-                                                            GRL_METADATA_KEY_CHILDCOUNT));
+        ms2_server_set_child_count (properties_table,
+                                    grl_data_get_int (GRL_DATA (media),
+                                                      GRL_METADATA_KEY_CHILDCOUNT));
         break;
       case GRL_METADATA_KEY_URL:
         urls[0] = (gchar *) grl_media_get_url (media);
-        media_server2_set_urls (properties_table, urls);
+        ms2_server_set_urls (properties_table, urls);
         break;
       case GRL_METADATA_KEY_BITRATE:
-        media_server2_set_bitrate (properties_table,
-                                   grl_data_get_int (GRL_DATA (media),
-                                                     GRL_METADATA_KEY_BITRATE));
+        ms2_server_set_bitrate (properties_table,
+                                grl_data_get_int (GRL_DATA (media),
+                                                  GRL_METADATA_KEY_BITRATE));
         break;
       case GRL_METADATA_KEY_DURATION:
-        media_server2_set_duration (properties_table,
-                                    grl_media_get_duration (media));
+        ms2_server_set_duration (properties_table,
+                                 grl_media_get_duration (media));
         break;
       case GRL_METADATA_KEY_HEIGHT:
-        media_server2_set_height (properties_table,
-                                  grl_data_get_int (GRL_DATA (media),
-                                                    GRL_METADATA_KEY_HEIGHT));
+        ms2_server_set_height (properties_table,
+                               grl_data_get_int (GRL_DATA (media),
+                                                 GRL_METADATA_KEY_HEIGHT));
         break;
       case GRL_METADATA_KEY_WIDTH:
-        media_server2_set_width (properties_table,
-                                 grl_data_get_int (GRL_DATA (media),
-                                                   GRL_METADATA_KEY_WIDTH));
+        ms2_server_set_width (properties_table,
+                              grl_data_get_int (GRL_DATA (media),
+                                                GRL_METADATA_KEY_WIDTH));
         break;
       }
     }
   }
 
   if (parent_id) {
-    media_server2_set_parent (properties_table, parent_id);
+    ms2_server_set_parent (properties_table, parent_id);
   }
 }
 
@@ -344,7 +344,7 @@ browse_cb (GrlMediaSource *source,
   if (media) {
     id = serialize_media (rgdata->parent_id, media);
     if (id) {
-      prop_table = media_server2_new_properties_hashtable (id);
+      prop_table = ms2_server_new_properties_hashtable (id);
       fill_properties_table (prop_table, rgdata->keys, media, rgdata->parent_id);
       rgdata->children = g_list_prepend (rgdata->children, prop_table);
       g_free (id);
@@ -384,7 +384,7 @@ get_properties_cb (const gchar *id,
 
   rgdata = g_slice_new0 (RygelGriloData);
   rgdata->source = (GrlMediaSource *) data;
-  rgdata->properties = media_server2_new_properties_hashtable (id);
+  rgdata->properties = ms2_server_new_properties_hashtable (id);
   rgdata->keys = get_grilo_keys (properties);
   rgdata->parent_id = get_parent_id (id);
   media = unserialize_media (GRL_METADATA_SOURCE (rgdata->source), id);
@@ -468,7 +468,7 @@ static void
 source_added_cb (GrlPluginRegistry *registry, gpointer user_data)
 {
   GrlSupportedOps supported_ops;
-  MediaServer2 *server;
+  MS2Server *server;
   gchar *source_id;
 
   /* Only sources that implement browse and metadata are of interest */
@@ -485,13 +485,13 @@ source_added_cb (GrlPluginRegistry *registry, gpointer user_data)
 
     sanitize (source_id);
 
-    server = media_server2_new (source_id, GRL_MEDIA_SOURCE (user_data));
+    server = ms2_server_new (source_id, GRL_MEDIA_SOURCE (user_data));
 
     if (!server) {
       g_warning ("Cannot register %s", source_id);
     } else {
-      media_server2_set_get_properties_func (server, get_properties_cb);
-      media_server2_set_get_children_func (server, get_children_cb);
+      ms2_server_set_get_properties_func (server, get_properties_cb);
+      ms2_server_set_get_children_func (server, get_children_cb);
     }
     g_free (source_id);
   } else {



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