* some style improvements again (ie lower case variables as pointed by Axel)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29238 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
79d4b99e40
commit
5076aaf050
@ -210,7 +210,7 @@ auich_stream_commit_parms(auich_stream *stream)
|
||||
|
||||
page = stream->dmaops_log_base;
|
||||
|
||||
for (i=0; i < AUICH_DMALIST_MAX; i++) {
|
||||
for (i = 0; i < AUICH_DMALIST_MAX; i++) {
|
||||
page[2*i] = ((uint32)stream->buffer->phy_base) +
|
||||
(i % stream->bufcount) * stream->blksize;
|
||||
page[2*i + 1] = AUICH_DMAF_IOC | (stream->blksize
|
||||
|
@ -206,7 +206,7 @@ auich_create_controls_list(multi_dev *multi)
|
||||
count = source_info_size;
|
||||
//Note that we ignore first item in source_info
|
||||
//It's for recording, but do match this with ac97.c's source_info
|
||||
for (i=1; i < count ; i++) {
|
||||
for (i = 1; i < count ; i++) {
|
||||
info = &source_info[i];
|
||||
PRINT(("name : %s\n", info->name));
|
||||
|
||||
@ -387,12 +387,12 @@ auich_create_controls_list(multi_dev *multi)
|
||||
|
||||
|
||||
static status_t
|
||||
auich_get_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
||||
auich_get_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
||||
{
|
||||
int32 i, id;
|
||||
multi_mixer_control *control = NULL;
|
||||
for (i=0; i<MMVI->item_count; i++) {
|
||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
for (i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("auich_get_mix : invalid control id requested : %li\n", id));
|
||||
continue;
|
||||
@ -404,22 +404,22 @@ auich_get_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
||||
float values[2];
|
||||
control->get(card, control->cookie, control->type, values);
|
||||
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||
MMVI->values[i].u.gain = values[0];
|
||||
mmvi->values[i].u.gain = values[0];
|
||||
else
|
||||
MMVI->values[i].u.gain = values[1];
|
||||
mmvi->values[i].u.gain = values[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||
float values[1];
|
||||
control->get(card, control->cookie, control->type, values);
|
||||
MMVI->values[i].u.enable = (values[0] == 1.0);
|
||||
mmvi->values[i].u.enable = (values[0] == 1.0);
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||
float values[1];
|
||||
control->get(card, control->cookie, control->type, values);
|
||||
MMVI->values[i].u.mux = (int32)values[0];
|
||||
mmvi->values[i].u.mux = (int32)values[0];
|
||||
}
|
||||
}
|
||||
return B_OK;
|
||||
@ -427,12 +427,12 @@ auich_get_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
||||
|
||||
|
||||
static status_t
|
||||
auich_set_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
||||
auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
|
||||
{
|
||||
int32 i, id;
|
||||
multi_mixer_control *control = NULL;
|
||||
for (i=0; i<MMVI->item_count; i++) {
|
||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
for (i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("auich_set_mix : invalid control id requested : %li\n", id));
|
||||
continue;
|
||||
@ -441,8 +441,8 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||
multi_mixer_control *control2 = NULL;
|
||||
if (i+1<MMVI->item_count) {
|
||||
id = MMVI->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if (i+1<mmvi->item_count) {
|
||||
id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("auich_set_mix : invalid control id requested : %li\n", id));
|
||||
} else {
|
||||
@ -458,12 +458,12 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
||||
values[1] = 0.0;
|
||||
|
||||
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||
values[0] = MMVI->values[i].u.gain;
|
||||
values[0] = mmvi->values[i].u.gain;
|
||||
else
|
||||
values[1] = MMVI->values[i].u.gain;
|
||||
values[1] = mmvi->values[i].u.gain;
|
||||
|
||||
if (control2 && control2->mix_control.master != EMU_MULTI_CONTROL_MASTERID)
|
||||
values[1] = MMVI->values[i+1].u.gain;
|
||||
values[1] = mmvi->values[i+1].u.gain;
|
||||
|
||||
control->set(card, control->cookie, control->type, values);
|
||||
}
|
||||
@ -475,14 +475,14 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = MMVI->values[i].u.enable ? 1.0 : 0.0;
|
||||
values[0] = mmvi->values[i].u.enable ? 1.0 : 0.0;
|
||||
control->set(card, control->cookie, control->type, values);
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = (float)MMVI->values[i].u.mux;
|
||||
values[0] = (float)mmvi->values[i].u.mux;
|
||||
control->set(card, control->cookie, control->type, values);
|
||||
}
|
||||
}
|
||||
@ -491,22 +491,22 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
||||
|
||||
|
||||
static status_t
|
||||
auich_list_mix_controls(auich_dev *card, multi_mix_control_info * MMCI)
|
||||
auich_list_mix_controls(auich_dev *card, multi_mix_control_info * mmci)
|
||||
{
|
||||
multi_mix_control *MMC;
|
||||
multi_mix_control *mmc;
|
||||
int32 i;
|
||||
|
||||
MMC = MMCI->controls;
|
||||
if (MMCI->control_count < 24)
|
||||
mmc = mmci->controls;
|
||||
if (mmci->control_count < 24)
|
||||
return B_ERROR;
|
||||
|
||||
if (auich_create_controls_list(&card->multi) < B_OK)
|
||||
return B_ERROR;
|
||||
for (i=0; i<card->multi.control_count; i++) {
|
||||
MMC[i] = card->multi.controls[i].mix_control;
|
||||
for (i = 0; i < card->multi.control_count; i++) {
|
||||
mmc[i] = card->multi.controls[i].mix_control;
|
||||
}
|
||||
|
||||
MMCI->control_count = card->multi.control_count;
|
||||
mmci->control_count = card->multi.control_count;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@ -586,7 +586,7 @@ auich_create_channels_list(multi_dev *multi)
|
||||
else
|
||||
designations = B_CHANNEL_SURROUND_BUS;
|
||||
|
||||
for (i=0; i<stream->channels; i++) {
|
||||
for (i = 0; i < stream->channels; i++) {
|
||||
chans[index].channel_id = index;
|
||||
chans[index].kind = (mode == AUICH_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
||||
chans[index].designations = designations | chan_designations[i];
|
||||
@ -794,7 +794,7 @@ auich_get_buffers(auich_dev *card, multi_buffer_list *data)
|
||||
if (bufcount > data->request_playback_buffers)
|
||||
bufcount = data->request_playback_buffers;
|
||||
|
||||
for (i=0; i<bufcount; i++)
|
||||
for (i = 0; i < bufcount; i++)
|
||||
for (j=0; j<pchannels; j++)
|
||||
auich_stream_get_nth_buffer(card->pstream, j, i,
|
||||
&data->playback_buffers[i][j].base,
|
||||
@ -808,7 +808,7 @@ auich_get_buffers(auich_dev *card, multi_buffer_list *data)
|
||||
if (bufcount > data->request_record_buffers)
|
||||
bufcount = data->request_record_buffers;
|
||||
|
||||
for (i=0; i<bufcount; i++)
|
||||
for (i = 0; i < bufcount; i++)
|
||||
for (j=0; j<rchannels; j++)
|
||||
auich_stream_get_nth_buffer(card->rstream, j, i,
|
||||
&data->record_buffers[i][j].base,
|
||||
|
@ -162,7 +162,7 @@ auvia_stream_commit_parms(auvia_stream *stream)
|
||||
|
||||
page = stream->dmaops_log_base;
|
||||
|
||||
for(i=0; i<stream->bufcount; i++) {
|
||||
for(i = 0; i < stream->bufcount; i++) {
|
||||
page[2*i] = ((uint32)stream->buffer->phy_base) +
|
||||
i * stream->blksize;
|
||||
page[2*i + 1] = AUVIA_DMAOP_FLAG | stream->blksize;
|
||||
|
@ -83,7 +83,7 @@ auvia_codec_waitready(device_config *config)
|
||||
int i;
|
||||
|
||||
/* poll until codec not busy */
|
||||
for(i=0; (i<AUVIA_TIMEOUT) && (pci->read_io_32(config->nabmbar
|
||||
for(i = 0; (i < AUVIA_TIMEOUT) && (pci->read_io_32(config->nabmbar
|
||||
+ AUVIA_CODEC_CTL) & AUVIA_CODEC_BUSY) ; i++)
|
||||
spin(1);
|
||||
if(i>=AUVIA_TIMEOUT) {
|
||||
@ -99,7 +99,7 @@ auvia_codec_waitvalid(device_config *config)
|
||||
int i;
|
||||
|
||||
/* poll until codec valid */
|
||||
for(i=0; (i<AUVIA_TIMEOUT) && !(pci->read_io_32(config->nabmbar
|
||||
for(i = 0; (i < AUVIA_TIMEOUT) && !(pci->read_io_32(config->nabmbar
|
||||
+ AUVIA_CODEC_CTL) & AUVIA_CODEC_PRIVALID) ; i++)
|
||||
spin(1);
|
||||
if(i>=AUVIA_TIMEOUT) {
|
||||
|
@ -309,7 +309,7 @@ auvia_create_controls_list(multi_dev *multi)
|
||||
count = source_info_size;
|
||||
count--;
|
||||
|
||||
for(i=1; i < count ; i++) {
|
||||
for(i = 1; i < count ; i++) {
|
||||
info = &source_info[i];
|
||||
PRINT(("name : %s\n", info->name));
|
||||
|
||||
@ -386,12 +386,12 @@ auvia_create_controls_list(multi_dev *multi)
|
||||
}
|
||||
|
||||
static status_t
|
||||
auvia_get_mix(auvia_dev *card, multi_mix_value_info * MMVI)
|
||||
auvia_get_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
||||
{
|
||||
int32 i, id;
|
||||
multi_mixer_control *control = NULL;
|
||||
for(i=0; i<MMVI->item_count; i++) {
|
||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
for(i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if(id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("auvia_get_mix : invalid control id requested : %li\n", id));
|
||||
continue;
|
||||
@ -403,34 +403,34 @@ auvia_get_mix(auvia_dev *card, multi_mix_value_info * MMVI)
|
||||
float values[2];
|
||||
control->get(card, control->cookie, control->type, values);
|
||||
if(control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||
MMVI->values[i].u.gain = values[0];
|
||||
mmvi->values[i].u.gain = values[0];
|
||||
else
|
||||
MMVI->values[i].u.gain = values[1];
|
||||
mmvi->values[i].u.gain = values[1];
|
||||
}
|
||||
}
|
||||
|
||||
if(control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||
float values[1];
|
||||
control->get(card, control->cookie, control->type, values);
|
||||
MMVI->values[i].u.enable = (values[0] == 1.0);
|
||||
mmvi->values[i].u.enable = (values[0] == 1.0);
|
||||
}
|
||||
|
||||
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||
float values[1];
|
||||
control->get(card, control->cookie, control->type, values);
|
||||
MMVI->values[i].u.mux = (int32)values[0];
|
||||
mmvi->values[i].u.mux = (int32)values[0];
|
||||
}
|
||||
}
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
static status_t
|
||||
auvia_set_mix(auvia_dev *card, multi_mix_value_info * MMVI)
|
||||
auvia_set_mix(auvia_dev *card, multi_mix_value_info * mmvi)
|
||||
{
|
||||
int32 i, id;
|
||||
multi_mixer_control *control = NULL;
|
||||
for(i=0; i<MMVI->item_count; i++) {
|
||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
for(i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if(id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("auvia_set_mix : invalid control id requested : %li\n", id));
|
||||
continue;
|
||||
@ -439,8 +439,8 @@ auvia_set_mix(auvia_dev *card, multi_mix_value_info * MMVI)
|
||||
|
||||
if(control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||
multi_mixer_control *control2 = NULL;
|
||||
if(i+1<MMVI->item_count) {
|
||||
id = MMVI->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if(i+1<mmvi->item_count) {
|
||||
id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if(id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("auvia_set_mix : invalid control id requested : %li\n", id));
|
||||
} else {
|
||||
@ -456,12 +456,12 @@ auvia_set_mix(auvia_dev *card, multi_mix_value_info * MMVI)
|
||||
values[1] = 0.0;
|
||||
|
||||
if(control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||
values[0] = MMVI->values[i].u.gain;
|
||||
values[0] = mmvi->values[i].u.gain;
|
||||
else
|
||||
values[1] = MMVI->values[i].u.gain;
|
||||
values[1] = mmvi->values[i].u.gain;
|
||||
|
||||
if(control2 && control2->mix_control.master != EMU_MULTI_CONTROL_MASTERID)
|
||||
values[1] = MMVI->values[i+1].u.gain;
|
||||
values[1] = mmvi->values[i+1].u.gain;
|
||||
|
||||
control->set(card, control->cookie, control->type, values);
|
||||
}
|
||||
@ -473,14 +473,14 @@ auvia_set_mix(auvia_dev *card, multi_mix_value_info * MMVI)
|
||||
if(control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = MMVI->values[i].u.enable ? 1.0 : 0.0;
|
||||
values[0] = mmvi->values[i].u.enable ? 1.0 : 0.0;
|
||||
control->set(card, control->cookie, control->type, values);
|
||||
}
|
||||
|
||||
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = (float)MMVI->values[i].u.mux;
|
||||
values[0] = (float)mmvi->values[i].u.mux;
|
||||
control->set(card, control->cookie, control->type, values);
|
||||
}
|
||||
}
|
||||
@ -488,22 +488,22 @@ auvia_set_mix(auvia_dev *card, multi_mix_value_info * MMVI)
|
||||
}
|
||||
|
||||
static status_t
|
||||
auvia_list_mix_controls(auvia_dev *card, multi_mix_control_info * MMCI)
|
||||
auvia_list_mix_controls(auvia_dev *card, multi_mix_control_info * mmci)
|
||||
{
|
||||
multi_mix_control *MMC;
|
||||
multi_mix_control *mmc;
|
||||
int32 i;
|
||||
|
||||
MMC = MMCI->controls;
|
||||
if(MMCI->control_count < 24)
|
||||
mmc = mmci->controls;
|
||||
if(mmci->control_count < 24)
|
||||
return B_ERROR;
|
||||
|
||||
if(auvia_create_controls_list(&card->multi) < B_OK)
|
||||
return B_ERROR;
|
||||
for(i=0; i<card->multi.control_count; i++) {
|
||||
MMC[i] = card->multi.controls[i].mix_control;
|
||||
for(i = 0; i < card->multi.control_count; i++) {
|
||||
mmc[i] = card->multi.controls[i].mix_control;
|
||||
}
|
||||
|
||||
MMCI->control_count = card->multi.control_count;
|
||||
mmci->control_count = card->multi.control_count;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@ -581,7 +581,7 @@ auvia_create_channels_list(multi_dev *multi)
|
||||
else
|
||||
designations = B_CHANNEL_SURROUND_BUS;
|
||||
|
||||
for(i=0; i<stream->channels; i++) {
|
||||
for(i = 0; i < stream->channels; i++) {
|
||||
chans[index].channel_id = index;
|
||||
chans[index].kind = (mode == AUVIA_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
||||
chans[index].designations = designations | chan_designations[i];
|
||||
@ -794,7 +794,7 @@ auvia_get_buffers(auvia_dev *card, multi_buffer_list *data)
|
||||
data->return_playback_channels = pchannels; /* playback_buffers[][c] */
|
||||
data->return_playback_buffer_size = BUFFER_FRAMES; /* frames */
|
||||
|
||||
for(i=0; i<BUFFER_COUNT; i++)
|
||||
for(i = 0; i < BUFFER_COUNT; i++)
|
||||
for(j=0; j<pchannels; j++)
|
||||
auvia_stream_get_nth_buffer(card->pstream, j, i,
|
||||
&data->playback_buffers[i][j].base,
|
||||
@ -804,7 +804,7 @@ auvia_get_buffers(auvia_dev *card, multi_buffer_list *data)
|
||||
data->return_record_channels = rchannels;
|
||||
data->return_record_buffer_size = BUFFER_FRAMES; /* frames */
|
||||
|
||||
for(i=0; i<BUFFER_COUNT; i++)
|
||||
for(i = 0; i < BUFFER_COUNT; i++)
|
||||
for(j=0; j<rchannels; j++)
|
||||
auvia_stream_get_nth_buffer(card->rstream, j, i,
|
||||
&data->record_buffers[i][j].base,
|
||||
|
@ -344,7 +344,7 @@ create_controls_list(geode_multi *multi)
|
||||
count = source_info_size;
|
||||
//Note that we ignore first item in source_info
|
||||
//It's for recording, but do match this with ac97.c's source_info
|
||||
for (i=1; i < count ; i++) {
|
||||
for (i = 1; i < count ; i++) {
|
||||
info = &source_info[i];
|
||||
TRACE("name : %s\n", info->name);
|
||||
|
||||
@ -525,19 +525,19 @@ create_controls_list(geode_multi *multi)
|
||||
|
||||
|
||||
static status_t
|
||||
list_mix_controls(geode_controller* controller, multi_mix_control_info* MMCI)
|
||||
list_mix_controls(geode_controller* controller, multi_mix_control_info* mmci)
|
||||
{
|
||||
multi_mix_control* MMC = MMCI->controls;
|
||||
if (MMCI->control_count < 24)
|
||||
multi_mix_control* mmc = mmci->controls;
|
||||
if (mmci->control_count < 24)
|
||||
return B_ERROR;
|
||||
|
||||
if (create_controls_list(controller->multi) < B_OK)
|
||||
return B_ERROR;
|
||||
for (uint32 i = 0; i < controller->multi->control_count; i++) {
|
||||
MMC[i] = controller->multi->controls[i].mix_control;
|
||||
mmc[i] = controller->multi->controls[i].mix_control;
|
||||
}
|
||||
|
||||
MMCI->control_count = controller->multi->control_count;
|
||||
mmci->control_count = controller->multi->control_count;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@ -559,10 +559,10 @@ list_mix_channels(geode_controller* controller, multi_mix_channel_info *data)
|
||||
|
||||
|
||||
static status_t
|
||||
get_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
||||
get_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
||||
{
|
||||
for (int32 i = 0; i < MMVI->item_count; i++) {
|
||||
uint32 id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||
uint32 id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= controller->multi->control_count) {
|
||||
dprintf("geode_get_mix : invalid control id requested : %li\n", id);
|
||||
continue;
|
||||
@ -574,22 +574,22 @@ get_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
||||
float values[2];
|
||||
control->get(controller, control->cookie, control->type, values);
|
||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||
MMVI->values[i].gain = values[0];
|
||||
mmvi->values[i].gain = values[0];
|
||||
else
|
||||
MMVI->values[i].gain = values[1];
|
||||
mmvi->values[i].gain = values[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||
float values[1];
|
||||
control->get(controller, control->cookie, control->type, values);
|
||||
MMVI->values[i].enable = (values[0] == 1.0);
|
||||
mmvi->values[i].enable = (values[0] == 1.0);
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||
float values[1];
|
||||
control->get(controller, control->cookie, control->type, values);
|
||||
MMVI->values[i].mux = (int32)values[0];
|
||||
mmvi->values[i].mux = (int32)values[0];
|
||||
}
|
||||
}
|
||||
return B_OK;
|
||||
@ -597,11 +597,11 @@ get_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
||||
|
||||
|
||||
static status_t
|
||||
set_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
||||
set_mix(geode_controller *controller, multi_mix_value_info * mmvi)
|
||||
{
|
||||
geode_multi *multi = controller->multi;
|
||||
for (int32 i = 0; i < MMVI->item_count; i++) {
|
||||
uint32 id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||
uint32 id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= multi->control_count) {
|
||||
dprintf("geode_set_mix : invalid control id requested : %li\n", id);
|
||||
continue;
|
||||
@ -610,8 +610,8 @@ set_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||
multi_mixer_control *control2 = NULL;
|
||||
if (i+1<MMVI->item_count) {
|
||||
id = MMVI->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
||||
if (i+1<mmvi->item_count) {
|
||||
id = mmvi->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= multi->control_count) {
|
||||
dprintf("geode_set_mix : invalid control id requested : %li\n", id);
|
||||
} else {
|
||||
@ -627,12 +627,12 @@ set_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
||||
values[1] = 0.0;
|
||||
|
||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||
values[0] = MMVI->values[i].gain;
|
||||
values[0] = mmvi->values[i].gain;
|
||||
else
|
||||
values[1] = MMVI->values[i].gain;
|
||||
values[1] = mmvi->values[i].gain;
|
||||
|
||||
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
|
||||
values[1] = MMVI->values[i+1].gain;
|
||||
values[1] = mmvi->values[i+1].gain;
|
||||
|
||||
control->set(controller, control->cookie, control->type, values);
|
||||
}
|
||||
@ -644,14 +644,14 @@ set_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = MMVI->values[i].enable ? 1.0 : 0.0;
|
||||
values[0] = mmvi->values[i].enable ? 1.0 : 0.0;
|
||||
control->set(controller, control->cookie, control->type, values);
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = (float)MMVI->values[i].mux;
|
||||
values[0] = (float)mmvi->values[i].mux;
|
||||
control->set(controller, control->cookie, control->type, values);
|
||||
}
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ echo_stream_set_audioparms(echo_stream *stream, uint8 channels,
|
||||
|
||||
uint32 dwNumFreeEntries = 0;
|
||||
|
||||
for (i=0; i<stream->bufcount; i++) {
|
||||
for (i = 0; i < stream->bufcount; i++) {
|
||||
duck->AddMapping(((uint32)stream->buffer->phy_base) +
|
||||
i * stream->blksize, stream->blksize, 0, TRUE, dwNumFreeEntries);
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ echo_create_controls_list(multi_dev *multi)
|
||||
MIXER_AUDIO_CHANNEL channel;
|
||||
channel.wCardId = 0;
|
||||
channel.dwType = ECHO_BUS_OUT;
|
||||
for (i=0; i < card->caps.wNumBussesOut / 2; i++) {
|
||||
for (i = 0; i < card->caps.wNumBussesOut / 2; i++) {
|
||||
channel.wChannel = i * 2;
|
||||
parent2 = echo_create_group_control(multi, &index, parent, S_null, "Output");
|
||||
|
||||
@ -232,7 +232,7 @@ echo_create_controls_list(multi_dev *multi)
|
||||
parent = echo_create_group_control(multi, &index, 0, S_INPUT, NULL);
|
||||
|
||||
channel.dwType = ECHO_BUS_IN;
|
||||
for (i=0; i < card->caps.wNumBussesIn / 2; i++) {
|
||||
for (i = 0; i < card->caps.wNumBussesIn / 2; i++) {
|
||||
channel.wChannel = i * 2;
|
||||
|
||||
parent2 = echo_create_group_control(multi, &index, parent, S_null, "Input");
|
||||
@ -247,13 +247,13 @@ echo_create_controls_list(multi_dev *multi)
|
||||
}
|
||||
|
||||
static status_t
|
||||
echo_get_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
||||
echo_get_mix(echo_dev *card, multi_mix_value_info * mmvi)
|
||||
{
|
||||
int32 i;
|
||||
uint32 id;
|
||||
multi_mixer_control *control = NULL;
|
||||
for (i=0; i<MMVI->item_count; i++) {
|
||||
id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
for (i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("echo_get_mix : invalid control id requested : %li\n", id));
|
||||
continue;
|
||||
@ -265,22 +265,22 @@ echo_get_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
||||
float values[2];
|
||||
control->get(card, control->channel, control->type, values);
|
||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||
MMVI->values[i].gain = values[0];
|
||||
mmvi->values[i].gain = values[0];
|
||||
else
|
||||
MMVI->values[i].gain = values[1];
|
||||
mmvi->values[i].gain = values[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||
float values[1];
|
||||
control->get(card, control->channel, control->type, values);
|
||||
MMVI->values[i].enable = (values[0] == 1.0);
|
||||
mmvi->values[i].enable = (values[0] == 1.0);
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||
float values[1];
|
||||
control->get(card, control->channel, control->type, values);
|
||||
MMVI->values[i].mux = (int32)values[0];
|
||||
mmvi->values[i].mux = (int32)values[0];
|
||||
}
|
||||
}
|
||||
return B_OK;
|
||||
@ -288,13 +288,13 @@ echo_get_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
||||
|
||||
|
||||
static status_t
|
||||
echo_set_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
||||
echo_set_mix(echo_dev *card, multi_mix_value_info * mmvi)
|
||||
{
|
||||
int32 i;
|
||||
uint32 id;
|
||||
multi_mixer_control *control = NULL;
|
||||
for (i=0; i<MMVI->item_count; i++) {
|
||||
id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
for (i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("echo_set_mix : invalid control id requested : %li\n", id));
|
||||
continue;
|
||||
@ -303,8 +303,8 @@ echo_set_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||
multi_mixer_control *control2 = NULL;
|
||||
if (i+1<MMVI->item_count) {
|
||||
id = MMVI->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
||||
if (i+1<mmvi->item_count) {
|
||||
id = mmvi->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("echo_set_mix : invalid control id requested : %li\n", id));
|
||||
} else {
|
||||
@ -320,12 +320,12 @@ echo_set_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
||||
values[1] = 0.0;
|
||||
|
||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||
values[0] = MMVI->values[i].gain;
|
||||
values[0] = mmvi->values[i].gain;
|
||||
else
|
||||
values[1] = MMVI->values[i].gain;
|
||||
values[1] = mmvi->values[i].gain;
|
||||
|
||||
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
|
||||
values[1] = MMVI->values[i+1].gain;
|
||||
values[1] = mmvi->values[i+1].gain;
|
||||
|
||||
control->set(card, control->channel, control->type, values);
|
||||
}
|
||||
@ -337,14 +337,14 @@ echo_set_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = MMVI->values[i].enable ? 1.0 : 0.0;
|
||||
values[0] = mmvi->values[i].enable ? 1.0 : 0.0;
|
||||
control->set(card, control->channel, control->type, values);
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = (float)MMVI->values[i].mux;
|
||||
values[0] = (float)mmvi->values[i].mux;
|
||||
control->set(card, control->channel, control->type, values);
|
||||
}
|
||||
}
|
||||
@ -353,22 +353,22 @@ echo_set_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
||||
|
||||
|
||||
static status_t
|
||||
echo_list_mix_controls(echo_dev *card, multi_mix_control_info * MMCI)
|
||||
echo_list_mix_controls(echo_dev *card, multi_mix_control_info * mmci)
|
||||
{
|
||||
multi_mix_control *MMC;
|
||||
multi_mix_control *mmc;
|
||||
uint32 i;
|
||||
|
||||
MMC = MMCI->controls;
|
||||
if (MMCI->control_count < 24)
|
||||
mmc = mmci->controls;
|
||||
if (mmci->control_count < 24)
|
||||
return B_ERROR;
|
||||
|
||||
if (echo_create_controls_list(&card->multi) < B_OK)
|
||||
return B_ERROR;
|
||||
for (i=0; i<card->multi.control_count; i++) {
|
||||
MMC[i] = card->multi.controls[i].mix_control;
|
||||
for (i = 0; i < card->multi.control_count; i++) {
|
||||
mmc[i] = card->multi.controls[i].mix_control;
|
||||
}
|
||||
|
||||
MMCI->control_count = card->multi.control_count;
|
||||
mmci->control_count = card->multi.control_count;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@ -449,7 +449,7 @@ echo_create_channels_list(multi_dev *multi)
|
||||
else
|
||||
designations = B_CHANNEL_SURROUND_BUS;
|
||||
|
||||
for (i=0; i<stream->channels; i++) {
|
||||
for (i = 0; i < stream->channels; i++) {
|
||||
chans[index].channel_id = index;
|
||||
chans[index].kind = (mode == ECHO_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
||||
chans[index].designations = designations | chan_designations[i];
|
||||
@ -645,7 +645,7 @@ echo_get_buffers(echo_dev *card, multi_buffer_list *data)
|
||||
if (data->request_playback_channels < data->return_playback_channels) {
|
||||
LOG(("not enough channels\n"));
|
||||
}
|
||||
for (i=0; i<current_settings.buffer_count; i++)
|
||||
for (i = 0; i < current_settings.buffer_count; i++)
|
||||
for (j=0; j<stream->channels; j++)
|
||||
echo_stream_get_nth_buffer(stream, j, i,
|
||||
&data->playback_buffers[i][channels+j].base,
|
||||
@ -665,7 +665,7 @@ echo_get_buffers(echo_dev *card, multi_buffer_list *data)
|
||||
if (data->request_record_channels < data->return_record_channels) {
|
||||
LOG(("not enough channels\n"));
|
||||
}
|
||||
for (i=0; i<current_settings.buffer_count; i++)
|
||||
for (i = 0; i < current_settings.buffer_count; i++)
|
||||
for (j=0; j<stream->channels; j++)
|
||||
echo_stream_get_nth_buffer(stream, j, i,
|
||||
&data->record_buffers[i][channels+j].base,
|
||||
@ -926,7 +926,7 @@ echo_open(const char *name, uint32 flags, void** cookie)
|
||||
}
|
||||
}
|
||||
#else
|
||||
for (i=0; i<num_cards; i++) {
|
||||
for (i = 0; i < num_cards; i++) {
|
||||
if (!strcmp(cards[i].name, name)) {
|
||||
card = &cards[i];
|
||||
}
|
||||
|
@ -1473,7 +1473,7 @@ emuxki_stream_set_audioparms(emuxki_stream *stream, bool stereo, uint8 channels,
|
||||
sample_size = stream->b16 + 1;
|
||||
frame_size = sample_size * (stream->stereo ? 2 : 1);
|
||||
|
||||
for (i=0; i<nvoices; i++) {
|
||||
for (i = 0; i < nvoices; i++) {
|
||||
voice = emuxki_voice_new(stream, stream->use, i);
|
||||
if (voice) {
|
||||
if (!stream->first_voice)
|
||||
@ -1709,15 +1709,15 @@ emuxki_gpr_set(emuxki_dev *card, emuxki_gpr *gpr, int32 type, float *values)
|
||||
case EMU_MIX_MUTE:
|
||||
gpr->mute = (values[0] == 1.0);
|
||||
if (gpr->mute) {
|
||||
for (i=0; i<count; i++)
|
||||
for (i = 0; i < count; i++)
|
||||
emuxki_write_gpr(&card->config, gpr->gpr + i, 0);
|
||||
break;
|
||||
}
|
||||
for (i=0; i<count; i++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
values[i] = gpr->current[i];
|
||||
}
|
||||
case EMU_MIX_GAIN:
|
||||
for (i=0; i<count; i++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
if (values[i]>gpr->max_gain || values[i]<gpr->min_gain)
|
||||
return;
|
||||
index = (int32)(values[i] / gpr->granularity);
|
||||
@ -1746,7 +1746,7 @@ emuxki_gpr_get(emuxki_dev *card, emuxki_gpr *gpr, int32 type, float *values)
|
||||
|
||||
switch(type) {
|
||||
case EMU_MIX_GAIN:
|
||||
for (i=0; i<count; i++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
values[i] = gpr->current[i];
|
||||
}
|
||||
break;
|
||||
|
@ -262,7 +262,7 @@ emuxki_create_controls_list(multi_dev *multi)
|
||||
|
||||
parent = emuxki_create_group_control(multi, &index, 0, 0, "Playback");
|
||||
|
||||
for (i=EMU_GPR_FIRST_MIX; i<card->gpr_count; i++) {
|
||||
for (i = EMU_GPR_FIRST_MIX; i < card->gpr_count; i++) {
|
||||
const emuxki_gpr *gpr = &card->gpr[i];
|
||||
if ((gpr->type & EMU_MIX_PLAYBACK) == 0)
|
||||
continue;
|
||||
@ -276,7 +276,7 @@ emuxki_create_controls_list(multi_dev *multi)
|
||||
|
||||
parent = emuxki_create_group_control(multi, &index, 0, 0, "Record");
|
||||
|
||||
for (i=EMU_GPR_FIRST_MIX; i<card->gpr_count; i++) {
|
||||
for (i = EMU_GPR_FIRST_MIX; i < card->gpr_count; i++) {
|
||||
const emuxki_gpr *gpr = &card->gpr[i];
|
||||
if ((gpr->type & EMU_MIX_RECORD) == 0)
|
||||
continue;
|
||||
@ -401,7 +401,7 @@ emuxki_create_controls_list(multi_dev *multi)
|
||||
if (!IS_LIVE_5_1(&card->config) && !IS_AUDIGY(&card->config))
|
||||
count--;
|
||||
|
||||
for (i=1; i < count ; i++) {
|
||||
for (i = 1; i < count ; i++) {
|
||||
info = &source_info[i];
|
||||
PRINT(("name : %s\n", info->name));
|
||||
|
||||
@ -520,13 +520,13 @@ emuxki_create_controls_list(multi_dev *multi)
|
||||
}
|
||||
|
||||
static status_t
|
||||
emuxki_get_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
|
||||
emuxki_get_mix(emuxki_dev *card, multi_mix_value_info * mmvi)
|
||||
{
|
||||
int32 i;
|
||||
uint32 id;
|
||||
multi_mixer_control *control = NULL;
|
||||
for (i=0; i<MMVI->item_count; i++) {
|
||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
for (i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("emuxki_get_mix : invalid control id requested : %li\n", id));
|
||||
continue;
|
||||
@ -538,35 +538,35 @@ emuxki_get_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
|
||||
float values[2];
|
||||
control->get(card, control->cookie, control->type, values);
|
||||
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||
MMVI->values[i].u.gain = values[0];
|
||||
mmvi->values[i].u.gain = values[0];
|
||||
else
|
||||
MMVI->values[i].u.gain = values[1];
|
||||
mmvi->values[i].u.gain = values[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||
float values[1];
|
||||
control->get(card, control->cookie, control->type, values);
|
||||
MMVI->values[i].u.enable = (values[0] == 1.0);
|
||||
mmvi->values[i].u.enable = (values[0] == 1.0);
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||
float values[1];
|
||||
control->get(card, control->cookie, control->type, values);
|
||||
MMVI->values[i].u.mux = (int32)values[0];
|
||||
mmvi->values[i].u.mux = (int32)values[0];
|
||||
}
|
||||
}
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
static status_t
|
||||
emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
|
||||
emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * mmvi)
|
||||
{
|
||||
int32 i;
|
||||
uint32 id;
|
||||
multi_mixer_control *control = NULL;
|
||||
for (i=0; i<MMVI->item_count; i++) {
|
||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
for (i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("emuxki_set_mix : invalid control id requested : %li\n", id));
|
||||
continue;
|
||||
@ -575,8 +575,8 @@ emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||
multi_mixer_control *control2 = NULL;
|
||||
if (i+1<MMVI->item_count) {
|
||||
id = MMVI->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if (i+1<mmvi->item_count) {
|
||||
id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= card->multi.control_count) {
|
||||
PRINT(("emuxki_set_mix : invalid control id requested : %li\n", id));
|
||||
} else {
|
||||
@ -592,12 +592,12 @@ emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
|
||||
values[1] = 0.0;
|
||||
|
||||
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||
values[0] = MMVI->values[i].u.gain;
|
||||
values[0] = mmvi->values[i].u.gain;
|
||||
else
|
||||
values[1] = MMVI->values[i].u.gain;
|
||||
values[1] = mmvi->values[i].u.gain;
|
||||
|
||||
if (control2 && control2->mix_control.master != EMU_MULTI_CONTROL_MASTERID)
|
||||
values[1] = MMVI->values[i+1].u.gain;
|
||||
values[1] = mmvi->values[i+1].u.gain;
|
||||
|
||||
control->set(card, control->cookie, control->type, values);
|
||||
}
|
||||
@ -609,14 +609,14 @@ emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
|
||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = MMVI->values[i].u.enable ? 1.0 : 0.0;
|
||||
values[0] = mmvi->values[i].u.enable ? 1.0 : 0.0;
|
||||
control->set(card, control->cookie, control->type, values);
|
||||
}
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = (float)MMVI->values[i].u.mux;
|
||||
values[0] = (float)mmvi->values[i].u.mux;
|
||||
control->set(card, control->cookie, control->type, values);
|
||||
}
|
||||
}
|
||||
@ -624,22 +624,22 @@ emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
|
||||
}
|
||||
|
||||
static status_t
|
||||
emuxki_list_mix_controls(emuxki_dev *card, multi_mix_control_info * MMCI)
|
||||
emuxki_list_mix_controls(emuxki_dev *card, multi_mix_control_info * mmci)
|
||||
{
|
||||
multi_mix_control *MMC;
|
||||
multi_mix_control *mmc;
|
||||
uint32 i;
|
||||
|
||||
MMC = MMCI->controls;
|
||||
if (MMCI->control_count < EMU_MULTICONTROLSNUM)
|
||||
mmc = mmci->controls;
|
||||
if (mmci->control_count < EMU_MULTICONTROLSNUM)
|
||||
return B_ERROR;
|
||||
|
||||
if (emuxki_create_controls_list(&card->multi) < B_OK)
|
||||
return B_ERROR;
|
||||
for (i=0; i<card->multi.control_count; i++) {
|
||||
MMC[i] = card->multi.controls[i].mix_control;
|
||||
for (i = 0; i < card->multi.control_count; i++) {
|
||||
mmc[i] = card->multi.controls[i].mix_control;
|
||||
}
|
||||
|
||||
MMCI->control_count = card->multi.control_count;
|
||||
mmci->control_count = card->multi.control_count;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@ -719,7 +719,7 @@ emuxki_create_channels_list(multi_dev *multi)
|
||||
else
|
||||
designations = B_CHANNEL_SURROUND_BUS;
|
||||
|
||||
for (i=0; i<nchannels; i++) {
|
||||
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];
|
||||
@ -921,13 +921,13 @@ emuxki_get_buffers(emuxki_dev *card, multi_buffer_list *data)
|
||||
data->return_playback_channels = pchannels + pchannels2; /* playback_buffers[][c] */
|
||||
data->return_playback_buffer_size = current_settings.buffer_frames; /* frames */
|
||||
|
||||
for (i=0; i<current_settings.buffer_count; i++)
|
||||
for (i = 0; i < current_settings.buffer_count; i++)
|
||||
for (j=0; j<pchannels; j++)
|
||||
emuxki_stream_get_nth_buffer(card->pstream, j, i,
|
||||
&data->playback_buffers[i][j].base,
|
||||
&data->playback_buffers[i][j].stride);
|
||||
|
||||
for (i=0; i<current_settings.buffer_count; i++)
|
||||
for (i = 0; i < current_settings.buffer_count; i++)
|
||||
for (j=0; j<pchannels2; j++)
|
||||
emuxki_stream_get_nth_buffer(card->pstream2, j, i,
|
||||
&data->playback_buffers[i][pchannels + j].base,
|
||||
@ -937,13 +937,13 @@ emuxki_get_buffers(emuxki_dev *card, multi_buffer_list *data)
|
||||
data->return_record_channels = rchannels + rchannels2;
|
||||
data->return_record_buffer_size = current_settings.buffer_frames; /* frames */
|
||||
|
||||
for (i=0; i<current_settings.buffer_count; i++)
|
||||
for (i = 0; i < current_settings.buffer_count; i++)
|
||||
for (j=0; j<rchannels; j++)
|
||||
emuxki_stream_get_nth_buffer(card->rstream, j, i,
|
||||
&data->record_buffers[i][j].base,
|
||||
&data->record_buffers[i][j].stride);
|
||||
|
||||
for (i=0; i<current_settings.buffer_count; i++)
|
||||
for (i = 0; i < current_settings.buffer_count; i++)
|
||||
for (j=0; j<rchannels2; j++)
|
||||
emuxki_stream_get_nth_buffer(card->rstream2, j, i,
|
||||
&data->record_buffers[i][rchannels + j].base,
|
||||
|
@ -459,19 +459,19 @@ hda_create_controls_list(hda_multi *multi)
|
||||
|
||||
|
||||
static status_t
|
||||
list_mix_controls(hda_audio_group* audioGroup, multi_mix_control_info* MMCI)
|
||||
list_mix_controls(hda_audio_group* audioGroup, multi_mix_control_info* mmci)
|
||||
{
|
||||
multi_mix_control *MMC = MMCI->controls;
|
||||
if (MMCI->control_count < 24)
|
||||
multi_mix_control *mmc = mmci->controls;
|
||||
if (mmci->control_count < 24)
|
||||
return B_ERROR;
|
||||
|
||||
if (hda_create_controls_list(audioGroup->multi) < B_OK)
|
||||
return B_ERROR;
|
||||
for (uint32 i = 0; i<audioGroup->multi->control_count; i++) {
|
||||
MMC[i] = audioGroup->multi->controls[i].mix_control;
|
||||
for (uint32 i = 0; i < audioGroup->multi->control_count; i++) {
|
||||
mmc[i] = audioGroup->multi->controls[i].mix_control;
|
||||
}
|
||||
|
||||
MMCI->control_count = audioGroup->multi->control_count;
|
||||
mmci->control_count = audioGroup->multi->control_count;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@ -511,12 +511,12 @@ get_control_gain_mute(hda_audio_group* audioGroup, hda_multi_mixer_control *cont
|
||||
|
||||
|
||||
static status_t
|
||||
get_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
||||
get_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
{
|
||||
uint32 id;
|
||||
hda_multi_mixer_control *control = NULL;
|
||||
for (int32 i = 0; i < MMVI->item_count; i++) {
|
||||
id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= audioGroup->multi->control_count) {
|
||||
dprintf("hda: get_mix : invalid control id requested : %li\n", id);
|
||||
continue;
|
||||
@ -527,17 +527,17 @@ get_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
||||
uint32 resp[2];
|
||||
get_control_gain_mute(audioGroup, control, resp);
|
||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE) {
|
||||
MMVI->values[i].enable = (resp[0] & AMP_MUTE) != 0;
|
||||
TRACE("get_mix: %ld mute: %d\n", control->nid, MMVI->values[i].enable);
|
||||
mmvi->values[i].enable = (resp[0] & AMP_MUTE) != 0;
|
||||
TRACE("get_mix: %ld mute: %d\n", control->nid, mmvi->values[i].enable);
|
||||
} else if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||
uint32 value;
|
||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||
value = resp[0] & AMP_GAIN_MASK;
|
||||
else
|
||||
value = resp[1] & AMP_GAIN_MASK;
|
||||
MMVI->values[i].gain = (0.0 + value - AMP_CAP_OFFSET(control->capabilities))
|
||||
mmvi->values[i].gain = (0.0 + value - AMP_CAP_OFFSET(control->capabilities))
|
||||
* AMP_CAP_STEP_SIZE(control->capabilities);
|
||||
TRACE("get_mix: %ld gain: %f (%ld)\n", control->nid, MMVI->values[i].gain, value);
|
||||
TRACE("get_mix: %ld gain: %f (%ld)\n", control->nid, mmvi->values[i].gain, value);
|
||||
}
|
||||
|
||||
|
||||
@ -546,7 +546,7 @@ get_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
||||
/*if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||
float values[1];
|
||||
control->get(audioGroup, control, values);
|
||||
MMVI->values[i].mux = (int32)values[0];
|
||||
mmvi->values[i].mux = (int32)values[0];
|
||||
}*/
|
||||
}
|
||||
return B_OK;
|
||||
@ -554,12 +554,12 @@ get_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
||||
|
||||
|
||||
static status_t
|
||||
set_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
||||
set_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi)
|
||||
{
|
||||
uint32 id;
|
||||
hda_multi_mixer_control *control = NULL;
|
||||
for (int32 i = 0; i < MMVI->item_count; i++) {
|
||||
id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||
id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= audioGroup->multi->control_count) {
|
||||
dprintf("set_mix : invalid control id requested : %li\n", id);
|
||||
continue;
|
||||
@ -567,7 +567,7 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
||||
control = &audioGroup->multi->controls[id];
|
||||
|
||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE) {
|
||||
control->mute = (MMVI->values[i].enable ? AMP_MUTE : 0);
|
||||
control->mute = (mmvi->values[i].enable ? AMP_MUTE : 0);
|
||||
TRACE("set_mix: %ld mute: %lx\n", control->nid, control->mute);
|
||||
uint32 resp[2];
|
||||
get_control_gain_mute(audioGroup, control, resp);
|
||||
@ -601,8 +601,8 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
||||
hda_send_verbs(audioGroup->codec, verb, NULL, 2);
|
||||
} else if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||
hda_multi_mixer_control *control2 = NULL;
|
||||
if (i+1<MMVI->item_count) {
|
||||
id = MMVI->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
||||
if (i+1<mmvi->item_count) {
|
||||
id = mmvi->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
||||
if (id < 0 || id >= audioGroup->multi->control_count) {
|
||||
dprintf("set_mix : invalid control id requested : %li\n", id);
|
||||
} else {
|
||||
@ -613,11 +613,11 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
||||
}
|
||||
|
||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||
control->gain = (uint32)(MMVI->values[i].gain / AMP_CAP_STEP_SIZE(control->capabilities)
|
||||
control->gain = (uint32)(mmvi->values[i].gain / AMP_CAP_STEP_SIZE(control->capabilities)
|
||||
+ AMP_CAP_OFFSET(control->capabilities));
|
||||
|
||||
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
|
||||
control2->gain = (uint32)(MMVI->values[i+1].gain / AMP_CAP_STEP_SIZE(control2->capabilities)
|
||||
control2->gain = (uint32)(mmvi->values[i+1].gain / AMP_CAP_STEP_SIZE(control2->capabilities)
|
||||
+ AMP_CAP_OFFSET(control2->capabilities));
|
||||
TRACE("set_mix: %ld gain: %lx and %ld gain: %lx\n",
|
||||
control->nid, control->gain, control2->nid, control2->gain);
|
||||
@ -664,7 +664,7 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
||||
/*if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||
float values[1];
|
||||
|
||||
values[0] = (float)MMVI->values[i].mux;
|
||||
values[0] = (float)mmvi->values[i].mux;
|
||||
control->set(card, control->channel, control->type, values);
|
||||
}*/
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user