1 [CCode (lower_case_cprefix = "jack_", cheader_filename="jack/jack.h")]
3 // note: there are no bindings for deprecated methods
5 public const int MAX_FRAMES;
6 public const int LOAD_INIT_LIMIT;
7 public const string DEFAULT_AUDIO_TYPE;
8 public const string DEFAULT_MIDI_TYPE;
9 [CCode (cname="JackOpenOptions")]
10 public const Options OpenOptions;
11 [CCode (cname="JackLoadOptions")]
12 public const Options LoadOptions;
15 [CCode (cname="jack_shmsize_t")]
16 public struct ShmSize : int32 {}
18 [IntegerType (rank = 7)]
19 [CCode (cname = "jack_nframes_t", cheader_filename = "jack/jack.h", type_id = "G_TYPE_UINT", marshaller_type_name = "UINT", get_value_function = "g_value_get_uint", set_value_function = "g_value_set_uint", default_value = "0U", type_signature = "u")]
20 public struct NFrames : uint32 {}
22 [CCode (cname="jack_time_t")]
23 public struct Time : uint64 {}
25 [CCode (cname="jack_intclient_t", cprefix="jack_internal_client", cheader_filename="jack/intclient.h")]
26 public struct InternalClient : uint64 {
27 public static void close(string name);
30 [CCode (cname="jack_port_t", cprefix="jack_port_")]
32 public void* get_buffer(NFrames nframes);
34 public string short_name();
37 public bool connected();
38 public bool connected_to(string name);
39 [CCode (array_null_terminated = true)]
41 public string[] get_connections();
42 public NFrames get_latency();
43 public NFrames get_total_latency();
44 public void set_latency(NFrames nframes);
45 public int set_name(string name);
46 public int set_alias(string alias);
47 public int unset_alias(string alias);
48 public int get_aliases(ref string[] aliases);
49 public int request_monitor(bool onoff);
50 public int ensure_monitor(bool onoff);
51 public int monitoring_input();
52 public static int name_size();
53 public static int type_size();
55 [CCode (cprefix="JackPort", cname="enum JackPortFlags")]
66 [CCode (cname="jack_client_t", free_function="", cprefix="jack_")]
68 // creation and manipulation
69 [CCode (cname="jack_client_open")]
70 public static Client? open(string name, Jack.Options options, out Jack.Status status, ...);
71 [CCode (cname="jack_client_name_size")]
72 public static int get_name_size();
73 [CCode (cname="jack_get_client_name")]
74 public string get_name();
75 public int activate();
76 public int deactivate();
77 [CCode (cname="jack_client_close")]
79 [CCode (cname="jack_client_thread_id")]
80 public GLib.Thread get_thread_id();
83 public int set_thread_init_callback(ThreadInitCallback cb);
84 public void on_shutdown(ShutdownFunc f);
85 public int set_process_callback(ProcessCallback cb);
86 public int set_freewheel_callback(FreewheelCallback cb);
87 public int set_buffer_size_callback(BufferSizeCallback cb);
88 public int set_sample_rate_callback(SampleRateCallback cb);
89 public int set_client_registration_callback(ClientRegistrationCallback cb);
90 public int set_port_registration_callback(PortRegistrationCallback cb);
91 public int set_port_connect_callback(PortConnectCallback cb);
92 public int set_graph_order_callback(GraphOrderCallback cb);
93 public int set_xrun_callback(XRunCallback cb);
95 // controlling and querying server operations
96 [CCode (cname="jack_client_create_thread")]
97 public int create_thread(out GLib.Thread thread, int priority, bool realtime, ThreadCallback cb);
98 [CCode (cname="jack_client_real_time_priority")]
99 public int get_real_time_priority();
100 [CCode (cname="jack_client_max_real_time_priority")]
101 public int get_max_real_time_priority();
102 public bool is_realtime();
103 public int set_freewheel(bool onoff);
104 public int set_buffer_size(NFrames nframes);
105 public NFrames get_sample_rate();
106 public NFrames get_buffer_size();
107 public float cpu_load();
109 // creating and manipulating ports
110 public unowned Port port_register(string name, string type, Port.Flags flags, ulong buffer_size);
111 public int port_unregister(Port p);
112 public bool port_is_mine(Port p);
113 [CCode (array_null_terminated = true)]
115 public string[] port_get_all_connections(Port p);
116 public int recompute_total_latency(Port p);
117 public int recompute_total_latencies();
118 public int port_request_monitor_by_name(string port_name, bool onoff);
119 public int connect(string source_port, string destination_port);
120 public int disconnect(string source_port, string destination_port);
121 public int port_disconnect(Port p);
124 [CCode (array_null_terminated = true)]
126 public unowned string[] get_ports(string name_pattern, string type_pattern, Port.Flags flags);
127 public Port port_by_name(string name);
128 public Port port_by_id(PortId id);
131 public NFrames frames_since_cycle_start();
132 public NFrames frame_time();
133 public NFrames last_frame_time();
134 public Time frames_to_time(NFrames nframes);
135 public NFrames time_to_frames(Time t);
136 public Time get_time();
139 public NFrames cycle_wait();
140 public void cycle_signal(bool should_exit);
141 public int set_process_thread(ThreadCallback cb);
144 [CCode (cheader_filename="jack/statistics.h")]
145 public float get_max_delayed_usecs();
146 [CCode (cheader_filename="jack/statistics.h")]
147 public float get_xrun_delayed_usecs();
148 [CCode (cheader_filename="jack/statistics.h")]
149 public void reset_max_delayed_usecs();
152 [CCode (cheader_filename="jack/intclient.h")]
153 public string get_internal_client_name(InternalClient intclient);
154 [CCode (cheader_filename="jack/intclient.h")]
155 public InternalClient internal_client_handle(string name, out Status s);
156 public InternalClient internal_client_load(string name, Options opts, out Status s, ...);
157 public Status internal_client_unload(InternalClient intclient);
159 // transport and timebase control
160 public int release_timebase();
161 public int set_sync_callback(SyncCallback cb);
162 public int set_sync_timeout(Jack.Time timeout);
163 public int set_timebase_callback(bool conditional, TimebaseCallback cb);
164 public int transport_locate(NFrames frame);
165 public TransportState transport_query(out Position pos);
166 public NFrames get_current_transport_frame();
167 public int transport_reposition(ref Position p);
168 public void transport_start();
169 public void transport_stop();
172 [CCode (cname="jack_port_id_t")]
173 public struct PortId : uint32 {}
175 public delegate void* ThreadCallback();
176 public delegate void ThreadInitCallback();
177 public delegate void ShutdownFunc();
178 public delegate int ProcessCallback(NFrames nframes);
179 public delegate void FreewheelCallback(bool starting);
180 public delegate int BufferSizeCallback(NFrames nframes);
181 public delegate int SampleRateCallback(NFrames nframes);
182 // do not change the parameter name to "register" because it will generate
183 // errors at C-compile time
184 public delegate void ClientRegistrationCallback(string name, bool reg);
185 public delegate void PortRegistrationCallback(PortId id, bool reg);
186 public delegate void PortConnectCallback(PortId a, PortId b, bool connect);
187 public delegate int GraphOrderCallback();
188 public delegate int XRunCallback();
191 [CCode (cname="jack_default_audio_sample_t")]
192 public struct DefaultAudioSample : float {}
194 [CCode (cprefix="Jack", cname="jack_options_t")]
205 [CCode (cprefix="Jack", cname="jack_status_t")]
221 public int drop_real_time_scheduling(GLib.Thread t);
222 public int acquire_real_time_scheduling(GLib.Thread t, int priority);
224 // error / information output
225 public static delegate void MessageFunc(string msg);
226 void set_error_function(MessageFunc f);
227 void set_info_function(MessageFunc f);
228 public MessageFunc error_callback;
229 public MessageFunc info_callback;
230 [CCode (cname="default_jack_error_callback")]
231 public void default_error_callback(string msg);
232 [CCode (cname="silent_jack_error_callback")]
233 public void silent_error_callback(string msg);
236 [CCode (lower_case_cprefix="jack_midi_", cheader_filename="jack/midiport.h")]
239 [CCode (cname="jack_midi_data_t")]
240 public struct Data : uchar {}
241 [CCode (cname="jack_midi_event_t", cprefix="jack_midi_event_", destroy_function="")]
246 public unowned Data[] buffer;
247 public static int get(Event e, void *port_buffer, NFrames event_index);
249 public static Data[] reserve(void *port_buffer, NFrames time, size_t data_size);
250 public static int write(void *port_buffer, NFrames time, [NoArrayLength]Data[] data, size_t data_size);
252 public NFrames get_event_count(void *port_buffer);
253 public void clear_buffer(void *port_buffer);
254 public size_t max_event_size(void *port_buffer);
255 public NFrames get_lost_event_count(void *port_buffer);
260 [CCode (cname="jack_ringbuffer_t", cprefix="jack_ringbuffer_", free_function="jack_ringbuffer_free")]
261 public class Ringbuffer{
262 [CCode (cname="jack_ringbuffer_data_t")]
269 public size_t write_ptr;
270 public size_t read_ptr;
272 public size_t size_mask;
275 public static Ringbuffer create(size_t sz);
276 public void get_read_vector(ref Data[] vec);
277 public void get_write_vector(ref Data[] vec);
278 public size_t read(char[] dest);
279 public size_t peek(char[] dest);
280 public void read_advance(size_t cnt);
281 public size_t read_space();
284 public size_t write(char[] src);
285 public void write_advance(size_t cnt);
286 public size_t write_space();
289 // transport and timebase
290 public delegate int SyncCallback(TransportState s, Position p);
291 public delegate void TimebaseCallback(TransportState s, NFrames nframes, Position p);
292 [CCode(cname="jack_transport_state_t", cprefix="JackTransport")]
293 public enum TransportState{
300 [CCode (cname="jack_unique_t")]
301 public struct Unique : uint64 {}
302 [CCode (cname="enum jack_position_bits_t", cprefix="Jack")]
304 public enum PositionBits{
312 [CCode (cname="jack_position_t", free_function="", destroy_function="")]
313 public struct Position {
314 public Unique unique_1;
315 public Jack.Time usecs;
316 public NFrames frame_rate;
317 public NFrames frame;
318 public PositionBits valid;
322 public double bar_start_tick;
323 public float beats_per_bar;
324 public float beat_type;
325 public double ticks_per_beat;
326 public double beats_per_minute;
327 public double frame_time;
328 public double next_time;
329 public NFrames bbt_offset;
330 public float audio_frames_per_video_frame;
331 public NFrames video_offset;
332 [CCode (array_length = false)]
333 public int32[] padding;
334 public Unique unique_2;