feat: audio mixer, Audio app, fix Installer crash

This commit is contained in:
2026-05-19 07:48:09 +02:00
parent 77a536bcc3
commit c6ca17984b
26 changed files with 1272 additions and 373 deletions
+36 -8
View File
@@ -162,6 +162,11 @@ namespace Montauk {
static constexpr uint64_t SYS_NETSTATUS = 125;
static constexpr uint64_t SYS_DRIVEKIND = 127;
// Audio mixer enumeration
static constexpr uint64_t SYS_AUDIOLIST = 128;
// Block until the mixer state serial differs from the caller's snapshot.
static constexpr uint64_t SYS_AUDIOWAIT = 129;
static constexpr uint32_t CLIPBOARD_MAX_TEXT_BYTES = 256 * 1024;
static constexpr uint32_t IPC_SIGNAL_READABLE = 1u << 0;
@@ -170,14 +175,23 @@ namespace Montauk {
static constexpr uint32_t IPC_SIGNAL_EXITED = 1u << 3;
static constexpr uint32_t IPC_SIGNAL_READY = 1u << 4;
// Audio control commands (for SYS_AUDIOCTL)
static constexpr int AUDIO_CTL_SET_VOLUME = 0;
static constexpr int AUDIO_CTL_GET_VOLUME = 1;
static constexpr int AUDIO_CTL_GET_POS = 2;
static constexpr int AUDIO_CTL_PAUSE = 3;
static constexpr int AUDIO_CTL_GET_OUTPUT = 4; // 0=HDA, 1=Bluetooth
static constexpr int AUDIO_CTL_SET_OUTPUT = 5; // Switch audio output
static constexpr int AUDIO_CTL_BT_STATUS = 6; // Get Bluetooth connection status
// Audio control commands (for SYS_AUDIOCTL).
//
// Commands 0..3 act on the stream named by the handle argument.
// Commands 7..12 act on the global master and ignore the handle.
static constexpr int AUDIO_CTL_SET_VOLUME = 0;
static constexpr int AUDIO_CTL_GET_VOLUME = 1;
static constexpr int AUDIO_CTL_GET_POS = 2;
static constexpr int AUDIO_CTL_PAUSE = 3;
static constexpr int AUDIO_CTL_GET_OUTPUT = 4; // 0=HDA, 1=Bluetooth
static constexpr int AUDIO_CTL_SET_OUTPUT = 5; // Switch audio output
static constexpr int AUDIO_CTL_BT_STATUS = 6; // Get Bluetooth status
static constexpr int AUDIO_CTL_SET_MASTER_VOLUME = 7; // 0-100
static constexpr int AUDIO_CTL_GET_MASTER_VOLUME = 8;
static constexpr int AUDIO_CTL_SET_MUTE = 9; // 0/1, per-stream
static constexpr int AUDIO_CTL_GET_MUTE = 10;
static constexpr int AUDIO_CTL_SET_MASTER_MUTE = 11;
static constexpr int AUDIO_CTL_GET_MASTER_MUTE = 12;
static constexpr int SOCK_TCP = 1;
static constexpr int SOCK_UDP = 2;
@@ -252,6 +266,20 @@ namespace Montauk {
uint64_t serial;
};
// One entry per active mixer stream; returned by SYS_AUDIOLIST.
struct AudioStreamInfo {
int32_t handle;
int32_t ownerPid;
char name[64];
uint32_t sampleRate;
uint8_t channels;
uint8_t bitsPerSample;
uint8_t volume; // 0-100
uint8_t muted; // 0/1
uint8_t paused; // 0/1
uint8_t _pad[7];
};
// Window server shared types
struct WinEvent {
uint8_t type; // 0=key, 1=mouse, 2=resize, 3=close, 4=scale