Commit a280d1f3 authored by sletz's avatar sletz
Browse files

Update JackTransportEngine for NetJack2 needs.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2800 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 266368e8
......@@ -1331,7 +1331,7 @@ EXPORT pthread_t jack_client_thread_id(jack_client_t* ext_client)
}
}
EXPORT char* jack_get_client_name (jack_client_t* ext_client)
EXPORT char* jack_get_client_name(jack_client_t* ext_client)
{
#ifdef __CLIENTDEBUG__
JackLibGlobals::CheckContext();
......
......@@ -709,8 +709,12 @@ void JackClient::CallSyncCallback()
void JackClient::CallTimebaseCallback()
{
JackTransportEngine& transport = GetEngineControl()->fTransport;
int master;
bool unused;
if (GetClientControl()->fRefNum == transport.GetTimebaseMaster() && fTimebase) { // Client *is* timebase...
transport.GetTimebaseMaster(master, unused);
if (GetClientControl()->fRefNum == master && fTimebase) { // Client *is* timebase...
jack_transport_state_t transport_state = transport.GetState();
jack_position_t* cur_pos = transport.WriteNextStateStart(1);
......
......@@ -305,7 +305,7 @@ int JackServer::ReleaseTimebase(int refnum)
int JackServer::SetTimebaseCallback(int refnum, int conditional)
{
return fEngineControl->fTransport.SetTimebase(refnum, conditional);
return fEngineControl->fTransport.SetTimebaseMaster(refnum, conditional);
}
JackLockedEngine* JackServer::GetEngine()
......
......@@ -44,6 +44,7 @@ JackTransportEngine::JackTransportEngine(): JackAtomicArrayState<jack_position_t
fSyncTimeLeft = 0;
fTimeBaseMaster = -1;
fWriteCounter = 0;
fConditionnal = false;
fPendingPos = false;
fNetworkSync = false;
}
......@@ -71,7 +72,7 @@ int JackTransportEngine::ResetTimebase(int refnum)
}
// Server
int JackTransportEngine::SetTimebase(int refnum, bool conditionnal)
int JackTransportEngine::SetTimebaseMaster(int refnum, bool conditionnal)
{
if (conditionnal && fTimeBaseMaster > 0) {
if (refnum != fTimeBaseMaster) {
......@@ -83,11 +84,18 @@ int JackTransportEngine::SetTimebase(int refnum, bool conditionnal)
}
} else {
fTimeBaseMaster = refnum;
fConditionnal = conditionnal;
jack_log("new timebase master: ref = %ld", refnum);
return 0;
}
}
void JackTransportEngine::GetTimebaseMaster(int& refnum, bool& conditionnal)
{
refnum = fTimeBaseMaster;
conditionnal = fConditionnal;
}
// RT
bool JackTransportEngine::CheckAllRolling(JackClientInterface** table)
{
......
......@@ -102,6 +102,7 @@ class EXPORT JackTransportEngine : public JackAtomicArrayState<jack_position_t>
int fTimeBaseMaster;
bool fPendingPos;
bool fNetworkSync;
bool fConditionnal;
SInt32 fWriteCounter;
bool CheckAllRolling(JackClientInterface** table);
......@@ -128,16 +129,11 @@ class EXPORT JackTransportEngine : public JackAtomicArrayState<jack_position_t>
return fTransportState;
}
void GetState(jack_transport_state_t state)
void SetState(jack_transport_state_t state)
{
fTransportState = state;
}
int GetTimebaseMaster() const
{
return fTimeBaseMaster;
}
/*
\brief
*/
......@@ -146,7 +142,9 @@ class EXPORT JackTransportEngine : public JackAtomicArrayState<jack_position_t>
/*
\brief
*/
int SetTimebase(int refnum, bool conditionnal);
int SetTimebaseMaster(int refnum, bool conditionnal);
void GetTimebaseMaster(int& refnum, bool& conditionnal);
/*
\brief
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment