[rygel] example server plugin: Rename this with a -vala prefix.



commit 8c0fd0fea598f8501b39eb12616cecba37100295
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Nov 15 10:46:25 2012 +0100

    example server plugin: Rename this with a -vala prefix.
    
    So that things are clearer when I add the C version,
    and so that there is no conflict caused by two plugins
    containing the same symbols.

 examples/renderer-plugins/vala/example-player.vala |    8 ++++++++
 examples/server-plugins/vala/Makefile.am           |   19 +++++++++++--------
 ...ainer.vala => example-root-container-vala.vala} |    4 ++--
 ...plugin.vala => example-server-plugin-vala.vala} |   14 +++++++-------
 4 files changed, 28 insertions(+), 17 deletions(-)
---
diff --git a/examples/renderer-plugins/vala/example-player.vala b/examples/renderer-plugins/vala/example-player.vala
index 875aed8..32c708e 100644
--- a/examples/renderer-plugins/vala/example-player.vala
+++ b/examples/renderer-plugins/vala/example-player.vala
@@ -65,6 +65,14 @@ public class Rygel.Example.Player : GLib.Object, Rygel.MediaPlayer {
 
         set {
             this._uri = value;
+
+            /*
+             * To see this debug output, to see that 
+             * the renderer has received the URI,
+             * you would need to run rygel like so:
+             * $ export G_MESSAGES_DEBUG=all
+             * rygel -g 5
+             */
             debug ("URI set to %s.", value);
         }
     }
diff --git a/examples/server-plugins/vala/Makefile.am b/examples/server-plugins/vala/Makefile.am
index 4e27034..4260f85 100644
--- a/examples/server-plugins/vala/Makefile.am
+++ b/examples/server-plugins/vala/Makefile.am
@@ -1,20 +1,23 @@
 include $(top_srcdir)/common.am
 
-plugin_LTLIBRARIES = librygel-example-server-plugin.la
+plugin_LTLIBRARIES = librygel-example-server-plugin-vala.la
 
-AM_CFLAGS += -DG_LOG_DOMAIN='"ExampleServerPlugin"'
+AM_CFLAGS += -DG_LOG_DOMAIN='"ExampleServerPluginVala"'
 
-librygel_example_server_plugin_la_SOURCES = \
-	example-server-plugin.vala \
-	example-root-container.vala
+# Note that we must have these Vala prefixes on the
+# class names (and therefore on the file names)
+# to avoid conflicts with other plugins.
+librygel_example_server_plugin_vala_la_SOURCES = \
+	example-server-plugin-vala.vala \
+	example-root-container-vala.vala
 
-librygel_example_server_plugin_la_VALAFLAGS = \
+librygel_example_server_plugin_vala_la_VALAFLAGS = \
 	--pkg gstreamer-0.10 \
 	$(RYGEL_COMMON_SERVER_PLUGIN_VALAFLAGS)
 
-librygel_example_server_plugin_la_LIBADD = \
+librygel_example_server_plugin_vala_la_LIBADD = \
 	$(LIBGSTREAMER_LIBS) \
 	$(RYGEL_COMMON_SERVER_LIBS)
 	
-librygel_example_server_plugin_la_LDFLAGS = \
+librygel_example_server_plugin_vala_la_LDFLAGS = \
   $(RYGEL_PLUGIN_LINKER_FLAGS)
diff --git a/examples/server-plugins/vala/example-root-container.vala b/examples/server-plugins/vala/example-root-container-vala.vala
similarity index 94%
rename from examples/server-plugins/vala/example-root-container.vala
rename to examples/server-plugins/vala/example-root-container-vala.vala
index 8c5cdc8..ea71991 100644
--- a/examples/server-plugins/vala/example-root-container.vala
+++ b/examples/server-plugins/vala/example-root-container-vala.vala
@@ -23,8 +23,8 @@
  * In this example, we just derive from the SimpleContainer,
  * but a real-world server plugin might need something more sophisticated.
  */
-public class Rygel.Example.RootContainer : Rygel.SimpleContainer {
-    public RootContainer (string title) {
+public class Rygel.Example.RootContainerVala : Rygel.SimpleContainer {
+    public RootContainerVala (string title) {
         base.root (title);
 
         /*
diff --git a/examples/server-plugins/vala/example-server-plugin.vala b/examples/server-plugins/vala/example-server-plugin-vala.vala
similarity index 82%
rename from examples/server-plugins/vala/example-server-plugin.vala
rename to examples/server-plugins/vala/example-server-plugin-vala.vala
index e0b0cfa..6eb682a 100644
--- a/examples/server-plugins/vala/example-server-plugin.vala
+++ b/examples/server-plugins/vala/example-server-plugin-vala.vala
@@ -22,14 +22,14 @@ using Rygel;
 using GUPnP;
 
 public void module_init (PluginLoader loader) {
-    if (loader.plugin_disabled (Rygel.Example.ServerPlugin.NAME)) {
-        message ("Plugin '%s' disabled by user, ignoring..",
-                 Rygel.Example.ServerPlugin.NAME);
+    if (loader.plugin_disabled (Rygel.Example.ServerPluginVala.NAME)) {
+        message ("Plugin '%s' disabled by user. Ignoring.",
+                 Rygel.Example.ServerPluginVala.NAME);
 
         return;
     }
 
-    var plugin = new Rygel.Example.ServerPlugin ();
+    var plugin = new Rygel.Example.ServerPluginVala ();
     loader.add_plugin (plugin);
 }
 
@@ -43,7 +43,7 @@ public void module_init (PluginLoader loader) {
  * [ExampleServerPluginVala]
  * enabled=false
  */
-public class Rygel.Example.ServerPlugin : Rygel.MediaServerPlugin {
+public class Rygel.Example.ServerPluginVala : Rygel.MediaServerPlugin {
     /*
      * The non-human-readable name for the service:
      * Note that this should currently not contain spaces.
@@ -57,12 +57,12 @@ public class Rygel.Example.ServerPlugin : Rygel.MediaServerPlugin {
     /* Optional human-readable description for the service: */
     public const string DESCRIPTION = "An example Rygel server plugin implemented in vala.";
 
-    public ServerPlugin () {
+    public ServerPluginVala () {
     
         /*
          * Use our derived container:
          */
-        var root_container = new RootContainer (TITLE);
+        var root_container = new RootContainerVala (TITLE);
 
         base (root_container, NAME, DESCRIPTION);
     }



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