aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2017-06-22 14:30:33 +0200
committercbdev <cb@cbcdn.com>2017-06-22 14:30:33 +0200
commitdda3f958716f7a6ce644d03f753add778d6f1512 (patch)
treee2772355daf3728307da26f7a441ba1c60e9d4c7
parent66c59fd7ec79338a47c68077674350ee2c74f326 (diff)
downloadmidimonster-dda3f958716f7a6ce644d03f753add778d6f1512.tar.gz
midimonster-dda3f958716f7a6ce644d03f753add778d6f1512.tar.bz2
midimonster-dda3f958716f7a6ce644d03f753add778d6f1512.zip
Minor fixes to multiple backends
-rw-r--r--artnet.c1
-rw-r--r--loopback.c2
-rw-r--r--midi.c10
3 files changed, 10 insertions, 3 deletions
diff --git a/artnet.c b/artnet.c
index 98bb792..55e4e85 100644
--- a/artnet.c
+++ b/artnet.c
@@ -337,6 +337,7 @@ static int artnet_start(){
}
if(!n){
+ free(inst);
return 0;
}
diff --git a/loopback.c b/loopback.c
index 56e8759..bb93a1f 100644
--- a/loopback.c
+++ b/loopback.c
@@ -29,7 +29,7 @@ static int backend_configure(char* option, char* value){
return 0;
}
-static int backend_configure_instance(instance* instance, char* option, char* value){
+static int backend_configure_instance(instance* inst, char* option, char* value){
//intentionally ignored
return 0;
}
diff --git a/midi.c b/midi.c
index f5666ba..6546ecd 100644
--- a/midi.c
+++ b/midi.c
@@ -273,6 +273,12 @@ static int midi_start(){
return 1;
}
+ //if there are no ports, do nothing
+ if(!n){
+ free(inst);
+ return 0;
+ }
+
//create all ports
for(p = 0; p < n; p++){
data = (midi_instance_data*) inst[p]->impl;
@@ -281,8 +287,8 @@ static int midi_start(){
//make connections
if(data->write){
- fprintf(stderr, "Connecting output of instance %s to MIDI device %s\n", inst[p]->name, data->write);
if(snd_seq_parse_address(sequencer, &addr, data->write) == 0){
+ fprintf(stderr, "Connecting output of instance %s to MIDI device %s (%d:%d)\n", inst[p]->name, data->write, addr.client, addr.port);
snd_seq_connect_to(sequencer, data->port, addr.client, addr.port);
}
else{
@@ -293,8 +299,8 @@ static int midi_start(){
}
if(data->read){
- fprintf(stderr, "Connecting input from MIDI device %s to instance %s\n", data->read, inst[p]->name);
if(snd_seq_parse_address(sequencer, &addr, data->read) == 0){
+ fprintf(stderr, "Connecting input from MIDI device %s to instance %s (%d:%d)\n", data->read, inst[p]->name, addr.client, addr.port);
snd_seq_connect_from(sequencer, data->port, addr.client, addr.port);
}
else{