summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/envelope.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-11-24 16:26:49 +0000
committerLennart Poettering <lennart@poettering.net>2007-11-24 16:26:49 +0000
commit95a98fe6f2002c9dd448b70bb6944541b5616df3 (patch)
treed1626697363d0bf059273404a2c4414e704c2385 /src/pulsecore/envelope.h
parent2d34bca4a13bc43eeda54535630e37703806d53f (diff)
Add new subsystem for applying envelopes (such as volume ramps) to audio signals
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2082 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/envelope.h')
-rw-r--r--src/pulsecore/envelope.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/pulsecore/envelope.h b/src/pulsecore/envelope.h
new file mode 100644
index 00000000..23be8f6a
--- /dev/null
+++ b/src/pulsecore/envelope.h
@@ -0,0 +1,55 @@
+#ifndef foopulseenvelopehfoo
+#define foopulseenvelopehfoo
+
+/* $Id$ */
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2007 Lennart Poettering
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ PulseAudio 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 GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulsecore/macro.h>
+#include <pulsecore/memchunk.h>
+
+#include <pulse/sample.h>
+
+#define PA_ENVELOPE_POINTS_MAX 4
+
+typedef struct pa_envelope pa_envelope;
+typedef struct pa_envelope_item pa_envelope_item;
+
+typedef struct pa_envelope_def {
+ unsigned n_points;
+
+ pa_usec_t points_x[PA_ENVELOPE_POINTS_MAX];
+ struct {
+ int32_t i[PA_ENVELOPE_POINTS_MAX];
+ float f[PA_ENVELOPE_POINTS_MAX];
+ } points_y;
+} pa_envelope_def;
+
+pa_envelope *pa_envelope_new(const pa_sample_spec *ss);
+void pa_envelope_free(pa_envelope *e);
+pa_envelope_item *pa_envelope_add(pa_envelope *e, const pa_envelope_def *def);
+pa_envelope_item *pa_envelope_replace(pa_envelope *e, pa_envelope_item *i, const pa_envelope_def *def);
+void pa_envelope_remove(pa_envelope *e, pa_envelope_item *i);
+void pa_envelope_apply(pa_envelope *e, pa_memchunk *chunk);
+void pa_envelope_rewind(pa_envelope *e, size_t n_bytes);
+
+#endif