midi: make sure to ignore non-parameters cli args
This commit is contained in:
parent
ee3a24e6fc
commit
eba8eb2df6
2 changed files with 7 additions and 8 deletions
|
|
@ -3,7 +3,9 @@ from list import *
|
|||
from utils import *
|
||||
from mtc import *
|
||||
|
||||
ipc_send('version', '1.8.7')
|
||||
ipc_send('version', '1.9.0')
|
||||
|
||||
argv = argv[argv.index('--params') + 1:]
|
||||
|
||||
if 'list' in argv:
|
||||
list()
|
||||
|
|
@ -26,11 +28,7 @@ outputs = {}
|
|||
|
||||
for arg in argv:
|
||||
|
||||
if 'python/midi.py' in arg:
|
||||
|
||||
pass # in case we're using pre-compiled binaries
|
||||
|
||||
elif type(arg) == str and ':' in arg:
|
||||
if type(arg) == str and ':' in arg:
|
||||
|
||||
name, *ports = arg.split(':')
|
||||
ports = ':'.join(ports) # port names may contain colons
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ var {PythonShell} = require('python-shell'),
|
|||
|
||||
// last o-s-c version that changed midi sources
|
||||
// must match version in midi.py / bundled midi executable
|
||||
var midiVersion = '1.8.7'
|
||||
var midiVersion = '1.9.0'
|
||||
|
||||
var pythonOptions = {
|
||||
scriptPath:__dirname,
|
||||
|
|
@ -32,6 +32,7 @@ class MidiConverter {
|
|||
|
||||
this.py = new PythonShell('python/midi.py', Object.assign({
|
||||
args: [
|
||||
'--params',
|
||||
settings.read('debug') ? 'debug' : '',
|
||||
...settings.read('midi')
|
||||
],
|
||||
|
|
@ -111,7 +112,7 @@ class MidiConverter {
|
|||
|
||||
static list() {
|
||||
|
||||
PythonShell.run('python/midi.py', Object.assign({pythonPath: MidiConverter.getPythonPath(), args: ['list-only']}, pythonOptions), function(e, results) {
|
||||
PythonShell.run('python/midi.py', Object.assign({pythonPath: MidiConverter.getPythonPath(), args: ['--params', 'list-only']}, pythonOptions), function(e, results) {
|
||||
if (e) {
|
||||
if (e.code === 'ENOENT') {
|
||||
console.error(`(ERROR, MIDI) Could not find python binary: ${e.message.replace(/spawn (.*) ENOENT/, '$1')}`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue