summaryrefslogtreecommitdiff
path: root/mate-volume-control/src
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-08-28 22:39:23 +0200
committerinfirit <[email protected]>2014-10-09 16:53:01 +0200
commit97b89e8056e82af76045443f0967c34d20b12fc0 (patch)
tree4a51a2dbf9045a82a31c0fe8f29519503f3c9438 /mate-volume-control/src
parent11fd36a91709a4e279718eca0cf90b08f6853b36 (diff)
downloadmate-media-97b89e8056e82af76045443f0967c34d20b12fc0.tar.bz2
mate-media-97b89e8056e82af76045443f0967c34d20b12fc0.tar.xz
Avoid using toggle as a port switch and fix indentation
Diffstat (limited to 'mate-volume-control/src')
-rw-r--r--mate-volume-control/src/gvc-mixer-dialog.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/mate-volume-control/src/gvc-mixer-dialog.c b/mate-volume-control/src/gvc-mixer-dialog.c
index 2ddc5ea..26e0540 100644
--- a/mate-volume-control/src/gvc-mixer-dialog.c
+++ b/mate-volume-control/src/gvc-mixer-dialog.c
@@ -139,35 +139,38 @@ G_DEFINE_TYPE (GvcMixerDialog, gvc_mixer_dialog, GTK_TYPE_DIALOG)
static MateMixerSwitch *
find_stream_port_switch (MateMixerStream *stream)
{
- const GList *switches;
+ const GList *switches;
- switches = mate_mixer_stream_list_switches (stream);
- while (switches != NULL) {
- MateMixerSwitch *swtch = MATE_MIXER_SWITCH (switches->data);
+ switches = mate_mixer_stream_list_switches (stream);
+ while (switches != NULL) {
+ MateMixerSwitch *swtch = MATE_MIXER_SWITCH (switches->data);
+ MateMixerSwitchFlags flags;
- if (mate_mixer_switch_get_role (swtch) == MATE_MIXER_SWITCH_ROLE_PORT)
- return swtch;
+ flags = mate_mixer_switch_get_flags (swtch);
+ if ((flags & MATE_MIXER_SWITCH_TOGGLE) == 0 &&
+ mate_mixer_switch_get_role (swtch) == MATE_MIXER_SWITCH_ROLE_PORT)
+ return swtch;
- switches = switches->next;
- }
- return NULL;
+ switches = switches->next;
+ }
+ return NULL;
}
static MateMixerSwitch *
find_device_profile_switch (MateMixerDevice *device)
{
- const GList *switches;
+ const GList *switches;
- switches = mate_mixer_device_list_switches (device);
- while (switches != NULL) {
- MateMixerSwitch *swtch = MATE_MIXER_SWITCH (switches->data);
+ switches = mate_mixer_device_list_switches (device);
+ while (switches != NULL) {
+ MateMixerSwitch *swtch = MATE_MIXER_SWITCH (switches->data);
- if (mate_mixer_switch_get_role (swtch) == MATE_MIXER_SWITCH_ROLE_DEVICE_PROFILE)
- return swtch;
+ if (mate_mixer_switch_get_role (swtch) == MATE_MIXER_SWITCH_ROLE_DEVICE_PROFILE)
+ return swtch;
- switches = switches->next;
- }
- return NULL;
+ switches = switches->next;
+ }
+ return NULL;
}
static MateMixerStream *