Fixed Linux compile.

This commit is contained in:
Casey Langen 2016-12-23 20:25:49 -08:00
parent 40e9fc90c3
commit 483dfa65cd
5 changed files with 19 additions and 3 deletions

View File

@ -39,7 +39,7 @@
#define PCM_FORMAT SND_PCM_FORMAT_FLOAT_LE
#define LOCK(x) \
/*std::f << "locking " << x << "\n";*/ \
/*std::cerr << "locking " << x << "\n";*/ \
boost::recursive_mutex::scoped_lock lock(this->stateMutex); \
/*std::cerr << "locked " << x << "\n";*/ \
@ -88,15 +88,19 @@ AlsaOut::AlsaOut()
AlsaOut::~AlsaOut() {
std::cerr << "AlsaOut: destructor\n";
std::cerr << "AlsaOut: waiting for thread...\n";
{
LOCK("dtor");
this->quit = true;
NOTIFY();
}
std::cerr << "AlsaOut: joining...\n";
this->writeThread->join();
std::cerr << "AlsaOut: closing device...\n";
this->CloseDevice();
std::cerr << "AlsaOut: destroyed.\n";
}
void AlsaOut::CloseDevice() {
@ -218,6 +222,10 @@ void AlsaOut::SetVolume(double volume) {
this->volume = volume;
}
double AlsaOut::GetVolume() {
return this->volume;
}
void AlsaOut::WriteLoop() {
{
LOCK("thread: init");
@ -277,6 +285,8 @@ void AlsaOut::WriteLoop() {
}
}
}
std::cerr << "AlsaOut: thread finished\n";
}
bool AlsaOut::Play(IBuffer *buffer, IBufferProvider* provider) {

View File

@ -35,7 +35,6 @@
#include "pch.h"
#include <boost/thread/condition.hpp>
#include <boost/thread/thread.hpp>
@ -59,6 +58,7 @@ class AlsaOut : public musik::core::sdk::IOutput {
virtual void Pause();
virtual void Resume();
virtual void SetVolume(double volume);
virtual double GetVolume();
virtual void Stop();
virtual double Latency() { return 0.0; }

View File

@ -34,6 +34,7 @@
#include "NomadDecoder.h"
#include <vector>
#include <cstring>
using namespace musik::core::sdk;

View File

@ -138,6 +138,10 @@ void PulseOut::SetVolume(double volume) {
}
}
double PulseOut::GetVolume() {
return this->volume;
}
bool PulseOut::Play(IBuffer *buffer, IBufferProvider* provider) {
int error = 0;

View File

@ -54,6 +54,7 @@ class PulseOut : public musik::core::sdk::IOutput {
virtual void Pause();
virtual void Resume();
virtual void SetVolume(double volume);
virtual double GetVolume();
virtual void Stop();
virtual double Latency();