Browse Source

Add disconnec to instrument context menu

master
Nils 8 months ago
parent
commit
c8c763e7d5
  1. 1
      engine/api.py
  2. 2
      qtgui/instrument.py
  3. 3
      template/qtgui/submenus.py

1
engine/api.py

@ -342,6 +342,7 @@ def setAuditionerVolume(value:float):
def connectInstrumentPort(idKey:tuple, externalPort:str):
"""externalPort can be empty string, which is disconnect"""
instrument = _instr(idKey)
if instrument.enabled:
instrument.connectMidiInputPort(externalPort)

2
qtgui/instrument.py

@ -320,6 +320,8 @@ class InstrumentTreeController(object):
assert item.state
externalPort = nestedJackPortsMenu() #returns None or clientAndPortString
if externalPort: #None or ClientPortString
if externalPort == -1:
externalPort = ""
api.connectInstrumentPort(item.idKey, externalPort)

3
template/qtgui/submenus.py

@ -160,6 +160,9 @@ def nestedJackPortsMenu(parseOtherOutputs:bool=True, midi:bool=True):
result["hardware"] = sorted(list(hardware))
result["software"] = sorted(list(software))
action = menu.addAction("Disconnect")
action.setData(-1)
hardwareMenu = menu.addMenu("Hardware")
for clientAndPortString in result["hardware"]:
action = hardwareMenu.addAction(clientAndPortString)

Loading…
Cancel
Save