mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00

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.
29 lines
662 B
C++
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);
|
|
};
|