rygel r49 - in trunk: . src
- From: zeeshanak svn gnome org
- To: svn-commits-list gnome org
- Subject: rygel r49 - in trunk: . src
- Date: Tue, 28 Oct 2008 20:59:07 +0000 (UTC)
Author: zeeshanak
Date: Tue Oct 28 20:59:07 2008
New Revision: 49
URL: http://svn.gnome.org/viewvc/rygel?rev=49&view=rev
Log:
Re-write X_MS_MediaReceiverRegistrar implementation in Vala.
Added:
trunk/src/gupnp-media-receiver-registrar.vala
Removed:
trunk/src/gupnp-media-receiver-registrar.c
trunk/src/gupnp-media-receiver-registrar.h
Modified:
trunk/ChangeLog
trunk/src/Makefile.am
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Tue Oct 28 20:59:07 2008
@@ -12,6 +12,8 @@
bin_PROGRAMS = gupnp-media-server
+BUILT_SOURCES = gupnp-media-server.stamp
+
gupnp_media_server_SOURCES = main.c \
gupnp-media-server.h \
gupnp-media-server.c \
@@ -19,8 +21,14 @@
gupnp-content-directory.c \
gupnp-media-receiver-registrar.h \
gupnp-media-receiver-registrar.c \
+ gupnp-media-receiver-registrar.vala \
gupnp-media-tracker.h \
gupnp-media-tracker.c
+
+gupnp-media-server.stamp: $(filter %.vala,$(gupnp_media_server_SOURCES))
+ $(VALAC) -C --pkg gupnp-1.0 $^
+ touch $@
+
gupnp_media_server_LDADD = $(LIBGUPNP_LIBS) \
$(LIBGUPNP_AV_LIBS) \
$(LIBGCONF_LIBS) \
Added: trunk/src/gupnp-media-receiver-registrar.vala
==============================================================================
--- (empty file)
+++ trunk/src/gupnp-media-receiver-registrar.vala Tue Oct 28 20:59:07 2008
@@ -0,0 +1,38 @@
+using GLib;
+using GUPnP;
+
+public class GUPnP.MediaReceiverRegistrar: Service {
+
+ construct {
+ /* FIXME: Use Vala's syntax for connecting signals when Vala adds
+ * support for signal details. */
+ Signal.connect (this,
+ "action-invoked::IsAuthorized",
+ (GLib.Callback) this.is_authorized_cb,
+ null);
+ Signal.connect (this,
+ "action-invoked::IsValidated",
+ (GLib.Callback) this.is_authorized_cb,
+ null);
+ Signal.connect (this,
+ "action-invoked::RegisterDevice",
+ (GLib.Callback) this.register_device_cb,
+ null);
+ }
+
+ /* IsAuthorized and IsValided action implementations (fake) */
+ private void is_authorized_cb (ServiceAction action) {
+ action.set ("Result", typeof (int), 1);
+
+ action.return ();
+ }
+
+ private void register_device_cb (ServiceAction action) {
+ action.set ("RegistrationRespMsg",
+ typeof (string),
+ "WhatisSupposedToBeHere");
+
+ action.return ();
+ }
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]