mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +00:00
AudioServer: Port to the new generated IPC mechanism
Fork the IPC Connection classes into Server:: and Client::ConnectionNG. The new IPC messages are serialized very snugly instead of using the same generic data structure for all messages. Remove ASAPI.h since we now generate all of it from AudioServer.ipc :^)
This commit is contained in:
parent
3519b6c201
commit
8e684f0959
14 changed files with 327 additions and 329 deletions
|
@ -1,23 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibAudio/ASAPI.h>
|
||||
#include <AudioServer/AudioServerEndpoint.h>
|
||||
#include <LibCore/CoreIPCServer.h>
|
||||
|
||||
class ABuffer;
|
||||
class ASBufferQueue;
|
||||
class ASMixer;
|
||||
|
||||
class ASClientConnection final : public IPC::Server::Connection<ASAPI_ServerMessage, ASAPI_ClientMessage> {
|
||||
class ASClientConnection final : public IPC::Server::ConnectionNG<AudioServerEndpoint>
|
||||
, public AudioServerEndpoint {
|
||||
C_OBJECT(ASClientConnection)
|
||||
public:
|
||||
explicit ASClientConnection(CLocalSocket&, int client_id, ASMixer& mixer);
|
||||
~ASClientConnection() override;
|
||||
void send_greeting() override;
|
||||
bool handle_message(const ASAPI_ClientMessage&, const ByteBuffer&& = {}) override;
|
||||
|
||||
void did_finish_playing_buffer(Badge<ASMixer>, int buffer_id);
|
||||
|
||||
private:
|
||||
virtual OwnPtr<AudioServer::GreetResponse> handle(const AudioServer::Greet&) override;
|
||||
virtual OwnPtr<AudioServer::GetMainMixVolumeResponse> handle(const AudioServer::GetMainMixVolume&) override;
|
||||
virtual OwnPtr<AudioServer::SetMainMixVolumeResponse> handle(const AudioServer::SetMainMixVolume&) override;
|
||||
virtual OwnPtr<AudioServer::EnqueueBufferResponse> handle(const AudioServer::EnqueueBuffer&) override;
|
||||
|
||||
ASMixer& m_mixer;
|
||||
RefPtr<ASBufferQueue> m_queue;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue