00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __JackNetDriver__
00022 #define __JackNetDriver__
00023
00024 #include "JackAudioDriver.h"
00025 #include "JackNetInterface.h"
00026
00027 #ifdef JACK_MONITOR
00028 #include "JackFrameTimer.h"
00029 #endif
00030
00031 namespace Jack
00032 {
00037 class JackNetDriver : public JackAudioDriver, public JackNetSlaveInterface
00038 {
00039 private:
00040
00041 jack_port_id_t* fMidiCapturePortList;
00042 jack_port_id_t* fMidiPlaybackPortList;
00043
00044
00045 int fLastTransportState;
00046 int fLastTimebaseMaster;
00047
00048
00049 #ifdef JACK_MONITOR
00050 JackGnuPlotMonitor<float>* fNetTimeMon;
00051 #endif
00052
00053 bool Initialize();
00054 void FreeAll();
00055
00056 int AllocPorts();
00057 int FreePorts();
00058
00059
00060 void EncodeTransportData();
00061 void DecodeTransportData();
00062
00063 JackMidiBuffer* GetMidiInputBuffer ( int port_index );
00064 JackMidiBuffer* GetMidiOutputBuffer ( int port_index );
00065
00066 public:
00067 JackNetDriver ( const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table,
00068 const char* ip, int port, int mtu, int midi_input_ports, int midi_output_ports,
00069 char* net_name, uint transport_sync, char network_master_mode );
00070 ~JackNetDriver();
00071
00072 int Open ( jack_nframes_t frames_per_cycle, jack_nframes_t rate, bool capturing, bool playing,
00073 int inchannels, int outchannels, bool monitor, const char* capture_driver_name,
00074 const char* playback_driver_name, jack_nframes_t capture_latency, jack_nframes_t playback_latency );
00075 int Close();
00076
00077 int Attach();
00078 int Detach();
00079
00080 int Read();
00081 int Write();
00082
00083
00084 bool IsFixedBufferSize()
00085 {
00086 return true;
00087 }
00088
00089 int SetBufferSize ( jack_nframes_t buffer_size )
00090 {
00091 return -1;
00092 }
00093
00094 int SetSampleRate ( jack_nframes_t sample_rate )
00095 {
00096 return -1;
00097 }
00098
00099 };
00100 }
00101
00102 #endif