rem: uint32 index, i, mode, designations, nchannels;
add: uint32 index, i, designations, nchannels; int32 mode;
context: emuxki_create_channels_list(multi_dev *multi){	emuxki_stream *stream;	uint32 index, i, mode, designations, nchannels;	multi_channel_info *chans;	uint32 chan_designations[] = {		B_CHANNEL_LEFT,		B_CHANNEL_RIGHT,		B_CHANNEL_REARLEFT,		B_CHANNEL_REARRIGHT,		B_CHANNEL_CENTER,		B_CHANNEL_SUB	};		chans = multi->chans;	index = 0;	for(mode=EMU_USE_PLAY; mode!=-1; 		mode = (mode == EMU_USE_PLAY) ? EMU_USE_RECORD : -1) {		LIST_FOREACH(stream, &((emuxki_dev*)multi->card)->streams, next) {			if ((stream->use & mode) == 0)				continue;							nchannels = stream->nmono + 2 * stream->nstereo;			if(nchannels == 2)				designations = B_CHANNEL_STEREO_BUS;			else				designations = B_CHANNEL_SURROUND_BUS;						for(i=0; i<nchannels; i++) {				chans[index].channel_id = index;				chans[index].kind = (mode == EMU_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;				chans[index].designations = designations | chan_designations[i];				chans[index].connectors = 0;				index++;			}		}				if(mode==EMU_USE_PLAY) {			multi->output_channel_count = index;		} else {			multi->input_channel_count = index - multi->output_channel_count;		}	}		chans[index].channel_id = index;	chans[index].kind = B_MULTI_OUTPUT_BUS;	chans[index].designations = B_CHANNEL_LEFT | B_CHANNEL_STEREO_BUS;	chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;	index++;		chans[index].channel_id = index;	chans[index].kind = B_MULTI_OUTPUT_BUS;	chans[index].designations = B_CHANNEL_RIGHT | B_CHANNEL_STEREO_BUS;	chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;	index++;		multi->output_bus_channel_count = index - multi->output_channel_count 		- multi->input_channel_count;		chans[index].channel_id = index;	chans[index].kind = B_MULTI_INPUT_BUS;	chans[index].designations = B_CHANNEL_LEFT | B_CHANNEL_STEREO_BUS;	chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;	index++;		chans[index].channel_id = index;	chans[index].kind = B_MULTI_INPUT_BUS;	chans[index].designations = B_CHANNEL_RIGHT | B_CHANNEL_STEREO_BUS;	chans[index].connectors = B_CHANNEL_MINI_JACK_STEREO;	index++;		multi->input_bus_channel_count = index - multi->output_channel_count 		- multi->input_channel_count - multi->output_bus_channel_count;			multi->aux_bus_channel_count = 0;}