aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-07-07 12:30:10 +0200
committercbdev <cb@cbcdn.com>2019-07-07 12:30:10 +0200
commit86b9706220ca285db961ea43ec0859ea99cc9f71 (patch)
treeca4e63219cc554e23fb23bb686042f02bd38ea30
parent4681120c21567df21d09903cdb2d3d8387786421 (diff)
downloadmidimonster-86b9706220ca285db961ea43ec0859ea99cc9f71.tar.gz
midimonster-86b9706220ca285db961ea43ec0859ea99cc9f71.tar.bz2
midimonster-86b9706220ca285db961ea43ec0859ea99cc9f71.zip
Minor fixes
-rw-r--r--backends/evdev.c4
-rw-r--r--backends/osc.c10
-rw-r--r--midimonster.c2
3 files changed, 7 insertions, 9 deletions
diff --git a/backends/evdev.c b/backends/evdev.c
index 8871ce4..ca8469a 100644
--- a/backends/evdev.c
+++ b/backends/evdev.c
@@ -378,6 +378,10 @@ static int evdev_start(){
fds++;
}
+ if(data->input_fd <= 0 && !data->output_ev){
+ fprintf(stderr, "Instance %s has neither input nor output device set up\n", inst[u]->name);
+ }
+
}
fprintf(stderr, "evdev backend registered %zu descriptors to core\n", fds);
diff --git a/backends/osc.c b/backends/osc.c
index fd1bcd4..1305169 100644
--- a/backends/osc.c
+++ b/backends/osc.c
@@ -167,14 +167,8 @@ static inline channel_value osc_parameter_normalise(osc_parameter_type t, osc_pa
fprintf(stderr, "Invalid OSC type passed to interpolation routine\n");
}
- //fix overshoot
- if(v.normalised > 1.0){
- v.normalised = 1.0;
- }
- else if(v.normalised < 0.0){
- v.normalised = 0.0;
- }
-
+ //clamp to range
+ v.normalised = clamp(v.normalised, 1.0, 0.0);
return v;
}
diff --git a/midimonster.c b/midimonster.c
index 4784052..fb664a4 100644
--- a/midimonster.c
+++ b/midimonster.c
@@ -324,7 +324,7 @@ int main(int argc, char** argv){
while(primary->n){
//swap primary and secondary event collectors
DBGPF("Swapping event collectors, %zu events in primary\n", primary->n);
- for(u = 0; u < sizeof(event_pool)/sizeof(event_collection); u++){
+ for(u = 0; u < sizeof(event_pool) / sizeof(event_collection); u++){
if(primary != event_pool + u){
secondary = primary;
primary = event_pool + u;