if (!pInstance) {
std::cerr << "Failed to create the process instance"<< std::endl;
return 1;
}
std::thread updater([pInstance](){
std::cerr << "plughost_StartUpdateThread (no json port)" << std::endl;
std::cerr << "plughost_StartUpdateThread END" << std::endl;
});
std::cerr << "Waiting update thread" << std::endl;
std::cerr << "Timeout to create the process instance"<< std::endl;
}
std::cerr << "Waiting update thread DONE" << std::endl;
#if (PLUGHOST_HAS_WEBSERVER)
std::cerr << "Starting web server" << std::endl;
int listenport= 8080;
int listenport_secure= 8443;
if (listenport || listenport_secure) {
std::cerr << "Starting web server FAILED" << std::endl;
} else {
if (listenport) {
std::cerr << "Web server listening on port " << listenport;
} else {
std::cerr << "Web server failed to listen on port " << listenport;
}
}
if (listenport_secure) {
std::cerr << "Web server listening on secure port " << listenport_secure;
} else {
std::cerr << "Web server failed to listen on secure port " << listenport_secure;
}
}
std::cerr << "Starting web server DONE" << std::endl;
}
}
#endif
struct plughost_CParameters * plughost_NewParameters()
void plughost_FreeParameters(struct plughost_CParameters *params)
void plughost_SetParameter(struct plughost_CParameters *params, const char *name, const char *value)
struct plughost_CInstance * plughost_InitProcess2(const char *LoginKey, const char *RadioName, const char *AWS_Access_ID, const char *AWS_Access_Secret, const char *save_path, const struct plughost_CParameters *parameters)
void plughost_StartUpdateThread(struct plughost_CInstance *instance, unsigned int port)
int plughost_WaitUpdateThreadReady(struct plughost_CInstance *instance, int milliseconds)
#define SOUND4_WEBSERVER_HTTPS_OK
int plughost_Webserver_Status(uint64_t id)
#define SOUND4_WEBSERVER_HTTP_OK
#define SOUND4_INVALID_WEBSERVER_ID
uint64_t plughost_Webserver(unsigned int listenport, unsigned int listenport_secure, struct plughost_CInstance *instance)
bool stopthread=false;
#if defined(_WIN32) || defined(WIN32)
_setmode(_fileno(stdin), _O_BINARY);
_setmode(_fileno(stdout), _O_BINARY);
#endif
while (!stopthread)
{
std::cerr << "ProcessLoop: input stopped"<< std::endl;
stopthread=true;
break;
}
if (stopthread) break;
std::cerr << "Failed to write audio output" << std::endl;
stopthread=true;
}
}
void plughost_ProcessAudio(struct plughost_CInstance *instance, const float *input, float *output)
#if (PLUGHOST_HAS_WEBSERVER)
std::cerr << "Stopping web server" << std::endl;
std::cerr << "Stopping web server DONE" << std::endl;
#endif
std::cerr << "Stopping Update thread" << std::endl;
std::cerr << "Stopping Update thread DONE" << std::endl;
updater.join();
void plughost_ExitProcess(struct plughost_CInstance *instance)
void plughost_StopUpdateThread(struct plughost_CInstance *instance)
int plughost_Webserver_Stop(uint64_t id, int timeout_ms)