From c9e5ec50ca924a9ae95e4ba9a2f54480c024bcdc Mon Sep 17 00:00:00 2001 From: Pootle daemon Date: Wed, 05 Dec 2012 05:30:38 +0000 Subject: Merge branch 'master' of git.sugarlabs.org:turtleart/mainline --- diff --git a/plugins/audio_sensors/audiograb.py b/plugins/audio_sensors/audiograb.py index 6072c61..37efa53 100644 --- a/plugins/audio_sensors/audiograb.py +++ b/plugins/audio_sensors/audiograb.py @@ -154,6 +154,7 @@ class AudioGrab(): 'dc input bias', 'v_refout']) self._mic_boost_control = self._find_control(['mic boost', + 'mic1 boost', 'mic boost (+20db)', 'internal mic boost', 'analog mic boost']) @@ -525,18 +526,17 @@ class AudioGrab(): if self._labels_available: if self._mic_boost_control is None: return - # If there is a flag property, use set_mute - if self._mic_boost_control not in self._mixer.list_tracks() or \ + # If there is a volume, use set volume + if hasattr(self._mic_boost_control, 'min_volume'): + if mic_boost: + self._set_volume(self._mic_boost_control, 'boost', 100) + else: + self._set_volume(self._mic_boost_control, 'boost', 0) + # Else if there is a flag property, use set_mute + elif self._mic_boost_control not in self._mixer.list_tracks() or \ hasattr(self._mic_boost_control.props, 'flags'): self._set_mute( self._mic_boost_control, 'Mic Boost', not mic_boost) - # Otherwise, set volume to max or min value - elif mic_boost: - self._mixer.set_volume(self._mic_boost_control, - self._mic_boost_control.max_volume) - else: - self._mixer.set_volume(self._mic_boost_control, - self._mic_boost_control.min_volume) else: self.amixer_set('Mic Boost (+20dB)', mic_boost) diff --git a/samples/graphics-jonny-emerson.ta b/samples/graphics-jonny-emerson.ta new file mode 100644 index 0000000..da6bec8 --- /dev/null +++ b/samples/graphics-jonny-emerson.ta @@ -0,0 +1,74 @@ +[[0, ["start", 2.0], 47, 205, [null, 1]], +[1, "fillscreen2", 47, 251, [0, 2, 4, 3, 5]], +[2, ["number", 0.0], 129, 251, [1, null]], +[3, ["number", 0.0], 129, 335, [1, null]], +[4, ["number", 0.0], 129, 293, [1, null]], +[5, "setcolor", 47, 377, [1, 6, 7]], +[6, ["number", 75.0], 124, 377, [5, null]], +[7, "setpensize", 47, 419, [5, 8, 9]], +[8, ["number", 7.0], 149, 419, [7, null]], +[9, "stack", 47, 461, [7, 10, null]], +[10, ["string", "action 1"], 105, 461, [9, null]], +[11, "hat", 308, 192, [null, 12, 13]], +[12, ["string", "action 1"], 366, 204, [11, null]], +[13, ["storein", 0], 308, 246, [11, 14, 15, 19]], +[14, ["string", "my box 3"], 376, 246, [13, null]], +[15, ["number", 100], 376, 288, [13, null]], +[16, "setshade", 326, 414, [21, 17, 25]], +[17, "box", 411, 414, [16, 18, null]], +[18, ["string", "my box 3"], 466, 414, [17, null]], +[19, ["repeat", 126], 308, 330, [13, 20, 21, null]], +[20, ["number", 70.0], 367, 330, [19, null]], +[21, "seth", 326, 372, [19, 22, 16]], +[22, ["number", 0], 425, 372, [21, null]], +[23, "hat", 784, 76, [null, 24, 38]], +[24, ["string", "action 2"], 842, 88, [23, null]], +[25, "stack", 326, 456, [16, 26, 27]], +[26, ["string", "action 2"], 384, 456, [25, null]], +[27, "seth", 326, 498, [25, 28, 29]], +[28, ["number", 180.0], 425, 498, [27, null]], +[29, "stack", 326, 540, [27, 30, 31]], +[30, ["string", "action 2"], 384, 540, [29, null]], +[31, ["storein", 0], 326, 582, [29, 32, 36, null]], +[32, ["string", "my box 3"], 394, 582, [31, null]], +[33, ["number", 1.0], 448, 666, [36, null]], +[34, "box", 448, 624, [36, 35, null]], +[35, ["string", "my box 3"], 503, 624, [34, null]], +[36, ["plus2", 0], 394, 624, [31, 34, 33]], +[37, "right", 784, 298, [41, 44, 46]], +[38, ["storein", 0], 784, 130, [23, 39, 40, 41]], +[39, ["string", "my box 1"], 852, 130, [38, null]], +[40, ["number", 10.0], 852, 172, [38, null]], +[41, ["storein", 0], 784, 214, [38, 42, 43, 37]], +[42, ["string", "my box 2"], 852, 214, [41, null]], +[43, ["number", 200.0], 852, 256, [41, null]], +[44, "box", 842, 298, [37, 45, null]], +[45, ["string", "my box 3"], 897, 298, [44, null]], +[46, "penup", 784, 340, [37, 48]], +[47, "pendown", 784, 466, [48, 51]], +[48, ["setxy2", 0], 784, 382, [46, 49, 50, 47]], +[49, ["number", 0], 842, 382, [48, null]], +[50, ["number", 0], 842, 424, [48, null]], +[51, ["repeat", 147], 784, 508, [47, 52, 53, null]], +[52, ["number", 40.0], 843, 508, [51, null]], +[53, ["arc", 0], 802, 550, [51, 56, 54, 58]], +[54, "box", 860, 592, [53, 55, null]], +[55, ["string", "my box 1"], 915, 592, [54, null]], +[56, "box", 860, 550, [53, 57, null]], +[57, ["string", "my box 2"], 915, 550, [56, null]], +[58, "left", 802, 634, [53, 59, 70]], +[59, ["number", 100.0], 860, 634, [58, null]], +[60, ["plus2", 0], 870, 718, [70, 68, 63]], +[61, ["minus2", 0], 870, 844, [64, 66, 62]], +[62, ["number", 10.0], 948, 886, [61, null]], +[63, ["number", 10.0], 924, 760, [60, null]], +[64, ["storein", 0], 802, 802, [72, 65, 61, null]], +[65, ["string", "my box 2"], 870, 802, [64, null]], +[66, "box", 924, 844, [61, 67, null]], +[67, ["string", "my box 2"], 979, 844, [66, null]], +[68, "box", 924, 718, [60, 69, null]], +[69, ["string", "my box 1"], 979, 718, [68, null]], +[70, ["storein", 0], 802, 676, [58, 71, 60, 72]], +[71, ["string", "my box 1"], 870, 676, [70, null]], +[72, ["vspace", 0], 802, 760, [70, 64]]] + diff --git a/turtleblocks.py b/turtleblocks.py index e82021d..938625c 100755 --- a/turtleblocks.py +++ b/turtleblocks.py @@ -312,8 +312,8 @@ class TurtleMain(): ''' Create a scrolled window to contain the turtle canvas. We add a Fixed container in order to position text Entry widgets on top of string and number blocks.''' - vbox = gtk.VBox(False, 0) - win.add(vbox) + # vbox = gtk.VBox(False, 0) + # win.add(vbox) self.fixed = gtk.Fixed() self.fixed.connect('size-allocate', self._fixed_resize_cb) @@ -342,7 +342,8 @@ class TurtleMain(): self.fixed.put(self.vbox, 0, 0) self.fixed.show() - vbox.pack_start(self.fixed, False, False, 0) + # vbox.pack_start(self.fixed, False, False, 0) + win.add(self.fixed) win.show_all() self.win = win self.canvas = canvas -- cgit v0.9.1