@@ -98,63 +98,73 @@ to your working directory (or to any directory in your Python path).
9898Usage
9999-----
100100
101- First, import the module::
101+ First, import the module:
102102
103- import jack
103+ >>> import jack
104104
105- Then, you most likely want to create a new JACK client::
105+ Then, you most likely want to create a new JACK client:
106106
107- client = jack.Client("MyGreatClient")
107+ >>> client = jack.Client(" MyGreatClient" )
108108
109- You probably want to create some input and output ports, too::
109+ You probably want to create some input and output ports, too:
110110
111- client.inports.register("input_1")
112- client.outports.register("output_1")
111+ >>> client.inports.register(" input_1" )
112+ jack.OwnPort('MyGreatClient:input_1')
113+ >>> client.outports.register(" output_1" )
114+ jack.OwnPort('MyGreatClient:output_1')
113115
114- These functions return the newly created port, so you can save it for later::
116+ As you can see, these functions return the newly created port, so you can save
117+ it for later:
115118
116- in2 = client.inports.register("input_2")
117- out2 = client.outports.register("output_2")
119+ >>> in2 = client.inports.register(" input_2" )
120+ >>> out2 = client.outports.register(" output_2" )
118121
119122To see what you can do with the returned objects, have a look at the
120123documentation of the class `jack.OwnPort `.
121124
122- You can also check what other JACK ports are available::
125+ You can also check what other JACK ports are available (your output may have
126+ additional ports in it):
123127
124- portlist = client.get_ports()
128+ >>> client.get_ports() # doctest: +SKIP
129+ [jack.Port('system:capture_1'),
130+ jack.Port('system:capture_2'),
131+ jack.Port('system:playback_1'),
132+ jack.Port('system:playback_2'),
133+ jack.OwnPort('MyGreatClient:input_1'),
134+ jack.OwnPort('MyGreatClient:output_1'),
135+ jack.OwnPort('MyGreatClient:input_2'),
136+ jack.OwnPort('MyGreatClient:output_2')]
125137
126138If you want, you can also set all kinds of callback functions, for details see
127139the API documentation for the class `jack.Client `.
128140
129- Once you are ready to run, you should activate your client::
141+ Once you are ready to run, you should activate your client:
130142
131- client.activate()
143+ >>> client.activate()
132144
133145Once the client is activated, you can make connections (this isn't possible
134- before activating the client)::
146+ before activating the client):
135147
136- client.connect("system:capture_1", "MyGreatClient:input_1")
137- client.connect("MyGreatClient:output_1", "system:playback_1")
148+ >>> client.connect(" system:capture_1" , " MyGreatClient:input_1" )
149+ >>> client.connect(" MyGreatClient:output_1" , " system:playback_1" )
138150
139- You can also use the port objects from before instead of port names::
151+ You can also use the port objects from before instead of port names:
140152
141- client.connect(out2, "system:playback_2")
142- in2.connect("system:capture_2")
153+ >>> client.connect(out2, " system:playback_2" )
154+ >>> in2.connect(" system:capture_2" )
143155
144- You can also disconnect ports, there are again several possibilities::
156+ You can also disconnect ports, there are again several possibilities:
145157
146- client.disconnect("system:capture_1", "MyGreatClient:input_1")
147- client.disconnect(out2, "system:playback_2")
148- # disconnect all connections with in2:
149- in2.disconnect()
158+ >>> client.disconnect(" system:capture_1" , " MyGreatClient:input_1" )
159+ >>> client.disconnect(out2, " system:playback_2" )
160+ >>> in2.disconnect() # disconnect all connections with in2
150161
151- If you don't need your ports anymore, you can un-register them::
162+ If you don't need your ports anymore, you can un-register them:
152163
153- in2.unregister()
154- # unregister all output ports:
155- client.outports.clear()
164+ >>> in2.unregister()
165+ >>> client.outports.clear() # unregister all output ports
156166
157- Finally, you can de-activate your JACK client and close it::
167+ Finally, you can de-activate your JACK client and close it:
158168
159- client.deactivate()
160- client.close()
169+ >>> client.deactivate()
170+ >>> client.close()
0 commit comments