AudioServer: Handle multiple audio devices with multiple pins

This makes audio server configurable during runtime!
This commit is contained in:
2026-01-06 21:55:40 +02:00
parent e7c9be1875
commit b7c40eeb57
6 changed files with 213 additions and 59 deletions

View File

@@ -9,8 +9,6 @@
namespace LibAudio
{
static constexpr BAN::StringView s_audio_server_socket = "/tmp/audio-server.socket"_sv;
struct AudioBuffer
{
using sample_t = double;

View File

@@ -0,0 +1,50 @@
#pragma once
#include <BAN/StringView.h>
namespace LibAudio
{
struct Packet
{
enum : uint8_t
{
Notify, // parameter: ignored
// response: nothing
// server refereshes buffered data
RegisterBuffer, // paramenter: smo key
// response: nothing
// register audio buffer to server
QueryDevices, // parameter: ignored
// response: (uint32_t)
// query the number of devices available
QueryPins, // parameter: sink number
// response: (uint32_t)
// query the number of pins the sink has
GetDevice, // parameter: ignored
// reponse: (uint32_t)
// get the currently active device
SetDevice, // parameter: device number
// reponse: nothing
// set the currently active device
GetPin, // parameter: ignored
// response: nothing
// get the active pin of the current device
SetPin, // parameter: pin number
// response: nothing
// set the active pin of the current device
} type;
uint64_t parameter;
};
static constexpr BAN::StringView s_audio_server_socket = "/tmp/audio-server.socket"_sv;
}