diff options
author | Michal Ratajsky <[email protected]> | 2014-11-03 16:07:36 +0100 |
---|---|---|
committer | Michal Ratajsky <[email protected]> | 2014-11-03 16:07:36 +0100 |
commit | 8331d79eae9391b6d158009dab4bb2798ce0ebc3 (patch) | |
tree | b61083ca14e502de78a59dec08e3c0478ccef194 /backends/oss | |
parent | b4d7066dfb7e76c16f3a8179be186d10af082224 (diff) | |
download | libmatemixer-8331d79eae9391b6d158009dab4bb2798ce0ebc3.tar.bz2 libmatemixer-8331d79eae9391b6d158009dab4bb2798ce0ebc3.tar.xz |
oss: Fix order of switch options to match priority list
Also remove obsolete items from the input priority list
Diffstat (limited to 'backends/oss')
-rw-r--r-- | backends/oss/oss-device.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/backends/oss/oss-device.c b/backends/oss/oss-device.c index 4b54fc3..7699e7d 100644 --- a/backends/oss/oss-device.c +++ b/backends/oss/oss-device.c @@ -137,8 +137,7 @@ static const gint oss_input_priority[] = { 8, /* cd */ 22, /* video */ 23, /* radio */ - 3, /* synth */ - 27 /* midi */ + 3 /* synth */ }; static const gint oss_output_priority[] = { @@ -149,12 +148,9 @@ static const gint oss_output_priority[] = { 17, /* dig1 */ 18, /* dig2 */ 19, /* dig3 */ - 25, /* depth */ - 26, /* center */ 21, /* phone out */ 13, /* ogain */ 9, /* mix */ - 24, /* monitor */ 1, /* bass */ 2 /* treble */ }; @@ -615,28 +611,27 @@ read_mixer_switch (OssDevice *device) GList *options = NULL; guint i; - for (i = 0; i < OSS_N_DEVICES; i++) { + /* This is always an input recording source switch */ + for (i = 0; i < G_N_ELEMENTS (oss_input_priority); i++) { + gint devnum = oss_input_priority[i]; OssSwitchOption *option; - /* Exclude output controls as this is always a recording - * source switch */ - if (oss_devices[i].type == OSS_DEV_OUTPUT) - continue; - if (OSS_MASK_HAS_DEVICE (device->priv->devmask, i) == FALSE || - OSS_MASK_HAS_DEVICE (device->priv->recmask, i) == FALSE) + /* Avoid devices that are not present or not recordable */ + if (OSS_MASK_HAS_DEVICE (device->priv->devmask, devnum) == FALSE || + OSS_MASK_HAS_DEVICE (device->priv->recmask, devnum) == FALSE) continue; - option = oss_switch_option_new (oss_devices[i].name, - gettext (oss_devices[i].label), - oss_devices[i].icon, - i); + option = oss_switch_option_new (oss_devices[devnum].name, + gettext (oss_devices[devnum].label), + oss_devices[devnum].icon, + devnum); options = g_list_prepend (options, option); } if G_LIKELY (options != NULL) oss_stream_set_switch_data (device->priv->input, device->priv->fd, - options); + g_list_reverse (options)); } static gboolean |