aboutsummaryrefslogtreecommitdiff
path: root/bin/pcmi.h
blob: e6bb1801897e5eacfccf6a33365ee7bd12c971cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 * Copyright (c) 2015-2016 Hanspeter Portner (dev@open-music-kontrollers.ch)
 *
 * This is free software: you can redistribute it and/or modify
 * it under the terms of the Artistic License 2.0 as published by
 * The Perl Foundation.
 *
 * This source is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * Artistic License 2.0 for more details.
 *
 * You should have received a copy of the Artistic License 2.0
 * along the source as a COPYING file. If not, obtain it from
 * http://www.perlfoundation.org/artistic_license_2_0.
 */

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <stdbool.h>

typedef void pcmi_t;

pcmi_t *
pcmi_new(const char *play_name, const char *capt_name, uint32_t srate,
	uint32_t frsize, uint32_t nfrags, bool twochan, bool debug);

void
pcmi_free(pcmi_t *pcmi);

void
pcmi_printinfo(pcmi_t *pcmi);

int
pcmi_ncapt(pcmi_t *pcmi);

int
pcmi_nplay(pcmi_t *pcmi);

void
pcmi_pcm_start(pcmi_t *pcmi);

int
pcmi_pcm_wait(pcmi_t *pcmi);

int
pcmi_pcm_idle(pcmi_t *pcmi, uint32_t frsize);

void
pcmi_pcm_stop(pcmi_t *pcmi);

void
pcmi_capt_init(pcmi_t *pcmi, uint32_t frsize);

void
pcmi_capt_chan(pcmi_t *pcmi, uint32_t channel, float *dst, uint32_t frsize);

void
pcmi_capt_done(pcmi_t *pcmi, uint32_t frsize);

void
pcmi_play_init(pcmi_t *pcmi, uint32_t frsize);

void
pcmi_clear_chan(pcmi_t *pcmi, uint32_t channel, uint32_t frsize);

void
pcmi_play_chan(pcmi_t *pcmi, uint32_t channel, const float *src, uint32_t frsize);

void
pcmi_play_done(pcmi_t *pcmi, uint32_t frsize);

#ifdef __cplusplus
}
#endif