Use jacklib functionality
authorNikita Zlobin <cook60020tmp@mail.ru>
Sun, 26 Dec 2010 12:02:19 +0000 (26 17:02 +0500)
committerNikita Zlobin <cook60020tmp@mail.ru>
Sun, 26 Dec 2010 12:02:19 +0000 (26 17:02 +0500)
jacktimectl

index d4ac6db..9cd43f8 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 
 import gtk
-import os
+import jacklib
 
 text_freewheel = "ON"
 text_rtwheel = "OFF"
@@ -9,11 +9,11 @@ text_generic = "Free wheel: "
 
 def on_button_toggled(button):
   if button.get_active():
-    os.system("jack_freewheel y 2>/dev/null")
     button.set_label(text_generic+text_freewheel)
+    jacklib.set_freewheel(client, 1)
   else:
-    os.system("jack_freewheel n 2>/dev/null")
     button.set_label(text_generic+text_rtwheel)
+    jacklib.set_freewheel(client, 0)
 
 # Create objects
 window = gtk.Window()
@@ -30,6 +30,11 @@ window.connect("delete-event", gtk.main_quit);
 button.connect("toggled", on_button_toggled);
 window.add(button)
 
+# JACK
+client = jacklib.client_open("jack_freewheel_button", jacklib.NullOption, None)
+
 window.show_all()
 
 gtk.main()
+
+jacklib.client_close(client)
\ No newline at end of file