@@ -302,12 +302,35 @@ SonicPiAPI::~SonicPiAPI()
302
302
303
303
void SonicPiAPI::Shutdown ()
304
304
{
305
+ LOG (INFO, " Shutdown" );
306
+
307
+ switch (m_state)
308
+ {
309
+ case State::Reset :
310
+ LOG (INFO, " Shutting down with state: Reset" );
311
+ break ;
312
+ case State::Initializing :
313
+ LOG (INFO, " Shutting down with state: Initializing" );
314
+ break ;
315
+ case State::Invalid :
316
+ LOG (INFO, " Shutting down with state: Invalid" );
317
+ break ;
318
+ case State::Created :
319
+ LOG (INFO, " Shutting down with state: Created" );
320
+ break ;
321
+ case State::Error :
322
+ LOG (INFO, " Shutting down with state: Error" );
323
+ break ;
324
+ default :
325
+ LOG (INFO, " Shutting down with unknown state!! Warning!" );
326
+ }
327
+
305
328
if (m_state == State::Created || m_state == State::Invalid || m_state == State::Initializing)
306
329
{
307
- LOG (INFO, " Shutdown" );
308
-
330
+ LOG (INFO, " Resetting audio processor..." );
309
331
m_spAudioProcessor.reset ();
310
332
333
+ LOG (INFO, " Stopping OSC server..." );
311
334
StopOscServer ();
312
335
313
336
if (m_coutbuf)
@@ -319,7 +342,7 @@ void SonicPiAPI::Shutdown()
319
342
320
343
if (m_bootDaemonSock)
321
344
{
322
- LOG (INFO, " Closing socket to Boot Daemon..." );
345
+ LOG (INFO, " Closing socket to Boot Daemon..." );
323
346
m_bootDaemonSock->close ();
324
347
} else {
325
348
LOG (INFO, " Boot Daemon socket not found so no need to close..." );
@@ -400,13 +423,16 @@ bool SonicPiAPI::WaitUntilReady()
400
423
401
424
bool SonicPiAPI::PingUntilServerCreated ()
402
425
{
426
+ LOG (INFO, " Pinging Spider Server until a response is received..." );
403
427
if (m_state == State::Created)
404
428
{
405
429
return true ;
430
+ LOG (ERR, " Error! No need to ping server as it's already created!" );
406
431
}
407
432
408
433
if (m_state != State::Initializing)
409
434
{
435
+ LOG (ERR, " API is not in the initialisation state. Error!" );
410
436
return false ;
411
437
}
412
438
0 commit comments