1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00
serenity/Libraries/LibAudio/AClientConnection.h
Andreas Kling 107011f119 AudioServer: Allow muting the system audio
This patch adds muting to ASMixer, which works by substituting what we
would normally send to the sound card with zero-filled memory instead.
We do it this way to ensure that the queued sample buffers keep getting
played (silently.)

This is obviously not the perfect way of doing this, and in the future
we should improve on this, and also find a way to utilize any hardware
mixing functions in the sound card.
2019-11-22 21:44:02 +01:00

29 lines
662 B
C++

#pragma once
#include <AudioServer/AudioServerEndpoint.h>
#include <LibCore/CoreIPCClient.h>
class ABuffer;
class AClientConnection : public IPC::Client::ConnectionNG<AudioServerEndpoint> {
C_OBJECT(AClientConnection)
public:
AClientConnection();
virtual void handshake() override;
void enqueue(const ABuffer&);
bool try_enqueue(const ABuffer&);
bool get_muted();
void set_muted(bool);
int get_main_mix_volume();
void set_main_mix_volume(int);
int get_remaining_samples();
int get_played_samples();
int get_playing_buffer();
void set_paused(bool paused);
void clear_buffer(bool paused = false);
};