mirror of
https://github.com/RGBCube/serenity
synced 2026-01-21 16:01:00 +00:00
* Add a LibAudio, and move WAV file parsing there (via AWavFile and AWavLoader) * Add CLocalSocket, and CSocket::connect() variant for local address types. We make some small use of this in WindowServer (as that's where we modelled it from), but don't get too invasive as this PR is already quite large, and the WS I/O is a bit carefully done * Add an AClientConnection which will eventually be used to talk to AudioServer (and make use of it in Piano, though right now it really doesn't do anything except connect, using our new CLocalSocket...)
32 lines
923 B
C++
32 lines
923 B
C++
#pragma once
|
|
|
|
#include <AK/ByteBuffer.h>
|
|
#include <LibCore/CEventLoop.h>
|
|
#include <LibCore/CNotifier.h>
|
|
#include <LibCore/CLocalSocket.h>
|
|
|
|
class WSClientConnection;
|
|
struct WSAPI_ClientMessage;
|
|
|
|
class WSEventLoop : public CEventLoop {
|
|
public:
|
|
WSEventLoop();
|
|
virtual ~WSEventLoop() override;
|
|
|
|
static WSEventLoop& the() { return static_cast<WSEventLoop&>(CEventLoop::current()); }
|
|
|
|
private:
|
|
virtual void add_file_descriptors_for_select(fd_set&, int& max_fd_added) override;
|
|
virtual void process_file_descriptors_after_select(const fd_set&) override;
|
|
|
|
void drain_server();
|
|
void drain_mouse();
|
|
void drain_keyboard();
|
|
void drain_client(WSClientConnection&);
|
|
bool on_receive_from_client(int client_id, const WSAPI_ClientMessage&, ByteBuffer&& extra_data);
|
|
|
|
int m_keyboard_fd { -1 };
|
|
int m_mouse_fd { -1 };
|
|
CLocalSocket m_server_sock;
|
|
OwnPtr<CNotifier> m_server_notifier;
|
|
};
|