From 8cb555460ff79e636a7907fb2589e16db98c8600 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 17 Jul 2020 00:01:32 -0400 Subject: [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 --- firmware/export/audio.h | 99 ++----------------------------------------------- 1 file changed, 3 insertions(+), 96 deletions(-) (limited to 'firmware/export/audio.h') diff --git a/firmware/export/audio.h b/firmware/export/audio.h index 5ed9c706a4..c2c23dfd5c 100644 --- a/firmware/export/audio.h +++ b/firmware/export/audio.h @@ -18,8 +18,8 @@ * KIND, either express or implied. * ****************************************************************************/ -#ifndef AUDIO_H -#define AUDIO_H +#ifndef __AUDIO_H +#define __AUDIO_H #include #include /* size_t */ @@ -27,13 +27,11 @@ /* These must always be included with audio.h for this to compile under cetain conditions. Do it here or else spread the complication around to many files. */ -#if CONFIG_CODEC == SWCODEC #include "pcm_sampr.h" #include "pcm.h" #ifdef HAVE_RECORDING #include "enc_base.h" #endif /* HAVE_RECORDING */ -#endif /* CONFIG_CODEC == SWCODEC */ #define AUDIO_STATUS_PLAY 0x0001 #define AUDIO_STATUS_PAUSE 0x0002 @@ -75,44 +73,9 @@ void audio_error_clear(void); int audio_get_file_pos(void); void audio_beep(int duration); -#if CONFIG_CODEC == SWCODEC void audio_next_dir(void); void audio_prev_dir(void); -#else /* hwcodec only */ -struct audio_debug -{ - int audiobuflen; - int audiobuf_write; - int audiobuf_swapwrite; - int audiobuf_read; - - int last_dma_chunk_size; - - bool dma_on; - bool playing; - bool play_pending; - bool is_playing; - bool filling; - bool dma_underrun; - - int unplayed_space; - int playable_space; - int unswapped_space; - - int low_watermark_level; - int lowest_watermark_level; -}; - -void audio_get_debugdata(struct audio_debug *dbgdata); -/* unsigned int audio_error(void); - unused function */ -void audio_init_playback(void); - -#define audio_next_dir() ({ }) -#define audio_prev_dir() ({ }) - -#endif - /* channel modes */ enum rec_channel_modes { @@ -124,12 +87,10 @@ enum rec_channel_modes CHN_NUM_MODES }; -#if CONFIG_CODEC == SWCODEC /* channel mode capability bits */ #define CHN_CAP_STEREO (1 << CHN_MODE_STEREO) #define CHN_CAP_MONO (1 << CHN_MODE_MONO) #define CHN_CAP_ALL (CHN_CAP_STEREO | CHN_CAP_MONO) -#endif /* CONFIG_CODEC == SWCODEC */ /* the enums below must match prestr[] in recording.c */ enum audio_sources @@ -164,7 +125,6 @@ enum rec_sources }; #endif /* HAVE_RECORDING */ -#if CONFIG_CODEC == SWCODEC /* selects a source to monitor for recording or playback */ #define SRCF_PLAYBACK 0x0000 /* default */ #define SRCF_RECORDING 0x1000 @@ -173,7 +133,6 @@ enum rec_sources #define SRCF_FMRADIO_PLAYING 0x0000 /* default */ #define SRCF_FMRADIO_PAUSED 0x2000 #endif -#endif #ifdef HAVE_RECORDING /* parameters for audio_set_recording_options */ @@ -183,14 +142,9 @@ struct audio_recording_options int rec_frequency; int rec_channels; int rec_prerecord_time; -#if CONFIG_CODEC == SWCODEC int rec_mono_mode; int rec_source_flags; /* for rec_set_source */ struct encoder_config enc_config; -#else - int rec_quality; - bool rec_editable; -#endif }; /* audio recording functions */ @@ -206,15 +160,10 @@ void audio_set_recording_gain(int left, int right, int type); unsigned long audio_recorded_time(void); unsigned long audio_num_recorded_bytes(void); -#if CONFIG_CODEC == SWCODEC -/* SWCODEC recording functions */ unsigned long audio_prerecorded_time(void); -#endif /* CONFIG_CODEC == SWCODEC */ #endif /* HAVE_RECORDING */ -#if CONFIG_CODEC == SWCODEC -/* SWCODEC misc. audio functions */ #if INPUT_SRC_CAPS != 0 /* audio.c */ void audio_set_input_source(int source, unsigned flags); @@ -223,7 +172,6 @@ void audio_set_input_source(int source, unsigned flags); void audio_input_mux(int source, unsigned flags); void audio_set_output_source(int source); #endif /* INPUT_SRC_CAPS */ -#endif /* CONFIG_CODEC == SWCODEC */ #ifdef HAVE_SPDIF_IN /* returns index into rec_master_sampr_list */ @@ -247,11 +195,9 @@ enum track_event_flags { TEF_NONE = 0x0, /* no flags are set */ TEF_CURRENT = 0x1, /* event is for the current track */ -#if CONFIG_CODEC == SWCODEC TEF_AUTO_SKIP = 0x2, /* event is sent in context of auto skip */ TEF_REWIND = 0x4, /* interpret as rewind, id3->elapsed is the position before the seek back to 0 */ -#endif /* CONFIG_CODEC == SWCODEC */ }; struct track_event @@ -260,43 +206,4 @@ struct track_event struct mp3entry *id3; /* pointer to mp3entry describing track */ }; -#if CONFIG_CODEC != SWCODEC -/* subscribe to one or more audio event(s) by OR'ing together the desired */ -/* event IDs (defined below); a handler is called with a solitary event ID */ -/* (so switch() is okay) and possibly some useful data (depending on the */ -/* event); a handler must return one of the return codes defined below */ - -typedef int (*AUDIO_EVENT_HANDLER)(unsigned short event, unsigned long data); - -void audio_register_event_handler(AUDIO_EVENT_HANDLER handler, unsigned short mask); - -/***********************************************************************/ -/* handler return codes */ - -#define AUDIO_EVENT_RC_IGNORED 200 - /* indicates that no action was taken or the event was not recognized */ - -#define AUDIO_EVENT_RC_HANDLED 201 - /* indicates that the event was handled and some action was taken which renders - the original event invalid; USE WITH CARE!; this return code aborts all further - processing of the given event */ - -/***********************************************************************/ -/* audio event IDs */ - -#define AUDIO_EVENT_POS_REPORT (1<<0) - /* sends a periodic song position report to handlers; a report is sent on - each kernal tick; the number of ticks per second is defined by HZ; on each - report the current song position is passed in 'data'; if a handler takes an - action that changes the song or the song position it must return - AUDIO_EVENT_RC_HANDLED which suppresses the event for any remaining handlers */ - -#define AUDIO_EVENT_END_OF_TRACK (1<<1) - /* generated when the end of the currently playing track is reached; no - data is passed; if the handler implements some alternate end-of-track - processing it should return AUDIO_EVENT_RC_HANDLED which suppresses the - event for any remaining handlers as well as the normal end-of-track - processing */ - -#endif -#endif +#endif /* __AUDIO_H */ -- cgit v1.2.3