mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 05:35:47 +01:00
don't ping JACK server 4 times to see if it is already up when ardour starts
This commit is contained in:
parent
d6274d5c3e
commit
c736d88a5f
4 changed files with 18 additions and 31 deletions
|
|
@ -36,6 +36,8 @@ using std::vector;
|
|||
using std::cerr;
|
||||
using std::endl;
|
||||
|
||||
bool JackConnection::_in_control = false;
|
||||
|
||||
static void jack_halted_callback (void* arg)
|
||||
{
|
||||
JackConnection* jc = static_cast<JackConnection*> (arg);
|
||||
|
|
@ -54,17 +56,9 @@ JackConnection::JackConnection (const std::string& arg1, const std::string& arg2
|
|||
, _client_name (arg1)
|
||||
, session_uuid (arg2)
|
||||
{
|
||||
_in_control = !server_running();
|
||||
}
|
||||
/* See if the server is already up
|
||||
*/
|
||||
|
||||
JackConnection::~JackConnection ()
|
||||
{
|
||||
close ();
|
||||
}
|
||||
|
||||
bool
|
||||
JackConnection::server_running ()
|
||||
{
|
||||
EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa ();
|
||||
boost::scoped_ptr<EnvironmentalProtectionAgency> current_epa;
|
||||
|
||||
|
|
@ -83,10 +77,15 @@ JackConnection::server_running ()
|
|||
|
||||
if (status == 0) {
|
||||
jack_client_close (c);
|
||||
return true;
|
||||
_in_control = false;
|
||||
} else {
|
||||
_in_control = true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
JackConnection::~JackConnection ()
|
||||
{
|
||||
close ();
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -106,19 +105,6 @@ JackConnection::open ()
|
|||
global_epa->restore ();
|
||||
}
|
||||
|
||||
/* check to see if the server is already running so that we know if we
|
||||
* are starting it.
|
||||
*/
|
||||
|
||||
jack_client_t* c = jack_client_open ("ardourprobe", JackNoStartServer, &status);
|
||||
|
||||
if (status == 0) {
|
||||
_in_control = false;
|
||||
jack_client_close (c);
|
||||
} else {
|
||||
_in_control = true;
|
||||
}
|
||||
|
||||
/* ensure that PATH or equivalent includes likely locations of the JACK
|
||||
* server, in case the user's default does not.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue