From 72d128955161302693abced7e768cf13bc6bc304 Mon Sep 17 00:00:00 2001 From: Pootle daemon Date: Sun, 03 Jun 2012 04:32:28 +0000 Subject: Merge branch 'master' of git.sugarlabs.org:turtleart/mainline --- diff --git a/TurtleArt/tagplay.py b/TurtleArt/tagplay.py index a90104b..7acc249 100644 --- a/TurtleArt/tagplay.py +++ b/TurtleArt/tagplay.py @@ -104,7 +104,7 @@ class Gplay(): if lc.tw.running_sugar: self.bin.set_transient_for(lc.tw.activity) - self.bin.move(x, y + 108) + self.bin.move(x, y) self.bin.resize(w, h) self.bin.show_all() @@ -220,8 +220,8 @@ class GstPlayer(gobject.GObject): if old == gst.STATE_READY and new == gst.STATE_PAUSED: self.emit('stream-info', self.player.props.stream_info_value_array) - else: - logging.debug(message.type) + # else: + # logging.debug(message.type) def _init_video_sink(self): self.bin = gst.Bin() diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index db44a8e..03d4957 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -27,6 +27,8 @@ from time import time from operator import isNumberType from UserDict import UserDict +from sugar.graphics import style + from taconstants import TAB_LAYER, DEFAULT_SCALE, PREFIX_DICTIONARY from tapalette import block_names, value_blocks from tautils import get_pixbuf_from_journal, convert, data_from_file, \ @@ -752,8 +754,17 @@ class LogoCode: return if self.tw.gst_available: from tagplay import play_movie_from_file - play_movie_from_file(self, self.filepath, self.x2tx(), self.y2ty(), - w, h) + # The video window is an overlay, so we need to know where + # the canvas is relative to the window, e.g., which + # toolbars, if any are open. + yoffset = 0 + if self.tw.running_sugar: + if not self.tw.activity.is_fullscreen(): + yoffset += style.GRID_CELL_SIZE + if self.tw.activity.toolbars_expanded(): + yoffset += style.GRID_CELL_SIZE + play_movie_from_file(self, self.filepath, self.x2tx(), + self.y2ty() + yoffset, w, h) def _expand_forever(self, b, blk, blocks): """ Expand a while or until block into: forever, ifelse, stopstack diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py index d8a4a36..ce75c36 100644 --- a/TurtleArtActivity.py +++ b/TurtleArtActivity.py @@ -515,6 +515,26 @@ class TurtleArtActivity(activity.Activity): ''' Keep-button clicked. ''' self.jobject_new_patch() + def is_fullscreen(self): + ''' Are we in fullscreen mode (toolbars hidden)? ''' + # Fixme: this should be a exposed as a window property, not private + return self._is_fullscreen + + def toolbars_expanded(self): + ''' Are any toolbars expanded? ''' + if not self.has_toolbarbox: + return False + if self.palette_toolbar_button.is_expanded(): + return True + elif self.edit_toolbar_button.is_expanded(): + return True + elif self.view_toolbar_button.is_expanded(): + return True + elif self.activity_toolbar_button.is_expanded(): + return True + else: + return False + def _setup_toolbar(self): ''' Setup toolbar according to Sugar version. ''' if self.has_toolbarbox: diff --git a/plugins/audio_sensors/audio_sensors.py b/plugins/audio_sensors/audio_sensors.py index 1cea2ce..978a17d 100644 --- a/plugins/audio_sensors/audio_sensors.py +++ b/plugins/audio_sensors/audio_sensors.py @@ -139,7 +139,10 @@ class Audio_sensors(Plugin): elif self.hw == XO15: self.voltage_gain = -0.0001471 self.voltage_bias = 1.695 - else: # XO 1.75 and 3.0 + elif self.hw == XO175: + self.voltage_gain = 0.000051 + self.voltage_bias = 1.372 + else: # XO 3.0 self.voltage_gain = 0.00007692 self.voltage_bias = 0.719 palette.add_block('resistance', @@ -247,7 +250,7 @@ class Audio_sensors(Plugin): 'block', ['voltage', 'voltage2'])) > 0: mode, bias, gain, boost = self.PARAMETERS[SENSOR_DC_NO_BIAS] else: - return # no audio blocks in play + return # No audio blocks in use. self.audiograb = AudioGrab(self.new_buffer, self, mode, bias, gain, boost) self._channels = self.audiograb.channels @@ -350,7 +353,9 @@ class Audio_sensors(Plugin): resistance = (420000000 / avg_buf) - 13500 else: resistance = 420000000 - else: # XO 1.75, 3.0 + elif self.hw == XO175: + return (180000000 / (30700 - avg_buf)) - 3150 + else: # XO 3.0 return (46000000 / (30514 - avg_buf)) - 1150 if channel == 0: self._parent.lc.update_label_value('resistance', resistance) -- cgit v0.9.1