Fixed BSD compile.

This commit is contained in:
casey langen 2020-10-31 17:38:52 +00:00
parent e0a2da7102
commit 5a5985932d
2 changed files with 7 additions and 5 deletions

View File

@ -165,23 +165,23 @@ IDevice* SndioOut::GetDefaultDevice() {
return nullptr;
}
int SndioOut::Play(IBuffer *buffer, IBufferProvider *provider) {
OutputState SndioOut::Play(IBuffer *buffer, IBufferProvider *provider) {
std::this_thread::yield();
if (this->state != StatePlaying) {
return OutputInvalidState;
return OutputState::InvalidState;
}
{
LOCK()
if (this->CountBuffersWithProvider(provider) >= BUFFER_COUNT) {
return OutputBufferFull;
return OutputState::BufferFull;
}
this->buffers.push_back(BufferContext{provider, buffer});
}
NOTIFY()
return OutputBufferWritten;
return OutputState::BufferWritten;
}
void SndioOut::WriteLoop() {

View File

@ -31,8 +31,10 @@
// POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include <musikcore/sdk/constants.h>
#include <musikcore/sdk/IOutput.h>
#include <sndio.h>
#include <mutex>
@ -57,7 +59,7 @@ class SndioOut : public IOutput {
virtual void SetVolume(double volume) override;
virtual double GetVolume() override;
virtual void Stop() override;
virtual int Play(IBuffer *buffer, IBufferProvider *provider) override;
virtual musik::core::sdk::OutputState Play(IBuffer *buffer, IBufferProvider *provider) override;
virtual double Latency() override;
virtual void Drain() override;
virtual IDeviceList* GetDeviceList() override;