Skip to content

Commit b5ea811

Browse files
committed
Some docstring updates
1 parent ce5ad26 commit b5ea811

1 file changed

Lines changed: 53 additions & 24 deletions

File tree

‎jack.py‎

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,10 @@ def connect(self, source, destination):
636636
destination : str or Port
637637
The other end of the connection. Must be an input port.
638638
639+
See Also
640+
--------
641+
OwnPort.connect
642+
639643
"""
640644
if isinstance(source, Port):
641645
source = source.name
@@ -753,14 +757,14 @@ def set_shutdown_callback(self, callback):
753757
the rest of the application knows that the JACK client thread
754758
has shut down.
755759
756-
.. note:: clients do not need to call this. It exists only to
760+
.. note:: Clients do not need to call this. It exists only to
757761
help more complex clients understand what is going on. It
758762
should be called before :meth:`activate`.
759763
760-
.. note:: application should typically signal another thread to
761-
correctly finish cleanup, that is by calling :meth:`close`
762-
(since :meth:`close` cannot be called directly in the context
763-
of the thread that calls the shutdown callback).
764+
.. note:: The `callback` should typically signal another thread
765+
to correctly finish cleanup by calling :meth:`close` (since
766+
:meth:`close` cannot be called directly in the context of the
767+
thread that calls the shutdown callback).
764768
765769
Parameters
766770
----------
@@ -772,10 +776,10 @@ def set_shutdown_callback(self, callback):
772776
773777
The argument `status` is of type :class:`jack.Status`.
774778
775-
Note that after server shutdown, `self`
776-
is *not* deallocated by libjack, the application is
777-
responsible to properly use :meth:`close` to release client
778-
ressources.
779+
.. note:: After server shutdown, the client is *not*
780+
deallocated by JACK, the user (that's you!) is
781+
responsible to properly use :meth:`close` to release
782+
client ressources.
779783
780784
.. warning:: :meth:`close` cannot be safely used inside the
781785
shutdown callback and has to be called outside of the
@@ -842,17 +846,20 @@ def set_freewheel_callback(self, callback):
842846
thread, the code in the supplied function does not need to be
843847
suitable for real-time execution.
844848
845-
.. note:: this function cannot be called while the client is
849+
.. note:: This function cannot be called while the client is
846850
activated (after :meth:`activate` has been called).
847851
848852
Parameters
849853
----------
850854
callback : callable
851-
User-supplied function that is called whenever jackd starts
855+
User-supplied function that is called whenever JACK starts
852856
or stops freewheeling. It must have this signature::
853857
854858
callback(starting:bool) -> None
855859
860+
The argument `starting` is ``True`` if we start to
861+
freewheel, ``False`` otherwise.
862+
856863
See Also
857864
--------
858865
set_freewheel
@@ -878,7 +885,7 @@ def set_blocksize_callback(self, callback):
878885
thread, the code in the supplied function does not need to be
879886
suitable for real-time execution.
880887
881-
.. note:: this function cannot be called while the client is
888+
.. note:: This function cannot be called while the client is
882889
activated (after :meth:`activate` has been called).
883890
884891
Parameters
@@ -889,15 +896,21 @@ def set_blocksize_callback(self, callback):
889896
890897
callback(blocksize:int) -> int
891898
899+
The argument `blocksize` is the new buffer size.
892900
The `callback` must return zero on success and non-zero on
893901
error. You can use the module constants :data:`jack.SUCCESS`
894902
and :data:`jack.FAILURE`, respectively.
895903
896-
Although this function is called in the JACK process thread,
897-
the normal process cycle is suspended during its operation,
898-
causing a gap in the audio flow. So, the `callback` can
899-
allocate storage, touch memory not previously referenced,
900-
and perform other operations that are not realtime safe.
904+
.. note:: Although this function is called in the JACK
905+
process thread, the normal process cycle is suspended
906+
during its operation, causing a gap in the audio flow.
907+
So, the `callback` can allocate storage, touch memory not
908+
previously referenced, and perform other operations that
909+
are not realtime safe.
910+
911+
See Also
912+
--------
913+
:attr:`blocksize`
901914
902915
"""
903916
@self._callback("JackBufferSizeCallback", error=FAILURE)
@@ -918,7 +931,7 @@ def set_samplerate_callback(self, callback):
918931
thread, the code in the supplied function does not need to be
919932
suitable for real-time execution.
920933
921-
.. note:: this function cannot be called while the client is
934+
.. note:: This function cannot be called while the client is
922935
activated (after :meth:`activate` has been called).
923936
924937
Parameters
@@ -934,6 +947,10 @@ def set_samplerate_callback(self, callback):
934947
error. You can use the module constants :data:`jack.SUCCESS`
935948
and :data:`jack.FAILURE`, respectively.
936949
950+
See Also
951+
--------
952+
:attr:`samplerate`
953+
937954
"""
938955
@self._callback("JackSampleRateCallback", error=FAILURE)
939956
def callback_wrapper(samplerate, _):
@@ -953,7 +970,7 @@ def set_client_registration_callback(self, callback):
953970
thread, the code in the supplied function does not need to be
954971
suitable for real-time execution.
955972
956-
.. note:: this function cannot be called while the client is
973+
.. note:: This function cannot be called while the client is
957974
activated (after :meth:`activate` has been called).
958975
959976
Parameters
@@ -987,7 +1004,7 @@ def set_port_registration_callback(self, callback):
9871004
thread, the code in the supplied function does not need to be
9881005
suitable for real-time execution.
9891006
990-
.. note:: this function cannot be called while the client is
1007+
.. note:: This function cannot be called while the client is
9911008
activated (after :meth:`activate` has been called).
9921009
9931010
Parameters
@@ -1004,6 +1021,10 @@ def set_port_registration_callback(self, callback):
10041021
argument is ``True`` if the port is being registered,
10051022
``False`` if the port is being unregistered.
10061023
1024+
See Also
1025+
--------
1026+
Ports.register
1027+
10071028
"""
10081029
@self._callback("JackPortRegistrationCallback")
10091030
def callback_wrapper(port, register, _):
@@ -1024,7 +1045,7 @@ def set_port_connect_callback(self, callback):
10241045
thread, the code in the supplied function does not need to be
10251046
suitable for real-time execution.
10261047
1027-
.. note:: this function cannot be called while the client is
1048+
.. note:: This function cannot be called while the client is
10281049
activated (after :meth:`activate` has been called).
10291050
10301051
Parameters
@@ -1041,6 +1062,10 @@ def set_port_connect_callback(self, callback):
10411062
The third argument is ``True`` if the ports were connected
10421063
and ``False`` if the ports were disconnected.
10431064
1065+
See Also
1066+
--------
1067+
Client.connect, OwnPort.connect
1068+
10441069
"""
10451070
@self._callback("JackPortConnectCallback")
10461071
def callback_wrapper(a, b, connect, _):
@@ -1062,7 +1087,7 @@ def set_port_rename_callback(self, callback):
10621087
thread, the code in the supplied function does not need to be
10631088
suitable for real-time execution.
10641089
1065-
.. note:: this function cannot be called while the client is
1090+
.. note:: This function cannot be called while the client is
10661091
activated (after :meth:`activate` has been called).
10671092
10681093
Parameters
@@ -1081,6 +1106,10 @@ def set_port_rename_callback(self, callback):
10811106
error. You can use the module constants :data:`jack.SUCCESS`
10821107
and :data:`jack.FAILURE`, respectively.
10831108
1109+
See Also
1110+
--------
1111+
:attr:`Port.shortname`
1112+
10841113
"""
10851114
@self._callback("JackPortRenameCallback", error=FAILURE)
10861115
def callback_wrapper(port, old_name, new_name, _):
@@ -1102,7 +1131,7 @@ def set_graph_order_callback(self, callback):
11021131
thread, the code in the supplied function does not need to be
11031132
suitable for real-time execution.
11041133
1105-
.. note:: this function cannot be called while the client is
1134+
.. note:: This function cannot be called while the client is
11061135
activated (after :meth:`activate` has been called).
11071136
11081137
Parameters
@@ -1137,7 +1166,7 @@ def set_xrun_callback(self, callback):
11371166
thread, the code in the supplied function does not need to be
11381167
suitable for real-time execution.
11391168
1140-
.. note:: this function cannot be called while the client is
1169+
.. note:: This function cannot be called while the client is
11411170
activated (after :meth:`activate` has been called).
11421171
11431172
Parameters

0 commit comments

Comments
 (0)