kernels/linux-2.4.0/drivers/sound/emu10k1/mixer.c
/* update value of local PCM volume level (using channel attenuation)
 *
 * return 1: in case its local change
 *        0: if the current process doesn't have entry in table
 *	     (it means this process have not opened audio (mixer usually)
 */
update value of local PCM volume level (using channel attenuation)
return 1: in case its local change
0: if the current process doesn't have entry in table
(it means this process have not opened audio (mixer usually)
update value of local PCM volume level ( using channel attenuation ) return 1 : in case its local change 0 : if the current process doesn ' t have entry in table ( it means this process have not opened audio ( mixer usually )
static int update_pcm_attn(struct emu10k1_card *card, unsigned l1, unsigned r1)
{
	int i;
	int mixer = (r1 << 8) | l1;
	for (i = 0; i < MAX_PCM_CHANNELS; i++) {
		if (sblive_pcm_volume[i].files == current->files) {
			sblive_pcm_volume[i].mixer = pcm_last_mixer = mixer;
			if (sblive_pcm_volume[i].opened) {
				if (sblive_pcm_volume[i].channel_r < NUM_G) {
					sblive_pcm_volume[i].attn_r = set_pcm_attn(card, sblive_pcm_volume[i].channel_r, r1);
					if (sblive_pcm_volume[i].channel_l < NUM_G)
						sblive_pcm_volume[i].attn_l = set_pcm_attn(card, sblive_pcm_volume[i].channel_l, l1);
				} else {
					if (sblive_pcm_volume[i].channel_l < NUM_G)
						sblive_pcm_volume[i].attn_l =
						    set_pcm_attn(card, sblive_pcm_volume[i].channel_l, (l1 >= r1) ? l1 : r1);
				}
			}
			return 1;
		}
	}
	card->arrwVol[volidx[SOUND_MIXER_PCM]] = mixer;
	return 0;
}
static int update_pcm_attn ( struct emu10k1_card * card , unsigned l1 , unsigned r1 ) { int i ; int mixer = ( r1 << 8 ) | l1 ; for ( i = 0 ; i < MAX_PCM_CHANNELS ; i ++ ) { if ( sblive_pcm_volume [ i ] . files == current -> files ) { sblive_pcm_volume [ i ] . mixer = pcm_last_mixer = mixer ; if ( sblive_pcm_volume [ i ] . opened ) { if ( sblive_pcm_volume [ i ] . channel_r < NUM_G ) { sblive_pcm_volume [ i ] . attn_r = set_pcm_attn ( card , sblive_pcm_volume [ i ] . channel_r , r1 ) ; if ( sblive_pcm_volume [ i ] . channel_l < NUM_G ) sblive_pcm_volume [ i ] . attn_l = set_pcm_attn ( card , sblive_pcm_volume [ i ] . channel_l , l1 ) ; } else { if ( sblive_pcm_volume [ i ] . channel_l < NUM_G ) sblive_pcm_volume [ i ] . attn_l = set_pcm_attn ( card , sblive_pcm_volume [ i ] . channel_l , ( l1 >= r1 ) ? l1 : r1 ) ; } } return 1 ; } } card -> arrwVol [ volidx [ SOUND_MIXER_PCM ] ] = mixer ; return 0 ; }
update value of local PCM volume level (using channel attenuation)
 return 1: in case its local change
        0: if the current process doesn't have entry in table
           (it means this process have not opened audio (mixer usually)
update value of local PCM volume level ( using channel attenuation ) return 1 : in case its local change 0 : if the current process doesn ' t have entry in table ( it means this process have not opened audio ( mixer usually )
/* mono voice */ /* to correctly handle mono voice here we would need
						   to go into stereo mode and move the voice to the right & left
						   looks a bit overcomplicated... */