31 #define NORMALIZED_FLOAT_MIN -1.0f 32 #define NORMALIZED_FLOAT_MAX 1.0f 33 #define SAMPLE_16BIT_SCALING 32767.0f 34 #define SAMPLE_16BIT_MAX 32767 35 #define SAMPLE_16BIT_MIN -32767 36 #define SAMPLE_16BIT_MAX_F 32767.0f 37 #define SAMPLE_16BIT_MIN_F -32767.0f 39 #define f_round(f) lrintf(f) 41 #define float_16(s, d)\ 42 if ((s) <= NORMALIZED_FLOAT_MIN) {\ 43 (d) = SAMPLE_16BIT_MIN;\ 44 } else if ((s) >= NORMALIZED_FLOAT_MAX) {\ 45 (d) = SAMPLE_16BIT_MAX;\ 47 (d) = f_round ((s) * SAMPLE_16BIT_SCALING);\ 56 short dataS[4]={(short)0xaaaa, (
short)0xff, (short)0x5555, (
short)0xff0};
59 for (
uint i=0; i<outputPorts.size(); i++) {
60 jack_default_audio_sample_t *out = ( jack_default_audio_sample_t* ) jack_port_get_buffer ( outputPorts[i], nframes );
61 for (
int j=0; j<nframes; j++){
62 int index=i+(int)fmod((
float)j*2.,4.);
77 int main(
int argc,
char *argv[]) {
79 #if __BYTE_ORDER == __LITTLE_ENDIAN 80 cout<<
"This system is little endian."<<endl;
81 #elif __BYTE_ORDER == __BIG_ENDIAN 82 cout<<
"This system is big endian."<<endl;
88 int res=jackClient.
connect(
"jack test client");
92 cout<<
"Jack : sample rate set to : "<<jackClient.
getSampleRate()<<
" Hz"<<endl;
93 cout<<
"Jack : block size set to : "<<jackClient.
getBlockSize()<<
" samples"<<endl;
virtual int createPorts(string inName, int inCnt, string outName, int outCnt)
virtual int getBlockSize()
virtual int evaluateError(int errorNum)
int processAudio(jack_nframes_t nframes)
virtual int startClient()
#define SAMPLE_16BIT_SCALING
int main(int argc, char *argv[])
int getSampleRate(void) const
virtual int connect(string clientName_)