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 jack_time_t fRcvSyncUst;
00052 #endif
00053
00054 bool Initialize();
00055 void FreeAll();
00056
00057 int AllocPorts();
00058 int FreePorts();
00059
00060
00061 void EncodeTransportData();
00062 void DecodeTransportData();
00063
00064 JackMidiBuffer* GetMidiInputBuffer ( int port_index );
00065 JackMidiBuffer* GetMidiOutputBuffer ( int port_index );
00066
00067 public:
00068 JackNetDriver ( const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table,
00069 const char* ip, int port, int mtu, int midi_input_ports, int midi_output_ports,
00070 char* net_name, uint transport_sync, char network_master_mode );
00071 ~JackNetDriver();
00072
00073 int Open ( jack_nframes_t frames_per_cycle, jack_nframes_t rate, bool capturing, bool playing,
00074 int inchannels, int outchannels, bool monitor, const char* capture_driver_name,
00075 const char* playback_driver_name, jack_nframes_t capture_latency, jack_nframes_t playback_latency );
00076 int Close();
00077
00078 int Attach();
00079 int Detach();
00080
00081 int Read();
00082 int Write();
00083
00084
00085 bool IsFixedBufferSize()
00086 {
00087 return true;
00088 }
00089
00090 int SetBufferSize ( jack_nframes_t buffer_size )
00091 {
00092 return -1;
00093 }
00094
00095 int SetSampleRate ( jack_nframes_t sample_rate )
00096 {
00097 return -1;
00098 }
00099
00100 };
00101 }
00102
00103 #endif