diff options
author | Nathanaël Lécaudé <Nat@localhost.localdomain> | 2006-11-17 01:53:08 (GMT) |
---|---|---|
committer | Nathanaël Lécaudé <Nat@localhost.localdomain> | 2006-11-17 01:53:08 (GMT) |
commit | 4d03d34ae7bf00b13f713ded241296e8f8072e84 (patch) | |
tree | 2dd1c4754b36678422eec7598edd097279eea219 /TamTam.py | |
parent | bedf317dfcd2da54d19da124688d8337d28e9d4b (diff) |
Fix for server conflict
Diffstat (limited to 'TamTam.py')
-rwxr-xr-x | TamTam.py | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -1,5 +1,3 @@ -#!/usr/bin/python2.4 - import pygtk pygtk.require( '2.0' ) import gtk @@ -24,7 +22,7 @@ if __name__ == "__main__": tamtam = StandAlonePlayer() #tamtam = gtk.Button("adsf") mainwin = gtk.Window(gtk.WINDOW_TOPLEVEL) - #mainwin.set_size_request(1200,700) + mainwin.set_size_request(1200,600) mainwin.set_title('miniTamTam') mainwin.set_resizable(False) mainwin.connect('destroy' , gtk.main_quit ) @@ -69,10 +67,9 @@ class TamTam(Activity): Activity.__init__(self) - CSoundClient.initialize(True) - CSoundClient.setMasterVolume(100) - self.tamtam = StandAlonePlayer() + self.connect('focus_in_event',self.handleFocusIn) + self.connect('focus_out_event',self.handleFocusOut) self.connect('destroy', self.do_quit) self.add(self.tamtam) self.tamtam.show() @@ -80,6 +77,13 @@ class TamTam(Activity): self.set_resizable(False) self.connect( "key-press-event", self.tamtam.keyboardStandAlone.onKeyPress ) self.connect( "key-release-event", self.tamtam.keyboardStandAlone.onKeyRelease ) + + def handleFocusIn(self, event, data=None): + CSoundClient.initialize(True) + CSoundClient.setMasterVolume(100) + + def handleFocusOut(self, event, data=None): + CSoundClient.initialize(False) def do_quit(self, arg2): CSoundClient.initialize(False) |