summaryrefslogtreecommitdiff
path: root/lib/rbcodec/dsp
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-05-23 14:19:06 -0400
committerMichael Sevakis <jethead71@rockbox.org>2013-05-23 14:25:37 -0400
commit6e211ab3ac36cf792f6412cd61b8336c12533778 (patch)
treeb4136d81ba1719a24ed60c4bac75862111945024 /lib/rbcodec/dsp
parentb7e0e1a0a3b44868ddb9ad60210158ccbe220e90 (diff)
downloadrockbox-6e211ab3ac36cf792f6412cd61b8336c12533778.tar.gz
rockbox-6e211ab3ac36cf792f6412cd61b8336c12533778.zip
Remove dsp_callback because DSP is now library code, not app code.
Yep, nope, not necessary anymore. Just call functions directly. Change-Id: I21dc35f8d674c2a9c8379b7cebd5613c1f05b5eb
Diffstat (limited to 'lib/rbcodec/dsp')
-rw-r--r--lib/rbcodec/dsp/dsp_misc.c46
-rw-r--r--lib/rbcodec/dsp/dsp_misc.h17
2 files changed, 8 insertions, 55 deletions
diff --git a/lib/rbcodec/dsp/dsp_misc.c b/lib/rbcodec/dsp/dsp_misc.c
index a19ef52883..40d198ff50 100644
--- a/lib/rbcodec/dsp/dsp_misc.c
+++ b/lib/rbcodec/dsp/dsp_misc.c
@@ -116,7 +116,7 @@ static void dsp_pitch_update(struct dsp_config *dsp)
116 fp_div(pitch_ratio, PITCH_SPEED_100, 16)); 116 fp_div(pitch_ratio, PITCH_SPEED_100, 16));
117} 117}
118 118
119static void dsp_set_pitch(int32_t percent) 119void dsp_set_pitch(int32_t percent)
120{ 120{
121 if (percent <= 0) 121 if (percent <= 0)
122 percent = PITCH_SPEED_100; 122 percent = PITCH_SPEED_100;
@@ -128,50 +128,12 @@ static void dsp_set_pitch(int32_t percent)
128 128
129 dsp_pitch_update(dsp_get_config(CODEC_IDX_AUDIO)); 129 dsp_pitch_update(dsp_get_config(CODEC_IDX_AUDIO));
130} 130}
131#endif /* HAVE_PITCHCONTROL */
132
133
134/** Firmware callback interface **/
135 131
136/* Hook back from firmware/ part of audio, which can't/shouldn't call apps/ 132int32_t dsp_get_pitch(void)
137 * code directly. */
138int dsp_callback(int msg, intptr_t param)
139{ 133{
140 int retval = 0; 134 return pitch_ratio;
141
142 switch (msg)
143 {
144#ifdef HAVE_SW_TONE_CONTROLS
145 case DSP_CALLBACK_SET_PRESCALE:
146 tone_set_prescale(param);
147 break;
148 case DSP_CALLBACK_SET_BASS:
149 tone_set_bass(param);
150 break;
151 case DSP_CALLBACK_SET_TREBLE:
152 tone_set_treble(param);
153 break;
154#endif /* HAVE_SW_TONE_CONTROLS */
155 case DSP_CALLBACK_SET_CHANNEL_CONFIG:
156 channel_mode_set_config(param);
157 break;
158 case DSP_CALLBACK_SET_STEREO_WIDTH:
159 channel_mode_custom_set_width(param);
160 break;
161#ifdef HAVE_PITCHCONTROL
162 case DSP_CALLBACK_SET_PITCH:
163 dsp_set_pitch(param);
164 break;
165 case DSP_CALLBACK_GET_PITCH:
166 retval = pitch_ratio;
167 break;
168#endif /* HAVE_PITCHCONTROL */
169 default:
170 break;
171 }
172
173 return retval;
174} 135}
136#endif /* HAVE_PITCHCONTROL */
175 137
176static void INIT_ATTR misc_dsp_init(struct dsp_config *dsp, 138static void INIT_ATTR misc_dsp_init(struct dsp_config *dsp,
177 enum dsp_ids dsp_id) 139 enum dsp_ids dsp_id)
diff --git a/lib/rbcodec/dsp/dsp_misc.h b/lib/rbcodec/dsp/dsp_misc.h
index 2583f495c3..2fed9400f2 100644
--- a/lib/rbcodec/dsp/dsp_misc.h
+++ b/lib/rbcodec/dsp/dsp_misc.h
@@ -54,18 +54,9 @@ struct dsp_replay_gains
54 54
55void dsp_replaygain_set_settings(const struct replaygain_settings *settings); 55void dsp_replaygain_set_settings(const struct replaygain_settings *settings);
56 56
57/* Callback for firmware layers to interface */ 57#ifdef HAVE_PITCHCONTROL
58enum 58void dsp_set_pitch(int32_t pitch);
59{ 59int32_t dsp_get_pitch(void);
60 DSP_CALLBACK_SET_PRESCALE = 0, 60#endif /* HAVE_PITCHCONTROL */
61 DSP_CALLBACK_SET_BASS,
62 DSP_CALLBACK_SET_TREBLE,
63 DSP_CALLBACK_SET_CHANNEL_CONFIG,
64 DSP_CALLBACK_SET_STEREO_WIDTH,
65 DSP_CALLBACK_SET_PITCH,
66 DSP_CALLBACK_GET_PITCH,
67};
68
69int dsp_callback(int msg, intptr_t param);
70 61
71#endif /* DSP_MISC_H */ 62#endif /* DSP_MISC_H */