Git init
[framework/multimedia/pulseaudio.git] / src / pulsecore / envelope.h
1 #ifndef foopulseenvelopehfoo
2 #define foopulseenvelopehfoo
3
4 /***
5   This file is part of PulseAudio.
6
7   Copyright 2007 Lennart Poettering
8
9   PulseAudio is free software; you can redistribute it and/or modify
10   it under the terms of the GNU Lesser General Public License as
11   published by the Free Software Foundation; either version 2.1 of the
12   License, or (at your option) any later version.
13
14   PulseAudio is distributed in the hope that it will be useful, but
15   WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17   Lesser General Public License for more details.
18
19   You should have received a copy of the GNU Lesser General Public
20   License along with PulseAudio; if not, write to the Free Software
21   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22   USA.
23 ***/
24
25 #include <pulsecore/macro.h>
26 #include <pulsecore/memchunk.h>
27
28 #include <pulse/sample.h>
29
30 #define PA_ENVELOPE_POINTS_MAX 4U
31
32 typedef struct pa_envelope pa_envelope;
33 typedef struct pa_envelope_item pa_envelope_item;
34
35 typedef struct pa_envelope_def {
36     unsigned n_points;
37
38     pa_usec_t points_x[PA_ENVELOPE_POINTS_MAX];
39     struct {
40         int32_t i[PA_ENVELOPE_POINTS_MAX];
41         float f[PA_ENVELOPE_POINTS_MAX];
42     } points_y;
43 } pa_envelope_def;
44
45 pa_envelope *pa_envelope_new(const pa_sample_spec *ss);
46 void pa_envelope_free(pa_envelope *e);
47 pa_envelope_item *pa_envelope_add(pa_envelope *e, const pa_envelope_def *def);
48 pa_envelope_item *pa_envelope_replace(pa_envelope *e, pa_envelope_item *i, const pa_envelope_def *def);
49 void pa_envelope_remove(pa_envelope *e, pa_envelope_item *i);
50 void pa_envelope_apply(pa_envelope *e, pa_memchunk *chunk);
51 void pa_envelope_rewind(pa_envelope *e, size_t n_bytes);
52
53 #endif