summaryrefslogtreecommitdiff
path: root/apps/menus
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-17 00:01:32 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-24 21:20:13 +0000
commit8cb555460ff79e636a7907fb2589e16db98c8600 (patch)
tree930a3878c7641c9ce045b24f0ade1309e36d5806 /apps/menus
parent0c4f89370d05056faa789aa9cabcccc4e509fb9f (diff)
[3/4] Completely remove HWCODEC support
'swcodec' is now always set (and recording_swcodec for recording-capable units) in feature.txt so the manual and language strings don't need to all be fixed up. Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/eq_menu.c1
-rw-r--r--apps/menus/menu_common.c5
-rw-r--r--apps/menus/menu_common.h2
-rw-r--r--apps/menus/playback_menu.c27
-rw-r--r--apps/menus/radio_menu.c18
-rw-r--r--apps/menus/recording_menu.c20
-rw-r--r--apps/menus/settings_menu.c10
-rw-r--r--apps/menus/sound_menu.c12
8 files changed, 7 insertions, 88 deletions
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c
index b41e4b0981..683025629b 100644
--- a/apps/menus/eq_menu.c
+++ b/apps/menus/eq_menu.c
@@ -30,7 +30,6 @@
#include "list.h"
#include "menu.h"
#include "action.h"
-#include "mp3_playback.h"
#include "settings.h"
#include "screens.h"
#include "icons.h"
diff --git a/apps/menus/menu_common.c b/apps/menus/menu_common.c
index 2ef48cc23b..1fa8ba3af2 100644
--- a/apps/menus/menu_common.c
+++ b/apps/menus/menu_common.c
@@ -25,11 +25,8 @@
#include "action.h"
#include "menu.h"
#include "menu_common.h"
-#if CONFIG_CODEC == SWCODEC
#include "pcmbuf.h"
-#endif
-#if CONFIG_CODEC == SWCODEC
/* Use this callback if your menu adjusts DSP settings. */
int lowlatency_callback(int action,
const struct menu_item_ex *this_item,
@@ -48,5 +45,3 @@ int lowlatency_callback(int action,
}
return action;
}
-#endif
-
diff --git a/apps/menus/menu_common.h b/apps/menus/menu_common.h
index e85ed8dc61..5a28c3f03c 100644
--- a/apps/menus/menu_common.h
+++ b/apps/menus/menu_common.h
@@ -24,11 +24,9 @@
#include "menu.h"
#include "config.h"
-#if CONFIG_CODEC == SWCODEC
int lowlatency_callback(int action,
const struct menu_item_ex *this_item,
struct gui_synclist *this_list);
-#endif
#endif /* _MENU_COMMON_H */
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c
index bf770c0f11..41c738725c 100644
--- a/apps/menus/playback_menu.c
+++ b/apps/menus/playback_menu.c
@@ -35,16 +35,13 @@
#include "audio.h"
#include "cuesheet.h"
#include "misc.h"
-#if CONFIG_CODEC == SWCODEC
#include "playback.h"
#include "pcm_sampr.h"
#ifdef HAVE_PLAY_FREQ
#include "talk.h"
#endif
-#endif
-
-#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE)
+#if defined(HAVE_CROSSFADE)
static int setcrossfadeonexit_callback(int action,
const struct menu_item_ex *this_item,
struct gui_synclist *this_list)
@@ -60,7 +57,7 @@ static int setcrossfadeonexit_callback(int action,
return action;
}
-#endif /* CONFIG_CODEC == SWCODEC */
+#endif /* HAVE_CROSSFADE */
/***********************************/
/* PLAYBACK MENU */
@@ -77,7 +74,6 @@ MENUITEM_SETTING(ff_rewind_min_step, &global_settings.ff_rewind_min_step, NULL);
MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, Icon_NOICON,
&ff_rewind_min_step, &ff_rewind_accel);
#ifdef HAVE_DISK_STORAGE
-#if CONFIG_CODEC == SWCODEC
static int buffermargin_callback(int action,
const struct menu_item_ex *this_item,
struct gui_synclist *this_list)
@@ -92,16 +88,12 @@ static int buffermargin_callback(int action,
}
return action;
}
-#else
-# define buffermargin_callback NULL
-#endif
MENUITEM_SETTING(buffer_margin, &global_settings.buffer_margin,
buffermargin_callback);
#endif /*HAVE_DISK_STORAGE */
MENUITEM_SETTING(fade_on_stop, &global_settings.fade_on_stop, NULL);
MENUITEM_SETTING(party_mode, &global_settings.party_mode, NULL);
-#if CONFIG_CODEC == SWCODEC
#ifdef HAVE_CROSSFADE
/* crossfade submenu */
MENUITEM_SETTING(crossfade, &global_settings.crossfade, setcrossfadeonexit_callback);
@@ -150,7 +142,6 @@ MAKE_MENU(replaygain_settings_menu,ID2P(LANG_REPLAYGAIN),0, Icon_NOICON,
&replaygain_type, &replaygain_noclip, &replaygain_preamp);
MENUITEM_SETTING(beep, &global_settings.beep ,NULL);
-#endif /* CONFIG_CODEC == SWCODEC */
#ifdef HAVE_SPDIF_POWER
MENUITEM_SETTING(spdif_enable, &global_settings.spdif_enable, NULL);
@@ -188,13 +179,7 @@ static int cuesheet_callback(int action,
switch (action)
{
case ACTION_EXIT_MENUITEM: /* on exit */
-#if CONFIG_CODEC == SWCODEC
audio_set_cuesheet(global_settings.cuesheet);
-#else
- if (global_settings.cuesheet)
- splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
- break;
-#endif
}
return action;
}
@@ -209,9 +194,7 @@ MAKE_MENU(unplug_menu, ID2P(LANG_HEADPHONE_UNPLUG), 0, Icon_NOICON,
MENUITEM_SETTING(skip_length, &global_settings.skip_length, NULL);
MENUITEM_SETTING(prevent_skip, &global_settings.prevent_skip, NULL);
-#if CONFIG_CODEC == SWCODEC
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,
@@ -227,13 +210,11 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
#endif
&fade_on_stop, &party_mode,
-#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE)
+#if defined(HAVE_CROSSFADE)
&crossfade_settings_menu,
#endif
-#if CONFIG_CODEC == SWCODEC
&replaygain_settings_menu, &beep,
-#endif
#ifdef HAVE_SPDIF_POWER
&spdif_enable,
@@ -244,9 +225,7 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
#endif
,&skip_length, &prevent_skip
-#if CONFIG_CODEC == SWCODEC
,&resume_rewind
-#endif
,&pause_rewind
#ifdef HAVE_PLAY_FREQ
,&play_frequency
diff --git a/apps/menus/radio_menu.c b/apps/menus/radio_menu.c
index 8871421c11..a6d259a21d 100644
--- a/apps/menus/radio_menu.c
+++ b/apps/menus/radio_menu.c
@@ -34,7 +34,7 @@
#ifdef HAVE_RECORDING
#include "recording.h" /* recording_screen() */
-#if defined(HAVE_FMRADIO_REC) && CONFIG_CODEC == SWCODEC
+#if defined(HAVE_FMRADIO_REC)
#define FM_RECORDING_SCREEN
static int fm_recording_screen(void)
{
@@ -53,30 +53,20 @@ static int fm_recording_screen(void)
MENUITEM_FUNCTION(recscreen_item, 0, ID2P(LANG_RECORDING),
fm_recording_screen, NULL, NULL, Icon_Recording);
-#endif /* defined(HAVE_FMRADIO_REC) && CONFIG_CODEC == SWCODEC */
+#endif /* defined(HAVE_FMRADIO_REC) */
-#if defined(HAVE_FMRADIO_REC) || CONFIG_CODEC != SWCODEC
+#if defined(HAVE_FMRADIO_REC)
#define FM_RECORDING_SETTINGS
static int fm_recording_settings(void)
{
int ret = recording_menu(true);
-#if CONFIG_CODEC != SWCODEC
- if (!ret)
- {
- struct audio_recording_options rec_options;
- rec_init_recording_options(&rec_options);
- rec_options.rec_source = AUDIO_SRC_LINEIN;
- rec_set_recording_options(&rec_options);
- }
-#endif
-
return ret;
}
MENUITEM_FUNCTION(recsettings_item, 0, ID2P(LANG_RECORDING_SETTINGS),
fm_recording_settings, NULL, NULL, Icon_Recording);
-#endif /* defined(HAVE_FMRADIO_REC) || CONFIG_CODEC != SWCODEC */
+#endif /* defined(HAVE_FMRADIO_REC) */
#endif /* HAVE_RECORDING */
#ifndef FM_PRESET
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index 0f24420a63..c841de4e89 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -29,7 +29,6 @@
#include "lcd.h"
#include "menu.h"
#include "button.h"
-#include "mp3_playback.h"
#include "settings.h"
#include "screens.h"
#include "icons.h"
@@ -51,14 +50,12 @@
#include "peakmeter.h"
#endif
#include "splash.h"
-#if CONFIG_CODEC == SWCODEC
#include "metadata.h"
#include "menus/eq_menu.h"
#ifdef HAVE_RECORDING
#include "enc_config.h"
#endif
#include "general.h"
-#endif
#include "action.h"
#include "recording.h"
#include "sound_menu.h"
@@ -101,7 +98,6 @@ static int recsource_func(void)
MENUITEM_FUNCTION(recsource, 0, ID2P(LANG_RECORDING_SOURCE),
recsource_func, NULL, recmenu_callback, Icon_Menu_setting);
-#if CONFIG_CODEC == SWCODEC
/* Makes an options list from a source list of options and indexes */
static void make_options_from_indexes(const struct opt_items *src_names,
const long *src_indexes,
@@ -112,12 +108,8 @@ static void make_options_from_indexes(const struct opt_items *src_names,
dst_names[n_indexes] = src_names[src_indexes[n_indexes]];
} /* make_options_from_indexes */
-
-#endif /* CONFIG_CODEC == SWCODEC */
-
static int recfrequency_func(void)
{
-#if CONFIG_CODEC == SWCODEC
static const struct opt_items names[REC_NUM_FREQ] = {
REC_HAVE_96_([REC_FREQ_96] = { "96kHz", TALK_ID(96, UNIT_KHZ) },)
REC_HAVE_88_([REC_FREQ_88] = { "88.2kHz", TALK_ID(88, UNIT_KHZ) },)
@@ -195,7 +187,6 @@ static int recfrequency_func(void)
}
return ret;
-#endif /* CONFIG_CODEC == SWCODEC */
} /* recfrequency */
MENUITEM_FUNCTION(recfrequency, 0, ID2P(LANG_FREQUENCY),
recfrequency_func, NULL, NULL, Icon_Menu_setting);
@@ -208,7 +199,6 @@ static int recchannels_func(void)
[CHN_MODE_MONO] = { STR(LANG_CHANNEL_MONO) }
};
-#if CONFIG_CODEC == SWCODEC
struct opt_items opts[CHN_NUM_MODES];
long table[CHN_NUM_MODES];
struct encoder_caps caps;
@@ -238,13 +228,10 @@ static int recchannels_func(void)
global_settings.rec_channels = table[rec_channels];
return ret;
-#endif /* CONFIG_CODEC == SWCODEC */
}
MENUITEM_FUNCTION(recchannels, 0, ID2P(LANG_CHANNELS),
recchannels_func, NULL, NULL, Icon_Menu_setting);
-#if CONFIG_CODEC == SWCODEC
-
static int recmonomode_func(void)
{
static const struct opt_items names[3] = {
@@ -293,9 +280,6 @@ MENUITEM_FUNCTION(enc_global_config_menu_item, 0, ID2P(LANG_ENCODER_SETTINGS),
enc_global_config_menu,
NULL, NULL, Icon_Submenu);
-#endif /* CONFIG_CODEC == SWCODEC */
-
-
static int recmenu_callback(int action,
const struct menu_item_ex *this_item,
struct gui_synclist *this_list)
@@ -603,14 +587,10 @@ MENUITEM_FUNCTION(save_recpresets_item, 0, ID2P(LANG_SAVE_SETTINGS),
MAKE_MENU(recording_settings_menu, ID2P(LANG_RECORDING_SETTINGS),
NULL, Icon_Recording,
-#if CONFIG_CODEC == SWCODEC
&recformat, &enc_global_config_menu_item,
-#endif
&recfrequency, &recsource, /* recsource not shown if no_source */
&recchannels,
-#if CONFIG_CODEC == SWCODEC
&recmonomode,
-#endif
&filesplitoptionsmenu,
&rec_prerecord_time,
&clear_rec_directory_item,
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 2957b0635c..e2b496a6f7 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -38,9 +38,7 @@
#include "yesno.h"
#include "talk.h"
#include "powermgmt.h"
-#if CONFIG_CODEC == SWCODEC
#include "playback.h"
-#endif
#if CONFIG_RTC
#include "screens.h"
#endif
@@ -326,7 +324,6 @@ MAKE_MENU(limits_menu, ID2P(LANG_LIMITS_MENU), 0, Icon_NOICON,
/* Keyclick menu */
-#if CONFIG_CODEC == SWCODEC
MENUITEM_SETTING(keyclick, &global_settings.keyclick, NULL);
MENUITEM_SETTING(keyclick_repeats, &global_settings.keyclick_repeats, NULL);
#ifdef HAVE_HARDWARE_CLICK
@@ -337,7 +334,6 @@ MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON,
MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON,
&keyclick, &keyclick_repeats);
#endif
-#endif
#if CONFIG_CHARGING
MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL);
@@ -437,9 +433,7 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
&buttonlight_brightness,
#endif
-#if CONFIG_CODEC == SWCODEC
&keyclick_menu,
-#endif
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
&touchpad_sensitivity,
#endif
@@ -619,7 +613,6 @@ MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0,
/***********************************/
/* AUTORESUME MENU */
#ifdef HAVE_TAGCACHE
-#if CONFIG_CODEC == SWCODEC
static int autoresume_callback(int action,
const struct menu_item_ex *this_item,
@@ -674,7 +667,6 @@ MAKE_MENU(autoresume_menu, ID2P(LANG_AUTORESUME),
0, Icon_NOICON,
&autoresume_enable, &autoresume_automatic);
-#endif /* CONFIG_CODEC == SWCODEC */
#endif /* HAVE_TAGCACHE */
/* AUTORESUME MENU */
/***********************************/
@@ -758,10 +750,8 @@ MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
&startup_shutdown_menu,
&bookmark_settings_menu,
#ifdef HAVE_TAGCACHE
-#if CONFIG_CODEC == SWCODEC
&autoresume_menu,
#endif
-#endif
&browse_langs, &voice_settings_menu,
#ifdef HAVE_HOTKEY
&hotkey_menu,
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c
index ee966ac62a..174329fcc8 100644
--- a/apps/menus/sound_menu.c
+++ b/apps/menus/sound_menu.c
@@ -108,18 +108,10 @@ MENUITEM_SETTING(treble_cutoff, &global_settings.treble_cutoff, NULL);
MENUITEM_SETTING(balance, &global_settings.balance, NULL);
MENUITEM_SETTING(channel_config, &global_settings.channel_config,
-#if CONFIG_CODEC == SWCODEC
lowlatency_callback
-#else
- NULL
-#endif
);
MENUITEM_SETTING(stereo_width, &global_settings.stereo_width,
-#if CONFIG_CODEC == SWCODEC
lowlatency_callback
-#else
- NULL
-#endif
);
#ifdef AUDIOHW_HAVE_DEPTH_3D
@@ -134,7 +126,6 @@ MENUITEM_SETTING(roll_off, &global_settings.roll_off, NULL);
MENUITEM_SETTING(func_mode, &global_settings.func_mode, NULL);
#endif
-#if CONFIG_CODEC == SWCODEC
/* Crossfeed Submenu */
MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, lowlatency_callback);
MENUITEM_SETTING(crossfeed_direct_gain,
@@ -216,7 +207,6 @@ static int timestretch_callback(int action,
MAKE_MENU(compressor_menu,ID2P(LANG_COMPRESSOR), NULL, Icon_NOICON,
&compressor_threshold, &compressor_gain, &compressor_ratio,
&compressor_knee, &compressor_attack, &compressor_release);
-#endif
#ifdef HAVE_SPEAKER
MENUITEM_SETTING(speaker_mode, &global_settings.speaker_mode, NULL);
@@ -253,14 +243,12 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
#ifdef AUDIOHW_HAVE_FUNCTIONAL_MODE
,&func_mode
#endif
-#if CONFIG_CODEC == SWCODEC
,&crossfeed_menu, &equalizer_menu, &dithering_enabled
,&surround_menu, &pbe_menu, &afr_enabled
#ifdef HAVE_PITCHCONTROL
,&timestretch_enabled
#endif
,&compressor_menu
-#endif
#ifdef HAVE_SPEAKER
,&speaker_mode
#endif