Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/jack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ def _wrap_port_ptr(self, ptr):
elif porttype == _MIDI:
cls = OwnMidiPort if self.owns(ptr) else MidiPort
else:
assert False
cls = UnknownPort
return cls(ptr, self)


Expand Down Expand Up @@ -1896,6 +1896,11 @@ def unset_alias(self, alias):
_check(_lib.jack_port_unset_alias(self._ptr, alias.encode()),
'Error unsetting port alias')

@property
def type(self):
"""Name of the JACK port type (read-only)."""
return _decode(_lib.jack_port_type(self._ptr))

@property
def uuid(self):
"""The UUID of the JACK port."""
Expand Down Expand Up @@ -1972,6 +1977,17 @@ class MidiPort(Port):
is_midi = property(lambda self: True, doc='This is always ``True``.')


class UnknownPort(Port):
"""A JACK port with an unknown type

This class is derived from `Port` and has exactly the same
attributes and methods.
"""

is_audio = property(lambda self: False, doc='This is always ``False``.')
is_midi = property(lambda self: False, doc='This is always ``False``.')


class OwnPort(Port):
"""A JACK audio port owned by a `Client`.

Expand Down