diff options
Diffstat (limited to 'speak/face.py')
-rw-r--r-- | speak/face.py | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/speak/face.py b/speak/face.py index ffbe556..5ad632c 100644 --- a/speak/face.py +++ b/speak/face.py @@ -44,9 +44,8 @@ FACE_PAD = 2 class Status: def __init__(self): self.voice = voice.defaultVoice() - self.pitch = espeak.PITCH_MAX / 2 - self.rate = espeak.RATE_MAX / 2 - + self.pitch = espeak.PITCH_DEFAULT + self.rate = espeak.RATE_DEFAULT self.eyes = [eye.Eye] * 2 self.mouth = mouth.Mouth @@ -111,7 +110,7 @@ class View(gtk.EventBox): self._mouth = None self._mouthbox = gtk.HBox() self._mouthbox.show() - + # layout the screen box = gtk.VBox(homogeneous=False) box.pack_start(self._eyebox) @@ -122,11 +121,12 @@ class View(gtk.EventBox): self._mapped = False self._peding = None - self.connect('map', self.__map_cb) + self.connect("map_event",self._map_event) self.update() - - def __map_cb(self, widget): + + def _map_event(self, widget, event): + self._mapped = True if self._peding: self.update(self._peding) self._peding = None @@ -135,20 +135,15 @@ class View(gtk.EventBox): if self._eyes: map(lambda e: e.look_ahead(), self._eyes) - def look_at(self, pos=None): + def look_at(self, x, y): if self._eyes: - if pos is None: - display = gtk.gdk.display_get_default() - screen_, x, y, modifiers_ = display.get_pointer() - else: - x, y = pos - map(lambda e, x=x, y=y: e.look_at(x, y), self._eyes) + map(lambda e, x=x, y=y: e.look_at(x,y), self._eyes) def update(self, status = None): if not status: status = self.status else: - if not self.flags() & gtk.MAPPED: + if not self._mapped: self._peding = status return self.status = status @@ -174,10 +169,6 @@ class View(gtk.EventBox): # enable mouse move events so we can track the eyes while the mouse is over the mouth #self._mouth.add_events(gtk.gdk.POINTER_MOTION_MASK) - def set_voice(self, voice): - self.status.voice = voice - self.say_notification(voice.friendlyname) - def say(self, something): self._audio.speak(self._peding or self.status, something) |