Fix JackCoreMidiDriver::ReadProcAux when ring buffer is full (thanks Devin Anderson).
[jack2.git] / common / JackNetOneDriver.h
blobb288c91f544503624d9a64572b2eacd643cfc87e
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 "netjack.h"
26 #include "netjack_packet.h"
28 namespace Jack
30 /**
31 \Brief This class describes the Net Backend
34 class JackNetOneDriver : public JackAudioDriver
36 private:
37 netjack_driver_state_t netj;
39 void
40 render_payload_to_jack_ports_float ( void *packet_payload, jack_nframes_t net_period_down, JSList *capture_ports, JSList *capture_srcs, jack_nframes_t nframes, int dont_htonl_floats);
41 void
42 render_jack_ports_to_payload_float (JSList *playback_ports, JSList *playback_srcs, jack_nframes_t nframes, void *packet_payload, jack_nframes_t net_period_up, int dont_htonl_floats );
43 #ifdef HAVE_CELT
44 void
45 render_payload_to_jack_ports_celt (void *packet_payload, jack_nframes_t net_period_down, JSList *capture_ports, JSList *capture_srcs, jack_nframes_t nframes);
46 void
47 render_jack_ports_to_payload_celt (JSList *playback_ports, JSList *playback_srcs, jack_nframes_t nframes, void *packet_payload, jack_nframes_t net_period_up);
48 #endif
49 void
50 render_payload_to_jack_ports (int bitdepth, void *packet_payload, jack_nframes_t net_period_down, JSList *capture_ports, JSList *capture_srcs, jack_nframes_t nframes, int dont_htonl_floats);
51 void
52 render_jack_ports_to_payload (int bitdepth, JSList *playback_ports, JSList *playback_srcs, jack_nframes_t nframes, void *packet_payload, jack_nframes_t net_period_up, int dont_htonl_floats);
54 public:
55 JackNetOneDriver ( const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table,
56 int port, int mtu, int capture_ports, int playback_ports, int midi_input_ports, int midi_output_ports,
57 int sample_rate, int period_size, int resample_factor,
58 const char* net_name, uint transport_sync, int bitdepth, int use_autoconfig,
59 int latency, int redundancy, int dont_htonl_floats, int always_deadline, int jitter_val );
60 ~JackNetOneDriver();
62 int Open ( jack_nframes_t frames_per_cycle, jack_nframes_t rate, bool capturing, bool playing,
63 int inchannels, int outchannels, bool monitor, const char* capture_driver_name,
64 const char* playback_driver_name, jack_nframes_t capture_latency, jack_nframes_t playback_latency );
66 int Close();
67 int Attach();
68 int Detach();
70 int Read();
71 int Write();
73 bool Initialize();
74 int AllocPorts();
75 void FreePorts();
77 // BufferSize can't be changed
78 bool IsFixedBufferSize()
80 return true;
83 int SetBufferSize ( jack_nframes_t buffer_size )
85 return -1;
88 int SetSampleRate ( jack_nframes_t sample_rate )
90 return -1;
96 #endif