* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* 0 sink PCH mute switch to PCH
* 1 sink BT mute switch to BT
- * 2 - - -
+ * 2 - mic non-mute -
* 3 desk brightness - desk lights on
* 4 MPD mute MPD play/pause
* 5 Albireo MPV mute MPD stop
#define PCH_SINK "alsa_output.pci-0000_00_1f.3.analog-stereo"
#define BT_SINK "bluez_sink.CC_98_8B_D0_8C_06.a2dp_sink"
+#define LOGI_SOURCE "alsa_input.usb-046d_Logitech_Webcam_C925e_EF163C5F-02.analog-stereo"
/*** Sink controls ***/
}
}
+/*** Source mute controls ***/
+
+static void update_source_buttons(void)
+{
+ struct pulse_source *source = pulse_source_by_name(LOGI_SOURCE);
+ if (!source)
+ return;
+
+ // if (source->suspended || source->mute)
+ if (source->mute)
+ noct_set_button(2, 0);
+ else
+ noct_set_button(2, 1);
+}
+
+static void update_source_mute_from_button(int on, const char *source_name)
+{
+ if (!on)
+ return;
+
+ struct pulse_source *s = pulse_source_by_name(source_name);
+ if (!s)
+ return;
+
+ DBG("## Setting mute of source %s to %d", s->name, !s->mute);
+ pulse_source_set_mute(s->idx, !s->mute);
+}
+
/*** MPD controls ***/
static bool mpd_flash_state;
update_ring_from_sink(1, BT_SINK);
update_groups();
update_default_sink();
+ update_source_buttons();
update_mpd();
update_lights();
}
case 1:
update_sink_mute_from_button(on, BT_SINK);
break;
+ case 2:
+ update_source_mute_from_button(on, LOGI_SOURCE);
+ break;
case 8:
case 9:
update_default_sink_from_button(button, on);