Changeset b1926d0 in mainline


Ignore:
Timestamp:
2011-09-26T08:50:38Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b3f36d2
Parents:
a4a4e47
Message:

sb16: min_value was always 0, so drop it and use level count instead.

Location:
uspace/drv/audio/sb16
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/mixer.c

    ra4a4e47 rb1926d0  
    4040        uint8_t channels;
    4141        const char *description;
    42         unsigned min_value;
    43         unsigned max_value;
     42        unsigned volume_levels;
    4443        unsigned shift;
    4544        bool same_reg;
     
    4746
    4847static const volume_item_t volume_ct1335[] = {
    49         { 0x02, 1, "Master", 0, 7, 1, true },
    50         { 0x06, 1, "MIDI", 0, 7, 1, true },
    51         { 0x08, 1, "CD", 0, 7, 1, true },
    52         { 0x0a, 1, "Voice", 0, 3, 1, true },
     48        { 0x02, 1, "Master", 8, 1, true },
     49        { 0x06, 1, "MIDI", 8, 1, true },
     50        { 0x08, 1, "CD", 8, 1, true },
     51        { 0x0a, 1, "Voice", 4, 1, true },
    5352};
    5453
    5554static const volume_item_t volume_ct1345[] = {
    56         { 0x04, 2, "Voice", 0, 7, 1, true },
    57         { 0x0a, 1, "Mic", 0, 3, 1, true },
    58         { 0x22, 2, "Master", 0, 7, 1, true },
    59         { 0x26, 2, "MIDI", 0, 7, 1, true },
    60         { 0x28, 2, "CD", 0, 7, 1, true },
    61         { 0x2e, 2, "Line", 0, 7, 1, true },
     55        { 0x04, 2, "Voice", 8, 1, true },
     56        { 0x0a, 1, "Mic", 4, 1, true },
     57        { 0x22, 2, "Master", 8, 1, true },
     58        { 0x26, 2, "MIDI", 8, 1, true },
     59        { 0x28, 2, "CD", 8, 1, true },
     60        { 0x2e, 2, "Line", 8, 1, true },
    6261};
    6362
    6463static const volume_item_t volume_ct1745[] = {
    65         { 0x30, 2, "Master", 0, 31, 3, false },
    66         { 0x32, 2, "Voice", 0, 31, 3, false },
    67         { 0x34, 2, "MIDI", 0, 31, 3, false },
    68         { 0x36, 2, "CD", 0, 31, 3, false },
    69         { 0x38, 2, "Line", 0, 31, 3, false },
    70         { 0x3a, 1, "Mic", 0, 31, 3, false },
    71         { 0x3b, 1, "PC Speaker", 0, 3, 6, false },
    72         { 0x3f, 2, "Input Gain", 0, 3, 6, false },
    73         { 0x41, 2, "Output Gain", 0, 3, 6, false },
    74         { 0x44, 2, "Treble", 0, 15, 4, false },
    75         { 0x46, 2, "Bass", 0, 15, 4, false },
     64        { 0x30, 2, "Master", 32, 3, false },
     65        { 0x32, 2, "Voice", 32, 3, false },
     66        { 0x34, 2, "MIDI", 32, 3, false },
     67        { 0x36, 2, "CD", 32, 3, false },
     68        { 0x38, 2, "Line", 32, 3, false },
     69        { 0x3a, 1, "Mic", 32, 3, false },
     70        { 0x3b, 1, "PC Speaker", 4, 6, false },
     71        { 0x3f, 2, "Input Gain", 4, 6, false },
     72        { 0x41, 2, "Output Gain", 4, 6, false },
     73        { 0x44, 2, "Treble", 16, 4, false },
     74        { 0x46, 2, "Bass", 16, 4, false },
    7675};
    7776
     
    129128/*----------------------------------------------------------------------------*/
    130129int mixer_get_control_item_info(mixer_type_t type, unsigned index,
    131     const char** name, unsigned *channels)
     130    const char** name, unsigned *channels, unsigned *levels)
    132131{
    133132        if (index > volume_table[type].count)
     
    135134
    136135        if (name)
    137             *name = volume_table[type].table[index].description;
     136                *name = volume_table[type].table[index].description;
    138137        if (channels)
    139             *channels = volume_table[type].table[index].channels;
     138                *channels = volume_table[type].table[index].channels;
     139        if (levels)
     140                *levels = volume_table[type].table[index].volume_levels;
    140141        return EOK;
    141142}
  • uspace/drv/audio/sb16/mixer.h

    ra4a4e47 rb1926d0  
    5151int mixer_get_control_item_count(mixer_type_t type);
    5252int mixer_get_control_item_info(mixer_type_t type, unsigned index,
    53     const char** name, unsigned *channels);
     53    const char** name, unsigned *channels, unsigned *levels);
    5454int mixer_set_volume_level(sb16_regs_t *regs, mixer_type_t type,
    5555    unsigned item, unsigned channel, unsigned level);
Note: See TracChangeset for help on using the changeset viewer.