Browse Source

Cleanup.

tags/v1.9.10
Stephane Letz 12 years ago
parent
commit
d8a6bc4de6
3 changed files with 54 additions and 35 deletions
  1. +1
    -1
      common/JackEngine.cpp
  2. +48
    -33
      common/JackServer.cpp
  3. +5
    -1
      common/JackServer.h

+ 1
- 1
common/JackEngine.cpp View File

@@ -279,7 +279,7 @@ int JackEngine::ClientNotify(JackClientInterface* client, int refnum, const char
}
if (ret < 0) {
jack_error("NotifyClient fails name = %s notification = %ld val1 = %ld val2 = %ld", name, notify, value1, value2);
jack_error("ClientNotify fails name = %s notification = %ld val1 = %ld val2 = %ld", name, notify, value1, value2);
}
return ret;
}


+ 48
- 33
common/JackServer.cpp View File

@@ -37,6 +37,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{

//----------------
// Server control
//----------------

JackServer::JackServer(bool sync, bool temporary, int timeout, bool rt, int priority, int port_max, bool verbose, jack_timer_type_t clock, const char* server_name)
{
if (rt) {
@@ -144,6 +148,42 @@ int JackServer::Close()
return 0;
}

int JackServer::Start()
{
jack_log("JackServer::Start");
if (fAudioDriver->Start() < 0) {
return -1;
}
return fRequestChannel.Start();
}

int JackServer::Stop()
{
jack_log("JackServer::Stop");
fEngine->NotifyQuit();
fRequestChannel.Stop();
fEngine->NotifyFailure(JackFailure, "JACK server has been closed");

if (fFreewheel) {
return fThreadedFreewheelDriver->Stop();
} else {
return fAudioDriver->Stop();
}
}

bool JackServer::IsRunning()
{
jack_log("JackServer::IsRunning");
assert(fAudioDriver);
return fAudioDriver->IsRunning();
}

//------------------
// Internal clients
//------------------

int JackServer::InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status)
{
JackLoadableInternalClient* client = new JackLoadableInternalClient1(JackServerGlobals::fInstance, GetSynchroTable(), objet_data);
@@ -176,37 +216,9 @@ int JackServer::InternalClientLoadAux(JackLoadableInternalClient* client, const
}
}

int JackServer::Start()
{
jack_log("JackServer::Start");
if (fAudioDriver->Start() < 0) {
return -1;
}
return fRequestChannel.Start();
}

int JackServer::Stop()
{
jack_log("JackServer::Stop");
fEngine->NotifyQuit();
fRequestChannel.Stop();
fEngine->NotifyFailure(JackFailure, "JACK server has been closed");

if (fFreewheel) {
return fThreadedFreewheelDriver->Stop();
} else {
return fAudioDriver->Stop();
}
}

bool JackServer::IsRunning()
{
jack_log("JackServer::IsRunning");
assert(fAudioDriver);
return fAudioDriver->IsRunning();
}
//---------------------------
// From request thread : API
//---------------------------

int JackServer::SetBufferSize(jack_nframes_t buffer_size)
{
@@ -284,7 +296,10 @@ int JackServer::SetFreewheel(bool onoff)
}
}

//---------------------------
// Coming from the RT thread
//---------------------------

void JackServer::Notify(int refnum, int notify, int value)
{
switch (notify) {
@@ -299,9 +314,9 @@ void JackServer::Notify(int refnum, int notify, int value)
}
}

//----------------------
//--------------------
// Backend management
//----------------------
//--------------------

JackDriverInfo* JackServer::AddSlave(jack_driver_desc_t* driver_desc, JSList* driver_params)
{


+ 5
- 1
common/JackServer.h View File

@@ -67,19 +67,23 @@ class SERVER_EXPORT JackServer
JackServer(bool sync, bool temporary, int timeout, bool rt, int priority, int port_max, bool verbose, jack_timer_type_t clock, const char* server_name);
~JackServer();

// Server control
int Open(jack_driver_desc_t* driver_desc, JSList* driver_params);
int Close();

int Start();
int Stop();
bool IsRunning();

// RT thread
void Notify(int refnum, int notify, int value);

// Command thread : API
// From request thread : API
int SetBufferSize(jack_nframes_t buffer_size);
int SetFreewheel(bool onoff);
// Internals clients
int InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status);
int InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status);


Loading…
Cancel
Save