summaryrefslogtreecommitdiff
path: root/apps/dsp.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dsp.h')
-rw-r--r--apps/dsp.h125
1 files changed, 0 insertions, 125 deletions
diff --git a/apps/dsp.h b/apps/dsp.h
deleted file mode 100644
index 2a00f649f8..0000000000
--- a/apps/dsp.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 Miika Pekkarinen
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _DSP_H
23#define _DSP_H
24
25#include <stdlib.h>
26#include <stdbool.h>
27
28#define NATIVE_FREQUENCY 44100
29
30enum
31{
32 STEREO_INTERLEAVED = 0,
33 STEREO_NONINTERLEAVED,
34 STEREO_MONO,
35 STEREO_NUM_MODES,
36};
37
38enum
39{
40 CODEC_IDX_AUDIO = 0,
41 CODEC_IDX_VOICE,
42};
43
44enum
45{
46 DSP_MYDSP = 1,
47 DSP_SET_FREQUENCY,
48 DSP_SWITCH_FREQUENCY,
49 DSP_SET_SAMPLE_DEPTH,
50 DSP_SET_STEREO_MODE,
51 DSP_RESET,
52 DSP_FLUSH,
53 DSP_SET_TRACK_GAIN,
54 DSP_SET_ALBUM_GAIN,
55 DSP_SET_TRACK_PEAK,
56 DSP_SET_ALBUM_PEAK,
57 DSP_CROSSFEED
58};
59
60
61/****************************************************************************
62 * NOTE: Any assembly routines that use these structures must be updated
63 * if current data members are moved or changed.
64 */
65struct resample_data
66{
67 uint32_t delta; /* 00h */
68 uint32_t phase; /* 04h */
69 int32_t last_sample[2]; /* 08h */
70 /* 10h */
71};
72
73/* This is for passing needed data to external dsp routines. If another
74 * dsp parameter needs to be passed, add to the end of the structure
75 * and remove from dsp_config.
76 * If another function type becomes assembly/external and requires dsp
77 * config info, add a pointer paramter of type "struct dsp_data *".
78 * If removing something from other than the end, reserve the spot or
79 * else update every implementation for every target.
80 * Be sure to add the offset of the new member for easy viewing as well. :)
81 * It is the first member of dsp_config and all members can be accessesed
82 * through the main aggregate but this is intended to make a safe haven
83 * for these items whereas the c part can be rearranged at will. dsp_data
84 * could even moved within dsp_config without disurbing the order.
85 */
86struct dsp_data
87{
88 int output_scale; /* 00h */
89 int num_channels; /* 04h */
90 struct resample_data resample_data; /* 08h */
91 int32_t clip_min; /* 18h */
92 int32_t clip_max; /* 1ch */
93 int32_t gain; /* 20h - Note that this is in S8.23 format. */
94 int frac_bits; /* 24h */
95 /* 28h */
96};
97
98struct dsp_config;
99
100int dsp_process(struct dsp_config *dsp, char *dest,
101 const char *src[], int count);
102int dsp_input_count(struct dsp_config *dsp, int count);
103int dsp_output_count(struct dsp_config *dsp, int count);
104intptr_t dsp_configure(struct dsp_config *dsp, int setting,
105 intptr_t value);
106int get_replaygain_mode(bool have_track_gain, bool have_album_gain);
107void dsp_set_replaygain(void);
108void dsp_set_crossfeed(bool enable);
109void dsp_set_crossfeed_direct_gain(int gain);
110void dsp_set_crossfeed_cross_params(long lf_gain, long hf_gain,
111 long cutoff);
112void dsp_set_eq(bool enable);
113void dsp_set_eq_precut(int precut);
114void dsp_set_eq_coefs(int band);
115void dsp_dither_enable(bool enable);
116void dsp_timestretch_enable(bool enable);
117bool dsp_timestretch_available(void);
118void sound_set_pitch(int32_t r);
119int32_t sound_get_pitch(void);
120void dsp_set_timestretch(int32_t percent);
121int32_t dsp_get_timestretch(void);
122int dsp_callback(int msg, intptr_t param);
123void dsp_set_compressor(void);
124
125#endif