Add freewheel callback
authorNikita Zlobin <cook60020tmp@mail.ru>
Sun, 26 Dec 2010 12:51:42 +0000 (26 17:51 +0500)
committerNikita Zlobin <cook60020tmp@mail.ru>
Sun, 26 Dec 2010 12:51:42 +0000 (26 17:51 +0500)
jacktimectl

index 9cd43f8..0421ffd 100644 (file)
@@ -15,6 +15,13 @@ def on_button_toggled(button):
     button.set_label(text_generic+text_rtwheel)
     jacklib.set_freewheel(client, 0)
 
+def freewheel_callback(client, onoff):
+  print "freewheel_callback() called"
+  if onoff > 0:
+    button.set_active(True)
+  else:
+    button.set_active(False)
+
 # Create objects
 window = gtk.Window()
 window.set_title("JACK time wheel control")
@@ -32,6 +39,7 @@ window.add(button)
 
 # JACK
 client = jacklib.client_open("jack_freewheel_button", jacklib.NullOption, None)
+jacklib.set_freewheel_callback(client, freewheel_callback)
 
 window.show_all()