mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-31 13:48:25 +00:00
AudioServer: Assorted infrastructure work
* 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...)
This commit is contained in:
committed by
Andreas Kling
parent
983245113a
commit
ffa8cb668f
19
Libraries/LibCore/CLocalSocket.cpp
Normal file
19
Libraries/LibCore/CLocalSocket.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <LibCore/CLocalSocket.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
CLocalSocket::CLocalSocket(CObject* parent)
|
||||
: CSocket(CSocket::Type::Local, parent)
|
||||
{
|
||||
int fd = socket(AF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
||||
if (fd < 0) {
|
||||
set_error(fd);
|
||||
} else {
|
||||
set_fd(fd);
|
||||
set_mode(CIODevice::ReadWrite);
|
||||
set_error(0);
|
||||
}
|
||||
}
|
||||
|
||||
CLocalSocket::~CLocalSocket()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user