Skip to content

Commit d33b6da

Browse files
committed
Docs: be more specific about port class inheritance
1 parent 21a24e7 commit d33b6da

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

‎jack.py‎

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ def callback_wrapper(code, reason, _):
771771
def set_process_callback(self, callback, userdata=None):
772772
"""Register process callback.
773773
774-
Tell the Jack server to call `callback` whenever there is work
774+
Tell the JACK server to call `callback` whenever there is work
775775
be done, passing `userdata` as the second argument.
776776
777777
The code in the supplied function must be suitable for real-time
@@ -1354,6 +1354,10 @@ class Port(object):
13541354
be created. In case of MIDI ports, instances of :class:`MidiPort`
13551355
or :class:`OwnMidiPort` are created.
13561356
1357+
Besides being the type of non-owned JACK audio ports, this class
1358+
also serves as base class for all other port classes
1359+
(:class:`OwnPort`, :class:`MidiPort` and :class:`OwnMidiPort`).
1360+
13571361
New JACK audio/MIDI ports can be created with the
13581362
:meth:`~Client.Ports.register` method of :attr:`Client.inports`,
13591363
:attr:`Client.outports`, :attr:`Client.midi_inports` and
@@ -1459,8 +1463,8 @@ class MidiPort(Port):
14591463

14601464
"""A JACK MIDI port.
14611465
1462-
This class has exactly the same attributes and methods as
1463-
:class:`Port`.
1466+
This class is derived from :class:`Port` and has exactly the same
1467+
attributes and methods.
14641468
14651469
New JACK audio/MIDI ports can be created with the
14661470
:meth:`~Client.Ports.register` method of :attr:`Client.inports`,
@@ -1481,9 +1485,8 @@ class OwnPort(Port):
14811485

14821486
"""A JACK audio port owned by a :class:`Client` object.
14831487
1484-
This class is derived from :class:`Port`. Therefore,
1485-
:class:`OwnPort` objects can do everything that :class:`Port`
1486-
objects can, plus some more things.
1488+
This class is derived from :class:`Port`. :class:`OwnPort` objects
1489+
can do everything that :class:`Port` objects can, plus a lot more.
14871490
14881491
This class cannot be instantiated directly. Instead, instances of
14891492
this class are returned from :meth:`Client.get_port_by_name`,
@@ -1617,7 +1620,7 @@ def get_buffer(self):
16171620
zero-filled. If there are multiple inbound connections, the
16181621
data will be mixed appropriately.
16191622
1620-
Caching output ports is DEPRECATED in Jack 2.0, due to some new
1623+
Caching output ports is DEPRECATED in JACK 2.0, due to some new
16211624
optimization (like "pipelining"). Port buffers have to be
16221625
retrieved in each callback for proper functioning.
16231626
@@ -1640,12 +1643,14 @@ def get_array(self):
16401643

16411644
class OwnMidiPort(MidiPort, OwnPort):
16421645

1643-
"""A JACK MIDI port owned by a Client object.
1646+
"""A JACK MIDI port owned by a :class:`Client` object.
16441647
1645-
This class is very similar to :class:`OwnPort`.
1646-
It has the same attributes and methods, but :meth:`get_buffer` and
1647-
:meth:`get_array` are disabled. Instead, it has methods for sending
1648-
and receiving MIDI events (from within the process callback).
1648+
This class is derived from :class:`OwnPort` and :class:`MidiPort`,
1649+
which are themselves derived from :class:`Port`. It has the same
1650+
attributes and methods as :class:`OwnPort`, but :meth:`get_buffer`
1651+
and :meth:`get_array` are disabled. Instead, it has methods for
1652+
sending and receiving MIDI events (to be used from within the
1653+
process callback -- see :meth:`Client.set_process_callback`).
16491654
16501655
New JACK audio/MIDI ports can be created with the
16511656
:meth:`~Client.Ports.register` method of :attr:`Client.inports`,
@@ -1692,7 +1697,7 @@ def lost_midi_events(self):
16921697
def incoming_midi_events(self):
16931698
"""Return generator for incoming MIDI events.
16941699
1695-
Jack MIDI is normalised, the MIDI events yielded by this
1700+
JACK MIDI is normalised, the MIDI events yielded by this
16961701
generator are guaranteed to be complete MIDI events (the status
16971702
byte will always be present, and no realtime events will be
16981703
interspersed with the events).

0 commit comments

Comments
 (0)