David Garcia Garzon unused_pkt_buf_field_jack2 netone patch.
[jack2.git] / common / netjack.h
blobedac28a01572a62b510a6bed421727846865f7dd
2 /*
3 Copyright (C) 2003 Robert Ham <rah@bash.sh>
4 Copyright (C) 2005 Torben Hohn <torbenh@gmx.de>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __NETJACK_H__
22 #define __NETJACK_H__
24 #include <unistd.h>
26 #include <jack/types.h>
27 //#include <jack/driver.h>
28 #include <jack/jack.h>
29 #include <jack/transport.h>
31 #include "jack/jslist.h"
33 //#include <netinet/in.h>
35 #ifdef __cplusplus
36 extern "C"
38 #endif
40 typedef struct _netjack_driver_state netjack_driver_state_t;
42 struct _netjack_driver_state {
43 jack_nframes_t net_period_up;
44 jack_nframes_t net_period_down;
46 jack_nframes_t sample_rate;
47 jack_nframes_t bitdepth;
48 jack_nframes_t period_size;
49 jack_time_t period_usecs;
50 int dont_htonl_floats;
51 int always_deadline;
53 jack_nframes_t codec_latency;
55 unsigned int listen_port;
57 unsigned int capture_channels;
58 unsigned int playback_channels;
59 unsigned int capture_channels_audio;
60 unsigned int playback_channels_audio;
61 unsigned int capture_channels_midi;
62 unsigned int playback_channels_midi;
64 JSList *capture_ports;
65 JSList *playback_ports;
66 JSList *playback_srcs;
67 JSList *capture_srcs;
69 jack_client_t *client;
71 #ifdef WIN32
72 SOCKET sockfd;
73 SOCKET outsockfd;
74 #else
75 int sockfd;
76 int outsockfd;
77 #endif
79 struct sockaddr_in syncsource_address;
81 int reply_port;
82 int srcaddress_valid;
84 int sync_state;
85 unsigned int handle_transport_sync;
87 unsigned int *rx_buf;
88 unsigned int rx_bufsize;
89 //unsigned int tx_bufsize;
90 unsigned int mtu;
91 unsigned int latency;
92 unsigned int redundancy;
94 jack_nframes_t expected_framecnt;
95 int expected_framecnt_valid;
96 unsigned int num_lost_packets;
97 jack_time_t next_deadline;
98 jack_time_t deadline_offset;
99 int next_deadline_valid;
100 int packet_data_valid;
101 int resync_threshold;
102 int running_free;
103 int deadline_goodness;
104 jack_time_t time_to_deadline;
105 unsigned int use_autoconfig;
106 unsigned int resample_factor;
107 unsigned int resample_factor_up;
108 int jitter_val;
111 int netjack_wait( netjack_driver_state_t *netj );
112 void netjack_send_silence( netjack_driver_state_t *netj, int syncstate );
113 void netjack_read( netjack_driver_state_t *netj, jack_nframes_t nframes ) ;
114 void netjack_write( netjack_driver_state_t *netj, jack_nframes_t nframes, int syncstate );
115 void netjack_attach( netjack_driver_state_t *netj );
116 void netjack_detach( netjack_driver_state_t *netj );
118 netjack_driver_state_t *netjack_init (netjack_driver_state_t *netj,
119 jack_client_t * client,
120 const char *name,
121 unsigned int capture_ports,
122 unsigned int playback_ports,
123 unsigned int capture_ports_midi,
124 unsigned int playback_ports_midi,
125 jack_nframes_t sample_rate,
126 jack_nframes_t period_size,
127 unsigned int listen_port,
128 unsigned int transport_sync,
129 unsigned int resample_factor,
130 unsigned int resample_factor_up,
131 unsigned int bitdepth,
132 unsigned int use_autoconfig,
133 unsigned int latency,
134 unsigned int redundancy,
135 int dont_htonl_floats,
136 int always_deadline,
137 int jitter_val );
139 void netjack_release( netjack_driver_state_t *netj );
140 int netjack_startup( netjack_driver_state_t *netj );
142 #ifdef __cplusplus
144 #endif
146 #endif