feat: audio - add concurrent mixing, output switching, and device-aware UI
This commit is contained in:
@@ -390,7 +390,7 @@ void gui::desktop_handle_mouse(DesktopState* ds) {
|
||||
int popup_x = ds->vol_icon_rect.x + ds->vol_icon_rect.w - 200;
|
||||
int popup_y = PANEL_HEIGHT + 2;
|
||||
if (popup_x < 4) popup_x = 4;
|
||||
Rect vol_rect = {popup_x, popup_y, 200, 120};
|
||||
Rect vol_rect = {popup_x, popup_y, 200, 202};
|
||||
|
||||
// Handle drag continuity
|
||||
if (ds->vol_dragging) {
|
||||
@@ -482,6 +482,23 @@ void gui::desktop_handle_mouse(DesktopState* ds) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Output device radio rows.
|
||||
Rect hda_r = {popup_x + 12, popup_y + 137, 200 - 24, 25};
|
||||
Rect bt_r = {hda_r.x, hda_r.y + hda_r.h, hda_r.w, hda_r.h};
|
||||
if (hda_r.contains(mx, my) &&
|
||||
ds->vol_output != montauk::abi::AUDIO_OUTPUT_HDA) {
|
||||
if (montauk::audio_set_output(montauk::abi::AUDIO_OUTPUT_HDA) == 0)
|
||||
ds->vol_output = montauk::abi::AUDIO_OUTPUT_HDA;
|
||||
return;
|
||||
}
|
||||
if (bt_r.contains(mx, my) && ds->vol_bt_status >= 2 &&
|
||||
ds->vol_output != montauk::abi::AUDIO_OUTPUT_BLUETOOTH) {
|
||||
if (montauk::audio_set_output(
|
||||
montauk::abi::AUDIO_OUTPUT_BLUETOOTH) == 0)
|
||||
ds->vol_output = montauk::abi::AUDIO_OUTPUT_BLUETOOTH;
|
||||
return;
|
||||
}
|
||||
return; // click inside popup but not on any control
|
||||
} else if (!ds->vol_icon_rect.contains(mx, my)) {
|
||||
ds->vol_popup_open = false;
|
||||
|
||||
Reference in New Issue
Block a user