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
14 changes: 11 additions & 3 deletions mod/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,10 @@ def jack_bufsize_changed(self, bufSize):
self.msg_callback("bufsize %i" % bufSize)

def jack_port_appeared(self, name, isOutput):
name = charPtrToString(name)
isOutput = bool(isOutput)
# Public entry from the JACK port scan.
self._handle_port_appeared(charPtrToString(name), bool(isOutput), retries=6)

def _handle_port_appeared(self, name, isOutput, retries):
if name.startswith(self.jack_slave_prefix+":"):
name = name.replace(self.jack_slave_prefix+":","")
if name.startswith("midi_"):
Expand All @@ -569,11 +570,18 @@ def jack_port_appeared(self, name, isOutput):
return

if self.midi_aggregated_mode:
# new ports are ignored under midi aggregated mode
# New ports are ignored in aggregated mode. The merger JACK client
# owns the connection to mod-midi-merger:in (its port-registration
# callback plus a bounded reconcile burst). The graph shows only
# the merged ports.
return

alias = get_jack_port_alias(name)
if not alias:
# The alias is not ready. Try again after a short delay.
if retries > 0:
IOLoop.instance().call_later(
0.5, self._handle_port_appeared, name, isOutput, retries - 1)
return
alias = midi_port_alias_to_name(alias, True)

Expand Down