View Single Post
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#7
look at the source-code:
Code:
// Check if device is in the cover eg. in the pocket etc.
  // If not, then read accelerometer
  FILE *fid = fopen("/sys/bus/platform/devices/proximity/state","r");
  if(fid!=NULL){
    
   rs=fscanf((FILE*) fid,"%s",&str);
   fclose(fid);
   if(str[0] != 'c'){
     
     FILE *fd = fopen("/sys/class/i2c-adapter/i2c-3/3-001d/coord","r");
    if(fd!=NULL){
  
    rs=fscanf((FILE*) fd,"%i %i %i",&x,&y,&z);
    fclose(fd);
 if( y<-1700 || y>1700){
      g_print("\nNext track"); 
      mafw_renderer_next(MAFW_RENDERER(self->renderer), error_cb, NULL);

 }
 
 if(z<-1700){
      mafw_renderer_get_status(MAFW_RENDERER(self->renderer),play_status,self);

 }
i think 1700 = 1,7G.
so to get an impression on how fast you have to move the phone from one point to another:
take a ball (or any other thing) and let it fall. that's 1G. make this movement 1,7 times faster and you have the edge when the song is skipped/paused. ^^

and you can see that it won't work when the proximity sensor is covered (when the phone is in a phonebag or in your pocket etc).

but you're right. i sometimes have to restart the app a few times to make it work. o.O