00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __JackNetDriver__
00021 #define __JackNetDriver__
00022
00023 #include "JackTimedDriver.h"
00024 #include "JackNetInterface.h"
00025
00026
00027
00028 namespace Jack
00029 {
00034 class JackNetDriver : public JackWaiterDriver, public JackNetSlaveInterface
00035 {
00036
00037 private:
00038
00039
00040 jack_port_id_t* fMidiCapturePortList;
00041 jack_port_id_t* fMidiPlaybackPortList;
00042
00043
00044 int fLastTransportState;
00045 int fLastTimebaseMaster;
00046
00047
00048 #ifdef JACK_MONITOR
00049 JackGnuPlotMonitor<float>* fNetTimeMon;
00050 jack_time_t fRcvSyncUst;
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 void SaveConnections();
00067
00068 public:
00069
00070 JackNetDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table,
00071 const char* ip, int port, int mtu, int midi_input_ports, int midi_output_ports,
00072 char* net_name, uint transport_sync, int network_latency, int celt_encoding);
00073 virtual ~JackNetDriver();
00074
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