|
@@ -1,23 +1,21 @@
|
|
|
#include <AK/BufferStream.h>
|
|
|
#include <AudioServer/ASClientConnection.h>
|
|
|
#include <AudioServer/ASMixer.h>
|
|
|
-#include <LibCore/CThread.h>
|
|
|
#include <limits>
|
|
|
|
|
|
ASMixer::ASMixer()
|
|
|
: m_device("/dev/audio", this)
|
|
|
+ , m_sound_thread([this] {
|
|
|
+ mix();
|
|
|
+ return 0;
|
|
|
+ })
|
|
|
{
|
|
|
if (!m_device.open(CIODevice::WriteOnly)) {
|
|
|
dbgprintf("Can't open audio device: %s\n", m_device.error_string());
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- CThread sound_thread([](void* context) -> int {
|
|
|
- ASMixer* mixer = (ASMixer*)context;
|
|
|
- mixer->mix();
|
|
|
- return 0;
|
|
|
- },
|
|
|
- this);
|
|
|
+ m_sound_thread.start();
|
|
|
}
|
|
|
|
|
|
ASMixer::~ASMixer()
|