diff options
| author | sbahling <sbahling@mudgum.net> | 2020-06-04 19:08:21 +0200 |
|---|---|---|
| committer | sbahling <sbahling@mudgum.net> | 2020-06-04 19:08:21 +0200 |
| commit | 6f8a7878c575ceedca82895ef0a99c421ecdcb06 (patch) | |
| tree | eff85cbf454c8fd4ea8f94e6b4ab130c933a30c8 /tascam_fw_console | |
| parent | 96241322a53eb70cb7410946e7fa3cd78ad35b6e (diff) | |
| download | tascam-fw-osc-6f8a7878c575ceedca82895ef0a99c421ecdcb06.tar.gz tascam-fw-osc-6f8a7878c575ceedca82895ef0a99c421ecdcb06.tar.xz tascam-fw-osc-6f8a7878c575ceedca82895ef0a99c421ecdcb06.zip | |
Add -d/--device option to specify path of the snd device
rename the GUID option to -g/--guid
Diffstat (limited to 'tascam_fw_console')
| -rw-r--r-- | tascam_fw_console/cli.py | 7 | ||||
| -rw-r--r-- | tascam_fw_console/console.py | 10 |
2 files changed, 14 insertions, 3 deletions
diff --git a/tascam_fw_console/cli.py b/tascam_fw_console/cli.py index 2319ad9..0442ebc 100644 --- a/tascam_fw_console/cli.py +++ b/tascam_fw_console/cli.py @@ -26,7 +26,8 @@ Options: -h --help Show this screen. -l --list List connected Tascam FW console units -c CARD_NUM --card=CARD_NUM Number of the ALSA sound card - -d GUID --device=GUID GUID of the FW unit + -g GUID --guid=GUID GUID of the FW unit + -d DEVICE --device=DEVICE Path to device under /dev -I IP --listen-ip=IP IP to listen on [default: 127.0.0.1] -P PORT --listen-port=PORT Port to listen on [default: 8100] -i IP --ip=IP IP to communicate to [default: 127.0.0.1] @@ -48,7 +49,9 @@ def main(): fullpath, guid)) exit() - console = Console(card_id=args['--card'], guid=args['--device']) + console = Console(card_id=args['--card'], + guid=args['--guid'], + device=args['--device']) osc.init_client(args['--ip'], int(args['--port'])) osc.init_server(args['--listen-ip'], int(args['--listen-port']), console) diff --git a/tascam_fw_console/console.py b/tascam_fw_console/console.py index 758888d..6f5dcc8 100644 --- a/tascam_fw_console/console.py +++ b/tascam_fw_console/console.py @@ -94,15 +94,23 @@ class RunningStatusThread(): time.sleep(self.interval) + print('Server thread shutdown.') + + def stop_thread(self): + self.pill2kill.set() + self.thread.join() + class Console(): - def __init__(self, card_id=None, guid=None): + def __init__(self, card_id=None, guid=None, device=None): fullpath = None if guid: fullpath = self._seek_snd_unit_from_guid(card_id) elif card_id: fullpath = '/dev/snd/hwC{0}D0'.format(card_id) + elif device: + fullpath = device else: try: units = list_units() |
