diff --git a/Userland/Services/AudioServer/ClientConnection.h b/Userland/Services/AudioServer/ClientConnection.h index 9a2004448e..a4d2d6a177 100644 --- a/Userland/Services/AudioServer/ClientConnection.h +++ b/Userland/Services/AudioServer/ClientConnection.h @@ -23,7 +23,6 @@ class Mixer; class ClientConnection final : public IPC::ClientConnection { C_OBJECT(ClientConnection) public: - explicit ClientConnection(NonnullRefPtr, int client_id, Mixer& mixer); ~ClientConnection() override; void did_finish_playing_buffer(Badge, int buffer_id); @@ -36,6 +35,8 @@ public: static void for_each(Function); private: + explicit ClientConnection(NonnullRefPtr, int client_id, Mixer& mixer); + virtual Messages::AudioServer::GetMainMixVolumeResponse get_main_mix_volume() override; virtual void set_main_mix_volume(double) override; virtual Messages::AudioServer::GetSelfVolumeResponse get_self_volume() override; diff --git a/Userland/Services/AudioServer/Mixer.h b/Userland/Services/AudioServer/Mixer.h index d56d97fef8..a9dbde4cc8 100644 --- a/Userland/Services/AudioServer/Mixer.h +++ b/Userland/Services/AudioServer/Mixer.h @@ -108,7 +108,6 @@ private: class Mixer : public Core::Object { C_OBJECT(Mixer) public: - Mixer(NonnullRefPtr config); virtual ~Mixer() override; NonnullRefPtr create_queue(ClientConnection&); @@ -124,6 +123,8 @@ public: u16 audiodevice_get_sample_rate() const; private: + Mixer(NonnullRefPtr config); + void request_setting_sync(); Vector> m_pending_mixing; diff --git a/Userland/Services/AudioServer/main.cpp b/Userland/Services/AudioServer/main.cpp index d02cf6392b..202cf9e102 100644 --- a/Userland/Services/AudioServer/main.cpp +++ b/Userland/Services/AudioServer/main.cpp @@ -29,7 +29,7 @@ int main(int, char**) unveil(nullptr, nullptr); Core::EventLoop event_loop; - AudioServer::Mixer mixer { config }; + auto mixer = AudioServer::Mixer::construct(config); auto server = Core::LocalServer::construct(); bool ok = server->take_over_from_system_server(); @@ -42,7 +42,7 @@ int main(int, char**) } static int s_next_client_id = 0; int client_id = ++s_next_client_id; - IPC::new_client_connection(client_socket.release_nonnull(), client_id, mixer); + IPC::new_client_connection(client_socket.release_nonnull(), client_id, *mixer); }; if (pledge("stdio recvfd thread accept cpath rpath wpath", nullptr) < 0) {