In JackCoreAudioDriver, improve management of input/output channels: -1 is now used...
[jack2.git] / common / JackNetDriver.h
blobaf137b436931417f5079ec7000d7a3d12e5875ae
1 /*
2 Copyright (C) 2001 Paul Davis
3 Copyright (C) 2008 Romain Moret at Grame
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __JackNetDriver__
22 #define __JackNetDriver__
24 #include "JackAudioDriver.h"
25 #include "JackNetInterface.h"
27 #ifdef JACK_MONITOR
28 #include "JackFrameTimer.h"
29 #endif
31 namespace Jack
33 /**
34 \Brief This class describes the Net Backend
37 class JackNetDriver : public JackAudioDriver, public JackNetSlaveInterface
39 private:
40 //jack data
41 jack_port_id_t* fMidiCapturePortList;
42 jack_port_id_t* fMidiPlaybackPortList;
44 //transport
45 int fLastTransportState;
46 int fLastTimebaseMaster;
48 //monitoring
49 #ifdef JACK_MONITOR
50 JackGnuPlotMonitor<float>* fNetTimeMon;
51 jack_time_t fRcvSyncUst;
52 #endif
54 bool Initialize();
55 void FreeAll();
57 int AllocPorts();
58 int FreePorts();
60 //transport
61 void EncodeTransportData();
62 void DecodeTransportData();
64 JackMidiBuffer* GetMidiInputBuffer ( int port_index );
65 JackMidiBuffer* GetMidiOutputBuffer ( int port_index );
67 public:
68 JackNetDriver ( const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table,
69 const char* ip, int port, int mtu, int midi_input_ports, int midi_output_ports,
70 char* net_name, uint transport_sync, char network_master_mode );
71 ~JackNetDriver();
73 int Open ( jack_nframes_t frames_per_cycle, jack_nframes_t rate, bool capturing, bool playing,
74 int inchannels, int outchannels, bool monitor, const char* capture_driver_name,
75 const char* playback_driver_name, jack_nframes_t capture_latency, jack_nframes_t playback_latency );
76 int Close();
78 int Attach();
79 int Detach();
81 int Read();
82 int Write();
84 // BufferSize can't be changed
85 bool IsFixedBufferSize()
87 return true;
90 int SetBufferSize ( jack_nframes_t buffer_size )
92 return -1;
95 int SetSampleRate ( jack_nframes_t sample_rate )
97 return -1;
103 #endif