|
10 | 10 | from __future__ import print_function # only needed for Python 2.x |
11 | 11 | import jack |
12 | 12 |
|
13 | | -print("setting error/info functions") |
| 13 | +print('setting error/info functions') |
14 | 14 |
|
15 | 15 |
|
16 | 16 | @jack.set_error_function |
17 | 17 | def error(msg): |
18 | | - print("Error:", msg) |
| 18 | + print('Error:', msg) |
19 | 19 |
|
20 | 20 |
|
21 | 21 | @jack.set_info_function |
22 | 22 | def info(msg): |
23 | | - print("Info:", msg) |
| 23 | + print('Info:', msg) |
24 | 24 |
|
25 | 25 |
|
26 | | -print("starting chatty client") |
| 26 | +print('starting chatty client') |
27 | 27 |
|
28 | | -client = jack.Client("Chatty-Client") |
| 28 | +client = jack.Client('Chatty-Client') |
29 | 29 |
|
30 | 30 | if client.status.server_started: |
31 | | - print("JACK server was started") |
| 31 | + print('JACK server was started') |
32 | 32 | else: |
33 | | - print("JACK server was already running") |
| 33 | + print('JACK server was already running') |
34 | 34 | if client.status.name_not_unique: |
35 | | - print("unique client name generated:", client.name) |
| 35 | + print('unique client name generated:', client.name) |
36 | 36 |
|
37 | 37 |
|
38 | | -print("registering callbacks") |
| 38 | +print('registering callbacks') |
39 | 39 |
|
40 | 40 |
|
41 | 41 | @client.set_shutdown_callback |
42 | 42 | def shutdown(status, reason): |
43 | | - print("JACK shutdown!") |
44 | | - print("status:", status) |
45 | | - print("reason:", reason) |
| 43 | + print('JACK shutdown!') |
| 44 | + print('status:', status) |
| 45 | + print('reason:', reason) |
46 | 46 |
|
47 | 47 |
|
48 | 48 | @client.set_freewheel_callback |
49 | 49 | def freewheel(starting): |
50 | | - print(["stopping", "starting"][starting], "freewheel mode") |
| 50 | + print(['stopping', 'starting'][starting], 'freewheel mode') |
51 | 51 |
|
52 | 52 |
|
53 | 53 | @client.set_blocksize_callback |
54 | 54 | def blocksize(blocksize): |
55 | | - print("setting blocksize to", blocksize) |
| 55 | + print('setting blocksize to', blocksize) |
56 | 56 |
|
57 | 57 |
|
58 | 58 | @client.set_samplerate_callback |
59 | 59 | def samplerate(samplerate): |
60 | | - print("setting samplerate to", samplerate) |
| 60 | + print('setting samplerate to', samplerate) |
61 | 61 |
|
62 | 62 |
|
63 | 63 | @client.set_client_registration_callback |
64 | 64 | def client_registration(name, register): |
65 | | - print("client", repr(name), ["unregistered", "registered"][register]) |
| 65 | + print('client', repr(name), ['unregistered', 'registered'][register]) |
66 | 66 |
|
67 | 67 |
|
68 | 68 | @client.set_port_registration_callback |
69 | 69 | def port_registration(port, register): |
70 | | - print(repr(port), ["unregistered", "registered"][register]) |
| 70 | + print(repr(port), ['unregistered', 'registered'][register]) |
71 | 71 |
|
72 | 72 |
|
73 | 73 | @client.set_port_connect_callback |
74 | 74 | def port_connect(a, b, connect): |
75 | | - print(["disconnected", "connected"][connect], a, "and", b) |
| 75 | + print(['disconnected', 'connected'][connect], a, 'and', b) |
76 | 76 |
|
77 | 77 |
|
78 | 78 | try: |
79 | 79 | @client.set_port_rename_callback |
80 | 80 | def port_rename(port, old, new): |
81 | | - print("renamed", port, "from", repr(old), "to", repr(new)) |
| 81 | + print('renamed', port, 'from', repr(old), 'to', repr(new)) |
82 | 82 | except AttributeError: |
83 | | - print("Could not register port rename callback (not available on JACK1).") |
| 83 | + print('Could not register port rename callback (not available on JACK1).') |
84 | 84 |
|
85 | 85 |
|
86 | 86 | @client.set_graph_order_callback |
87 | 87 | def graph_order(): |
88 | | - print("graph order changed") |
| 88 | + print('graph order changed') |
89 | 89 |
|
90 | 90 |
|
91 | 91 | @client.set_xrun_callback |
92 | 92 | def xrun(delay): |
93 | | - print("xrun; delay", delay, "microseconds") |
| 93 | + print('xrun; delay', delay, 'microseconds') |
94 | 94 |
|
95 | 95 |
|
96 | | -print("activating JACK") |
| 96 | +print('activating JACK') |
97 | 97 | with client: |
98 | | - print("#" * 80) |
99 | | - print("press Return to quit") |
100 | | - print("#" * 80) |
| 98 | + print('#' * 80) |
| 99 | + print('press Return to quit') |
| 100 | + print('#' * 80) |
101 | 101 | input() |
102 | | - print("closing JACK") |
| 102 | + print('closing JACK') |
0 commit comments