[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
This commit is contained in:
Solomon Peachy 2020-07-17 00:01:32 -04:00
parent 0c4f89370d
commit 8cb555460f
207 changed files with 322 additions and 5594 deletions

View file

@ -54,9 +54,7 @@
#include "viewport.h"
#include "skin_engine/skin_engine.h"
#include "statusbar-skinned.h"
#if CONFIG_CODEC == SWCODEC
#include "playback.h"
#endif
#include "presets.h"
#if CONFIG_TUNER
@ -353,14 +351,6 @@ void radio_screen(void)
int lastbutton = BUTTON_NONE;
unsigned long rec_lastclick = 0;
#endif
#if CONFIG_CODEC != SWCODEC
int timeout = current_tick + HZ/10;
#if !defined(SIMULATOR)
unsigned int last_seconds = 0;
unsigned int seconds = 0;
struct audio_recording_options rec_options;
#endif /* SIMULATOR */
#endif /* CONFIG_CODEC != SWCODEC */
#ifndef HAVE_NOISY_IDLE_MODE
int button_timeout = current_tick + (2*HZ);
#endif
@ -383,29 +373,7 @@ void radio_screen(void)
fms_fix_displays(FMS_ENTER);
#ifndef SIMULATOR
#if CONFIG_CODEC != SWCODEC
rec_create_directory();
audio_init_recording();
sound_settings_apply();
/* Yes, we use the D/A for monitoring */
peak_meter_playback(true);
peak_meter_enable(true);
rec_init_recording_options(&rec_options);
rec_options.rec_source = AUDIO_SRC_LINEIN;
rec_set_recording_options(&rec_options);
audio_set_recording_gain(sound_default(SOUND_LEFT_GAIN),
sound_default(SOUND_RIGHT_GAIN), AUDIO_GAIN_LINEIN);
#endif /* CONFIG_CODEC != SWCODEC */
#endif /* ndef SIMULATOR */
/* turn on radio */
#if CONFIG_CODEC == SWCODEC
/* This should be done before touching audio settings */
while (!pcm_is_initialized())
sleep(0);
@ -413,10 +381,6 @@ void radio_screen(void)
audio_set_input_source(AUDIO_SRC_FMRADIO,
(radio_status == FMRADIO_PAUSED) ?
SRCF_FMRADIO_PAUSED : SRCF_FMRADIO_PLAYING);
#else
if (radio_status == FMRADIO_OFF)
radio_start();
#endif
if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN)))
presets_scan(NULL);
@ -468,13 +432,6 @@ void radio_screen(void)
switch(button)
{
case ACTION_FM_STOP:
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
if(audio_status() == AUDIO_STATUS_RECORD)
{
audio_stop();
}
else
#endif
{
done = true;
if(presets_have_changed())
@ -513,18 +470,11 @@ void radio_screen(void)
rec_command(RECORDING_CMD_START);
update_type = SKIN_REFRESH_ALL;
}
#if CONFIG_CODEC != SWCODEC
last_seconds = 0;
#endif
#endif /* SIMULATOR */
break;
#endif /* #ifdef FM_RECORD */
case ACTION_FM_EXIT:
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
if(audio_status() == AUDIO_STATUS_RECORD)
audio_stop();
#endif
keep_playing = true;
done = true;
if(presets_have_changed())
@ -629,10 +579,6 @@ void radio_screen(void)
#endif /* FM_FREEZE */
case SYS_USB_CONNECTED:
#if CONFIG_CODEC != SWCODEC
/* Only accept USB connection when not recording */
if(audio_status() != AUDIO_STATUS_RECORD)
#endif
{
default_event_handler(SYS_USB_CONNECTED);
screen_freeze = true; /* Cosmetic: makes sure the
@ -688,10 +634,6 @@ void radio_screen(void)
default_event_handler(button);
if (!tuner_get(RADIO_PRESENT))
{
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
if(audio_status() == AUDIO_STATUS_RECORD)
audio_stop();
#endif
keep_playing = false;
done = true;
if(presets_have_changed())
@ -713,21 +655,10 @@ void radio_screen(void)
lastbutton = button;
#endif
#if CONFIG_CODEC != SWCODEC
peak_meter_peek();
#endif
if(!screen_freeze)
{
/* Only display the peak meter when not recording */
#if CONFIG_CODEC != SWCODEC
if(TIME_AFTER(current_tick, timeout))
{
timeout = current_tick + HZ;
#else /* SWCODEC */
{
#endif /* CONFIG_CODEC == SWCODEC */
/* keep "mono" from always being displayed when paused */
if (radio_status != FMRADIO_PAUSED)
{
@ -742,15 +673,8 @@ void radio_screen(void)
}
}
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
seconds = audio_recorded_time() / HZ;
if (update_type || seconds > last_seconds)
{
last_seconds = seconds;
#else
if (update_type)
{
#endif
FOR_NB_SCREENS(i)
skin_update(FM_SCREEN, i, update_type);
if (update_type == (int)SKIN_REFRESH_ALL)
@ -774,13 +698,6 @@ void radio_screen(void)
enqueue);
}
#if CONFIG_CODEC != SWCODEC
if(audio_status() & AUDIO_STATUS_ERROR)
{
done = true;
}
#endif
#ifndef HAVE_NOISY_IDLE_MODE
if (TIME_AFTER(current_tick, button_timeout))
{
@ -790,23 +707,6 @@ void radio_screen(void)
} /*while(!done)*/
#ifndef SIMULATOR
#if CONFIG_CODEC != SWCODEC
if(audio_status() & AUDIO_STATUS_ERROR)
{
splash(0, str(LANG_DISK_FULL));
audio_error_clear();
while(1)
{
button = get_action(CONTEXT_FM|ALLOW_SOFTLOCK, TIMEOUT_BLOCK);
if(button == ACTION_FM_STOP)
break;
}
}
audio_init_playback();
#endif /* CONFIG_CODEC != SWCODEC */
sound_settings_apply();
#endif /* SIMULATOR */
@ -814,23 +714,12 @@ void radio_screen(void)
{
/* Catch FMRADIO_PLAYING status for the sim. */
#ifndef SIMULATOR
#if CONFIG_CODEC != SWCODEC
/* Enable the Left and right A/D Converter */
audio_set_recording_gain(sound_default(SOUND_LEFT_GAIN),
sound_default(SOUND_RIGHT_GAIN),
AUDIO_GAIN_LINEIN);
mas_codec_writereg(6, 0x4000);
#endif
end_search();
#endif /* SIMULATOR */
}
else
{
#if CONFIG_CODEC == SWCODEC
audio_set_input_source(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK);
#else
radio_stop();
#endif
}
#ifndef HAVE_NOISY_IDLE_MODE