Jack2 1.9.8
|
00001 /* 00002 Copyright (C) 2008-2011 Romain Moret at Grame 00003 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 00018 */ 00019 00020 #ifndef __JackNetDriver__ 00021 #define __JackNetDriver__ 00022 00023 #include "JackTimedDriver.h" 00024 #include "JackNetInterface.h" 00025 00026 //#define JACK_MONITOR 00027 00028 namespace Jack 00029 { 00034 class JackNetDriver : public JackWaiterDriver, public JackNetSlaveInterface 00035 { 00036 00037 private: 00038 00039 //jack data 00040 jack_port_id_t* fMidiCapturePortList; 00041 jack_port_id_t* fMidiPlaybackPortList; 00042 00043 //transport 00044 int fLastTransportState; 00045 int fLastTimebaseMaster; 00046 00047 //monitoring 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 //transport 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 // BufferSize can't be changed 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