* 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:
@@ -210,7 +210,7 @@ auich_stream_commit_parms(auich_stream *stream)
|
|||||||
|
|
||||||
page = stream->dmaops_log_base;
|
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) +
|
page[2*i] = ((uint32)stream->buffer->phy_base) +
|
||||||
(i % stream->bufcount) * stream->blksize;
|
(i % stream->bufcount) * stream->blksize;
|
||||||
page[2*i + 1] = AUICH_DMAF_IOC | (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;
|
count = source_info_size;
|
||||||
//Note that we ignore first item in source_info
|
//Note that we ignore first item in source_info
|
||||||
//It's for recording, but do match this with ac97.c's 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];
|
info = &source_info[i];
|
||||||
PRINT(("name : %s\n", info->name));
|
PRINT(("name : %s\n", info->name));
|
||||||
|
|
||||||
@@ -387,12 +387,12 @@ auich_create_controls_list(multi_dev *multi)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
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;
|
int32 i, id;
|
||||||
multi_mixer_control *control = NULL;
|
multi_mixer_control *control = NULL;
|
||||||
for (i=0; i<MMVI->item_count; i++) {
|
for (i = 0; i < mmvi->item_count; i++) {
|
||||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= card->multi.control_count) {
|
if (id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("auich_get_mix : invalid control id requested : %li\n", id));
|
PRINT(("auich_get_mix : invalid control id requested : %li\n", id));
|
||||||
continue;
|
continue;
|
||||||
@@ -404,22 +404,22 @@ auich_get_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
|||||||
float values[2];
|
float values[2];
|
||||||
control->get(card, control->cookie, control->type, values);
|
control->get(card, control->cookie, control->type, values);
|
||||||
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||||
MMVI->values[i].u.gain = values[0];
|
mmvi->values[i].u.gain = values[0];
|
||||||
else
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->cookie, control->type, values);
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->cookie, control->type, values);
|
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;
|
return B_OK;
|
||||||
@@ -427,12 +427,12 @@ auich_get_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
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;
|
int32 i, id;
|
||||||
multi_mixer_control *control = NULL;
|
multi_mixer_control *control = NULL;
|
||||||
for (i=0; i<MMVI->item_count; i++) {
|
for (i = 0; i < mmvi->item_count; i++) {
|
||||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= card->multi.control_count) {
|
if (id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("auich_set_mix : invalid control id requested : %li\n", id));
|
PRINT(("auich_set_mix : invalid control id requested : %li\n", id));
|
||||||
continue;
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
multi_mixer_control *control2 = NULL;
|
multi_mixer_control *control2 = NULL;
|
||||||
if (i+1<MMVI->item_count) {
|
if (i+1<mmvi->item_count) {
|
||||||
id = MMVI->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= card->multi.control_count) {
|
if (id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("auich_set_mix : invalid control id requested : %li\n", id));
|
PRINT(("auich_set_mix : invalid control id requested : %li\n", id));
|
||||||
} else {
|
} else {
|
||||||
@@ -458,12 +458,12 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * MMVI)
|
|||||||
values[1] = 0.0;
|
values[1] = 0.0;
|
||||||
|
|
||||||
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||||
values[0] = MMVI->values[i].u.gain;
|
values[0] = mmvi->values[i].u.gain;
|
||||||
else
|
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)
|
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);
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||||
float values[1];
|
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);
|
control->set(card, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||||
float values[1];
|
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);
|
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
|
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;
|
int32 i;
|
||||||
|
|
||||||
MMC = MMCI->controls;
|
mmc = mmci->controls;
|
||||||
if (MMCI->control_count < 24)
|
if (mmci->control_count < 24)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if (auich_create_controls_list(&card->multi) < B_OK)
|
if (auich_create_controls_list(&card->multi) < B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
for (i=0; i<card->multi.control_count; i++) {
|
for (i = 0; i < card->multi.control_count; i++) {
|
||||||
MMC[i] = card->multi.controls[i].mix_control;
|
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;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,7 +586,7 @@ auich_create_channels_list(multi_dev *multi)
|
|||||||
else
|
else
|
||||||
designations = B_CHANNEL_SURROUND_BUS;
|
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].channel_id = index;
|
||||||
chans[index].kind = (mode == AUICH_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
chans[index].kind = (mode == AUICH_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
||||||
chans[index].designations = designations | chan_designations[i];
|
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)
|
if (bufcount > data->request_playback_buffers)
|
||||||
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++)
|
for (j=0; j<pchannels; j++)
|
||||||
auich_stream_get_nth_buffer(card->pstream, j, i,
|
auich_stream_get_nth_buffer(card->pstream, j, i,
|
||||||
&data->playback_buffers[i][j].base,
|
&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)
|
if (bufcount > data->request_record_buffers)
|
||||||
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++)
|
for (j=0; j<rchannels; j++)
|
||||||
auich_stream_get_nth_buffer(card->rstream, j, i,
|
auich_stream_get_nth_buffer(card->rstream, j, i,
|
||||||
&data->record_buffers[i][j].base,
|
&data->record_buffers[i][j].base,
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ auvia_stream_commit_parms(auvia_stream *stream)
|
|||||||
|
|
||||||
page = stream->dmaops_log_base;
|
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) +
|
page[2*i] = ((uint32)stream->buffer->phy_base) +
|
||||||
i * stream->blksize;
|
i * stream->blksize;
|
||||||
page[2*i + 1] = AUVIA_DMAOP_FLAG | stream->blksize;
|
page[2*i + 1] = AUVIA_DMAOP_FLAG | stream->blksize;
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ auvia_codec_waitready(device_config *config)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* poll until codec not busy */
|
/* 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++)
|
+ AUVIA_CODEC_CTL) & AUVIA_CODEC_BUSY) ; i++)
|
||||||
spin(1);
|
spin(1);
|
||||||
if(i>=AUVIA_TIMEOUT) {
|
if(i>=AUVIA_TIMEOUT) {
|
||||||
@@ -99,7 +99,7 @@ auvia_codec_waitvalid(device_config *config)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* poll until codec valid */
|
/* 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++)
|
+ AUVIA_CODEC_CTL) & AUVIA_CODEC_PRIVALID) ; i++)
|
||||||
spin(1);
|
spin(1);
|
||||||
if(i>=AUVIA_TIMEOUT) {
|
if(i>=AUVIA_TIMEOUT) {
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
count = source_info_size;
|
count = source_info_size;
|
||||||
count--;
|
count--;
|
||||||
|
|
||||||
for(i=1; i < count ; i++) {
|
for(i = 1; i < count ; i++) {
|
||||||
info = &source_info[i];
|
info = &source_info[i];
|
||||||
PRINT(("name : %s\n", info->name));
|
PRINT(("name : %s\n", info->name));
|
||||||
|
|
||||||
@@ -386,12 +386,12 @@ auvia_create_controls_list(multi_dev *multi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
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;
|
int32 i, id;
|
||||||
multi_mixer_control *control = NULL;
|
multi_mixer_control *control = NULL;
|
||||||
for(i=0; i<MMVI->item_count; i++) {
|
for(i = 0; i < mmvi->item_count; i++) {
|
||||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||||
if(id < 0 || id >= card->multi.control_count) {
|
if(id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("auvia_get_mix : invalid control id requested : %li\n", id));
|
PRINT(("auvia_get_mix : invalid control id requested : %li\n", id));
|
||||||
continue;
|
continue;
|
||||||
@@ -403,34 +403,34 @@ auvia_get_mix(auvia_dev *card, multi_mix_value_info * MMVI)
|
|||||||
float values[2];
|
float values[2];
|
||||||
control->get(card, control->cookie, control->type, values);
|
control->get(card, control->cookie, control->type, values);
|
||||||
if(control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
if(control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||||
MMVI->values[i].u.gain = values[0];
|
mmvi->values[i].u.gain = values[0];
|
||||||
else
|
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) {
|
if(control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->cookie, control->type, values);
|
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) {
|
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->cookie, control->type, values);
|
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;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
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;
|
int32 i, id;
|
||||||
multi_mixer_control *control = NULL;
|
multi_mixer_control *control = NULL;
|
||||||
for(i=0; i<MMVI->item_count; i++) {
|
for(i = 0; i < mmvi->item_count; i++) {
|
||||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||||
if(id < 0 || id >= card->multi.control_count) {
|
if(id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("auvia_set_mix : invalid control id requested : %li\n", id));
|
PRINT(("auvia_set_mix : invalid control id requested : %li\n", id));
|
||||||
continue;
|
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) {
|
if(control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
multi_mixer_control *control2 = NULL;
|
multi_mixer_control *control2 = NULL;
|
||||||
if(i+1<MMVI->item_count) {
|
if(i+1<mmvi->item_count) {
|
||||||
id = MMVI->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||||
if(id < 0 || id >= card->multi.control_count) {
|
if(id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("auvia_set_mix : invalid control id requested : %li\n", id));
|
PRINT(("auvia_set_mix : invalid control id requested : %li\n", id));
|
||||||
} else {
|
} else {
|
||||||
@@ -456,12 +456,12 @@ auvia_set_mix(auvia_dev *card, multi_mix_value_info * MMVI)
|
|||||||
values[1] = 0.0;
|
values[1] = 0.0;
|
||||||
|
|
||||||
if(control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
if(control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||||
values[0] = MMVI->values[i].u.gain;
|
values[0] = mmvi->values[i].u.gain;
|
||||||
else
|
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)
|
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);
|
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) {
|
if(control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||||
float values[1];
|
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);
|
control->set(card, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
if(control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||||
float values[1];
|
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);
|
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
|
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;
|
int32 i;
|
||||||
|
|
||||||
MMC = MMCI->controls;
|
mmc = mmci->controls;
|
||||||
if(MMCI->control_count < 24)
|
if(mmci->control_count < 24)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if(auvia_create_controls_list(&card->multi) < B_OK)
|
if(auvia_create_controls_list(&card->multi) < B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
for(i=0; i<card->multi.control_count; i++) {
|
for(i = 0; i < card->multi.control_count; i++) {
|
||||||
MMC[i] = card->multi.controls[i].mix_control;
|
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;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -581,7 +581,7 @@ auvia_create_channels_list(multi_dev *multi)
|
|||||||
else
|
else
|
||||||
designations = B_CHANNEL_SURROUND_BUS;
|
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].channel_id = index;
|
||||||
chans[index].kind = (mode == AUVIA_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
chans[index].kind = (mode == AUVIA_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
||||||
chans[index].designations = designations | chan_designations[i];
|
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_channels = pchannels; /* playback_buffers[][c] */
|
||||||
data->return_playback_buffer_size = BUFFER_FRAMES; /* frames */
|
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++)
|
for(j=0; j<pchannels; j++)
|
||||||
auvia_stream_get_nth_buffer(card->pstream, j, i,
|
auvia_stream_get_nth_buffer(card->pstream, j, i,
|
||||||
&data->playback_buffers[i][j].base,
|
&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_channels = rchannels;
|
||||||
data->return_record_buffer_size = BUFFER_FRAMES; /* frames */
|
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++)
|
for(j=0; j<rchannels; j++)
|
||||||
auvia_stream_get_nth_buffer(card->rstream, j, i,
|
auvia_stream_get_nth_buffer(card->rstream, j, i,
|
||||||
&data->record_buffers[i][j].base,
|
&data->record_buffers[i][j].base,
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ create_controls_list(geode_multi *multi)
|
|||||||
count = source_info_size;
|
count = source_info_size;
|
||||||
//Note that we ignore first item in source_info
|
//Note that we ignore first item in source_info
|
||||||
//It's for recording, but do match this with ac97.c's 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];
|
info = &source_info[i];
|
||||||
TRACE("name : %s\n", info->name);
|
TRACE("name : %s\n", info->name);
|
||||||
|
|
||||||
@@ -525,19 +525,19 @@ create_controls_list(geode_multi *multi)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
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;
|
multi_mix_control* mmc = mmci->controls;
|
||||||
if (MMCI->control_count < 24)
|
if (mmci->control_count < 24)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if (create_controls_list(controller->multi) < B_OK)
|
if (create_controls_list(controller->multi) < B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
for (uint32 i = 0; i < controller->multi->control_count; i++) {
|
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;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,10 +559,10 @@ list_mix_channels(geode_controller* controller, multi_mix_channel_info *data)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
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++) {
|
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||||
uint32 id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
uint32 id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= controller->multi->control_count) {
|
if (id < 0 || id >= controller->multi->control_count) {
|
||||||
dprintf("geode_get_mix : invalid control id requested : %li\n", id);
|
dprintf("geode_get_mix : invalid control id requested : %li\n", id);
|
||||||
continue;
|
continue;
|
||||||
@@ -574,22 +574,22 @@ get_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
|||||||
float values[2];
|
float values[2];
|
||||||
control->get(controller, control->cookie, control->type, values);
|
control->get(controller, control->cookie, control->type, values);
|
||||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||||
MMVI->values[i].gain = values[0];
|
mmvi->values[i].gain = values[0];
|
||||||
else
|
else
|
||||||
MMVI->values[i].gain = values[1];
|
mmvi->values[i].gain = values[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(controller, control->cookie, control->type, values);
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(controller, control->cookie, control->type, values);
|
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;
|
return B_OK;
|
||||||
@@ -597,11 +597,11 @@ get_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
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;
|
geode_multi *multi = controller->multi;
|
||||||
for (int32 i = 0; i < MMVI->item_count; i++) {
|
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||||
uint32 id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
uint32 id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= multi->control_count) {
|
if (id < 0 || id >= multi->control_count) {
|
||||||
dprintf("geode_set_mix : invalid control id requested : %li\n", id);
|
dprintf("geode_set_mix : invalid control id requested : %li\n", id);
|
||||||
continue;
|
continue;
|
||||||
@@ -610,8 +610,8 @@ set_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
|||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
multi_mixer_control *control2 = NULL;
|
multi_mixer_control *control2 = NULL;
|
||||||
if (i+1<MMVI->item_count) {
|
if (i+1<mmvi->item_count) {
|
||||||
id = MMVI->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= multi->control_count) {
|
if (id < 0 || id >= multi->control_count) {
|
||||||
dprintf("geode_set_mix : invalid control id requested : %li\n", id);
|
dprintf("geode_set_mix : invalid control id requested : %li\n", id);
|
||||||
} else {
|
} else {
|
||||||
@@ -627,12 +627,12 @@ set_mix(geode_controller *controller, multi_mix_value_info * MMVI)
|
|||||||
values[1] = 0.0;
|
values[1] = 0.0;
|
||||||
|
|
||||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||||
values[0] = MMVI->values[i].gain;
|
values[0] = mmvi->values[i].gain;
|
||||||
else
|
else
|
||||||
values[1] = MMVI->values[i].gain;
|
values[1] = mmvi->values[i].gain;
|
||||||
|
|
||||||
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
|
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);
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||||
float values[1];
|
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);
|
control->set(controller, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||||
float values[1];
|
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);
|
control->set(controller, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ echo_stream_set_audioparms(echo_stream *stream, uint8 channels,
|
|||||||
|
|
||||||
uint32 dwNumFreeEntries = 0;
|
uint32 dwNumFreeEntries = 0;
|
||||||
|
|
||||||
for (i=0; i<stream->bufcount; i++) {
|
for (i = 0; i < stream->bufcount; i++) {
|
||||||
duck->AddMapping(((uint32)stream->buffer->phy_base) +
|
duck->AddMapping(((uint32)stream->buffer->phy_base) +
|
||||||
i * stream->blksize, stream->blksize, 0, TRUE, dwNumFreeEntries);
|
i * stream->blksize, stream->blksize, 0, TRUE, dwNumFreeEntries);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ echo_create_controls_list(multi_dev *multi)
|
|||||||
MIXER_AUDIO_CHANNEL channel;
|
MIXER_AUDIO_CHANNEL channel;
|
||||||
channel.wCardId = 0;
|
channel.wCardId = 0;
|
||||||
channel.dwType = ECHO_BUS_OUT;
|
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;
|
channel.wChannel = i * 2;
|
||||||
parent2 = echo_create_group_control(multi, &index, parent, S_null, "Output");
|
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);
|
parent = echo_create_group_control(multi, &index, 0, S_INPUT, NULL);
|
||||||
|
|
||||||
channel.dwType = ECHO_BUS_IN;
|
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;
|
channel.wChannel = i * 2;
|
||||||
|
|
||||||
parent2 = echo_create_group_control(multi, &index, parent, S_null, "Input");
|
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
|
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;
|
int32 i;
|
||||||
uint32 id;
|
uint32 id;
|
||||||
multi_mixer_control *control = NULL;
|
multi_mixer_control *control = NULL;
|
||||||
for (i=0; i<MMVI->item_count; i++) {
|
for (i = 0; i < mmvi->item_count; i++) {
|
||||||
id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= card->multi.control_count) {
|
if (id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("echo_get_mix : invalid control id requested : %li\n", id));
|
PRINT(("echo_get_mix : invalid control id requested : %li\n", id));
|
||||||
continue;
|
continue;
|
||||||
@@ -265,22 +265,22 @@ echo_get_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
|||||||
float values[2];
|
float values[2];
|
||||||
control->get(card, control->channel, control->type, values);
|
control->get(card, control->channel, control->type, values);
|
||||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||||
MMVI->values[i].gain = values[0];
|
mmvi->values[i].gain = values[0];
|
||||||
else
|
else
|
||||||
MMVI->values[i].gain = values[1];
|
mmvi->values[i].gain = values[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->channel, control->type, values);
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->channel, control->type, values);
|
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;
|
return B_OK;
|
||||||
@@ -288,13 +288,13 @@ echo_get_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
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;
|
int32 i;
|
||||||
uint32 id;
|
uint32 id;
|
||||||
multi_mixer_control *control = NULL;
|
multi_mixer_control *control = NULL;
|
||||||
for (i=0; i<MMVI->item_count; i++) {
|
for (i = 0; i < mmvi->item_count; i++) {
|
||||||
id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= card->multi.control_count) {
|
if (id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("echo_set_mix : invalid control id requested : %li\n", id));
|
PRINT(("echo_set_mix : invalid control id requested : %li\n", id));
|
||||||
continue;
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
multi_mixer_control *control2 = NULL;
|
multi_mixer_control *control2 = NULL;
|
||||||
if (i+1<MMVI->item_count) {
|
if (i+1<mmvi->item_count) {
|
||||||
id = MMVI->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= card->multi.control_count) {
|
if (id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("echo_set_mix : invalid control id requested : %li\n", id));
|
PRINT(("echo_set_mix : invalid control id requested : %li\n", id));
|
||||||
} else {
|
} else {
|
||||||
@@ -320,12 +320,12 @@ echo_set_mix(echo_dev *card, multi_mix_value_info * MMVI)
|
|||||||
values[1] = 0.0;
|
values[1] = 0.0;
|
||||||
|
|
||||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||||
values[0] = MMVI->values[i].gain;
|
values[0] = mmvi->values[i].gain;
|
||||||
else
|
else
|
||||||
values[1] = MMVI->values[i].gain;
|
values[1] = mmvi->values[i].gain;
|
||||||
|
|
||||||
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
|
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);
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||||
float values[1];
|
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);
|
control->set(card, control->channel, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||||
float values[1];
|
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);
|
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
|
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;
|
uint32 i;
|
||||||
|
|
||||||
MMC = MMCI->controls;
|
mmc = mmci->controls;
|
||||||
if (MMCI->control_count < 24)
|
if (mmci->control_count < 24)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if (echo_create_controls_list(&card->multi) < B_OK)
|
if (echo_create_controls_list(&card->multi) < B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
for (i=0; i<card->multi.control_count; i++) {
|
for (i = 0; i < card->multi.control_count; i++) {
|
||||||
MMC[i] = card->multi.controls[i].mix_control;
|
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;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,7 +449,7 @@ echo_create_channels_list(multi_dev *multi)
|
|||||||
else
|
else
|
||||||
designations = B_CHANNEL_SURROUND_BUS;
|
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].channel_id = index;
|
||||||
chans[index].kind = (mode == ECHO_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
chans[index].kind = (mode == ECHO_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
||||||
chans[index].designations = designations | chan_designations[i];
|
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) {
|
if (data->request_playback_channels < data->return_playback_channels) {
|
||||||
LOG(("not enough channels\n"));
|
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++)
|
for (j=0; j<stream->channels; j++)
|
||||||
echo_stream_get_nth_buffer(stream, j, i,
|
echo_stream_get_nth_buffer(stream, j, i,
|
||||||
&data->playback_buffers[i][channels+j].base,
|
&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) {
|
if (data->request_record_channels < data->return_record_channels) {
|
||||||
LOG(("not enough channels\n"));
|
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++)
|
for (j=0; j<stream->channels; j++)
|
||||||
echo_stream_get_nth_buffer(stream, j, i,
|
echo_stream_get_nth_buffer(stream, j, i,
|
||||||
&data->record_buffers[i][channels+j].base,
|
&data->record_buffers[i][channels+j].base,
|
||||||
@@ -926,7 +926,7 @@ echo_open(const char *name, uint32 flags, void** cookie)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
for (i=0; i<num_cards; i++) {
|
for (i = 0; i < num_cards; i++) {
|
||||||
if (!strcmp(cards[i].name, name)) {
|
if (!strcmp(cards[i].name, name)) {
|
||||||
card = &cards[i];
|
card = &cards[i];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1473,7 +1473,7 @@ emuxki_stream_set_audioparms(emuxki_stream *stream, bool stereo, uint8 channels,
|
|||||||
sample_size = stream->b16 + 1;
|
sample_size = stream->b16 + 1;
|
||||||
frame_size = sample_size * (stream->stereo ? 2 : 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);
|
voice = emuxki_voice_new(stream, stream->use, i);
|
||||||
if (voice) {
|
if (voice) {
|
||||||
if (!stream->first_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:
|
case EMU_MIX_MUTE:
|
||||||
gpr->mute = (values[0] == 1.0);
|
gpr->mute = (values[0] == 1.0);
|
||||||
if (gpr->mute) {
|
if (gpr->mute) {
|
||||||
for (i=0; i<count; i++)
|
for (i = 0; i < count; i++)
|
||||||
emuxki_write_gpr(&card->config, gpr->gpr + i, 0);
|
emuxki_write_gpr(&card->config, gpr->gpr + i, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (i=0; i<count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
values[i] = gpr->current[i];
|
values[i] = gpr->current[i];
|
||||||
}
|
}
|
||||||
case EMU_MIX_GAIN:
|
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)
|
if (values[i]>gpr->max_gain || values[i]<gpr->min_gain)
|
||||||
return;
|
return;
|
||||||
index = (int32)(values[i] / gpr->granularity);
|
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) {
|
switch(type) {
|
||||||
case EMU_MIX_GAIN:
|
case EMU_MIX_GAIN:
|
||||||
for (i=0; i<count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
values[i] = gpr->current[i];
|
values[i] = gpr->current[i];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ emuxki_create_controls_list(multi_dev *multi)
|
|||||||
|
|
||||||
parent = emuxki_create_group_control(multi, &index, 0, 0, "Playback");
|
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];
|
const emuxki_gpr *gpr = &card->gpr[i];
|
||||||
if ((gpr->type & EMU_MIX_PLAYBACK) == 0)
|
if ((gpr->type & EMU_MIX_PLAYBACK) == 0)
|
||||||
continue;
|
continue;
|
||||||
@@ -276,7 +276,7 @@ emuxki_create_controls_list(multi_dev *multi)
|
|||||||
|
|
||||||
parent = emuxki_create_group_control(multi, &index, 0, 0, "Record");
|
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];
|
const emuxki_gpr *gpr = &card->gpr[i];
|
||||||
if ((gpr->type & EMU_MIX_RECORD) == 0)
|
if ((gpr->type & EMU_MIX_RECORD) == 0)
|
||||||
continue;
|
continue;
|
||||||
@@ -401,7 +401,7 @@ emuxki_create_controls_list(multi_dev *multi)
|
|||||||
if (!IS_LIVE_5_1(&card->config) && !IS_AUDIGY(&card->config))
|
if (!IS_LIVE_5_1(&card->config) && !IS_AUDIGY(&card->config))
|
||||||
count--;
|
count--;
|
||||||
|
|
||||||
for (i=1; i < count ; i++) {
|
for (i = 1; i < count ; i++) {
|
||||||
info = &source_info[i];
|
info = &source_info[i];
|
||||||
PRINT(("name : %s\n", info->name));
|
PRINT(("name : %s\n", info->name));
|
||||||
|
|
||||||
@@ -520,13 +520,13 @@ emuxki_create_controls_list(multi_dev *multi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
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;
|
int32 i;
|
||||||
uint32 id;
|
uint32 id;
|
||||||
multi_mixer_control *control = NULL;
|
multi_mixer_control *control = NULL;
|
||||||
for (i=0; i<MMVI->item_count; i++) {
|
for (i = 0; i < mmvi->item_count; i++) {
|
||||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= card->multi.control_count) {
|
if (id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("emuxki_get_mix : invalid control id requested : %li\n", id));
|
PRINT(("emuxki_get_mix : invalid control id requested : %li\n", id));
|
||||||
continue;
|
continue;
|
||||||
@@ -538,35 +538,35 @@ emuxki_get_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
|
|||||||
float values[2];
|
float values[2];
|
||||||
control->get(card, control->cookie, control->type, values);
|
control->get(card, control->cookie, control->type, values);
|
||||||
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||||
MMVI->values[i].u.gain = values[0];
|
mmvi->values[i].u.gain = values[0];
|
||||||
else
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->cookie, control->type, values);
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(card, control->cookie, control->type, values);
|
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;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
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;
|
int32 i;
|
||||||
uint32 id;
|
uint32 id;
|
||||||
multi_mixer_control *control = NULL;
|
multi_mixer_control *control = NULL;
|
||||||
for (i=0; i<MMVI->item_count; i++) {
|
for (i = 0; i < mmvi->item_count; i++) {
|
||||||
id = MMVI->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= card->multi.control_count) {
|
if (id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("emuxki_set_mix : invalid control id requested : %li\n", id));
|
PRINT(("emuxki_set_mix : invalid control id requested : %li\n", id));
|
||||||
continue;
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
multi_mixer_control *control2 = NULL;
|
multi_mixer_control *control2 = NULL;
|
||||||
if (i+1<MMVI->item_count) {
|
if (i+1<mmvi->item_count) {
|
||||||
id = MMVI->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= card->multi.control_count) {
|
if (id < 0 || id >= card->multi.control_count) {
|
||||||
PRINT(("emuxki_set_mix : invalid control id requested : %li\n", id));
|
PRINT(("emuxki_set_mix : invalid control id requested : %li\n", id));
|
||||||
} else {
|
} else {
|
||||||
@@ -592,12 +592,12 @@ emuxki_set_mix(emuxki_dev *card, multi_mix_value_info * MMVI)
|
|||||||
values[1] = 0.0;
|
values[1] = 0.0;
|
||||||
|
|
||||||
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
if (control->mix_control.master == EMU_MULTI_CONTROL_MASTERID)
|
||||||
values[0] = MMVI->values[i].u.gain;
|
values[0] = mmvi->values[i].u.gain;
|
||||||
else
|
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)
|
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);
|
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) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE && control->set) {
|
||||||
float values[1];
|
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);
|
control->set(card, control->cookie, control->type, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||||
float values[1];
|
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);
|
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
|
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;
|
uint32 i;
|
||||||
|
|
||||||
MMC = MMCI->controls;
|
mmc = mmci->controls;
|
||||||
if (MMCI->control_count < EMU_MULTICONTROLSNUM)
|
if (mmci->control_count < EMU_MULTICONTROLSNUM)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if (emuxki_create_controls_list(&card->multi) < B_OK)
|
if (emuxki_create_controls_list(&card->multi) < B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
for (i=0; i<card->multi.control_count; i++) {
|
for (i = 0; i < card->multi.control_count; i++) {
|
||||||
MMC[i] = card->multi.controls[i].mix_control;
|
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;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -719,7 +719,7 @@ emuxki_create_channels_list(multi_dev *multi)
|
|||||||
else
|
else
|
||||||
designations = B_CHANNEL_SURROUND_BUS;
|
designations = B_CHANNEL_SURROUND_BUS;
|
||||||
|
|
||||||
for (i=0; i<nchannels; i++) {
|
for (i = 0; i < nchannels; i++) {
|
||||||
chans[index].channel_id = index;
|
chans[index].channel_id = index;
|
||||||
chans[index].kind = (mode == EMU_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
chans[index].kind = (mode == EMU_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
|
||||||
chans[index].designations = designations | chan_designations[i];
|
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_channels = pchannels + pchannels2; /* playback_buffers[][c] */
|
||||||
data->return_playback_buffer_size = current_settings.buffer_frames; /* frames */
|
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++)
|
for (j=0; j<pchannels; j++)
|
||||||
emuxki_stream_get_nth_buffer(card->pstream, j, i,
|
emuxki_stream_get_nth_buffer(card->pstream, j, i,
|
||||||
&data->playback_buffers[i][j].base,
|
&data->playback_buffers[i][j].base,
|
||||||
&data->playback_buffers[i][j].stride);
|
&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++)
|
for (j=0; j<pchannels2; j++)
|
||||||
emuxki_stream_get_nth_buffer(card->pstream2, j, i,
|
emuxki_stream_get_nth_buffer(card->pstream2, j, i,
|
||||||
&data->playback_buffers[i][pchannels + j].base,
|
&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_channels = rchannels + rchannels2;
|
||||||
data->return_record_buffer_size = current_settings.buffer_frames; /* frames */
|
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++)
|
for (j=0; j<rchannels; j++)
|
||||||
emuxki_stream_get_nth_buffer(card->rstream, j, i,
|
emuxki_stream_get_nth_buffer(card->rstream, j, i,
|
||||||
&data->record_buffers[i][j].base,
|
&data->record_buffers[i][j].base,
|
||||||
&data->record_buffers[i][j].stride);
|
&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++)
|
for (j=0; j<rchannels2; j++)
|
||||||
emuxki_stream_get_nth_buffer(card->rstream2, j, i,
|
emuxki_stream_get_nth_buffer(card->rstream2, j, i,
|
||||||
&data->record_buffers[i][rchannels + j].base,
|
&data->record_buffers[i][rchannels + j].base,
|
||||||
|
|||||||
@@ -459,19 +459,19 @@ hda_create_controls_list(hda_multi *multi)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
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;
|
multi_mix_control *mmc = mmci->controls;
|
||||||
if (MMCI->control_count < 24)
|
if (mmci->control_count < 24)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if (hda_create_controls_list(audioGroup->multi) < B_OK)
|
if (hda_create_controls_list(audioGroup->multi) < B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
for (uint32 i = 0; i<audioGroup->multi->control_count; i++) {
|
for (uint32 i = 0; i < audioGroup->multi->control_count; i++) {
|
||||||
MMC[i] = audioGroup->multi->controls[i].mix_control;
|
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;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,12 +511,12 @@ get_control_gain_mute(hda_audio_group* audioGroup, hda_multi_mixer_control *cont
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
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;
|
uint32 id;
|
||||||
hda_multi_mixer_control *control = NULL;
|
hda_multi_mixer_control *control = NULL;
|
||||||
for (int32 i = 0; i < MMVI->item_count; i++) {
|
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||||
id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= audioGroup->multi->control_count) {
|
if (id < 0 || id >= audioGroup->multi->control_count) {
|
||||||
dprintf("hda: get_mix : invalid control id requested : %li\n", id);
|
dprintf("hda: get_mix : invalid control id requested : %li\n", id);
|
||||||
continue;
|
continue;
|
||||||
@@ -527,17 +527,17 @@ get_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
|||||||
uint32 resp[2];
|
uint32 resp[2];
|
||||||
get_control_gain_mute(audioGroup, control, resp);
|
get_control_gain_mute(audioGroup, control, resp);
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE) {
|
if (control->mix_control.flags & B_MULTI_MIX_ENABLE) {
|
||||||
MMVI->values[i].enable = (resp[0] & AMP_MUTE) != 0;
|
mmvi->values[i].enable = (resp[0] & AMP_MUTE) != 0;
|
||||||
TRACE("get_mix: %ld mute: %d\n", control->nid, MMVI->values[i].enable);
|
TRACE("get_mix: %ld mute: %d\n", control->nid, mmvi->values[i].enable);
|
||||||
} else if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
} else if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
uint32 value;
|
uint32 value;
|
||||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
||||||
value = resp[0] & AMP_GAIN_MASK;
|
value = resp[0] & AMP_GAIN_MASK;
|
||||||
else
|
else
|
||||||
value = resp[1] & AMP_GAIN_MASK;
|
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);
|
* 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) {
|
/*if (control->mix_control.flags & B_MULTI_MIX_MUX && control->get) {
|
||||||
float values[1];
|
float values[1];
|
||||||
control->get(audioGroup, control, values);
|
control->get(audioGroup, control, values);
|
||||||
MMVI->values[i].mux = (int32)values[0];
|
mmvi->values[i].mux = (int32)values[0];
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -554,12 +554,12 @@ get_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
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;
|
uint32 id;
|
||||||
hda_multi_mixer_control *control = NULL;
|
hda_multi_mixer_control *control = NULL;
|
||||||
for (int32 i = 0; i < MMVI->item_count; i++) {
|
for (int32 i = 0; i < mmvi->item_count; i++) {
|
||||||
id = MMVI->values[i].id - MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i].id - MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= audioGroup->multi->control_count) {
|
if (id < 0 || id >= audioGroup->multi->control_count) {
|
||||||
dprintf("set_mix : invalid control id requested : %li\n", id);
|
dprintf("set_mix : invalid control id requested : %li\n", id);
|
||||||
continue;
|
continue;
|
||||||
@@ -567,7 +567,7 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
|||||||
control = &audioGroup->multi->controls[id];
|
control = &audioGroup->multi->controls[id];
|
||||||
|
|
||||||
if (control->mix_control.flags & B_MULTI_MIX_ENABLE) {
|
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);
|
TRACE("set_mix: %ld mute: %lx\n", control->nid, control->mute);
|
||||||
uint32 resp[2];
|
uint32 resp[2];
|
||||||
get_control_gain_mute(audioGroup, control, resp);
|
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);
|
hda_send_verbs(audioGroup->codec, verb, NULL, 2);
|
||||||
} else if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
} else if (control->mix_control.flags & B_MULTI_MIX_GAIN) {
|
||||||
hda_multi_mixer_control *control2 = NULL;
|
hda_multi_mixer_control *control2 = NULL;
|
||||||
if (i+1<MMVI->item_count) {
|
if (i+1<mmvi->item_count) {
|
||||||
id = MMVI->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
id = mmvi->values[i + 1].id - MULTI_CONTROL_FIRSTID;
|
||||||
if (id < 0 || id >= audioGroup->multi->control_count) {
|
if (id < 0 || id >= audioGroup->multi->control_count) {
|
||||||
dprintf("set_mix : invalid control id requested : %li\n", id);
|
dprintf("set_mix : invalid control id requested : %li\n", id);
|
||||||
} else {
|
} else {
|
||||||
@@ -613,11 +613,11 @@ set_mix(hda_audio_group* audioGroup, multi_mix_value_info * MMVI)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (control->mix_control.master == MULTI_CONTROL_MASTERID)
|
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));
|
+ AMP_CAP_OFFSET(control->capabilities));
|
||||||
|
|
||||||
if (control2 && control2->mix_control.master != MULTI_CONTROL_MASTERID)
|
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));
|
+ AMP_CAP_OFFSET(control2->capabilities));
|
||||||
TRACE("set_mix: %ld gain: %lx and %ld gain: %lx\n",
|
TRACE("set_mix: %ld gain: %lx and %ld gain: %lx\n",
|
||||||
control->nid, control->gain, control2->nid, control2->gain);
|
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) {
|
/*if (control->mix_control.flags & B_MULTI_MIX_MUX && control->set) {
|
||||||
float values[1];
|
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);
|
control->set(card, control->channel, control->type, values);
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user