mirror of
https://github.com/clangen/musikcube.git
synced 2024-10-02 04:52:32 +00:00
Fixed Linux compile.
This commit is contained in:
parent
40e9fc90c3
commit
483dfa65cd
@ -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) {
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include "NomadDecoder.h"
|
||||
#include <vector>
|
||||
#include <cstring>
|
||||
|
||||
using namespace musik::core::sdk;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user