diff options
| author | sbahling <sbahling@mudgum.net> | 2018-10-23 22:46:21 +0200 |
|---|---|---|
| committer | sbahling <sbahling@mudgum.net> | 2018-10-23 22:46:21 +0200 |
| commit | 2d3f2be7b037398a187fc3bb9680ecb7dc0fc375 (patch) | |
| tree | 23c1239c52a8695daf6dc9a943c8944c9247729e /tascam-fw-console | |
| parent | 1c0feac08827040b5e33c8661c85f3edd346d8f4 (diff) | |
| download | tascam-fw-osc-2d3f2be7b037398a187fc3bb9680ecb7dc0fc375.tar.gz tascam-fw-osc-2d3f2be7b037398a187fc3bb9680ecb7dc0fc375.tar.xz tascam-fw-osc-2d3f2be7b037398a187fc3bb9680ecb7dc0fc375.zip | |
Create main command tascam-fw-console
- Add list units option
- Autodiscover and use first found Tascam Console unit
Diffstat (limited to 'tascam-fw-console')
| -rwxr-xr-x | tascam-fw-console | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tascam-fw-console b/tascam-fw-console new file mode 100755 index 0000000..21fdbd0 --- /dev/null +++ b/tascam-fw-console @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +""" + Open Sound Control send/recieve daemon for Tascam Firewire control surface + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + :copyright: Copyright (c) 2012-2014 Scott Bahling + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program (see the file COPYING); if not, write to the + Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + :license: GPL-2.0, see COPYING for details + +Usage: + tascam-fw-osc [options] + +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 + -I IP --listen-ip=IP IP to listen on [default: 127.0.0.1] + -P PORT --listen-port=PORT Port to listen on [default: 5005] + -i IP --ip=IP IP to communicate to [default: 127.0.0.1] + -p PORT --port=PORT Port to communicate to [default: 3919] +""" + +from docopt import docopt +from console import Console, list_units +import osc + +if __name__ == "__main__": + + args = docopt(__doc__, version='0.1') + + if args['--list']: + for model, fullpath, guid in list_units(): + print('{0} path: {1} GUID: 0x{2:016x}'.format(model, + fullpath, guid)) + exit() + + console = Console(card_id=args['--card'], guid=args['--device']) + osc.init_client(args['--ip'], int(args['--port'])) + osc.init_server(args['--listen-ip'], int(args['--listen-port']), console) + + print("Serving on {}".format(osc.server.server_address)) + osc.server.serve_forever() |
