Anyway, the changes are to the alsa_classes.cpp file. The lines to change are 161 and 167, in the scale_out and scale_in functions.
Here is the original code:
Code: Select all
//this is used internally to scale a number to be from 0-100
int Element::scale_out(int num){
if(max-min==0){ return(num); }
return(ceil(100.0*(num-min)/(max-min)));
}
//this is the inverse of scale_out; it's used to take a 0-100 number and put it
//into the proper scale for the element to understand
int Element::scale_in(int num){
if(max-min==0){ return(num); }
return(floor((num*(max-min)/(100))+min));
}
Code: Select all
//this is used internally to scale a number to be from 0-100
int Element::scale_out(int num){
if(max-min==0){ return(num); }
return(ceil(pow(100.0, (num-min)/(double)(max-min))));
}
//this is the inverse of scale_out; it's used to take a 0-100 number and put it
//into the proper scale for the element to understand
int Element::scale_in(int num){
if(max-min==0){ return(num); }
return(round((log(num)/log(100)*(max-min))+min));
}
Code: Select all
--- src/alsa_classes.cpp (revision 181)
+++ src/alsa_classes.cpp (working copy)
@@ -158,13 +158,13 @@
//this is used internally to scale a number to be from 0-100
int Element::scale_out(int num){
if(max-min==0){ return(num); }
- return(ceil(100.0*(num-min)/(max-min)));
+ return(ceil(pow(100.0, (num-min)/(double)(max-min))));
}
//this is the inverse of scale_out; it's used to take a 0-100 number and put it
//into the proper scale for the element to understand
int Element::scale_in(int num){
if(max-min==0){ return(num); }
- return(floor((num*(max-min)/(100))+min));
+ return(round((log(num)/log(100)*(max-min))+min));
}
//this will grab the highest value in the element
int Element::get(){