seed r450 - trunk/examples
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r450 - trunk/examples
- Date: Sun, 14 Dec 2008 06:53:07 +0000 (UTC)
Author: racarr
Date: Sun Dec 14 06:53:07 2008
New Revision: 450
URL: http://svn.gnome.org/viewvc/seed?rev=450&view=rev
Log:
Update oscillator example to not use signal this.
Modified:
trunk/examples/n-oscillator.js
Modified: trunk/examples/n-oscillator.js
==============================================================================
--- trunk/examples/n-oscillator.js (original)
+++ trunk/examples/n-oscillator.js Sun Dec 14 06:53:07 2008
@@ -45,30 +45,30 @@
this.vbox.pack_start(this.hbox, true, true, 10);
this.vbox.pack_start(this.button, false, false, 10);
- this.toggle = function(button)
+ this.toggle = function(button, that)
{
- if (this.playing == false)
+ if (that.playing == false)
{
- this.pipeline.set_state(Gst.State.playing);
- this.playing = true;
+ that.pipeline.set_state(Gst.State.playing);
+ that.playing = true;
}
else
{
- this.pipeline.set_state(Gst.State.paused);
- this.playing = false;
+ that.pipeline.set_state(Gst.State.paused);
+ that.playing = false;
}
}
- this.update_freq = function(range)
+ this.update_freq = function(range, that)
{
- this.audiosrc.freq = range.get_value();
+ that.audiosrc.freq = range.get_value();
}
- this.update_vol = function(range)
+ this.update_vol = function(range, that)
{
- this.volume.volume = range.get_value();
+ that.volume.volume = range.get_value();
}
- this.button.signal.clicked.connect(this.toggle, this);
- this.vscale.signal.value_changed.connect(this.update_freq, this);
- this.volscale.signal.value_changed.connect(this.update_vol, this);
+ this.button.signal.clicked.connect(this.toggle, null, this);
+ this.vscale.signal.value_changed.connect(this.update_freq, null, this);
+ this.volscale.signal.value_changed.connect(this.update_vol, null, this);
}
function end_program()
@@ -90,10 +90,10 @@
function add_oscillator(button)
{
var os = new oscillator(300);
- this.pack_start(os.vbox, true, true, 10);
+ hbox.pack_start(os.vbox, true, true, 10);
os.vbox.show_all();
}
-button.signal.clicked.connect(add_oscillator, hbox);
+button.signal.clicked.connect(add_oscillator);
window.add(hbox);
hbox.pack_start(button, true, true, 10);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]