comparison libaf/af_volume.c @ 8186:b56fd4b1738d

Printing of max volume on exit
author anders
date Thu, 14 Nov 2002 09:49:06 +0000
parents e8832e66babd
children d6f40a06867b
comparison
equal deleted inserted replaced
8185:aae2d081864a 8186:b56fd4b1738d
57 57
58 for(i=0;i<NCH;i++){ 58 for(i=0;i<NCH;i++){
59 if(in[i]<MIN_VOL) 59 if(in[i]<MIN_VOL)
60 out[i]=0.0; 60 out[i]=0.0;
61 else 61 else
62 out[i]=pow(10.0,clamp(in[i],MIN_VOL,MAX_VOL)/k); 62 out[i]=pow(10.0,clamp(in[i],MIN_VOL,MAX_VOL)/k);
63 } 63 }
64 return AF_OK; 64 return AF_OK;
65 } 65 }
66 66
67 /* Convert from gain value to dB. Returns AF_OK if of and AF_ERROR if 67 /* Convert from gain value to dB. Returns AF_OK if of and AF_ERROR if
129 s->probe = (int)arg; 129 s->probe = (int)arg;
130 return AF_OK; 130 return AF_OK;
131 case AF_CONTROL_VOLUME_ON_OFF: 131 case AF_CONTROL_VOLUME_ON_OFF:
132 s->onoff = (int)arg; 132 s->onoff = (int)arg;
133 return AF_OK; 133 return AF_OK;
134 case AF_CONTROL_PRE_DESTROY:{
135 float m = 0.0;
136 int i;
137 for(i=0;i<NCH;i++)
138 m=max(m,s->maxpower[i]);
139 af_msg(AF_MSG_INFO,"The maximum volume was %0.2fdB \n",10*log10(m));
140 return AF_OK;
141 }
134 } 142 }
135 return AF_UNKNOWN; 143 return AF_UNKNOWN;
136 } 144 }
137 145
138 // Deallocate memory 146 // Deallocate memory