From: Zeeshan Ali (Khattak) Date: Tue, 5 Aug 2008 15:48:43 +0000 (+0000) Subject: Use 'this' keyword wherever possible. This makes code much more cleaner. X-Git-Tag: RYGEL_0_2~256 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5a81b846a4fa7fbf90ad7cce1ecb7265350e546;p=profile%2Fivi%2Frygel.git Use 'this' keyword wherever possible. This makes code much more cleaner. svn path=/trunk/; revision=217 --- diff --git a/ChangeLog b/ChangeLog index 08a83cf..efa32a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -156,6 +156,13 @@ 2008-06-25 Zeeshan Ali Khattak + * src/gupnp-metadata-extractor.vala: + + Use 'this' keyword wherever possible. This makes code much more + cleaner. + +2008-06-25 Zeeshan Ali Khattak + * src/Makefile.am: * src/gupnp-metadata-extractor.vala: diff --git a/src/gupnp-metadata-extractor.vala b/src/gupnp-metadata-extractor.vala index 015f0b8..921fc03 100644 --- a/src/gupnp-metadata-extractor.vala +++ b/src/gupnp-metadata-extractor.vala @@ -38,15 +38,15 @@ public class GUPnP.MetadataExtractor: GLib.Object { public string uri { get { - return playbin.uri; + return this.playbin.uri; } set { - playbin.uri = value; + this.playbin.uri = value; - if (playbin.uri != null) { + if (this.playbin.uri != null) { /* Start the extaction when we get a new URI */ - playbin.set_state (State.PAUSED); + this.playbin.set_state (State.PAUSED); } } } @@ -55,32 +55,32 @@ public class GUPnP.MetadataExtractor: GLib.Object { public List _uris = null; public List uris { get { - return _uris; + return this._uris; } set { - _uris = value.copy (); + this._uris = value.copy (); - if (_uris != null) { - extraction_done += goto_next_uri; - uri = _uris.data; + if (this._uris != null) { + this.extraction_done += this.goto_next_uri; + this.uri = this._uris.data; } else { - extraction_done -= goto_next_uri; + this.extraction_done -= this.goto_next_uri; } } } private void goto_next_uri (MetadataExtractor extractor, string uri) { - return_if_fail (_uris != null); + return_if_fail (this._uris != null); - weak List link = _uris.find_custom (uri, strcmp); - _uris.remove_link (link); + weak List link = this._uris.find_custom (uri, strcmp); + this._uris.remove_link (link); - if (_uris != null) { - this.uri = _uris.data; + if (this._uris != null) { + this.uri = this._uris.data; } else { - extraction_done -= goto_next_uri; + this.extraction_done -= this.goto_next_uri; } } @@ -90,7 +90,7 @@ public class GUPnP.MetadataExtractor: GLib.Object { message.parse_tag (out tag_list); - tag_list.foreach (foreach_tag); + tag_list.foreach (this.foreach_tag); } private void foreach_tag (TagList tag_list, string tag) { @@ -98,13 +98,13 @@ public class GUPnP.MetadataExtractor: GLib.Object { if (tag_list.copy_value (ref value, tag_list, tag)) { /* signal the availability of new tag */ - metadata_available (playbin.uri, tag, ref value); + this.metadata_available (this.playbin.uri, tag, ref value); } } private void state_changed_cb (Gst.Bus bus, Gst.Message message) { - if (message.src != playbin) + if (message.src != this.playbin) return; State new_state; @@ -114,28 +114,28 @@ public class GUPnP.MetadataExtractor: GLib.Object { int64 duration; Format format = Format.TIME; - if (playbin.query_duration (ref format, out duration)) { + if (this.playbin.query_duration (ref format, out duration)) { GLib.Value duration_val; duration_val.init (typeof (int64)); duration_val.set_int64 (duration); /* signal the availability of duration tag */ - metadata_available (playbin.uri, + this.metadata_available (this.playbin.uri, TAG_DURATION, ref duration_val); } /* No hopes of getting any tags after this point */ - playbin.set_state (State.NULL); - extraction_done (playbin.uri); + this.playbin.set_state (State.NULL); + this.extraction_done (this.playbin.uri); } } private void error_cb (Gst.Bus bus, Gst.Message message) { - return_if_fail (uri != null); + return_if_fail (this.uri != null); Error error = null; string debug; @@ -145,24 +145,24 @@ public class GUPnP.MetadataExtractor: GLib.Object { debug = error.message; } - critical ("Failed to extract metadata from %s: %s\n", uri, debug); + critical ("Failed to extract metadata from %s: %s\n", this.uri, debug); - if (_uris != null) { + if (this._uris != null) { /* We have a list of URIs to harvest, so lets jump to next one */ - goto_next_uri (this, uri); + this.goto_next_uri (this, this.uri); } } construct { - playbin = ElementFactory.make ("playbin", null); + this.playbin = ElementFactory.make ("playbin", null); - var bus = playbin.get_bus (); + var bus = this.playbin.get_bus (); bus.add_signal_watch (); - bus.message["tag"] += tag_cb; - bus.message["state-changed"] += state_changed_cb; - bus.message["error"] += error_cb; + bus.message["tag"] += this.tag_cb; + bus.message["state-changed"] += this.state_changed_cb; + bus.message["error"] += this.error_cb; } }