summaryrefslogtreecommitdiffstats
path: root/apps/menus
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-05-23 13:58:51 -0400
committerMichael Sevakis <jethead71@rockbox.org>2013-07-06 04:22:04 +0200
commitd37bf24d9011addbfbd40942a4e9bbf26de7df00 (patch)
treedafb7eaeb494081668a4841d490fce2bfbb2438d /apps/menus
parent00faabef5e902008172e08d3bcd77683cbafef51 (diff)
downloadrockbox-d37bf24d9011addbfbd40942a4e9bbf26de7df00.tar.gz
rockbox-d37bf24d9011addbfbd40942a4e9bbf26de7df00.tar.bz2
rockbox-d37bf24d9011addbfbd40942a4e9bbf26de7df00.zip
Enable setting of global output samplerate on certain targets.
Replaces the NATIVE_FREQUENCY constant with a configurable frequency. The user may select 48000Hz if the hardware supports it. The default is still 44100Hz and the minimum is 44100Hz. The setting is located in the playback settings, under "Frequency". "Frequency" was duplicated in english.lang for now to avoid having to fix every .lang file for the moment and throwing everything out of sync because of the new play_frequency feature in features.txt. The next cleanup should combine it with the one included for recording and generalize the ID label. If the hardware doesn't support 48000Hz, no setting will be available. On particular hardware where very high rates are practical and desireable, the upper bound can be extended by patching. The PCM mixer can be configured to play at the full hardware frequency range. The DSP core can configure to the hardware minimum up to the maximum playback setting (some buffers must be reserved according to the maximum rate). If only 44100Hz is supported or possible on a given target for playback, using the DSP and mixer at other samperates is possible if the hardware offers them. Change-Id: I6023cf0c0baa8bc6292b6919b4dd3618a6a25622 Reviewed-on: http://gerrit.rockbox.org/479 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/playback_menu.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c
index 6beda93991..89472d45b9 100644
--- a/apps/menus/playback_menu.c
+++ b/apps/menus/playback_menu.c
@@ -37,6 +37,10 @@
#include "misc.h"
#if CONFIG_CODEC == SWCODEC
#include "playback.h"
+#include "pcm_sampr.h"
+#ifdef HAVE_PLAY_FREQ
+#include "talk.h"
+#endif
#endif
@@ -192,6 +196,10 @@ MENUITEM_SETTING(prevent_skip, &global_settings.prevent_skip, NULL);
MENUITEM_SETTING(resume_rewind, &global_settings.resume_rewind, NULL);
#endif
MENUITEM_SETTING(pause_rewind, &global_settings.pause_rewind, NULL);
+#ifdef HAVE_PLAY_FREQ
+MENUITEM_SETTING(play_frequency, &global_settings.play_frequency,
+ playback_callback);
+#endif
MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
Icon_Playback_menu,
@@ -217,12 +225,15 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
#ifdef HAVE_HEADPHONE_DETECTION
,&unplug_menu
#endif
- ,&skip_length, &prevent_skip,
+ ,&skip_length, &prevent_skip
#if CONFIG_CODEC == SWCODEC
- &resume_rewind,
+ ,&resume_rewind
+#endif
+ ,&pause_rewind
+#ifdef HAVE_PLAY_FREQ
+ ,&play_frequency
#endif
- &pause_rewind,
);
static int playback_callback(int action,const struct menu_item_ex *this_item)
@@ -243,9 +254,19 @@ static int playback_callback(int action,const struct menu_item_ex *this_item)
break;
case ACTION_EXIT_MENUITEM: /* on exit */
+ /* Playing or not */
+#ifdef HAVE_PLAY_FREQ
+ if (this_item == &play_frequency)
+ {
+ settings_apply_play_freq(global_settings.play_frequency, false);
+ break;
+ }
+#endif /* HAVE_PLAY_FREQ */
+
if (!(audio_status() & AUDIO_STATUS_PLAY))
break;
+ /* Playing only */
if (this_item == &shuffle_item)
{
if (old_shuffle == global_settings.playlist_shuffle)