-
Notifications
You must be signed in to change notification settings - Fork 34
Enhanced NG features for optimized use of a Mackie C4 Controller #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| case MBNG_EVENT_ENC_MODE_C4ENC: | ||
| if( item->value != 0x00 ) { | ||
| if(item->value < 0x40){ | ||
| switch(item->value){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a switch() statement it would be better to use range checks here in case values are processed which are not explicitly mentioned here (for whatever reason…)
E.g.:
if( item->value <= 1 ) incrementer = 1;
else if( item->value <=4 ) incrementer = 2;
else if( item->value <=8 ) incrementer= 4;
…
| } | ||
| else{ | ||
| switch(item->value){ | ||
| case 0x41: incrementer = -1; break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here: range checks would be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about mbng_enc.c line 223 onwards?
case MBNG_EVENT_ENC_MODE_C4ENC: if(event_incrementer > 0){ switch(event_incrementer){ case 1: item.value = 0x01; break; case 2: item.value = 0x04; break; case 4: item.value = 0x08; break;
And so on..
Is a range check more efficient in that case too?
The relevant modifications are referred to as "macdis" and "c4enc"