From 387e44b90082500f7c944fea4938126b885ba4fa Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Fri, 20 Jul 2007 16:50:21 +0000 Subject: gtk.gdk.threads_init() makes problems when running two instances on one machine. makes the second player freeze after receiving the first flip. took it out for now. --- diff --git a/game.py b/game.py index ad25dcb..46da2e2 100755 --- a/game.py +++ b/game.py @@ -74,9 +74,10 @@ class MemorizeGame(gobject.GObject): self.model = Model(os.path.dirname(__file__)) # create csound instance to play sound files - self.sound = 0 + self.sound = 0 try: import csnd + del csnd self.sound = 1 _logger.error(' [Check for module csnd] found.') except: @@ -84,12 +85,12 @@ class MemorizeGame(gobject.GObject): if self.sound == 1: from csound.csoundserver import CsoundServer - self.cs = CsoundServer() - gtk.gdk.threads_init() + self.cs = CsoundServer() if self.cs.start() != 0: _logger.error(' Error starting csound performance.') self.sound = 0 - + #gtk.gdk.threads_init() + def load_game(self, game_name, size): if self.model.read(game_name) == 0: @@ -145,16 +146,14 @@ class MemorizeGame(gobject.GObject): # play sound in any case if available if self.sound == 1: snd = self.model.grid[id].get('snd', None) - if snd == None: - _logger.debug('Audio: no sound in this game.') - else: + if snd != None: self.cs.perform('i 108 0.0 3.0 "%s" 1 0.9 0.1'%(snd)) _logger.debug('Audio: play sound=%s'%snd) # First card case if self.last_flipped == -1: self.last_flipped = id - self.model.grid[id]['state'] = '1' + self.model.grid[id]['state'] = '1' self.emit('flip-card', id) if not signal: self.emit('flip-card-signal', id) -- cgit v0.9.1