JackUtils 0.5
Provides simplified Jack API for clients :)
Loading...
Searching...
No Matches
ju_port.h
Go to the documentation of this file.
1/* JackUtils Ports Functions
2 * Copyright (C) UtoECat 2022. All rights Reserved!
3
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20
47JU_API int ju_port_open (ju_ctx_t* x, ju_cstr_t n, enum ju_port_type t, int f);
48
54JU_API void ju_port_close(ju_ctx_t* x, int p);
55
61JU_API void ju_port_take (ju_ctx_t* x, int p);
62
69JU_API int ju_port_connected(ju_ctx_t* x, int p);
70
80JU_API int ju_port_mine(ju_ctx_t* x, int p);
81
101JU_API int ju_port_next(ju_ctx_t* x, int p, enum ju_port_type t);
102
117JU_API int ju_port_find(ju_ctx_t* x, ju_cstr_t n);
118
134JU_PROC const ju_sample_t* (ju_port_read) (ju_ctx_t* x, int p);
135
148JU_PROC size_t (ju_port_write) (ju_ctx_t* x, int p, const ju_sample_t* a, size_t l);
149
162JU_PROC void (ju_port_write_stream) (ju_ctx_t* x, int p, ju_stream_func_t s, void* u);
163
182JU_API int ju_port_rawfind(ju_ctx_t* x, jack_port_t* p, int not_own);
183
194JU_API jack_port_t* ju_port_rawget(ju_ctx_t* x, int p);
195
const char * ju_cstr_t
Informative type definition.
Definition: jackutils.h:64
jack_default_audio_sample_t ju_sample_t
Sample type.
Definition: jackutils.h:68
size_t() ju_stream_func_t(void *p, ju_sample_t *x, size_t s)
Stream callback function for ju_port_write_stream() function.
Definition: jackutils.h:109
ju_port_type
Enum of all available port types.
Definition: jackutils.h:55
JU_API jack_port_t * ju_port_rawget(ju_ctx_t *x, int p)
Returns jack_port_t, associated with handle.
Definition: jackutilsport.c:29
JU_PROC const ju_sample_t *() ju_port_read(ju_ctx_t *x, int p)
Gets audio buffer from the port.
Definition: jackutilsport.c:136
JU_PROC void() ju_port_write_stream(ju_ctx_t *x, int p, ju_stream_func_t s, void *u)
Writes data to port with Output type from stream callback.
JU_API int ju_port_open(ju_ctx_t *x, ju_cstr_t n, enum ju_port_type t, int f)
Creates new port, and returns port desriptor.
Definition: jackutilsport.c:58
JU_API int ju_port_find(ju_ctx_t *x, ju_cstr_t n)
Finds port by full name.
Definition: jackutilsport.c:98
JU_PROC size_t() ju_port_write(ju_ctx_t *x, int p, const ju_sample_t *a, size_t l)
Writes data to port with Output type from sample array.
Definition: jackutilsport.c:144
JU_API int ju_port_connected(ju_ctx_t *x, int p)
Returns number of connections to the port (or simply is port connected to anything)
Definition: jackutilsport.c:86
JU_API int ju_port_mine(ju_ctx_t *x, int p)
Returns is port owned by context.
Definition: jackutilsport.c:91
JU_API void ju_port_take(ju_ctx_t *x, int p)
Increases reference counter of port.
Definition: jackutilsport.c:80
JU_API int ju_port_next(ju_ctx_t *x, int p, enum ju_port_type t)
Returns next valid port descriptor, owned by JackUtils context.
Definition: jackutilsport.c:105
JU_API void ju_port_close(ju_ctx_t *x, int p)
Decreases reference counter of port, and destroys it, if refcounter == 0.
Definition: jackutilsport.c:70
JU_API int ju_port_rawfind(ju_ctx_t *x, jack_port_t *p, int not_own)
Finds existed port handle, or takes new port handle from jack_port_t.
Definition: jackutilsport.c:33
Internal JackUtils context structure.
Definition: ju_bits_ctx.h:39