mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-04 20:44:42 +00:00
Give the mixer a main volume value (percent) that we scale all the outgoing samples by (before clipping.) Also add a simple "avol" program for querying and setting the volume: - "avol" prints the current volume. - "avol 200" sets the main mix volume to 200%
52 lines
963 B
C
52 lines
963 B
C
#pragma once
|
|
|
|
struct ASAPI_ServerMessage {
|
|
enum class Type {
|
|
Invalid,
|
|
Greeting,
|
|
PlayingBuffer,
|
|
FinishedPlayingBuffer,
|
|
EnqueueBufferResponse,
|
|
DidGetMainMixVolume,
|
|
DidSetMainMixVolume,
|
|
};
|
|
|
|
Type type { Type::Invalid };
|
|
unsigned extra_size { 0 };
|
|
bool success { true };
|
|
int value { 0 };
|
|
|
|
union {
|
|
struct {
|
|
int server_pid;
|
|
int your_client_id;
|
|
} greeting;
|
|
struct {
|
|
int buffer_id;
|
|
} playing_buffer;
|
|
};
|
|
};
|
|
|
|
struct ASAPI_ClientMessage {
|
|
enum class Type {
|
|
Invalid,
|
|
Greeting,
|
|
EnqueueBuffer,
|
|
GetMainMixVolume,
|
|
SetMainMixVolume,
|
|
};
|
|
|
|
Type type { Type::Invalid };
|
|
unsigned extra_size { 0 };
|
|
int value { 0 };
|
|
|
|
union {
|
|
struct {
|
|
int client_pid;
|
|
} greeting;
|
|
struct {
|
|
int buffer_id;
|
|
} play_buffer;
|
|
};
|
|
};
|