[rygel] gst-renderer: Use new syntax to connect signals
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] gst-renderer: Use new syntax to connect signals
- Date: Fri, 23 Oct 2009 17:15:23 +0000 (UTC)
commit fffa105c497ba047f2af3eaf464e9ef40571d003
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Oct 14 14:15:51 2009 +0300
gst-renderer: Use new syntax to connect signals
.../gst-renderer/rygel-gst-av-transport.vala | 76 ++++++++++---------
.../gst-renderer/rygel-gst-rendering-control.vala | 32 ++++----
2 files changed, 56 insertions(+), 52 deletions(-)
---
diff --git a/src/plugins/gst-renderer/rygel-gst-av-transport.vala b/src/plugins/gst-renderer/rygel-gst-av-transport.vala
index e31dd3e..4a22ed1 100644
--- a/src/plugins/gst-renderer/rygel-gst-av-transport.vala
+++ b/src/plugins/gst-renderer/rygel-gst-av-transport.vala
@@ -139,26 +139,30 @@ public class Rygel.GstAVTransport : Service {
this.changelog = new GstChangeLog (this, LAST_CHANGE_NS);
this.video_window = GstVideoWindow.get_default ();
- query_variable["LastChange"] += query_last_change_cb;
-
- action_invoked["SetAVTransportURI"] += set_av_transport_uri_cb;
- action_invoked["GetMediaInfo"] += get_media_info_cb;
- action_invoked["GetTransportInfo"] += get_transport_info_cb;
- action_invoked["GetPositionInfo"] += get_position_info_cb;
- action_invoked["GetDeviceCapabilities"] += get_device_capabilities_cb;
- action_invoked["GetTransportSettings"] += get_transport_settings_cb;
- action_invoked["Stop"] += stop_cb;
- action_invoked["Play"] += play_cb;
- action_invoked["Pause"] += pause_cb;
- action_invoked["Seek"] += seek_cb;
- action_invoked["Next"] += next_cb;
- action_invoked["Previous"] += previous_cb;
-
- this.video_window.notify["playback-state"] += this.notify_state_cb;
- this.video_window.notify["duration"] += this.notify_duration_cb;
+ query_variable["LastChange"].connect (query_last_change_cb);
+
+ action_invoked["SetAVTransportURI"].connect (set_av_transport_uri_cb);
+ action_invoked["GetMediaInfo"].connect (get_media_info_cb);
+ action_invoked["GetTransportInfo"].connect (get_transport_info_cb);
+ action_invoked["GetPositionInfo"].connect (get_position_info_cb);
+ action_invoked["GetDeviceCapabilities"].connect (
+ get_device_capabilities_cb);
+ action_invoked["GetTransportSettings"].connect (
+ get_transport_settings_cb);
+ action_invoked["Stop"].connect (stop_cb);
+ action_invoked["Play"].connect (play_cb);
+ action_invoked["Pause"].connect (pause_cb);
+ action_invoked["Seek"].connect (seek_cb);
+ action_invoked["Next"].connect (next_cb);
+ action_invoked["Previous"].connect (previous_cb);
+
+ this.video_window.notify["playback-state"].connect (
+ this.notify_state_cb);
+ this.video_window.notify["duration"].connect (
+ this.notify_duration_cb);
}
- private void query_last_change_cb (GstAVTransport s,
+ private void query_last_change_cb (Service service,
string variable,
ref Value value) {
// Send current state
@@ -203,7 +207,7 @@ public class Rygel.GstAVTransport : Service {
return true;
}
- private void set_av_transport_uri_cb (GstAVTransport s,
+ private void set_av_transport_uri_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -220,7 +224,7 @@ public class Rygel.GstAVTransport : Service {
action.return ();
}
- private void get_media_info_cb (GstAVTransport s,
+ private void get_media_info_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -258,7 +262,7 @@ public class Rygel.GstAVTransport : Service {
action.return ();
}
- private void get_transport_info_cb (GstAVTransport s,
+ private void get_transport_info_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -277,7 +281,7 @@ public class Rygel.GstAVTransport : Service {
action.return ();
}
- private void get_position_info_cb (GstAVTransport s,
+ private void get_position_info_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -311,7 +315,7 @@ public class Rygel.GstAVTransport : Service {
action.return ();
}
- private void get_device_capabilities_cb (GstAVTransport s,
+ private void get_device_capabilities_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -324,7 +328,7 @@ public class Rygel.GstAVTransport : Service {
action.return ();
}
- private void get_transport_settings_cb (GstAVTransport s,
+ private void get_transport_settings_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -336,7 +340,7 @@ public class Rygel.GstAVTransport : Service {
action.return ();
}
- private void stop_cb (GstAVTransport s, owned ServiceAction action) {
+ private void stop_cb (Service service, owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
}
@@ -346,7 +350,7 @@ public class Rygel.GstAVTransport : Service {
action.return ();
}
- private void play_cb (GstAVTransport s, owned ServiceAction action) {
+ private void play_cb (Service service, owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
}
@@ -365,7 +369,7 @@ public class Rygel.GstAVTransport : Service {
action.return ();
}
- private void pause_cb (GstAVTransport s, owned ServiceAction action) {
+ private void pause_cb (Service service, owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
}
@@ -375,7 +379,7 @@ public class Rygel.GstAVTransport : Service {
action.return ();
}
- private void seek_cb (GstAVTransport s, owned ServiceAction action) {
+ private void seek_cb (Service service, owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
}
@@ -403,22 +407,22 @@ public class Rygel.GstAVTransport : Service {
}
}
- private void next_cb (GstAVTransport s, owned ServiceAction action) {
+ private void next_cb (Service service, owned ServiceAction action) {
action.return_error (701, "Transition not available");
}
- private void previous_cb (GstAVTransport s, owned ServiceAction action) {
+ private void previous_cb (Service service, owned ServiceAction action) {
action.return_error (701, "Transition not available");
}
- private void notify_state_cb (GstVideoWindow video_window,
- ParamSpec p) {
+ private void notify_state_cb (Object video_window,
+ ParamSpec p) {
this.changelog.log ("TransportState", this.video_window.playback_state);
}
- private void notify_duration_cb (GstVideoWindow window,
- ParamSpec p) {
- this.changelog.log ("CurrentTrackDuration", window.duration);
- this.changelog.log ("CurrentMediaDuration", window.duration);
+ private void notify_duration_cb (Object window,
+ ParamSpec p) {
+ this.changelog.log ("CurrentTrackDuration", this.video_window.duration);
+ this.changelog.log ("CurrentMediaDuration", this.video_window.duration);
}
}
diff --git a/src/plugins/gst-renderer/rygel-gst-rendering-control.vala b/src/plugins/gst-renderer/rygel-gst-rendering-control.vala
index 23da583..cc746e9 100644
--- a/src/plugins/gst-renderer/rygel-gst-rendering-control.vala
+++ b/src/plugins/gst-renderer/rygel-gst-rendering-control.vala
@@ -82,21 +82,21 @@ public class Rygel.GstRenderingControl : Service {
this.changelog = new GstChangeLog (this, LAST_CHANGE_NS);
this.video_window = GstVideoWindow.get_default ();
- query_variable["LastChange"] += query_last_change_cb;
+ query_variable["LastChange"].connect (query_last_change_cb);
- action_invoked["ListPresets"] += list_presets_cb;
- action_invoked["SelectPreset"] += select_preset_cb;
- action_invoked["GetMute"] += get_mute_cb;
- action_invoked["SetMute"] += set_mute_cb;
- action_invoked["GetVolume"] += get_volume_cb;
- action_invoked["SetVolume"] += set_volume_cb;
+ action_invoked["ListPresets"].connect (list_presets_cb);
+ action_invoked["SelectPreset"].connect (select_preset_cb);
+ action_invoked["GetMute"].connect (get_mute_cb);
+ action_invoked["SetMute"].connect (set_mute_cb);
+ action_invoked["GetVolume"].connect (get_volume_cb);
+ action_invoked["SetVolume"].connect (set_volume_cb);
this._volume = Volume.to_percentage (this.video_window.volume);
}
- private void query_last_change_cb (GstRenderingControl s,
- string variable,
- ref GLib.Value value) {
+ private void query_last_change_cb (Service service,
+ string variable,
+ ref GLib.Value value) {
// Send current state
var log = new GstChangeLog (null, LAST_CHANGE_NS);
@@ -121,7 +121,7 @@ public class Rygel.GstRenderingControl : Service {
return true;
}
- private void list_presets_cb (GstRenderingControl s,
+ private void list_presets_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -134,7 +134,7 @@ public class Rygel.GstRenderingControl : Service {
action.return ();
}
- private void select_preset_cb (GstRenderingControl s,
+ private void select_preset_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -166,7 +166,7 @@ public class Rygel.GstRenderingControl : Service {
return true;
}
- private void get_mute_cb (GstRenderingControl s,
+ private void get_mute_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -181,7 +181,7 @@ public class Rygel.GstRenderingControl : Service {
action.return ();
}
- private void set_mute_cb (GstRenderingControl s,
+ private void set_mute_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -200,7 +200,7 @@ public class Rygel.GstRenderingControl : Service {
action.return ();
}
- private void get_volume_cb (GstRenderingControl s,
+ private void get_volume_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
@@ -215,7 +215,7 @@ public class Rygel.GstRenderingControl : Service {
action.return ();
}
- private void set_volume_cb (GstRenderingControl s,
+ private void set_volume_cb (Service service,
owned ServiceAction action) {
if (!check_instance_id (action)) {
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]