1 --- jack-mixer-8.orig/jack_mixer.py
2 +++ jack-mixer-8/jack_mixer.py
5 -# -*- coding: UTF-8 -*-
6 +# -*- coding: utf-8 -*-
8 # This file is part of jack_mixer
20 self.monitor_channel = self.mixer.add_output_channel("Monitor", True, True)
25 # Send our client name to server
26 lash_event = lash.lash_event_new_with_type(lash.LASH_Client_Name)
28 gobject.timeout_add(80, self.read_meters)
29 self.lash_client = lash_client
32 - gobject.timeout_add(1000, self.lash_check_events)
33 + gobject.timeout_add(200, self.lash_check_events)
35 + def sighandler(self, signum, frame):
36 + #print "Signal %d received" % signum
37 + if signum == signal.SIGUSR1:
39 + elif signum == signal.SIGTERM:
41 + elif signum == signal.SIGINT:
44 + print "Unknown signal %d received" % signum
47 print "Cleaning jack_mixer"
51 def lash_check_events(self):
54 + if self.current_filename:
55 + print "saving on SIGUSR1 request"
59 + print "not saving because filename is not known"
62 + if not self.lash_client:
65 while lash.lash_get_pending_event_count(self.lash_client):
66 event = lash.lash_get_event(self.lash_client)
70 self.window.show_all()
72 + signal.signal(signal.SIGUSR1, self.sighandler)
73 + signal.signal(signal.SIGTERM, self.sighandler)
74 + signal.signal(signal.SIGINT, self.sighandler)
78 #f = file("/dev/stdout", "w")
81 # Yeah , this sounds stupid, we connected earlier, but we dont want to show this if we got --help option
82 # This issue should be fixed in pylash, there is a reason for having two functions for initialization after all
84 + lash_connection = lash.lash_get_server_name(lash_client)
86 print "Successfully connected to LASH server at " + lash.lash_get_server_name(lash_client)
91 name = "jack_mixer-%u" % os.getpid()
93 - gtk.gdk.threads_init()
94 + #gtk.gdk.threads_init() # if this function is called, when SIGUSR1 is received, we enter tight loop...
96 mixer = JackMixer(name, lash_client)