@@ -53,41 +53,41 @@ class JackAC3Encoder | |||||
private: | private: | ||||
AftenContext fAftenContext; | |||||
AftenContext fAftenContext; | |||||
jack_ringbuffer_t* fRingBuffer; | jack_ringbuffer_t* fRingBuffer; | ||||
float* fSampleBuffer; | float* fSampleBuffer; | ||||
unsigned char* fAC3Buffer; | unsigned char* fAC3Buffer; | ||||
unsigned char* fZeroBuffer; | unsigned char* fZeroBuffer; | ||||
int fOutSizeByte; | |||||
int fOutSizeByte; | |||||
jack_nframes_t fFramePos; | jack_nframes_t fFramePos; | ||||
jack_nframes_t fSampleRate; | jack_nframes_t fSampleRate; | ||||
jack_nframes_t fByteRate; | jack_nframes_t fByteRate; | ||||
void FillSpdifHeader(unsigned char* buf, int outsize); | void FillSpdifHeader(unsigned char* buf, int outsize); | ||||
int Output2Driver(float** outputs, jack_nframes_t nframes); | int Output2Driver(float** outputs, jack_nframes_t nframes); | ||||
void sample_move_dS_s16(jack_default_audio_sample_t* dst, char *src, jack_nframes_t nsamples, unsigned long src_skip); | void sample_move_dS_s16(jack_default_audio_sample_t* dst, char *src, jack_nframes_t nsamples, unsigned long src_skip); | ||||
void sample_move_dS_s16_24ph(jack_default_audio_sample_t* dst, char *src, jack_nframes_t nsamples, unsigned long src_skip); | void sample_move_dS_s16_24ph(jack_default_audio_sample_t* dst, char *src, jack_nframes_t nsamples, unsigned long src_skip); | ||||
public: | public: | ||||
#ifdef __ppc__ | #ifdef __ppc__ | ||||
JackAC3Encoder(const JackAC3EncoderParams& params) {} | JackAC3Encoder(const JackAC3EncoderParams& params) {} | ||||
virtual ~JackAC3Encoder() {} | virtual ~JackAC3Encoder() {} | ||||
bool Init(jack_nframes_t sample_rate) {return false;} | bool Init(jack_nframes_t sample_rate) {return false;} | ||||
void Process(float** inputs, float** outputs, int nframes) {} | void Process(float** inputs, float** outputs, int nframes) {} | ||||
void GetChannelName(const char* name, const char* alias, char* portname, int channel) {} | void GetChannelName(const char* name, const char* alias, char* portname, int channel) {} | ||||
#else | #else | ||||
JackAC3Encoder(const JackAC3EncoderParams& params); | JackAC3Encoder(const JackAC3EncoderParams& params); | ||||
virtual ~JackAC3Encoder(); | virtual ~JackAC3Encoder(); | ||||
bool Init(jack_nframes_t sample_rate); | bool Init(jack_nframes_t sample_rate); | ||||
void Process(float** inputs, float** outputs, int nframes); | void Process(float** inputs, float** outputs, int nframes); | ||||
void GetChannelName(const char* name, const char* alias, char* portname, int channel); | void GetChannelName(const char* name, const char* alias, char* portname, int channel); | ||||
#endif | #endif | ||||
@@ -40,18 +40,18 @@ struct AtomicArrayCounter | |||||
scounter; | scounter; | ||||
UInt32 fLongVal; | UInt32 fLongVal; | ||||
}info; | }info; | ||||
AtomicArrayCounter() | AtomicArrayCounter() | ||||
{ | { | ||||
info.fLongVal = 0; | info.fLongVal = 0; | ||||
} | } | ||||
AtomicArrayCounter(volatile const AtomicArrayCounter& obj) | |||||
AtomicArrayCounter(volatile const AtomicArrayCounter& obj) | |||||
{ | { | ||||
info.fLongVal = obj.info.fLongVal; | info.fLongVal = obj.info.fLongVal; | ||||
} | } | ||||
AtomicArrayCounter(volatile AtomicArrayCounter& obj) | |||||
AtomicArrayCounter(volatile AtomicArrayCounter& obj) | |||||
{ | { | ||||
info.fLongVal = obj.info.fLongVal; | info.fLongVal = obj.info.fLongVal; | ||||
} | } | ||||
@@ -67,7 +67,7 @@ struct AtomicArrayCounter | |||||
info.fLongVal = obj.info.fLongVal; | info.fLongVal = obj.info.fLongVal; | ||||
return *this; | return *this; | ||||
} | } | ||||
} POST_PACKED_STRUCTURE; | } POST_PACKED_STRUCTURE; | ||||
#define Counter1(e) (e).info.fLongVal | #define Counter1(e) (e).info.fLongVal | ||||
@@ -243,7 +243,7 @@ class JackAtomicArrayState | |||||
/*! | /*! | ||||
\brief Stop write operation : make the next state ready to be used by the RT thread | \brief Stop write operation : make the next state ready to be used by the RT thread | ||||
*/ | */ | ||||
void WriteNextStateStop(int state) | void WriteNextStateStop(int state) | ||||
{ | { | ||||
WriteNextStateStopAux(state); | WriteNextStateStopAux(state); | ||||
@@ -48,12 +48,12 @@ struct AtomicCounter | |||||
info.fLongVal = 0; | info.fLongVal = 0; | ||||
} | } | ||||
AtomicCounter(volatile const AtomicCounter& obj) | |||||
AtomicCounter(volatile const AtomicCounter& obj) | |||||
{ | { | ||||
info.fLongVal = obj.info.fLongVal; | info.fLongVal = obj.info.fLongVal; | ||||
} | } | ||||
AtomicCounter(volatile AtomicCounter& obj) | |||||
AtomicCounter(volatile AtomicCounter& obj) | |||||
{ | { | ||||
info.fLongVal = obj.info.fLongVal; | info.fLongVal = obj.info.fLongVal; | ||||
} | } | ||||
@@ -139,7 +139,7 @@ class JackAtomicState | |||||
{} | {} | ||||
/*! | /*! | ||||
\brief Returns the current state : only valid in the RT reader thread | |||||
\brief Returns the current state : only valid in the RT reader thread | |||||
*/ | */ | ||||
T* ReadCurrentState() | T* ReadCurrentState() | ||||
{ | { | ||||
@@ -212,7 +212,7 @@ class JackAtomicState | |||||
/* | /* | ||||
// Single writer : write methods get the *next* state to be updated | // Single writer : write methods get the *next* state to be updated | ||||
void TestWriteMethod() | |||||
void TestWriteMethod() | |||||
{ | { | ||||
T* state = WriteNextStateStart(); | T* state = WriteNextStateStart(); | ||||
...... | ...... | ||||
@@ -221,7 +221,7 @@ class JackAtomicState | |||||
} | } | ||||
// First RT call possibly switch state | // First RT call possibly switch state | ||||
void TestReadRTMethod1() | |||||
void TestReadRTMethod1() | |||||
{ | { | ||||
T* state = TrySwitchState(); | T* state = TrySwitchState(); | ||||
...... | ...... | ||||
@@ -235,25 +235,25 @@ class JackAtomicState | |||||
...... | ...... | ||||
...... | ...... | ||||
} | } | ||||
// Non RT read methods : must check state coherency | // Non RT read methods : must check state coherency | ||||
void TestReadMethod() | |||||
void TestReadMethod() | |||||
{ | { | ||||
T* state; | T* state; | ||||
UInt16 cur_index; | UInt16 cur_index; | ||||
UInt16 next_index = GetCurrentIndex(); | UInt16 next_index = GetCurrentIndex(); | ||||
do { | do { | ||||
cur_index = next_index; | |||||
cur_index = next_index; | |||||
state = ReadCurrentState(); | state = ReadCurrentState(); | ||||
...... | ...... | ||||
...... | ...... | ||||
next_index = GetCurrentIndex(); | next_index = GetCurrentIndex(); | ||||
} while (cur_index != next_index); | } while (cur_index != next_index); | ||||
} | } | ||||
*/ | */ | ||||
} POST_PACKED_STRUCTURE; | } POST_PACKED_STRUCTURE; | ||||
} // end of namespace | } // end of namespace | ||||
@@ -75,10 +75,10 @@ class JackClientRequestInterface : public JackChannelTransactionInterface, publi | |||||
{} | {} | ||||
virtual ~JackClientRequestInterface() | virtual ~JackClientRequestInterface() | ||||
{} | {} | ||||
virtual int Read(void* data, int len) { return -1; } | virtual int Read(void* data, int len) { return -1; } | ||||
virtual int Write(void* data, int len) { return -1; } | virtual int Write(void* data, int len) { return -1; } | ||||
virtual int Connect(const char* dir, const char* name, int which) { return -1; } | virtual int Connect(const char* dir, const char* name, int which) { return -1; } | ||||
virtual int Close() { return -1; } | virtual int Close() { return -1; } | ||||
@@ -131,7 +131,7 @@ class JackDebugClient : public JackClient | |||||
int InternalClientHandle(const char* client_name, jack_status_t* status); | int InternalClientHandle(const char* client_name, jack_status_t* status); | ||||
int InternalClientLoad(const char* client_name, jack_options_t options, jack_status_t* status, jack_varargs_t* va); | int InternalClientLoad(const char* client_name, jack_options_t options, jack_status_t* status, jack_varargs_t* va); | ||||
void InternalClientUnload(int ref, jack_status_t* status); | void InternalClientUnload(int ref, jack_status_t* status); | ||||
// RT Thread | // RT Thread | ||||
int SetProcessThread(JackThreadCallback fun, void *arg); | int SetProcessThread(JackThreadCallback fun, void *arg); | ||||
@@ -162,14 +162,14 @@ class SERVER_EXPORT JackDriver : public JackDriverClientInterface | |||||
jack_port_id_t fPlaybackPortList[DRIVER_PORT_NUM]; | jack_port_id_t fPlaybackPortList[DRIVER_PORT_NUM]; | ||||
jack_port_id_t fMonitorPortList[DRIVER_PORT_NUM]; | jack_port_id_t fMonitorPortList[DRIVER_PORT_NUM]; | ||||
driver_connections_list_t fConnections; // Connections list | |||||
driver_connections_list_t fConnections; // Connections list | |||||
void CycleIncTime(); | void CycleIncTime(); | ||||
void CycleTakeBeginTime(); | void CycleTakeBeginTime(); | ||||
void CycleTakeEndTime(); | void CycleTakeEndTime(); | ||||
void SetupDriverSync(int ref, bool freewheel); | void SetupDriverSync(int ref, bool freewheel); | ||||
void NotifyXRun(jack_time_t callback_usecs, float delayed_usecs); // XRun notification sent by the driver | void NotifyXRun(jack_time_t callback_usecs, float delayed_usecs); // XRun notification sent by the driver | ||||
void NotifyBufferSize(jack_nframes_t buffer_size); // BufferSize notification sent by the driver | void NotifyBufferSize(jack_nframes_t buffer_size); // BufferSize notification sent by the driver | ||||
void NotifySampleRate(jack_nframes_t sample_rate); // SampleRate notification sent by the driver | void NotifySampleRate(jack_nframes_t sample_rate); // SampleRate notification sent by the driver | ||||
@@ -78,7 +78,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||||
void ReleaseRefnum(int refnum); | void ReleaseRefnum(int refnum); | ||||
int ClientNotify(JackClientInterface* client, int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2); | int ClientNotify(JackClientInterface* client, int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2); | ||||
void NotifyClient(int refnum, int event, int sync, const char* message, int value1, int value2); | void NotifyClient(int refnum, int event, int sync, const char* message, int value1, int value2); | ||||
void NotifyClients(int event, int sync, const char* message, int value1, int value2); | void NotifyClients(int event, int sync, const char* message, int value1, int value2); | ||||
@@ -104,10 +104,10 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||||
int Open(); | int Open(); | ||||
int Close(); | int Close(); | ||||
// Client management | // Client management | ||||
int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status); | int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status); | ||||
int ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager); | int ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager); | ||||
int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait); | int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait); | ||||
@@ -116,7 +116,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||||
int ClientActivate(int refnum, bool is_real_time); | int ClientActivate(int refnum, bool is_real_time); | ||||
int ClientDeactivate(int refnum); | int ClientDeactivate(int refnum); | ||||
void ClientKill(int refnum); | void ClientKill(int refnum); | ||||
int GetClientPID(const char* name); | int GetClientPID(const char* name); | ||||
@@ -104,7 +104,7 @@ struct SERVER_EXPORT JackEngineControl : public JackShmMem | |||||
fRealTime = rt; | fRealTime = rt; | ||||
fSavedRealTime = false; | fSavedRealTime = false; | ||||
fServerPriority = priority; | fServerPriority = priority; | ||||
#ifdef WIN32 | #ifdef WIN32 | ||||
fClientPriority = (rt) ? priority - 3 : 0; | fClientPriority = (rt) ? priority - 3 : 0; | ||||
#else | #else | ||||
@@ -130,7 +130,7 @@ struct SERVER_EXPORT JackEngineControl : public JackShmMem | |||||
~JackEngineControl() | ~JackEngineControl() | ||||
{} | {} | ||||
void UpdateTimeOut() | void UpdateTimeOut() | ||||
{ | { | ||||
fPeriodUsecs = jack_time_t(1000000.f / fSampleRate * fBufferSize); // In microsec | fPeriodUsecs = jack_time_t(1000000.f / fSampleRate * fBufferSize); // In microsec | ||||
@@ -45,7 +45,7 @@ struct JackTimingMeasureClient | |||||
jack_time_t fAwakeAt; | jack_time_t fAwakeAt; | ||||
jack_time_t fFinishedAt; | jack_time_t fFinishedAt; | ||||
jack_client_state_t fStatus; | jack_client_state_t fStatus; | ||||
JackTimingMeasureClient() | JackTimingMeasureClient() | ||||
:fRefNum(-1), | :fRefNum(-1), | ||||
fSignaledAt(0), | fSignaledAt(0), | ||||
@@ -53,7 +53,7 @@ struct JackTimingMeasureClient | |||||
fFinishedAt(0), | fFinishedAt(0), | ||||
fStatus((jack_client_state_t)0) | fStatus((jack_client_state_t)0) | ||||
{} | {} | ||||
} POST_PACKED_STRUCTURE; | } POST_PACKED_STRUCTURE; | ||||
/*! | /*! | ||||
@@ -67,13 +67,13 @@ struct JackTimingClientInterval | |||||
char fName[JACK_CLIENT_NAME_SIZE + 1]; | char fName[JACK_CLIENT_NAME_SIZE + 1]; | ||||
int fBeginInterval; | int fBeginInterval; | ||||
int fEndInterval; | int fEndInterval; | ||||
JackTimingClientInterval() | JackTimingClientInterval() | ||||
:fRefNum(-1), | :fRefNum(-1), | ||||
fBeginInterval(-1), | fBeginInterval(-1), | ||||
fEndInterval(-1) | fEndInterval(-1) | ||||
{} | {} | ||||
} POST_PACKED_STRUCTURE; | } POST_PACKED_STRUCTURE; | ||||
/*! | /*! | ||||
@@ -88,14 +88,14 @@ struct JackTimingMeasure | |||||
jack_time_t fCurCycleBegin; | jack_time_t fCurCycleBegin; | ||||
jack_time_t fPrevCycleEnd; | jack_time_t fPrevCycleEnd; | ||||
JackTimingMeasureClient fClientTable[CLIENT_NUM]; | JackTimingMeasureClient fClientTable[CLIENT_NUM]; | ||||
JackTimingMeasure() | JackTimingMeasure() | ||||
:fAudioCycle(0), | :fAudioCycle(0), | ||||
fPeriodUsecs(0), | fPeriodUsecs(0), | ||||
fCurCycleBegin(0), | fCurCycleBegin(0), | ||||
fPrevCycleEnd(0) | fPrevCycleEnd(0) | ||||
{} | {} | ||||
} POST_PACKED_STRUCTURE; | } POST_PACKED_STRUCTURE; | ||||
/*! | /*! | ||||
@@ -110,20 +110,20 @@ class SERVER_EXPORT JackEngineProfiling | |||||
{ | { | ||||
private: | private: | ||||
JackTimingMeasure fProfileTable[TIME_POINTS]; | JackTimingMeasure fProfileTable[TIME_POINTS]; | ||||
JackTimingClientInterval fIntervalTable[MEASURED_CLIENTS]; | JackTimingClientInterval fIntervalTable[MEASURED_CLIENTS]; | ||||
unsigned int fAudioCycle; | unsigned int fAudioCycle; | ||||
unsigned int fMeasuredClient; | unsigned int fMeasuredClient; | ||||
bool CheckClient(const char* name, int cur_point); | bool CheckClient(const char* name, int cur_point); | ||||
public: | public: | ||||
JackEngineProfiling(); | JackEngineProfiling(); | ||||
~JackEngineProfiling(); | ~JackEngineProfiling(); | ||||
void Profile(JackClientInterface** table, | void Profile(JackClientInterface** table, | ||||
JackGraphManager* manager, | JackGraphManager* manager, | ||||
jack_time_t period_usecs, | jack_time_t period_usecs, | ||||
@@ -88,11 +88,11 @@ class SERVER_EXPORT JackLockedEngine | |||||
{} | {} | ||||
~JackLockedEngine() | ~JackLockedEngine() | ||||
{} | {} | ||||
bool Lock() { return fEngine.Lock(); } | bool Lock() { return fEngine.Lock(); } | ||||
bool Unlock() { return fEngine.Unlock(); } | bool Unlock() { return fEngine.Unlock(); } | ||||
bool Trylock() { return fEngine.Trylock(); } | bool Trylock() { return fEngine.Trylock(); } | ||||
int Open() | int Open() | ||||
{ | { | ||||
// No lock needed | // No lock needed | ||||
@@ -107,7 +107,7 @@ class SERVER_EXPORT JackLockedEngine | |||||
return fEngine.Close(); | return fEngine.Close(); | ||||
CATCH_EXCEPTION_RETURN | CATCH_EXCEPTION_RETURN | ||||
} | } | ||||
// Client management | // Client management | ||||
int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status) | int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status) | ||||
{ | { | ||||
@@ -50,7 +50,7 @@ namespace Jack | |||||
//adapter thread | //adapter thread | ||||
JackThread fThread; | JackThread fThread; | ||||
//transport | //transport | ||||
void EncodeTransportData(); | void EncodeTransportData(); | ||||
void DecodeTransportData(); | void DecodeTransportData(); | ||||
@@ -43,16 +43,16 @@ namespace Jack | |||||
//transport | //transport | ||||
int fLastTransportState; | int fLastTransportState; | ||||
int fLastTimebaseMaster; | int fLastTimebaseMaster; | ||||
// The wanted value at creation time (may be different than the value actually returned by the master) | // The wanted value at creation time (may be different than the value actually returned by the master) | ||||
int fWantedAudioCaptureChannels; | |||||
int fWantedAudioPlaybackChannels; | |||||
int fWantedAudioCaptureChannels; | |||||
int fWantedAudioPlaybackChannels; | |||||
int fWantedMIDICaptureChannels; | int fWantedMIDICaptureChannels; | ||||
int fWantedMIDIPlaybackChannels; | int fWantedMIDIPlaybackChannels; | ||||
bool fAutoSave; | bool fAutoSave; | ||||
//monitoring | //monitoring | ||||
#ifdef JACK_MONITOR | #ifdef JACK_MONITOR | ||||
JackGnuPlotMonitor<float>* fNetTimeMon; | JackGnuPlotMonitor<float>* fNetTimeMon; | ||||
@@ -73,14 +73,14 @@ namespace Jack | |||||
JackMidiBuffer* GetMidiOutputBuffer(int port_index); | JackMidiBuffer* GetMidiOutputBuffer(int port_index); | ||||
void SaveConnections(int alias); | void SaveConnections(int alias); | ||||
void UpdateLatencies(); | void UpdateLatencies(); | ||||
public: | public: | ||||
JackNetDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table, | JackNetDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table, | ||||
const char* ip, int port, int mtu, int midi_input_ports, int midi_output_ports, | const char* ip, int port, int mtu, int midi_input_ports, int midi_output_ports, | ||||
char* net_name, uint transport_sync, int network_latency, int celt_encoding, | |||||
char* net_name, uint transport_sync, int network_latency, int celt_encoding, | |||||
int opus_encoding, bool auto_save); | int opus_encoding, bool auto_save); | ||||
virtual ~JackNetDriver(); | virtual ~JackNetDriver(); | ||||
@@ -38,7 +38,7 @@ namespace Jack | |||||
#define SLAVE_INIT_TIMEOUT 1000000 * 1 // in usec | #define SLAVE_INIT_TIMEOUT 1000000 * 1 // in usec | ||||
#define PACKET_TIMEOUT 1000000 // in usec | #define PACKET_TIMEOUT 1000000 // in usec | ||||
#define NETWORK_DEFAULT_LATENCY 2 | |||||
#define NETWORK_DEFAULT_LATENCY 2 | |||||
#define NETWORK_MAX_LATENCY 30 // maximum possible latency in network master/slave loop | #define NETWORK_MAX_LATENCY 30 // maximum possible latency in network master/slave loop | ||||
/** | /** | ||||
@@ -49,9 +49,9 @@ namespace Jack | |||||
{ | { | ||||
friend class JackNetExt; | friend class JackNetExt; | ||||
protected: | protected: | ||||
bool fSetTimeOut; | bool fSetTimeOut; | ||||
int fPacketTimeOut; | int fPacketTimeOut; | ||||
@@ -115,7 +115,7 @@ namespace Jack | |||||
int AudioRecv(packet_header_t* rx_head, NetAudioBuffer* buffer); | int AudioRecv(packet_header_t* rx_head, NetAudioBuffer* buffer); | ||||
int FinishRecv(NetAudioBuffer* buffer); | int FinishRecv(NetAudioBuffer* buffer); | ||||
void SetRcvTimeOut(); | void SetRcvTimeOut(); | ||||
void SetPacketTimeOut(int time_out) | void SetPacketTimeOut(int time_out) | ||||
{ | { | ||||
@@ -149,7 +149,7 @@ namespace Jack | |||||
int fCurrentCycleOffset; | int fCurrentCycleOffset; | ||||
int fMaxCycleOffset; | int fMaxCycleOffset; | ||||
bool fSynched; | bool fSynched; | ||||
bool Init(); | bool Init(); | ||||
bool SetParams(); | bool SetParams(); | ||||
@@ -207,7 +207,7 @@ namespace Jack | |||||
bool InitConnection(int time_out_sec); | bool InitConnection(int time_out_sec); | ||||
bool InitRendering(); | bool InitRendering(); | ||||
net_status_t SendAvailableToMaster(int count = INT_MAX); | |||||
net_status_t SendAvailableToMaster(int count = INT_MAX); | |||||
net_status_t SendStartToMaster(); | net_status_t SendStartToMaster(); | ||||
bool SetParams(); | bool SetParams(); | ||||
@@ -32,7 +32,7 @@ namespace Jack | |||||
/** | /** | ||||
\Brief This class describes a Net Master | \Brief This class describes a Net Master | ||||
*/ | */ | ||||
typedef std::list<std::pair<std::string, std::string> > connections_list_t; | typedef std::list<std::pair<std::string, std::string> > connections_list_t; | ||||
class JackNetMaster : public JackNetMasterInterface | class JackNetMaster : public JackNetMasterInterface | ||||
@@ -40,7 +40,7 @@ namespace Jack | |||||
friend class JackNetMasterManager; | friend class JackNetMasterManager; | ||||
private: | private: | ||||
static int SetProcess(jack_nframes_t nframes, void* arg); | static int SetProcess(jack_nframes_t nframes, void* arg); | ||||
static int SetBufferSize(jack_nframes_t nframes, void* arg); | static int SetBufferSize(jack_nframes_t nframes, void* arg); | ||||
static int SetSampleRate(jack_nframes_t nframes, void* arg); | static int SetSampleRate(jack_nframes_t nframes, void* arg); | ||||
@@ -60,7 +60,7 @@ namespace Jack | |||||
//sync and transport | //sync and transport | ||||
int fLastTransportState; | int fLastTransportState; | ||||
//monitoring | //monitoring | ||||
#ifdef JACK_MONITOR | #ifdef JACK_MONITOR | ||||
jack_time_t fPeriodUsecs; | jack_time_t fPeriodUsecs; | ||||
@@ -79,7 +79,7 @@ namespace Jack | |||||
void TimebaseCallback(jack_position_t* pos); | void TimebaseCallback(jack_position_t* pos); | ||||
void ConnectPorts(); | void ConnectPorts(); | ||||
void ConnectCallback(jack_port_id_t a, jack_port_id_t b, int connect); | void ConnectCallback(jack_port_id_t a, jack_port_id_t b, int connect); | ||||
void SaveConnections(connections_list_t& connections); | void SaveConnections(connections_list_t& connections); | ||||
void LoadConnections(const connections_list_t& connections); | void LoadConnections(const connections_list_t& connections); | ||||
@@ -342,8 +342,8 @@ namespace Jack | |||||
int fPacketSize; | int fPacketSize; | ||||
void UpdateParams(int active_ports); | void UpdateParams(int active_ports); | ||||
void RenderFromNetwork(char* net_buffer, int active_port, int sub_cycle); | void RenderFromNetwork(char* net_buffer, int active_port, int sub_cycle); | ||||
void RenderToNetwork(char* net_buffer, int active_port, int sub_cycle); | void RenderToNetwork(char* net_buffer, int active_port, int sub_cycle); | ||||
@@ -379,7 +379,7 @@ namespace Jack | |||||
int fCompressedSizeByte; | int fCompressedSizeByte; | ||||
unsigned char** fCompressedBuffer; | unsigned char** fCompressedBuffer; | ||||
size_t fLastSubPeriodBytesSize; | size_t fLastSubPeriodBytesSize; | ||||
void FreeCelt(); | void FreeCelt(); | ||||
@@ -422,7 +422,7 @@ namespace Jack | |||||
int fCompressedMaxSizeByte; | int fCompressedMaxSizeByte; | ||||
unsigned short* fCompressedSizesByte; | unsigned short* fCompressedSizesByte; | ||||
size_t fLastSubPeriodBytesSize; | size_t fLastSubPeriodBytesSize; | ||||
unsigned char** fCompressedBuffer; | unsigned char** fCompressedBuffer; | ||||
@@ -456,7 +456,7 @@ namespace Jack | |||||
private: | private: | ||||
int fCompressedSizeByte; | int fCompressedSizeByte; | ||||
size_t fLastSubPeriodBytesSize; | size_t fLastSubPeriodBytesSize; | ||||
short** fIntBuffer; | short** fIntBuffer; | ||||
@@ -40,21 +40,21 @@ struct JackProfilerClient { | |||||
jack_client_t* fClient; | jack_client_t* fClient; | ||||
jack_port_t* fSchedulingPort; | jack_port_t* fSchedulingPort; | ||||
jack_port_t* fDurationPort; | jack_port_t* fDurationPort; | ||||
JackProfilerClient(jack_client_t* client, const char* name); | JackProfilerClient(jack_client_t* client, const char* name); | ||||
~JackProfilerClient(); | ~JackProfilerClient(); | ||||
}; | }; | ||||
/*! | /*! | ||||
\brief Server real-time monitoring | \brief Server real-time monitoring | ||||
*/ | */ | ||||
class JackProfiler | |||||
class JackProfiler | |||||
{ | { | ||||
private: | private: | ||||
jack_client_t* fClient; | jack_client_t* fClient; | ||||
jack_port_t* fCPULoadPort; | jack_port_t* fCPULoadPort; | ||||
jack_port_t* fDriverPeriodPort; | jack_port_t* fDriverPeriodPort; | ||||
@@ -64,7 +64,7 @@ class JackProfiler | |||||
std::map<std::string, JackProfilerClient*> fClientTable; | std::map<std::string, JackProfilerClient*> fClientTable; | ||||
JackMutex fMutex; | JackMutex fMutex; | ||||
#endif | #endif | ||||
public: | public: | ||||
JackProfiler(jack_client_t* jack_client, const JSList* params); | JackProfiler(jack_client_t* jack_client, const JSList* params); | ||||
@@ -111,14 +111,14 @@ struct JackRequest | |||||
} | } | ||||
virtual int Write(detail::JackChannelTransactionInterface* trans) { return -1; } | virtual int Write(detail::JackChannelTransactionInterface* trans) { return -1; } | ||||
virtual int Write(detail::JackChannelTransactionInterface* trans, int size) | virtual int Write(detail::JackChannelTransactionInterface* trans, int size) | ||||
{ | { | ||||
fSize = size; | fSize = size; | ||||
CheckRes(trans->Write(&fType, sizeof(RequestType))); | CheckRes(trans->Write(&fType, sizeof(RequestType))); | ||||
return trans->Write(&fSize, sizeof(int)); | return trans->Write(&fSize, sizeof(int)); | ||||
} | } | ||||
virtual int Size() { return 0; } | virtual int Size() { return 0; } | ||||
}; | }; | ||||
@@ -194,7 +194,7 @@ struct JackClientCheckRequest : public JackRequest | |||||
CheckRes(trans->Write(&fUUID, sizeof(int))); | CheckRes(trans->Write(&fUUID, sizeof(int))); | ||||
return trans->Write(&fOpen, sizeof(int)); | return trans->Write(&fOpen, sizeof(int)); | ||||
} | } | ||||
int Size() { return sizeof(fName) + 4 * sizeof(int); } | int Size() { return sizeof(fName) + 4 * sizeof(int); } | ||||
}; | }; | ||||
@@ -278,7 +278,7 @@ struct JackClientOpenRequest : public JackRequest | |||||
} | } | ||||
int Size() { return 2 * sizeof(int) + sizeof(fName); } | int Size() { return 2 * sizeof(int) + sizeof(fName); } | ||||
}; | }; | ||||
/*! | /*! | ||||
@@ -458,7 +458,7 @@ struct JackPortRegisterRequest : public JackRequest | |||||
CheckRes(trans->Write(&fBufferSize, sizeof(unsigned int))); | CheckRes(trans->Write(&fBufferSize, sizeof(unsigned int))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Size() { return sizeof(int) + sizeof(fName) + sizeof(fPortType) + 2 * sizeof(unsigned int); } | int Size() { return sizeof(int) + sizeof(fName) + sizeof(fPortType) + 2 * sizeof(unsigned int); } | ||||
}; | }; | ||||
@@ -566,7 +566,7 @@ struct JackPortConnectNameRequest : public JackRequest | |||||
CheckRes(trans->Write(&fDst, sizeof(fDst))); | CheckRes(trans->Write(&fDst, sizeof(fDst))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Size() { return sizeof(int) + sizeof(fSrc) + sizeof(fDst); } | int Size() { return sizeof(int) + sizeof(fSrc) + sizeof(fDst); } | ||||
}; | }; | ||||
@@ -615,7 +615,7 @@ struct JackPortDisconnectNameRequest : public JackRequest | |||||
} | } | ||||
int Size() { return sizeof(int) + sizeof(fSrc) + sizeof(fDst); } | int Size() { return sizeof(int) + sizeof(fSrc) + sizeof(fDst); } | ||||
}; | }; | ||||
/*! | /*! | ||||
@@ -733,7 +733,7 @@ struct JackPortRenameRequest : public JackRequest | |||||
CheckRes(trans->Write(&fName, sizeof(fName))); | CheckRes(trans->Write(&fName, sizeof(fName))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Size() { return sizeof(int) + sizeof(jack_port_id_t) + sizeof(fName); } | int Size() { return sizeof(int) + sizeof(jack_port_id_t) + sizeof(fName); } | ||||
}; | }; | ||||
@@ -794,7 +794,7 @@ struct JackSetFreeWheelRequest : public JackRequest | |||||
CheckRes(JackRequest::Write(trans, Size())); | CheckRes(JackRequest::Write(trans, Size())); | ||||
return trans->Write(&fOnOff, sizeof(int)); | return trans->Write(&fOnOff, sizeof(int)); | ||||
} | } | ||||
int Size() { return sizeof(int); } | int Size() { return sizeof(int); } | ||||
}; | }; | ||||
@@ -851,7 +851,7 @@ struct JackReleaseTimebaseRequest : public JackRequest | |||||
CheckRes(JackRequest::Write(trans, Size())); | CheckRes(JackRequest::Write(trans, Size())); | ||||
return trans->Write(&fRefNum, sizeof(int)); | return trans->Write(&fRefNum, sizeof(int)); | ||||
} | } | ||||
int Size() { return sizeof(int); } | int Size() { return sizeof(int); } | ||||
}; | }; | ||||
@@ -1156,7 +1156,7 @@ struct JackInternalClientUnloadRequest : public JackRequest | |||||
CheckRes(trans->Write(&fRefNum, sizeof(int))); | CheckRes(trans->Write(&fRefNum, sizeof(int))); | ||||
return trans->Write(&fIntRefNum, sizeof(int)); | return trans->Write(&fIntRefNum, sizeof(int)); | ||||
} | } | ||||
int Size() { return sizeof(int) + sizeof(int); } | int Size() { return sizeof(int) + sizeof(int); } | ||||
}; | }; | ||||
@@ -1226,7 +1226,7 @@ struct JackClientNotificationRequest : public JackRequest | |||||
CheckRes(trans->Write(&fValue, sizeof(int))); | CheckRes(trans->Write(&fValue, sizeof(int))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Size() { return 3 * sizeof(int); } | int Size() { return 3 * sizeof(int); } | ||||
}; | }; | ||||
@@ -1420,7 +1420,7 @@ struct JackSessionReplyRequest : public JackRequest | |||||
} | } | ||||
int Size() { return sizeof(int); } | int Size() { return sizeof(int); } | ||||
}; | }; | ||||
struct JackClientNameResult : public JackResult | struct JackClientNameResult : public JackResult | ||||
@@ -1451,7 +1451,7 @@ struct JackClientNameResult : public JackResult | |||||
CheckRes(trans->Write(&fName, sizeof(fName))); | CheckRes(trans->Write(&fName, sizeof(fName))); | ||||
return 0; | return 0; | ||||
} | } | ||||
}; | }; | ||||
struct JackUUIDResult : public JackResult | struct JackUUIDResult : public JackResult | ||||
@@ -1516,7 +1516,7 @@ struct JackGetUUIDRequest : public JackRequest | |||||
} | } | ||||
int Size() { return sizeof(fName); } | int Size() { return sizeof(fName); } | ||||
}; | }; | ||||
struct JackGetClientNameRequest : public JackRequest | struct JackGetClientNameRequest : public JackRequest | ||||
@@ -1536,7 +1536,7 @@ struct JackGetClientNameRequest : public JackRequest | |||||
} | } | ||||
int Read(detail::JackChannelTransactionInterface* trans) | int Read(detail::JackChannelTransactionInterface* trans) | ||||
{ | |||||
{ | |||||
CheckSize(); | CheckSize(); | ||||
CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | CheckRes(trans->Read(&fUUID, sizeof(fUUID))); | ||||
return 0; | return 0; | ||||
@@ -1550,7 +1550,7 @@ struct JackGetClientNameRequest : public JackRequest | |||||
} | } | ||||
int Size() { return sizeof(fUUID); } | int Size() { return sizeof(fUUID); } | ||||
}; | }; | ||||
struct JackReserveNameRequest : public JackRequest | struct JackReserveNameRequest : public JackRequest | ||||
@@ -1593,7 +1593,7 @@ struct JackReserveNameRequest : public JackRequest | |||||
} | } | ||||
int Size() { return sizeof(fUUID) + sizeof(fName) + sizeof(fRefNum); } | int Size() { return sizeof(fUUID) + sizeof(fName) + sizeof(fRefNum); } | ||||
}; | }; | ||||
struct JackClientHasSessionCallbackRequest : public JackRequest | struct JackClientHasSessionCallbackRequest : public JackRequest | ||||
@@ -1627,7 +1627,7 @@ struct JackClientHasSessionCallbackRequest : public JackRequest | |||||
} | } | ||||
int Size() { return sizeof(fName); } | int Size() { return sizeof(fName); } | ||||
}; | }; | ||||
@@ -1678,7 +1678,7 @@ struct JackPropertyChangeNotifyRequest : public JackRequest | |||||
struct JackClientNotification | struct JackClientNotification | ||||
{ | { | ||||
int fSize; | |||||
int fSize; | |||||
char fName[JACK_CLIENT_NAME_SIZE+1]; | char fName[JACK_CLIENT_NAME_SIZE+1]; | ||||
int fRefNum; | int fRefNum; | ||||
int fNotify; | int fNotify; | ||||
@@ -1727,7 +1727,7 @@ struct JackClientNotification | |||||
CheckRes(trans->Write(&fMessage, sizeof(fMessage))); | CheckRes(trans->Write(&fMessage, sizeof(fMessage))); | ||||
return 0; | return 0; | ||||
} | } | ||||
int Size() { return sizeof(int) + sizeof(fName) + 5 * sizeof(int) + sizeof(fMessage); } | int Size() { return sizeof(int) + sizeof(fName) + 5 * sizeof(int) + sizeof(fMessage); } | ||||
}; | }; | ||||
@@ -82,7 +82,7 @@ class JackResampler : public JackRingBuffer | |||||
protected: | protected: | ||||
double fRatio; | double fRatio; | ||||
public: | public: | ||||
JackResampler():JackRingBuffer(),fRatio(1) | JackResampler():JackRingBuffer(),fRatio(1) | ||||
@@ -73,23 +73,23 @@ class SERVER_EXPORT JackServer | |||||
int Start(); | int Start(); | ||||
int Stop(); | int Stop(); | ||||
bool IsRunning(); | bool IsRunning(); | ||||
// RT thread | // RT thread | ||||
void Notify(int refnum, int notify, int value); | void Notify(int refnum, int notify, int value); | ||||
// From request thread : API | |||||
// From request thread : API | |||||
int SetBufferSize(jack_nframes_t buffer_size); | int SetBufferSize(jack_nframes_t buffer_size); | ||||
int SetFreewheel(bool onoff); | int SetFreewheel(bool onoff); | ||||
// Internals clients | // 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 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); | int InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status); | ||||
// Internal session file | // Internal session file | ||||
int LoadInternalSessionFile(const char* file); | int LoadInternalSessionFile(const char* file); | ||||
// Transport management | // Transport management | ||||
int ReleaseTimebase(int refnum); | int ReleaseTimebase(int refnum); | ||||
int SetTimebaseCallback(int refnum, int conditional); | int SetTimebaseCallback(int refnum, int conditional); | ||||
@@ -186,7 +186,7 @@ class JackShmReadWritePtr | |||||
~JackShmReadWritePtr() | ~JackShmReadWritePtr() | ||||
{ | { | ||||
if (!fInitDone) { | if (!fInitDone) { | ||||
jack_error("JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for %d, skipping unlock", fInfo.index); | |||||
jack_error("JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for %d, skipping unlock", fInfo.index); | |||||
return; | return; | ||||
} | } | ||||
if (fInfo.index >= 0) { | if (fInfo.index >= 0) { | ||||
@@ -281,7 +281,7 @@ class JackShmReadWritePtr1 | |||||
~JackShmReadWritePtr1() | ~JackShmReadWritePtr1() | ||||
{ | { | ||||
if (!fInitDone) { | if (!fInitDone) { | ||||
jack_error("JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for %d, skipping unlock", fInfo.index); | |||||
jack_error("JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for %d, skipping unlock", fInfo.index); | |||||
return; | return; | ||||
} | } | ||||
if (fInfo.index >= 0) { | if (fInfo.index >= 0) { | ||||
@@ -370,7 +370,7 @@ class JackShmReadPtr | |||||
~JackShmReadPtr() | ~JackShmReadPtr() | ||||
{ | { | ||||
if (!fInitDone) { | if (!fInitDone) { | ||||
jack_error("JackShmReadPtr::~JackShmReadPtr - Init not done for %ld, skipping unlock", fInfo.index); | |||||
jack_error("JackShmReadPtr::~JackShmReadPtr - Init not done for %ld, skipping unlock", fInfo.index); | |||||
return; | return; | ||||
} | } | ||||
if (fInfo.index >= 0) { | if (fInfo.index >= 0) { | ||||
@@ -121,7 +121,7 @@ extern "C" | |||||
OpusCustomMode* opus_mode; | OpusCustomMode* opus_mode; | ||||
#endif | #endif | ||||
}; | }; | ||||
int netjack_wait( netjack_driver_state_t *netj ); | int netjack_wait( netjack_driver_state_t *netj ); | ||||
void netjack_send_silence( netjack_driver_state_t *netj, int syncstate ); | void netjack_send_silence( netjack_driver_state_t *netj, int syncstate ); | ||||
void netjack_read( netjack_driver_state_t *netj, jack_nframes_t nframes ) ; | void netjack_read( netjack_driver_state_t *netj, jack_nframes_t nframes ) ; | ||||
@@ -71,7 +71,7 @@ extern "C" | |||||
typedef char shm_name_t[SHM_NAME_MAX]; | typedef char shm_name_t[SHM_NAME_MAX]; | ||||
typedef shm_name_t jack_shm_id_t; | typedef shm_name_t jack_shm_id_t; | ||||
#elif WIN32 | |||||
#elif WIN32 | |||||
#define NAME_MAX 255 | #define NAME_MAX 255 | ||||
#ifndef SHM_NAME_MAX | #ifndef SHM_NAME_MAX | ||||
#define SHM_NAME_MAX NAME_MAX | #define SHM_NAME_MAX NAME_MAX | ||||
@@ -178,10 +178,10 @@ extern "C" | |||||
char ptr_size[8]; | char ptr_size[8]; | ||||
} ptr; /* a "pointer" that has the same 8 bytes size when compling in 32 or 64 bits */ | } ptr; /* a "pointer" that has the same 8 bytes size when compling in 32 or 64 bits */ | ||||
} POST_PACKED_STRUCTURE; | } POST_PACKED_STRUCTURE; | ||||
typedef struct _jack_shm_info jack_shm_info_t; | typedef struct _jack_shm_info jack_shm_info_t; | ||||
/* utility functions used only within JACK */ | |||||
/* utility functions used only within JACK */ | |||||
void jack_shm_copy_from_registry (jack_shm_info_t*, | void jack_shm_copy_from_registry (jack_shm_info_t*, | ||||
jack_shm_registry_index_t); | jack_shm_registry_index_t); | ||||
@@ -190,7 +190,7 @@ extern "C" | |||||
int jack_release_shm_info (jack_shm_registry_index_t); | int jack_release_shm_info (jack_shm_registry_index_t); | ||||
char* jack_shm_addr (jack_shm_info_t* si); | char* jack_shm_addr (jack_shm_info_t* si); | ||||
// here begin the API | |||||
/* here begin the API */ | |||||
int jack_register_server (const char *server_name, int new_registry); | int jack_register_server (const char *server_name, int new_registry); | ||||
int jack_unregister_server (const char *server_name); | int jack_unregister_server (const char *server_name); | ||||