77 |
const long timeout_seconds = 10; // we give the server max. 10 seconds to startup, otherwise we declare the startup as failed |
const long timeout_seconds = 10; // we give the server max. 10 seconds to startup, otherwise we declare the startup as failed |
78 |
try { |
try { |
79 |
pSampler = new Sampler; |
pSampler = new Sampler; |
80 |
pLSCPServer = new LSCPServer(pSampler); |
pLSCPServer = new LSCPServer(pSampler, htonl(LSCP_ADDR), htons(LSCP_PORT)); |
81 |
pLSCPServer->StartThread(); |
pLSCPServer->StartThread(); |
82 |
int res = pLSCPServer->WaitUntilInitialized(timeout_seconds); |
int res = pLSCPServer->WaitUntilInitialized(timeout_seconds); |
83 |
if (res < 0) throw; |
if (res < 0) throw; |
347 |
int devices = atoi(answer.c_str()); |
int devices = atoi(answer.c_str()); |
348 |
CPPUNIT_ASSERT(devices >= 0); |
CPPUNIT_ASSERT(devices >= 0); |
349 |
if (!devices) { // if there's no audio output device yet, try to create one |
if (!devices) { // if there's no audio output device yet, try to create one |
350 |
sendCommandToLSCPServer("GET AVAILABLE_AUDIO_OUTPUT_DRIVERS"); |
sendCommandToLSCPServer("LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS"); |
351 |
string drivers = receiveSingleLineAnswerFromLSCPServer(); |
string drivers = receiveSingleLineAnswerFromLSCPServer(); |
352 |
CPPUNIT_ASSERT(drivers.size()); |
CPPUNIT_ASSERT(drivers.size()); |
353 |
|
|