00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __JackAudioDriver__
00022 #define __JackAudioDriver__
00023
00024 #include "JackDriver.h"
00025
00026 namespace Jack
00027 {
00028
00033 class SERVER_EXPORT JackAudioDriver : public JackDriver
00034 {
00035
00036 private:
00037
00038 int ProcessAsync();
00039 int ProcessSync();
00040 void ProcessGraphAsync();
00041 void ProcessGraphSync();
00042 void WaitUntilNextCycle();
00043
00044 protected:
00045
00046 int fCaptureChannels;
00047 int fPlaybackChannels;
00048
00049
00050
00051 jack_port_id_t fCapturePortList[DRIVER_PORT_NUM];
00052 jack_port_id_t fPlaybackPortList[DRIVER_PORT_NUM];
00053 jack_port_id_t fMonitorPortList[DRIVER_PORT_NUM];
00054
00055 bool fWithMonitorPorts;
00056
00057 jack_default_audio_sample_t* GetInputBuffer(int port_index);
00058 jack_default_audio_sample_t* GetOutputBuffer(int port_index);
00059 jack_default_audio_sample_t* GetMonitorBuffer(int port_index);
00060
00061 public:
00062
00063 JackAudioDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table);
00064 virtual ~JackAudioDriver();
00065
00066 virtual int Open(jack_nframes_t buffer_size,
00067 jack_nframes_t samplerate,
00068 bool capturing,
00069 bool playing,
00070 int inchannels,
00071 int outchannels,
00072 bool monitor,
00073 const char* capture_driver_name,
00074 const char* playback_driver_name,
00075 jack_nframes_t capture_latency,
00076 jack_nframes_t playback_latency);
00077
00078 virtual int Process();
00079 virtual int ProcessNull();
00080
00081 virtual int Attach();
00082 virtual int Detach();
00083
00084 virtual int Write();
00085
00086 virtual int SetBufferSize(jack_nframes_t buffer_size);
00087 virtual int SetSampleRate(jack_nframes_t sample_rate);
00088
00089 };
00090
00091 }
00092
00093 #endif