Renamed CONFIG_HWCODEC and MASNONE to the more appropriate CONFIG_CODEC and SWCODEC, respectively.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7416 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2005-08-29 21:15:27 +00:00
parent 99a0598c28
commit d6c054575b
56 changed files with 248 additions and 248 deletions

View file

@ -23,7 +23,7 @@ settings_menu.c
sleeptimer.c sleeptimer.c
sound_menu.c sound_menu.c
status.c status.c
#if !defined(SIMULATOR) || CONFIG_HWCODEC == MASNONE #if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC
talk.c talk.c
#endif #endif
tree.c tree.c
@ -49,7 +49,7 @@ recorder/radio.c
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
recorder/recording.c recorder/recording.c
#endif #endif
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
pcmbuf.c pcmbuf.c
playback.c playback.c
metadata.c metadata.c

View file

@ -48,12 +48,12 @@
#include "system.h" #include "system.h"
#include "sound.h" #include "sound.h"
#include "database.h" #include "database.h"
#if (CONFIG_HWCODEC == MASNONE) #if (CONFIG_CODEC == SWCODEC)
#include "pcm_playback.h" #include "pcm_playback.h"
#endif #endif
#ifdef SIMULATOR #ifdef SIMULATOR
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
unsigned char codecbuf[CODEC_SIZE]; unsigned char codecbuf[CODEC_SIZE];
#endif #endif
void *sim_codec_load_ram(char* codecptr, int size, void *sim_codec_load_ram(char* codecptr, int size,
@ -161,10 +161,10 @@ struct codec_api ci = {
mp3_play_pause, mp3_play_pause,
mp3_play_stop, mp3_play_stop,
mp3_is_playing, mp3_is_playing,
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
bitswap, bitswap,
#endif #endif
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
pcm_play_data, pcm_play_data,
pcm_play_stop, pcm_play_stop,
pcm_set_frequency, pcm_set_frequency,
@ -188,24 +188,24 @@ struct codec_api ci = {
audio_current_track, audio_current_track,
audio_flush_and_reload_tracks, audio_flush_and_reload_tracks,
audio_get_file_pos, audio_get_file_pos,
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
mpeg_get_last_header, mpeg_get_last_header,
#endif #endif
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
sound_set_pitch, sound_set_pitch,
#endif #endif
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
/* MAS communication */ /* MAS communication */
mas_readmem, mas_readmem,
mas_writemem, mas_writemem,
mas_readreg, mas_readreg,
mas_writereg, mas_writereg,
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
mas_codec_writereg, mas_codec_writereg,
mas_codec_readreg, mas_codec_readreg,
#endif #endif
#endif /* !simulator and HWCODEC != MASNONE */ #endif /* !simulator and HWCODEC != SWCODEC */
/* tag database */ /* tag database */
&tagdbheader, &tagdbheader,
@ -232,7 +232,7 @@ struct codec_api ci = {
find_next_frame, find_next_frame,
battery_level, battery_level,
battery_level_safe, battery_level_safe,
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
peak_meter_scale_value, peak_meter_scale_value,
peak_meter_set_use_dbfs, peak_meter_set_use_dbfs,
peak_meter_get_use_dbfs, peak_meter_get_use_dbfs,

View file

@ -43,7 +43,7 @@
#include "mpeg.h" #include "mpeg.h"
#include "audio.h" #include "audio.h"
#include "mp3_playback.h" #include "mp3_playback.h"
#if (HWCODEC == MASNONE) #if (HWCODEC == SWCODEC)
#include "pcm_playback.h" #include "pcm_playback.h"
#endif #endif
#include "settings.h" #include "settings.h"
@ -234,10 +234,10 @@ struct codec_api {
void (*mp3_play_pause)(bool play); void (*mp3_play_pause)(bool play);
void (*mp3_play_stop)(void); void (*mp3_play_stop)(void);
bool (*mp3_is_playing)(void); bool (*mp3_is_playing)(void);
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
void (*bitswap)(unsigned char *data, int length); void (*bitswap)(unsigned char *data, int length);
#endif #endif
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
void (*pcm_play_data)(void (*get_more)(unsigned char** start, long*size)); void (*pcm_play_data)(void (*get_more)(unsigned char** start, long*size));
void (*pcm_play_stop)(void); void (*pcm_play_stop)(void);
void (*pcm_set_frequency)(unsigned int frequency); void (*pcm_set_frequency)(unsigned int frequency);
@ -261,20 +261,20 @@ struct codec_api {
struct mp3entry* (*audio_current_track)(void); struct mp3entry* (*audio_current_track)(void);
void (*audio_flush_and_reload_tracks)(void); void (*audio_flush_and_reload_tracks)(void);
int (*audio_get_file_pos)(void); int (*audio_get_file_pos)(void);
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
unsigned long (*mpeg_get_last_header)(void); unsigned long (*mpeg_get_last_header)(void);
#endif #endif
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
void (*sound_set_pitch)(int pitch); void (*sound_set_pitch)(int pitch);
#endif #endif
/* MAS communication */ /* MAS communication */
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len); int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len);
int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len); int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len);
int (*mas_readreg)(int reg); int (*mas_readreg)(int reg);
int (*mas_writereg)(int reg, unsigned int val); int (*mas_writereg)(int reg, unsigned int val);
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
int (*mas_codec_writereg)(int reg, unsigned int val); int (*mas_codec_writereg)(int reg, unsigned int val);
int (*mas_codec_readreg)(int reg); int (*mas_codec_readreg)(int reg);
#endif #endif
@ -311,7 +311,7 @@ struct codec_api {
long max_offset, unsigned long last_header); long max_offset, unsigned long last_header);
int (*battery_level)(void); int (*battery_level)(void);
bool (*battery_level_safe)(void); bool (*battery_level_safe)(void);
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
unsigned short (*peak_meter_scale_value)(unsigned short val, unsigned short (*peak_meter_scale_value)(unsigned short val,
int meterwidth); int meterwidth);
void (*peak_meter_set_use_dbfs)(bool use); void (*peak_meter_set_use_dbfs)(bool use);
@ -332,7 +332,7 @@ struct codec_api {
}; };
/* defined by the codec loader (codec.c) */ /* defined by the codec loader (codec.c) */
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap, int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap,
struct codec_api *api); struct codec_api *api);
int codec_load_file(const char* codec, struct codec_api *api); int codec_load_file(const char* codec, struct codec_api *api);

View file

@ -1,4 +1,4 @@
#if CONFIG_HWCODEC == MASNONE /* software codec platforms */ #if CONFIG_CODEC == SWCODEC /* software codec platforms */
codeclib.c codeclib.c
xxx2wav.c xxx2wav.c
#endif #endif

View file

@ -19,7 +19,7 @@
/* Various "helper functions" common to all the xxx2wav decoder plugins */ /* Various "helper functions" common to all the xxx2wav decoder plugins */
#if (CONFIG_HWCODEC == MASNONE) #if (CONFIG_CODEC == SWCODEC)
/* software codec platforms, not for simulator */ /* software codec platforms, not for simulator */
#include "codecs.h" #include "codecs.h"
@ -138,4 +138,4 @@ void qsort(void *base, size_t nmemb, size_t size,
local_rb->qsort(base,nmemb,size,compar); local_rb->qsort(base,nmemb,size,compar);
} }
#endif /* CONFIG_HWCODEC == MASNONE */ #endif /* CONFIG_CODEC == SWCODEC */

View file

@ -44,7 +44,7 @@
#include "database.h" #include "database.h"
#include "autoconf.h" #include "autoconf.h"
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
#include "playback.h" #include "playback.h"
#else #else
#include "mpeg.h" #include "mpeg.h"

View file

@ -61,7 +61,7 @@
#if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR) #if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR)
extern bool pcm_rec_screen(void); extern bool pcm_rec_screen(void);
#endif #endif
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
#include "pcmbuf.h" #include "pcmbuf.h"
#include "pcm_playback.h" #include "pcm_playback.h"
#endif #endif
@ -154,7 +154,7 @@ bool dbg_os(void)
#endif #endif
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
bool dbg_audio_thread(void) bool dbg_audio_thread(void)
{ {
char buf[32]; char buf[32];

View file

@ -40,14 +40,14 @@
#define MAX_PLUGIN_LENGTH 32 #define MAX_PLUGIN_LENGTH 32
/* max filetypes (plugins & icons stored here) */ /* max filetypes (plugins & icons stored here) */
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
#define MAX_FILETYPES 64 #define MAX_FILETYPES 64
#else #else
#define MAX_FILETYPES 32 #define MAX_FILETYPES 32
#endif #endif
/* max exttypes (extensions stored here) */ /* max exttypes (extensions stored here) */
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
/* Software codecs require more file extensions */ /* Software codecs require more file extensions */
#define MAX_EXTTYPES 64 #define MAX_EXTTYPES 64
#else #else

View file

@ -61,7 +61,7 @@
#include "misc.h" #include "misc.h"
#include "database.h" #include "database.h"
#if (CONFIG_HWCODEC == MASNONE) #if (CONFIG_CODEC == SWCODEC)
#include "pcmbuf.h" #include "pcmbuf.h"
#else #else
#define pcmbuf_init() #define pcmbuf_init()
@ -129,7 +129,7 @@ void init(void)
global_settings.mdb_enable, global_settings.mdb_enable,
global_settings.superbass); global_settings.superbass);
button_clear_queue(); /* Empty the keyboard buffer */ button_clear_queue(); /* Empty the keyboard buffer */
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
talk_init(); talk_init();
#endif #endif
} }
@ -264,7 +264,7 @@ void init(void)
/* On software codec platforms we have to init audio before /* On software codec platforms we have to init audio before
calling audio_set_buffer_margin(). */ calling audio_set_buffer_margin(). */
#if (CONFIG_HWCODEC == MASNONE) #if (CONFIG_CODEC == SWCODEC)
audio_init(); audio_init();
#endif #endif
settings_calc_config_sector(); settings_calc_config_sector();
@ -291,7 +291,7 @@ void init(void)
global_settings.mdb_shape, global_settings.mdb_shape,
global_settings.mdb_enable, global_settings.mdb_enable,
global_settings.superbass); global_settings.superbass);
#if (CONFIG_HWCODEC == MASNONE) #if (CONFIG_CODEC == SWCODEC)
sound_settings_apply(); sound_settings_apply();
#else #else
audio_init(); audio_init();

View file

@ -1417,7 +1417,7 @@ int playlist_resume(void)
}; };
/* use mp3 buffer for maximum load speed */ /* use mp3 buffer for maximum load speed */
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
talk_buffer_steal(); /* we use the mp3 buffer, need to tell */ talk_buffer_steal(); /* we use the mp3 buffer, need to tell */
buflen = (audiobufend - audiobuf); buflen = (audiobufend - audiobuf);
buffer = audiobuf; buffer = audiobuf;
@ -1836,7 +1836,7 @@ int playlist_start(int start_index, int offset)
struct playlist_info* playlist = &current_playlist; struct playlist_info* playlist = &current_playlist;
playlist->index = start_index; playlist->index = start_index;
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
talk_buffer_steal(); /* will use the mp3 buffer */ talk_buffer_steal(); /* will use the mp3 buffer */
#endif #endif
audio_play(offset); audio_play(offset);

View file

@ -48,7 +48,7 @@
#include "timer.h" #include "timer.h"
#include "sound.h" #include "sound.h"
#include "database.h" #include "database.h"
#if (CONFIG_HWCODEC == MASNONE) #if (CONFIG_CODEC == SWCODEC)
#include "pcm_playback.h" #include "pcm_playback.h"
#endif #endif
@ -249,10 +249,10 @@ static const struct plugin_api rockbox_api = {
mp3_play_pause, mp3_play_pause,
mp3_play_stop, mp3_play_stop,
mp3_is_playing, mp3_is_playing,
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
bitswap, bitswap,
#endif #endif
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
pcm_play_data, pcm_play_data,
pcm_play_stop, pcm_play_stop,
pcm_set_frequency, pcm_set_frequency,
@ -276,24 +276,24 @@ static const struct plugin_api rockbox_api = {
audio_current_track, audio_current_track,
audio_flush_and_reload_tracks, audio_flush_and_reload_tracks,
audio_get_file_pos, audio_get_file_pos,
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
mpeg_get_last_header, mpeg_get_last_header,
#endif #endif
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
sound_set_pitch, sound_set_pitch,
#endif #endif
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
/* MAS communication */ /* MAS communication */
mas_readmem, mas_readmem,
mas_writemem, mas_writemem,
mas_readreg, mas_readreg,
mas_writereg, mas_writereg,
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
mas_codec_writereg, mas_codec_writereg,
mas_codec_readreg, mas_codec_readreg,
#endif #endif
#endif /* !simulator and HWCODEC != MASNONE */ #endif /* !SIMULATOR && CONFIG_CODEC != SWCODEC */
/* tag database */ /* tag database */
&tagdbheader, &tagdbheader,
@ -328,7 +328,7 @@ static const struct plugin_api rockbox_api = {
find_next_frame, find_next_frame,
battery_level, battery_level,
battery_level_safe, battery_level_safe,
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
peak_meter_scale_value, peak_meter_scale_value,
peak_meter_set_use_dbfs, peak_meter_set_use_dbfs,
peak_meter_get_use_dbfs, peak_meter_get_use_dbfs,

View file

@ -44,7 +44,7 @@
#include "mpeg.h" #include "mpeg.h"
#include "audio.h" #include "audio.h"
#include "mp3_playback.h" #include "mp3_playback.h"
#if (HWCODEC == MASNONE) #if (HWCODEC == SWCODEC)
#include "pcm_playback.h" #include "pcm_playback.h"
#endif #endif
#include "settings.h" #include "settings.h"
@ -325,10 +325,10 @@ struct plugin_api {
void (*mp3_play_pause)(bool play); void (*mp3_play_pause)(bool play);
void (*mp3_play_stop)(void); void (*mp3_play_stop)(void);
bool (*mp3_is_playing)(void); bool (*mp3_is_playing)(void);
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
void (*bitswap)(unsigned char *data, int length); void (*bitswap)(unsigned char *data, int length);
#endif #endif
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
void (*pcm_play_data)(void (*get_more)(unsigned char** start, long*size)); void (*pcm_play_data)(void (*get_more)(unsigned char** start, long*size));
void (*pcm_play_stop)(void); void (*pcm_play_stop)(void);
void (*pcm_set_frequency)(unsigned int frequency); void (*pcm_set_frequency)(unsigned int frequency);
@ -352,20 +352,20 @@ struct plugin_api {
struct mp3entry* (*audio_current_track)(void); struct mp3entry* (*audio_current_track)(void);
void (*audio_flush_and_reload_tracks)(void); void (*audio_flush_and_reload_tracks)(void);
int (*audio_get_file_pos)(void); int (*audio_get_file_pos)(void);
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
unsigned long (*mpeg_get_last_header)(void); unsigned long (*mpeg_get_last_header)(void);
#endif #endif
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
void (*sound_set_pitch)(int pitch); void (*sound_set_pitch)(int pitch);
#endif #endif
/* MAS communication */ /* MAS communication */
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len); int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len);
int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len); int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len);
int (*mas_readreg)(int reg); int (*mas_readreg)(int reg);
int (*mas_writereg)(int reg, unsigned int val); int (*mas_writereg)(int reg, unsigned int val);
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
int (*mas_codec_writereg)(int reg, unsigned int val); int (*mas_codec_writereg)(int reg, unsigned int val);
int (*mas_codec_readreg)(int reg); int (*mas_codec_readreg)(int reg);
#endif #endif
@ -410,7 +410,7 @@ struct plugin_api {
long max_offset, unsigned long last_header); long max_offset, unsigned long last_header);
int (*battery_level)(void); int (*battery_level)(void);
bool (*battery_level_safe)(void); bool (*battery_level_safe)(void);
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
unsigned short (*peak_meter_scale_value)(unsigned short val, unsigned short (*peak_meter_scale_value)(unsigned short val,
int meterwidth); int meterwidth);
void (*peak_meter_set_use_dbfs)(bool use); void (*peak_meter_set_use_dbfs)(bool use);

View file

@ -66,7 +66,7 @@ nim.c
alpine_cdc.c alpine_cdc.c
#endif #endif
#if CONFIG_HWCODEC == MASNONE /* software codec platforms */ #if CONFIG_CODEC == SWCODEC /* software codec platforms */
iriverify.c iriverify.c
wav2wv.c wav2wv.c
midi2wav.c midi2wav.c

View file

@ -20,7 +20,7 @@
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
#ifndef SIMULATOR /* don't want this code in the simulator */ #ifndef SIMULATOR /* don't want this code in the simulator */
#if CONFIG_HWCODEC != MASNONE /* only for MAS-targets */ #if CONFIG_CODEC != SWCODEC /* only for MAS-targets */
/* The different drawing modes */ /* The different drawing modes */
#define DRAW_MODE_FILLED 0 #define DRAW_MODE_FILLED 0

View file

@ -23,7 +23,7 @@
#include "plugin.h" #include "plugin.h"
#ifdef HAVE_LCD_BITMAP /* and also not for the Player */ #ifdef HAVE_LCD_BITMAP /* and also not for the Player */
#if CONFIG_HWCODEC != MASNONE /* only for MAS-targets */ #if CONFIG_CODEC != SWCODEC /* only for MAS-targets */
/* The different drawing modes */ /* The different drawing modes */
#define DRAW_MODE_FILLED 0 #define DRAW_MODE_FILLED 0

View file

@ -15,7 +15,7 @@ rcvar_t pcm_exports[] =
RCV_END RCV_END
}; };
/*#if CONFIG_HWCODEC == MASNONE && !defined(SIMULATOR) /*#if CONFIG_CODEC == SWCODEC && !defined(SIMULATOR)
* disabled cause it crashes with current audio implementation.. no sound. * disabled cause it crashes with current audio implementation.. no sound.
*/ */
#if 0 #if 0

View file

@ -269,7 +269,7 @@ static void update_icons(void)
LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
BMPWIDTH, BMPHEIGHT); BMPWIDTH, BMPHEIGHT);
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
/* The scale icon */ /* The scale icon */
rb->lcd_mono_bitmap(SCALE_BMP[rb->peak_meter_get_use_dbfs() ? 1 : 0], rb->lcd_mono_bitmap(SCALE_BMP[rb->peak_meter_get_use_dbfs() ? 1 : 0],
2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT, 2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
@ -909,7 +909,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
{ {
/* read volume info */ /* read volume info */
unsigned short volume; unsigned short volume;
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
volume = rb->mas_codec_readreg(0x0c); volume = rb->mas_codec_readreg(0x0c);
volume += rb->mas_codec_readreg(0x0d); volume += rb->mas_codec_readreg(0x0d);
volume = volume / 2; volume = volume / 2;
@ -1074,7 +1074,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
lastx = time_to_xpos(mp3->elapsed); lastx = time_to_xpos(mp3->elapsed);
break; break;
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
#ifdef SPLITEDIT_SPEED100 #ifdef SPLITEDIT_SPEED100
case SPLITEDIT_SPEED150: case SPLITEDIT_SPEED150:
rb->sound_set_pitch(1500); rb->sound_set_pitch(1500);
@ -1133,7 +1133,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
break; break;
case SPLITEDIT_SCALE: case SPLITEDIT_SCALE:
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
rb->peak_meter_set_use_dbfs(!rb->peak_meter_get_use_dbfs()); rb->peak_meter_set_use_dbfs(!rb->peak_meter_get_use_dbfs());
#endif #endif
splitedit_invalidate_osci(); splitedit_invalidate_osci();
@ -1202,7 +1202,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
} }
} }
} }
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
#ifdef SPLITEDIT_SPEED100 #ifdef SPLITEDIT_SPEED100
rb->sound_set_pitch(1000); /* make sure to reset pitch */ rb->sound_set_pitch(1000); /* make sure to reset pitch */
#endif #endif

View file

@ -17,7 +17,7 @@
**************************************************************************/ **************************************************************************/
#include "plugin.h" #include "plugin.h"
#if defined(HAVE_LCD_BITMAP) && (CONFIG_HWCODEC != MASNONE) #if defined(HAVE_LCD_BITMAP) && (CONFIG_CODEC != SWCODEC)
/* variable button definitions */ /* variable button definitions */
#if CONFIG_KEYPAD == RECORDER_PAD #if CONFIG_KEYPAD == RECORDER_PAD

View file

@ -33,11 +33,11 @@
#include "lang.h" #include "lang.h"
#include "peakmeter.h" #include "peakmeter.h"
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
#include "pcm_playback.h" #include "pcm_playback.h"
#endif #endif
#if !defined(SIMULATOR) && CONFIG_HWCODEC != MASNONE #if !defined(SIMULATOR) && CONFIG_CODEC != SWCODEC
/* Data source */ /* Data source */
static int pm_src_left = MAS_REG_DQPEAK_L; static int pm_src_left = MAS_REG_DQPEAK_L;
static int pm_src_right = MAS_REG_DQPEAK_R; static int pm_src_right = MAS_REG_DQPEAK_R;
@ -490,7 +490,7 @@ void peak_meter_playback(bool playback)
{ {
#ifdef SIMULATOR #ifdef SIMULATOR
(void)playback; (void)playback;
#elif CONFIG_HWCODEC == MASNONE #elif CONFIG_CODEC == SWCODEC
/* FIX: not for the sw-based ones yes */ /* FIX: not for the sw-based ones yes */
(void)playback; (void)playback;
#else #else
@ -530,7 +530,7 @@ void peak_meter_peek(void)
#ifdef SIMULATOR #ifdef SIMULATOR
pm_cur_left = left = 8000; pm_cur_left = left = 8000;
pm_cur_right = right = 9000; pm_cur_right = right = 9000;
#elif CONFIG_HWCODEC == MASNONE #elif CONFIG_CODEC == SWCODEC
pcm_calculate_peaks(&pm_cur_left, &pm_cur_right); pcm_calculate_peaks(&pm_cur_left, &pm_cur_right);
left = pm_cur_left; left = pm_cur_left;
right = pm_cur_right; right = pm_cur_right;

View file

@ -55,7 +55,7 @@
#ifdef CONFIG_TUNER #ifdef CONFIG_TUNER
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
#include "uda1380.h" #include "uda1380.h"
#include "pcm_record.h" #include "pcm_record.h"
#endif #endif
@ -213,14 +213,14 @@ bool radio_screen(void)
radio_load_presets(); radio_load_presets();
#ifndef SIMULATOR #ifndef SIMULATOR
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
if(rec_create_directory() > 0) if(rec_create_directory() > 0)
have_recorded = true; have_recorded = true;
#endif #endif
audio_stop(); audio_stop();
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
mpeg_init_recording(); mpeg_init_recording();
sound_settings_apply(); sound_settings_apply();
@ -497,7 +497,7 @@ bool radio_screen(void)
} }
#ifndef SIMULATOR #ifndef SIMULATOR
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
seconds = mpeg_recorded_time() / HZ; seconds = mpeg_recorded_time() / HZ;
#endif #endif
#endif #endif
@ -580,7 +580,7 @@ bool radio_screen(void)
} }
} }
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
audio_init_playback(); audio_init_playback();
#endif #endif
@ -588,7 +588,7 @@ bool radio_screen(void)
if(keep_playing) if(keep_playing)
{ {
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
/* Enable the Left and right A/D Converter */ /* Enable the Left and right A/D Converter */
mpeg_set_recording_gain(sound_default(SOUND_LEFT_GAIN), mpeg_set_recording_gain(sound_default(SOUND_LEFT_GAIN),
sound_default(SOUND_RIGHT_GAIN), false); sound_default(SOUND_RIGHT_GAIN), false);
@ -599,7 +599,7 @@ bool radio_screen(void)
else else
{ {
radio_stop(); radio_stop();
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
pcmrec_set_mux(0); /* Line In */ pcmrec_set_mux(0); /* Line In */
#endif #endif
} }
@ -880,7 +880,7 @@ bool handle_radio_presets(void)
} }
#ifndef SIMULATOR #ifndef SIMULATOR
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
static bool fm_recording_settings(void) static bool fm_recording_settings(void)
{ {
bool ret; bool ret;
@ -959,7 +959,7 @@ bool radio_menu(void)
#endif #endif
{ monomode_menu_string , toggle_mono_mode }, { monomode_menu_string , toggle_mono_mode },
{ ID2P(LANG_SOUND_SETTINGS) , sound_menu }, { ID2P(LANG_SOUND_SETTINGS) , sound_menu },
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) #if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
{ ID2P(LANG_RECORDING_SETTINGS) , fm_recording_settings}, { ID2P(LANG_RECORDING_SETTINGS) , fm_recording_settings},
#endif #endif
}; };

View file

@ -1307,7 +1307,7 @@ int draw_id3_item(int line, int top, int header, const char* body)
return line + 2; return line + 2;
} }
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
#define ID3_ITEMS 13 #define ID3_ITEMS 13
#else #else
#define ID3_ITEMS 11 #define ID3_ITEMS 11
@ -1401,7 +1401,7 @@ bool browse_id3(void)
snprintf(buf, sizeof(buf), "%d Hz", id3->frequency); snprintf(buf, sizeof(buf), "%d Hz", id3->frequency);
line = draw_id3_item(line, top, LANG_ID3_FRECUENCY, buf); line = draw_id3_item(line, top, LANG_ID3_FRECUENCY, buf);
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
line = draw_id3_item(line, top, LANG_ID3_TRACK_GAIN, line = draw_id3_item(line, top, LANG_ID3_TRACK_GAIN,
id3->track_gain_string); id3->track_gain_string);

View file

@ -66,14 +66,14 @@
#include "version.h" #include "version.h"
#include "rtc.h" #include "rtc.h"
#include "sound.h" #include "sound.h"
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
void dac_line_in(bool enable); void dac_line_in(bool enable);
#endif #endif
struct user_settings global_settings; struct user_settings global_settings;
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
const char rec_base_directory[] = REC_BASE_DIR; const char rec_base_directory[] = REC_BASE_DIR;
#endif #endif
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
#include "pcmbuf.h" #include "pcmbuf.h"
#include "pcm_playback.h" #include "pcm_playback.h"
#endif #endif
@ -183,14 +183,14 @@ static const struct bit_entry rtc_bits[] =
/* sound */ /* sound */
{7, S_O(volume), 70, "volume", NULL }, /* 0...100 */ {7, S_O(volume), 70, "volume", NULL }, /* 0...100 */
{8 | SIGNED, S_O(balance), 0, "balance", NULL }, /* -100...100 */ {8 | SIGNED, S_O(balance), 0, "balance", NULL }, /* -100...100 */
#if CONFIG_HWCODEC != MASNONE /* any MAS */ #if CONFIG_CODEC != SWCODEC /* any MAS */
{5 | SIGNED, S_O(bass), 0, "bass", NULL }, /* -15..+15 / -12..+12 */ {5 | SIGNED, S_O(bass), 0, "bass", NULL }, /* -15..+15 / -12..+12 */
{5 | SIGNED, S_O(treble), 0, "treble", NULL }, /* -15..+15 / -12..+12 */ {5 | SIGNED, S_O(treble), 0, "treble", NULL }, /* -15..+15 / -12..+12 */
#elif defined HAVE_UDA1380 #elif defined HAVE_UDA1380
{5, S_O(bass), 0, "bass", NULL }, /* 0..+24 */ {5, S_O(bass), 0, "bass", NULL }, /* 0..+24 */
{3, S_O(treble), 0, "treble", NULL }, /* 0..+6 */ {3, S_O(treble), 0, "treble", NULL }, /* 0..+6 */
#endif #endif
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
{5, S_O(loudness), 0, "loudness", NULL }, /* 0...17 */ {5, S_O(loudness), 0, "loudness", NULL }, /* 0...17 */
{3, S_O(avc), 0, "auto volume", "off,20ms,2,4,8" }, {3, S_O(avc), 0, "auto volume", "off,20ms,2,4,8" },
{1, S_O(superbass), false, "superbass", off_on }, {1, S_O(superbass), false, "superbass", off_on },
@ -312,7 +312,7 @@ static const struct bit_entry hd_bits[] =
{4, S_O(ff_rewind_min_step), FF_REWIND_1000, {4, S_O(ff_rewind_min_step), FF_REWIND_1000,
"scan min step", "1,2,3,4,5,6,8,10,15,20,25,30,45,60" }, "scan min step", "1,2,3,4,5,6,8,10,15,20,25,30,45,60" },
{4, S_O(ff_rewind_accel), 3, "scan accel", NULL }, {4, S_O(ff_rewind_accel), 3, "scan accel", NULL },
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
{3, S_O(buffer_margin), 0, "antiskip", {3, S_O(buffer_margin), 0, "antiskip",
"5s,15s,30s,1min,2min,3min,5min,10min" }, "5s,15s,30s,1min,2min,3min,5min,10min" },
#else #else
@ -356,7 +356,7 @@ static const struct bit_entry hd_bits[] =
{7, S_O(peak_meter_min), 60, "peak meter min", NULL }, /* 0...100 */ {7, S_O(peak_meter_min), 60, "peak meter min", NULL }, /* 0...100 */
{7, S_O(peak_meter_max), 0, "peak meter max", NULL }, /* 0...100 */ {7, S_O(peak_meter_max), 0, "peak meter max", NULL }, /* 0...100 */
#endif #endif
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
/* recording */ /* recording */
{1, S_O(rec_editable), false, "editable recordings", off_on }, {1, S_O(rec_editable), false, "editable recordings", off_on },
{4, S_O(rec_timesplit), 0, "rec timesplit", /* 0...15 */ {4, S_O(rec_timesplit), 0, "rec timesplit", /* 0...15 */
@ -376,14 +376,14 @@ static const struct bit_entry hd_bits[] =
{1, S_O(rec_directory), 0, /* rec_base_directory */ {1, S_O(rec_directory), 0, /* rec_base_directory */
"rec directory", REC_BASE_DIR ",current" }, "rec directory", REC_BASE_DIR ",current" },
#endif #endif
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
{7, S_O(mdb_strength), 0, "mdb strength", NULL}, {7, S_O(mdb_strength), 0, "mdb strength", NULL},
{7, S_O(mdb_harmonics), 0, "mdb harmonics", NULL}, {7, S_O(mdb_harmonics), 0, "mdb harmonics", NULL},
{9, S_O(mdb_center), 0, "mdb center", NULL}, {9, S_O(mdb_center), 0, "mdb center", NULL},
{9, S_O(mdb_shape), 0, "mdb shape", NULL}, {9, S_O(mdb_shape), 0, "mdb shape", NULL},
{1, S_O(mdb_enable), 0, "mdb enable", off_on}, {1, S_O(mdb_enable), 0, "mdb enable", off_on},
#endif #endif
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
{1, S_O(line_in), false, "line in", off_on }, {1, S_O(line_in), false, "line in", off_on },
#endif #endif
/* voice */ /* voice */
@ -407,7 +407,7 @@ static const struct bit_entry hd_bits[] =
{4, S_O(rec_trigger_mode ), 1, "trigger mode", "off,no rearm,rearm"}, {4, S_O(rec_trigger_mode ), 1, "trigger mode", "off,no rearm,rearm"},
#endif #endif
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
{3, S_O(crossfade_duration), 0, "crossfade duration", "1s,2s,4s,6s,8s,10s,12s,14s"}, {3, S_O(crossfade_duration), 0, "crossfade duration", "1s,2s,4s,6s,8s,10s,12s,14s"},
#endif #endif
@ -425,7 +425,7 @@ static const struct bit_entry hd_bits[] =
{1, S_O(next_folder), false, "move to next folder", off_on }, {1, S_O(next_folder), false, "move to next folder", off_on },
{1, S_O(runtimedb), false, "gather runtime data", off_on }, {1, S_O(runtimedb), false, "gather runtime data", off_on },
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
{2, S_O(crossfade), 0, "crossfade type", "off,crossfade,mix"}, {2, S_O(crossfade), 0, "crossfade type", "off,crossfade,mix"},
{1, S_O(replaygain), false, "replaygain", off_on }, {1, S_O(replaygain), false, "replaygain", off_on },
{1, S_O(replaygain_track), false, "replaygain type", "track,album" }, {1, S_O(replaygain_track), false, "replaygain type", "track,album" },
@ -776,7 +776,7 @@ void sound_settings_apply(void)
sound_set(SOUND_VOLUME, global_settings.volume); sound_set(SOUND_VOLUME, global_settings.volume);
sound_set(SOUND_CHANNELS, global_settings.channel_config); sound_set(SOUND_CHANNELS, global_settings.channel_config);
sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width); sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width);
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
sound_set(SOUND_LOUDNESS, global_settings.loudness); sound_set(SOUND_LOUDNESS, global_settings.loudness);
sound_set(SOUND_AVC, global_settings.avc); sound_set(SOUND_AVC, global_settings.avc);
sound_set(SOUND_MDB_STRENGTH, global_settings.mdb_strength); sound_set(SOUND_MDB_STRENGTH, global_settings.mdb_strength);
@ -811,7 +811,7 @@ void settings_apply(void)
backlight_set_fade_out(global_settings.backlight_fade_out); backlight_set_fade_out(global_settings.backlight_fade_out);
#endif #endif
ata_spindown(global_settings.disk_spindown); ata_spindown(global_settings.disk_spindown);
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
dac_line_in(global_settings.line_in); dac_line_in(global_settings.line_in);
#endif #endif
#ifdef HAVE_ATA_POWER_OFF #ifdef HAVE_ATA_POWER_OFF
@ -872,7 +872,7 @@ void settings_apply(void)
talk_init(); /* use voice of same language */ talk_init(); /* use voice of same language */
} }
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
audio_set_crossfade(global_settings.crossfade); audio_set_crossfade(global_settings.crossfade);
#endif #endif

View file

@ -154,7 +154,7 @@ struct user_settings
bool mdb_enable; /* true/false */ bool mdb_enable; /* true/false */
bool superbass; /* true/false */ bool superbass; /* true/false */
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
int crossfade; int crossfade;
int crossfade_duration; int crossfade_duration;
#endif #endif
@ -330,7 +330,7 @@ struct user_settings
bool next_folder; /* move to next folder */ bool next_folder; /* move to next folder */
bool runtimedb; /* runtime database active? */ bool runtimedb; /* runtime database active? */
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
bool replaygain; /* enable replaygain */ bool replaygain; /* enable replaygain */
bool replaygain_track; /* true for track gain, false for album gain */ bool replaygain_track; /* true for track gain, false for album gain */
bool replaygain_noclip; /* scale to prevent clips */ bool replaygain_noclip; /* scale to prevent clips */

View file

@ -54,7 +54,7 @@
#include "peakmeter.h" #include "peakmeter.h"
#endif #endif
#include "lang.h" #include "lang.h"
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
void dac_line_in(bool enable); void dac_line_in(bool enable);
#endif #endif
#ifdef HAVE_ALARM_MOD #ifdef HAVE_ALARM_MOD
@ -65,7 +65,7 @@ void dac_line_in(bool enable);
#include "lcd-remote.h" #include "lcd-remote.h"
#endif #endif
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
#include "pcmbuf.h" #include "pcmbuf.h"
#include "pcm_playback.h" #include "pcm_playback.h"
#include "dsp.h" #include "dsp.h"
@ -879,7 +879,7 @@ static bool poweroff(void)
#endif /* HAVE_ATA_POWEROFF */ #endif /* HAVE_ATA_POWEROFF */
#endif /* !HAVE_MMC */ #endif /* !HAVE_MMC */
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
static bool line_in(void) static bool line_in(void)
{ {
bool rc = set_bool(str(LANG_LINE_IN), &global_settings.line_in); bool rc = set_bool(str(LANG_LINE_IN), &global_settings.line_in);
@ -902,7 +902,7 @@ static bool max_files_in_playlist(void)
NULL, 1000, 1000, 20000, NULL ); NULL, 1000, 1000, 20000, NULL );
} }
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
static bool buffer_margin(void) static bool buffer_margin(void)
{ {
int ret; int ret;
@ -1111,7 +1111,7 @@ static bool id3_order(void)
mpeg_id3_options); mpeg_id3_options);
} }
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
static bool crossfade(void) static bool crossfade(void)
{ {
static const struct opt_items names[] = { static const struct opt_items names[] = {
@ -1172,7 +1172,7 @@ static bool runtimedb(void)
return rc; return rc;
} }
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
static bool replaygain(void) static bool replaygain(void)
{ {
bool result = set_bool(str(LANG_REPLAYGAIN_ENABLE), bool result = set_bool(str(LANG_REPLAYGAIN_ENABLE),
@ -1270,7 +1270,7 @@ static bool playback_settings_menu(void)
{ ID2P(LANG_WIND_MENU), ff_rewind_settings_menu }, { ID2P(LANG_WIND_MENU), ff_rewind_settings_menu },
{ ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin }, { ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin },
{ ID2P(LANG_FADE_ON_STOP), set_fade_on_stop }, { ID2P(LANG_FADE_ON_STOP), set_fade_on_stop },
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
{ ID2P(LANG_CROSSFADE), crossfade }, { ID2P(LANG_CROSSFADE), crossfade },
{ ID2P(LANG_CROSSFADE_DURATION), crossfade_duration }, { ID2P(LANG_CROSSFADE_DURATION), crossfade_duration },
{ ID2P(LANG_REPLAYGAIN), replaygain_settings_menu }, { ID2P(LANG_REPLAYGAIN), replaygain_settings_menu },
@ -1654,7 +1654,7 @@ static bool system_settings_menu(void)
{ ID2P(LANG_ALARM_MOD_ALARM_MENU), alarm_screen }, { ID2P(LANG_ALARM_MOD_ALARM_MENU), alarm_screen },
#endif #endif
{ ID2P(LANG_LIMITS_MENU), limits_settings_menu }, { ID2P(LANG_LIMITS_MENU), limits_settings_menu },
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
{ ID2P(LANG_LINE_IN), line_in }, { ID2P(LANG_LINE_IN), line_in },
#endif #endif
#ifdef HAVE_CHARGING #ifdef HAVE_CHARGING

View file

@ -38,7 +38,7 @@
#include "talk.h" #include "talk.h"
#include "misc.h" #include "misc.h"
#include "sound.h" #include "sound.h"
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
#include "peakmeter.h" #include "peakmeter.h"
#include "mas.h" #include "mas.h"
#endif #endif
@ -171,7 +171,7 @@ static bool treble(void)
return set_sound(str(LANG_TREBLE), &global_settings.treble, SOUND_TREBLE); return set_sound(str(LANG_TREBLE), &global_settings.treble, SOUND_TREBLE);
} }
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
static bool loudness(void) static bool loudness(void)
{ {
return set_sound(str(LANG_LOUDNESS), &global_settings.loudness, return set_sound(str(LANG_LOUDNESS), &global_settings.loudness,
@ -421,7 +421,7 @@ bool sound_menu(void)
{ ID2P(LANG_BALANCE), balance }, { ID2P(LANG_BALANCE), balance },
{ ID2P(LANG_CHANNEL_MENU), chanconf }, { ID2P(LANG_CHANNEL_MENU), chanconf },
{ ID2P(LANG_STEREO_WIDTH), stereo_width }, { ID2P(LANG_STEREO_WIDTH), stereo_width },
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
{ ID2P(LANG_LOUDNESS), loudness }, { ID2P(LANG_LOUDNESS), loudness },
{ ID2P(LANG_AUTOVOL), avc }, { ID2P(LANG_AUTOVOL), avc },
{ ID2P(LANG_SUPERBASS), superbass }, { ID2P(LANG_SUPERBASS), superbass },
@ -454,7 +454,7 @@ enum trigger_menu_option
TRIG_OPTION_COUNT, TRIG_OPTION_COUNT,
}; };
#if !defined(SIMULATOR) && CONFIG_HWCODEC == MAS3587F #if !defined(SIMULATOR) && CONFIG_CODEC == MAS3587F
static char* create_thres_str(int threshold) static char* create_thres_str(int threshold)
{ {
static char retval[6]; static char retval[6];
@ -846,7 +846,7 @@ bool recording_menu(bool no_source)
items[i++].function = recdirectory; items[i++].function = recdirectory;
items[i].desc = ID2P(LANG_RECORD_STARTUP); items[i].desc = ID2P(LANG_RECORD_STARTUP);
items[i++].function = reconstartup; items[i++].function = reconstartup;
#if !defined(SIMULATOR) && CONFIG_HWCODEC == MAS3587F #if !defined(SIMULATOR) && CONFIG_CODEC == MAS3587F
items[i].desc = str(LANG_RECORD_TRIGGER); items[i].desc = str(LANG_RECORD_TRIGGER);
items[i++].function = rectrigger; items[i++].function = rectrigger;
#endif #endif

View file

@ -106,7 +106,7 @@ int current_playmode(void)
else else
return STATUS_PLAY; return STATUS_PLAY;
} }
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
else else
{ {
if(audio_stat & AUDIO_STATUS_RECORD) if(audio_stat & AUDIO_STATUS_RECORD)

View file

@ -34,7 +34,7 @@
#include "id3.h" #include "id3.h"
#include "logf.h" #include "logf.h"
#include "bitswap.h" #include "bitswap.h"
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
#include "playback.h" #include "playback.h"
#endif #endif
@ -148,7 +148,7 @@ static void load_voicefile(void)
int load_size; int load_size;
int got_size; int got_size;
int file_size; int file_size;
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
int length, i; int length, i;
unsigned char *buf, temp; unsigned char *buf, temp;
#endif #endif
@ -205,7 +205,7 @@ static void load_voicefile(void)
#endif #endif
/* Do a bitswap as necessary. */ /* Do a bitswap as necessary. */
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
logf("Bitswapping voice file."); logf("Bitswapping voice file.");
cpu_boost(true); cpu_boost(true);
buf = (unsigned char *)(&p_voicefile->index) + buf = (unsigned char *)(&p_voicefile->index) +
@ -261,7 +261,7 @@ static void mp3_callback(unsigned char** start, int* size)
if (queue[queue_read].len > 0) /* current clip not finished? */ if (queue[queue_read].len > 0) /* current clip not finished? */
{ /* feed the next 64K-1 chunk */ { /* feed the next 64K-1 chunk */
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
sent = MIN(queue[queue_read].len, 0xFFFF); sent = MIN(queue[queue_read].len, 0xFFFF);
#else #else
sent = queue[queue_read].len; sent = queue[queue_read].len;
@ -279,7 +279,7 @@ re_check:
if (QUEUE_LEVEL) /* queue is not empty? */ if (QUEUE_LEVEL) /* queue is not empty? */
{ /* start next clip */ { /* start next clip */
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
sent = MIN(queue[queue_read].len, 0xFFFF); sent = MIN(queue[queue_read].len, 0xFFFF);
#else #else
sent = queue[queue_read].len; sent = queue[queue_read].len;
@ -393,7 +393,7 @@ static int queue_clip(unsigned char* buf, long size, bool enqueue)
if (queue_level == 0) if (queue_level == 0)
{ /* queue was empty, we have to do the initial start */ { /* queue was empty, we have to do the initial start */
p_lastclip = buf; p_lastclip = buf;
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
sent = MIN(size, 0xFFFF); /* DMA can do no more */ sent = MIN(size, 0xFFFF); /* DMA can do no more */
#else #else
sent = size; sent = size;
@ -485,7 +485,7 @@ void talk_init(void)
if (has_voicefile) if (has_voicefile)
{ {
voicefile_size = filesize(filehandle); voicefile_size = filesize(filehandle);
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
voice_init(); voice_init();
#endif #endif
close(filehandle); /* close again, this was just to detect presence */ close(filehandle); /* close again, this was just to detect presence */
@ -519,7 +519,7 @@ int talk_id(long id, bool enqueue)
unsigned char* clipbuf; unsigned char* clipbuf;
int unit; int unit;
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
if (audio_status()) /* busy, buffer in use */ if (audio_status()) /* busy, buffer in use */
return -1; return -1;
#endif #endif
@ -586,7 +586,7 @@ int talk_file(const char* filename, bool enqueue)
if (size) if (size)
{ {
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
bitswap(p_thumbnail, size); bitswap(p_thumbnail, size);
#endif #endif
queue_clip(p_thumbnail, size, enqueue); queue_clip(p_thumbnail, size, enqueue);
@ -603,7 +603,7 @@ int talk_number(long n, bool enqueue)
int level = 0; /* mille count */ int level = 0; /* mille count */
long mil = 1000000000; /* highest possible "-illion" */ long mil = 1000000000; /* highest possible "-illion" */
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
if (audio_status()) /* busy, buffer in use */ if (audio_status()) /* busy, buffer in use */
return -1; return -1;
#endif #endif
@ -684,7 +684,7 @@ int talk_value(long n, int unit, bool enqueue)
VOICE_HERTZ, VOICE_HERTZ,
}; };
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
if (audio_status()) /* busy, buffer in use */ if (audio_status()) /* busy, buffer in use */
return -1; return -1;
#endif #endif
@ -718,7 +718,7 @@ int talk_spell(const char* spell, bool enqueue)
{ {
char c; /* currently processed char */ char c; /* currently processed char */
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
if (audio_status()) /* busy, buffer in use */ if (audio_status()) /* busy, buffer in use */
return -1; return -1;
#endif #endif

View file

@ -71,7 +71,7 @@ const struct filetype filetypes[] = {
{ ".mp3", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, { ".mp3", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
{ ".mp2", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, { ".mp2", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
{ ".mpa", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, { ".mpa", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
/* Temporary hack to allow playlist creation */ /* Temporary hack to allow playlist creation */
{ ".mp1", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, { ".mp1", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
{ ".ogg", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, { ".ogg", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },

View file

@ -85,7 +85,7 @@ drivers/i2c-coldfire.c
#else #else
drivers/i2c.c drivers/i2c.c
#endif #endif
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
drivers/mas.c drivers/mas.c
#endif #endif
#ifdef HAVE_RTC #ifdef HAVE_RTC
@ -107,7 +107,7 @@ crt0.S
#endif #endif
mp3_playback.c mp3_playback.c
mp3data.c mp3data.c
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
mpeg.c mpeg.c
#endif #endif
#ifndef WIN32 /* the win32 sim has its own versin of these: */ #ifndef WIN32 /* the win32 sim has its own versin of these: */
@ -130,10 +130,10 @@ drivers/uda1380.c
#elif defined(HAVE_TLV320) && !defined(SIMULATOR) #elif defined(HAVE_TLV320) && !defined(SIMULATOR)
drivers/tlv320.c drivers/tlv320.c
#endif #endif
#if (CONFIG_HWCODEC == MASNONE) && !defined(SIMULATOR) #if (CONFIG_CODEC == SWCODEC) && !defined(SIMULATOR)
pcm_playback.c pcm_playback.c
#endif #endif
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
replaygain.c replaygain.c
#endif #endif
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR) #if defined(CPU_COLDFIRE) && !defined(SIMULATOR)

View file

@ -132,7 +132,7 @@ int mas_writemem(int bank, int addr, const unsigned long* src, int len)
j = 0; j = 0;
while(len--) { while(len--) {
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
buf[i++] = 0; buf[i++] = 0;
buf[i++] = ptr[j+1]; buf[i++] = ptr[j+1];
buf[i++] = ptr[j+2]; buf[i++] = ptr[j+2];
@ -232,7 +232,7 @@ static int mas_devread(unsigned long *dest, int len)
if (i2c_getack()) { if (i2c_getack()) {
for (i=0;len;i++) { for (i=0;len;i++) {
len--; len--;
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
i2c_inb(0); /* Dummy read */ i2c_inb(0); /* Dummy read */
ptr[i*4+0] = 0; ptr[i*4+0] = 0;
ptr[i*4+1] = i2c_inb(0) & 0x0f; ptr[i*4+1] = i2c_inb(0) & 0x0f;
@ -270,7 +270,7 @@ void mas_reset(void)
{ {
or_b(0x01, &PAIORH); or_b(0x01, &PAIORH);
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
/* PB5 is "MAS enable". make it GPIO output and high */ /* PB5 is "MAS enable". make it GPIO output and high */
PBCR2 &= ~0x0c00; PBCR2 &= ~0x0c00;
or_b(0x20, &PBIORL); or_b(0x20, &PBIORL);
@ -280,7 +280,7 @@ void mas_reset(void)
sleep(HZ/100); sleep(HZ/100);
or_b(0x01, &PADRH); or_b(0x01, &PADRH);
sleep(HZ/5); sleep(HZ/5);
#elif (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #elif (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
if(old_recorder) if(old_recorder)
{ {
/* Older recorder models don't invert the POR signal */ /* Older recorder models don't invert the POR signal */
@ -299,7 +299,7 @@ void mas_reset(void)
#endif #endif
} }
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
int mas_direct_config_read(unsigned char reg) int mas_direct_config_read(unsigned char reg)
{ {
int ret = 0; int ret = 0;

View file

@ -29,7 +29,7 @@
#ifndef SIMULATOR #ifndef SIMULATOR
/* Define this if you have a MAS3587F */ /* Define this if you have a MAS3587F */
#define CONFIG_HWCODEC MAS3587F #define CONFIG_CODEC MAS3587F
/* Define this if you have a SH7034 */ /* Define this if you have a SH7034 */
#define CONFIG_CPU SH7034 #define CONFIG_CPU SH7034

View file

@ -38,7 +38,7 @@
#define CONFIG_I2C I2C_GMINI #define CONFIG_I2C I2C_GMINI
/* Define this if you do software codec */ /* Define this if you do software codec */
#define CONFIG_HWCODEC MASNONE #define CONFIG_CODEC SWCODEC
/* Type of mobile power, FIXME: probably different, make new type */ /* Type of mobile power, FIXME: probably different, make new type */
#define CONFIG_BATTERY BATT_LIION2200 #define CONFIG_BATTERY BATT_LIION2200

View file

@ -32,7 +32,7 @@
#define CONFIG_I2C I2C_GMINI #define CONFIG_I2C I2C_GMINI
/* Define this if you do software codec */ /* Define this if you do software codec */
#define CONFIG_HWCODEC MASNONE #define CONFIG_CODEC SWCODEC
/* Type of mobile power, FIXME: probably different, make new type */ /* Type of mobile power, FIXME: probably different, make new type */
#define CONFIG_BATTERY BATT_LIION2200 #define CONFIG_BATTERY BATT_LIION2200

View file

@ -31,7 +31,7 @@
#define CONFIG_REMOTE_KEYPAD H100_REMOTE #define CONFIG_REMOTE_KEYPAD H100_REMOTE
/* Define this if you do software codec */ /* Define this if you do software codec */
#define CONFIG_HWCODEC MASNONE #define CONFIG_CODEC SWCODEC
/* Define this if you have an remote lcd */ /* Define this if you have an remote lcd */
#define HAVE_REMOTE_LCD #define HAVE_REMOTE_LCD

View file

@ -27,7 +27,7 @@
#define CONFIG_REMOTE_KEYPAD H100_REMOTE #define CONFIG_REMOTE_KEYPAD H100_REMOTE
/* Define this if you do software codec */ /* Define this if you do software codec */
#define CONFIG_HWCODEC MASNONE #define CONFIG_CODEC SWCODEC
/* Define this if you have an remote lcd */ /* Define this if you have an remote lcd */
#define HAVE_REMOTE_LCD #define HAVE_REMOTE_LCD

View file

@ -25,7 +25,7 @@
#define CONFIG_REMOTE_KEYPAD H300_REMOTE #define CONFIG_REMOTE_KEYPAD H300_REMOTE
/* Define this if you do software codec */ /* Define this if you do software codec */
#define CONFIG_HWCODEC MASNONE #define CONFIG_CODEC SWCODEC
/* Define this if you have an remote lcd */ /* Define this if you have an remote lcd */
#define HAVE_REMOTE_LCD #define HAVE_REMOTE_LCD

View file

@ -24,7 +24,7 @@
#define CONFIG_KEYPAD IAUDIO_X5_PAD #define CONFIG_KEYPAD IAUDIO_X5_PAD
/* Define this if you do software codec */ /* Define this if you do software codec */
#define CONFIG_HWCODEC MASNONE #define CONFIG_CODEC SWCODEC
/* Define this if you have an remote lcd */ /* Define this if you have an remote lcd */
#define HAVE_REMOTE_LCD #define HAVE_REMOTE_LCD

View file

@ -28,7 +28,7 @@
#define CONFIG_CPU SH7034 #define CONFIG_CPU SH7034
/* Define this if you have a MAS3587F */ /* Define this if you have a MAS3587F */
#define CONFIG_HWCODEC MAS3587F #define CONFIG_CODEC MAS3587F
/* Define this to the CPU frequency */ /* Define this to the CPU frequency */
#define CPU_FREQ 12000000 #define CPU_FREQ 12000000

View file

@ -21,7 +21,7 @@
#define CONFIG_CPU SH7034 #define CONFIG_CPU SH7034
/* Define this if you have a MAS3539F */ /* Define this if you have a MAS3539F */
#define CONFIG_HWCODEC MAS3539F #define CONFIG_CODEC MAS3539F
/* Define this to the CPU frequency */ /* Define this to the CPU frequency */
#define CPU_FREQ 12000000 #define CPU_FREQ 12000000

View file

@ -20,7 +20,7 @@
#define CONFIG_CPU SH7034 #define CONFIG_CPU SH7034
/* Define this if you have a MAS3507D */ /* Define this if you have a MAS3507D */
#define CONFIG_HWCODEC MAS3507D #define CONFIG_CODEC MAS3507D
/* Define this if you have a DAC3550A */ /* Define this if you have a DAC3550A */
#define HAVE_DAC3550A #define HAVE_DAC3550A

View file

@ -23,7 +23,7 @@
#ifndef SIMULATOR #ifndef SIMULATOR
/* Define this if you have a MAS3587F */ /* Define this if you have a MAS3587F */
#define CONFIG_HWCODEC MAS3587F #define CONFIG_CODEC MAS3587F
/* Define this if you have a SH7034 */ /* Define this if you have a SH7034 */
#define CONFIG_CPU SH7034 #define CONFIG_CPU SH7034

View file

@ -29,7 +29,7 @@
#define CONFIG_CPU SH7034 #define CONFIG_CPU SH7034
/* Define this if you have a MAS3587F */ /* Define this if you have a MAS3587F */
#define CONFIG_HWCODEC MAS3587F #define CONFIG_CODEC MAS3587F
/* Define this if you have a FM Recorder key system */ /* Define this if you have a FM Recorder key system */
#define HAVE_FMADC 1 #define HAVE_FMADC 1

View file

@ -28,11 +28,11 @@
#define S1A0903X01 0x01 /* Samsung */ #define S1A0903X01 0x01 /* Samsung */
#define TEA5767 0x02 /* Philips */ #define TEA5767 0x02 /* Philips */
/* CONFIG_HWCODEC */ /* CONFIG_CODEC */
#define MAS3587F 3587 #define MAS3587F 3587
#define MAS3507D 3507 #define MAS3507D 3507
#define MAS3539F 3539 #define MAS3539F 3539
#define MASNONE 1 /* if codec is done by SW */ #define SWCODEC 1 /* if codec is done by SW */
/* CONFIG_CPU */ /* CONFIG_CPU */
#define SH7034 7034 #define SH7034 7034

View file

@ -28,14 +28,14 @@
enum { enum {
AFMT_UNKNOWN = 1, /* Unknown file format */ AFMT_UNKNOWN = 1, /* Unknown file format */
#if CONFIG_HWCODEC==MASNONE #if CONFIG_CODEC==SWCODEC
AFMT_MPA_L1, /* MPEG Audio layer 1 */ AFMT_MPA_L1, /* MPEG Audio layer 1 */
#endif #endif
AFMT_MPA_L2, /* MPEG Audio layer 2 */ AFMT_MPA_L2, /* MPEG Audio layer 2 */
AFMT_MPA_L3, /* MPEG Audio layer 3 */ AFMT_MPA_L3, /* MPEG Audio layer 3 */
#if CONFIG_HWCODEC==MASNONE #if CONFIG_CODEC==SWCODEC
AFMT_PCM_WAV, /* Uncompressed PCM in a WAV file */ AFMT_PCM_WAV, /* Uncompressed PCM in a WAV file */
AFMT_OGG_VORBIS, /* Ogg Vorbis */ AFMT_OGG_VORBIS, /* Ogg Vorbis */
AFMT_FLAC, /* FLAC */ AFMT_FLAC, /* FLAC */
@ -118,7 +118,7 @@ struct mp3entry {
/* replaygain support */ /* replaygain support */
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
char* track_gain_string; char* track_gain_string;
char* album_gain_string; char* album_gain_string;
long track_gain; /* 7.24 signed fixed point. 0 for no gain. */ long track_gain; /* 7.24 signed fixed point. 0 for no gain. */

View file

@ -27,7 +27,7 @@
/* /*
MAS I2C defs MAS I2C defs
*/ */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
#define MAS_ADR 0x3c #define MAS_ADR 0x3c
#define MAS_DEV_WRITE (MAS_ADR | 0x00) #define MAS_DEV_WRITE (MAS_ADR | 0x00)
#define MAS_DEV_READ (MAS_ADR | 0x01) #define MAS_DEV_READ (MAS_ADR | 0x01)
@ -38,7 +38,7 @@
#endif #endif
/* registers..*/ /* registers..*/
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
#define MAS_DATA_WRITE 0x68 #define MAS_DATA_WRITE 0x68
#define MAS_DATA_READ 0x69 #define MAS_DATA_READ 0x69
#define MAS_CODEC_WRITE 0x6c #define MAS_CODEC_WRITE 0x6c
@ -62,7 +62,7 @@
#define MAS_REG_KPRESCALE 0xe7 #define MAS_REG_KPRESCALE 0xe7
#define MAS_REG_KBASS 0x6b #define MAS_REG_KBASS 0x6b
#define MAS_REG_KTREBLE 0x6f #define MAS_REG_KTREBLE 0x6f
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
#define MAS_REG_KMDB_SWITCH 0x21 #define MAS_REG_KMDB_SWITCH 0x21
#define MAS_REG_KMDB_STR 0x22 #define MAS_REG_KMDB_STR 0x22
#define MAS_REG_KMDB_HAR 0x23 #define MAS_REG_KMDB_HAR 0x23
@ -78,7 +78,7 @@
/* /*
* MAS commands * MAS commands
*/ */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
#define MAS_CMD_READ_ANCILLARY 0x50 #define MAS_CMD_READ_ANCILLARY 0x50
#define MAS_CMD_FAST_PRG_DL 0x60 #define MAS_CMD_FAST_PRG_DL 0x60
#define MAS_CMD_READ_IC_VER 0x70 #define MAS_CMD_READ_IC_VER 0x70
@ -101,7 +101,7 @@
/* /*
* MAS D0 memory cells (MAS3587F / MAS3539F) * MAS D0 memory cells (MAS3587F / MAS3539F)
*/ */
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
#define MAS_D0_APP_SELECT 0x7f6 #define MAS_D0_APP_SELECT 0x7f6
#define MAS_D0_APP_RUNNING 0x7f7 #define MAS_D0_APP_RUNNING 0x7f7
#define MAS_D0_ENCODER_CONTROL 0x7f0 #define MAS_D0_ENCODER_CONTROL 0x7f0
@ -120,7 +120,7 @@
#define MAS_D0_MPEG_STATUS_2 0xfd2 #define MAS_D0_MPEG_STATUS_2 0xfd2
#define MAS_D0_CRC_ERROR_COUNT 0xfd3 #define MAS_D0_CRC_ERROR_COUNT 0xfd3
#elif CONFIG_HWCODEC == MAS3539F #elif CONFIG_CODEC == MAS3539F
#define MAS_D0_APP_SELECT 0x34b #define MAS_D0_APP_SELECT 0x34b
#define MAS_D0_APP_RUNNING 0x34c #define MAS_D0_APP_RUNNING 0x34c
/* no encoder :( */ /* no encoder :( */

View file

@ -32,7 +32,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
bool superbass); bool superbass);
/* exported just for mpeg.c, to keep the recording there */ /* exported just for mpeg.c, to keep the recording there */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
void demand_irq_enable(bool on); void demand_irq_enable(bool on);
#endif #endif

View file

@ -43,7 +43,7 @@
/* For ID3 info and VBR header */ /* For ID3 info and VBR header */
#define MPEG_RESERVED_HEADER_SPACE (4096 + 1500) #define MPEG_RESERVED_HEADER_SPACE (4096 + 1500)
#if (CONFIG_HWCODEC == MAS3587F) || defined(SIMULATOR) #if (CONFIG_CODEC == MAS3587F) || defined(SIMULATOR)
void mpeg_init_recording(void); void mpeg_init_recording(void);
void mpeg_record(const char *filename); void mpeg_record(const char *filename);
void mpeg_new_file(const char *filename); void mpeg_new_file(const char *filename);

View file

@ -54,7 +54,7 @@ int sound_val2phys(int setting, int value);
const char *sound_unit(int setting); const char *sound_unit(int setting);
int sound_numdecimals(int setting); int sound_numdecimals(int setting);
int sound_steps(int setting); int sound_steps(int setting);
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) || defined(SIMULATOR) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || defined(SIMULATOR)
void sound_set_pitch(int permille); void sound_set_pitch(int permille);
int sound_get_pitch(void); int sound_get_pitch(void);
#endif #endif

View file

@ -83,14 +83,14 @@ static const char* const codec_labels[] = {
"ERR", /* Invalid codec type */ "ERR", /* Invalid codec type */
"???", /* Unknown file format */ "???", /* Unknown file format */
#if CONFIG_HWCODEC==MASNONE #if CONFIG_CODEC==SWCODEC
"MP1", /* MPEG Audio layer 1 */ "MP1", /* MPEG Audio layer 1 */
#endif #endif
"MP2", /* MPEG Audio layer 2 */ "MP2", /* MPEG Audio layer 2 */
"MP3", /* MPEG Audio layer 3 */ "MP3", /* MPEG Audio layer 3 */
#if CONFIG_HWCODEC==MASNONE #if CONFIG_CODEC==SWCODEC
"WAV", /* Uncompressed PCM in a WAV file */ "WAV", /* Uncompressed PCM in a WAV file */
"OGG", /* Ogg Vorbis */ "OGG", /* Ogg Vorbis */
"FLAC", /* FLAC */ "FLAC", /* FLAC */
@ -310,7 +310,7 @@ static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos )
} }
} }
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
/* parse user defined text, looking for replaygain information. */ /* parse user defined text, looking for replaygain information. */
static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) static int parseuser( struct mp3entry* entry, char* tag, int bufferpos )
{ {
@ -352,7 +352,7 @@ static const struct tag_resolver taglist[] = {
{ "TCOM", 4, offsetof(struct mp3entry, composer), NULL }, { "TCOM", 4, offsetof(struct mp3entry, composer), NULL },
{ "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre }, { "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre },
{ "TCO", 3, offsetof(struct mp3entry, genre_string), &parsegenre }, { "TCO", 3, offsetof(struct mp3entry, genre_string), &parsegenre },
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
{ "TXXX", 4, 0, &parseuser }, { "TXXX", 4, 0, &parseuser },
#endif #endif
}; };
@ -885,7 +885,7 @@ static int getsonglength(int fd, struct mp3entry *entry)
entry->version = info.version; entry->version = info.version;
entry->layer = info.layer; entry->layer = info.layer;
switch(entry->layer) { switch(entry->layer) {
#if CONFIG_HWCODEC==MASNONE #if CONFIG_CODEC==SWCODEC
case 0: case 0:
entry->codectype=AFMT_MPA_L1; entry->codectype=AFMT_MPA_L1;
break; break;
@ -947,7 +947,7 @@ bool mp3info(struct mp3entry *entry, const char *filename, bool v1first)
if(-1 == fd) if(-1 == fd)
return true; return true;
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
memset(entry, 0, sizeof(struct mp3entry)); memset(entry, 0, sizeof(struct mp3entry));
#endif #endif

View file

@ -36,7 +36,7 @@
#endif #endif
/* hacking into mpeg.c, recording is still there */ /* hacking into mpeg.c, recording is still there */
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
enum enum
{ {
MPEG_DECODER, MPEG_DECODER,
@ -44,7 +44,7 @@ enum
} mpeg_mode; } mpeg_mode;
#endif /* #ifdef MAS3587F */ #endif /* #ifdef MAS3587F */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
extern unsigned long shadow_io_control_main; extern unsigned long shadow_io_control_main;
extern unsigned shadow_codec_reg0; extern unsigned shadow_codec_reg0;
#endif #endif
@ -72,14 +72,14 @@ static void (*callback_for_more)(unsigned char**, int*);
bool audio_is_initialized = false; bool audio_is_initialized = false;
#endif #endif
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
/* FIX: this code pretty much assumes a MAS */ /* FIX: this code pretty much assumes a MAS */
#ifndef SIMULATOR #ifndef SIMULATOR
unsigned long mas_version_code; unsigned long mas_version_code;
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
static void mas_poll_start(void) static void mas_poll_start(void)
{ {
unsigned int count; unsigned int count;
@ -104,7 +104,7 @@ static void mas_poll_start(void)
TSTR |= 0x02; /* Start timer 1 */ TSTR |= 0x02; /* Start timer 1 */
} }
#elif CONFIG_HWCODEC != MASNONE #elif CONFIG_CODEC != SWCODEC
static void postpone_dma_tick(void) static void postpone_dma_tick(void)
{ {
unsigned int count; unsigned int count;
@ -132,7 +132,7 @@ static void postpone_dma_tick(void)
#endif #endif
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
void demand_irq_enable(bool on) void demand_irq_enable(bool on)
{ {
int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
@ -147,7 +147,7 @@ void demand_irq_enable(bool on)
set_irq_level(oldlevel); set_irq_level(oldlevel);
} }
#endif /* #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ #endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
void play_tick(void) void play_tick(void)
@ -194,7 +194,7 @@ void IMIA1(void) /* Timer 1 interrupt */
if(playing) if(playing)
play_tick(); play_tick();
TSR1 &= ~0x01; TSR1 &= ~0x01;
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
/* Disable interrupt */ /* Disable interrupt */
IPRC &= ~0x000f; IPRC &= ~0x000f;
#endif #endif
@ -206,21 +206,21 @@ void IRQ6(void) /* PB14: MAS stop demand IRQ */
SCR0 &= ~0x80; SCR0 &= ~0x80;
} }
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
#pragma interrupt #pragma interrupt
void IRQ3(void) /* PA15: MAS demand IRQ */ void IRQ3(void) /* PA15: MAS demand IRQ */
{ {
/* Begin with setting the IRQ to edge sensitive */ /* Begin with setting the IRQ to edge sensitive */
ICR |= 0x0010; ICR |= 0x0010;
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
if(mpeg_mode == MPEG_ENCODER) if(mpeg_mode == MPEG_ENCODER)
rec_tick(); rec_tick();
else else
#endif #endif
postpone_dma_tick(); postpone_dma_tick();
} }
#endif /* #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ #endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
static void setup_sci0(void) static void setup_sci0(void)
{ {
@ -260,7 +260,7 @@ static void setup_sci0(void)
} }
#endif /* SIMULATOR */ #endif /* SIMULATOR */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
static void init_playback(void) static void init_playback(void)
{ {
unsigned long val; unsigned long val;
@ -310,7 +310,7 @@ static void init_playback(void)
mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1); mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1);
} while((val & 0x0c) != 0x0c); } while((val & 0x0c) != 0x0c);
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
mpeg_mode = MPEG_DECODER; mpeg_mode = MPEG_DECODER;
#endif #endif
@ -322,7 +322,7 @@ static void init_playback(void)
DEBUGF("MAS Decoding application started\n"); DEBUGF("MAS Decoding application started\n");
} }
#endif /* #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ #endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
void mp3_init(int volume, int bass, int treble, int balance, int loudness, void mp3_init(int volume, int bass, int treble, int balance, int loudness,
int avc, int channel_config, int stereo_width, int avc, int channel_config, int stereo_width,
@ -346,7 +346,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
(void)mdb_enable; (void)mdb_enable;
(void)superbass; (void)superbass;
#else #else
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
unsigned long val; unsigned long val;
(void)loudness; (void)loudness;
(void)avc; (void)avc;
@ -365,9 +365,9 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
or_b(0x01, &PBIORH); /* output for PB8 */ or_b(0x01, &PBIORH); /* output for PB8 */
#endif #endif
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
mas_reset(); mas_reset();
#elif CONFIG_HWCODEC == MAS3587F #elif CONFIG_CODEC == MAS3587F
or_b(0x08, &PAIORH); /* output for /PR */ or_b(0x08, &PAIORH); /* output for /PR */
init_playback(); init_playback();
@ -375,7 +375,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
DEBUGF("MAS3587 derivate %d, version %c%d\n", DEBUGF("MAS3587 derivate %d, version %c%d\n",
(mas_version_code & 0xf000) >> 12, (mas_version_code & 0xf000) >> 12,
'A' + ((mas_version_code & 0x0f00) >> 8), mas_version_code & 0xff); 'A' + ((mas_version_code & 0x0f00) >> 8), mas_version_code & 0xff);
#elif CONFIG_HWCODEC == MAS3539F #elif CONFIG_CODEC == MAS3539F
or_b(0x08, &PAIORH); /* output for /PR */ or_b(0x08, &PAIORH); /* output for /PR */
init_playback(); init_playback();
@ -389,7 +389,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
dac_init(); dac_init();
#endif #endif
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
/* set IRQ6 to edge detect */ /* set IRQ6 to edge detect */
ICR |= 0x02; ICR |= 0x02;
@ -430,14 +430,14 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
#endif #endif
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
mas_poll_start(); mas_poll_start();
mas_writereg(MAS_REG_KPRESCALE, 0xe9400); mas_writereg(MAS_REG_KPRESCALE, 0xe9400);
dac_enable(true); dac_enable(true);
#endif #endif
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
ICR &= ~0x0010; /* IRQ3 level sensitive */ ICR &= ~0x0010; /* IRQ3 level sensitive */
PACR1 = (PACR1 & 0x3fff) | 0x4000; /* PA15 is IRQ3 */ PACR1 = (PACR1 & 0x3fff) | 0x4000; /* PA15 is IRQ3 */
#endif #endif
@ -452,7 +452,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
sound_set(SOUND_CHANNELS, channel_config); sound_set(SOUND_CHANNELS, channel_config);
sound_set(SOUND_STEREO_WIDTH, stereo_width); sound_set(SOUND_STEREO_WIDTH, stereo_width);
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
sound_set(SOUND_LOUDNESS, loudness); sound_set(SOUND_LOUDNESS, loudness);
sound_set(SOUND_AVC, avc); sound_set(SOUND_AVC, avc);
sound_set(SOUND_MDB_STRENGTH, mdb_strength); sound_set(SOUND_MDB_STRENGTH, mdb_strength);
@ -471,12 +471,12 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
void mp3_shutdown(void) void mp3_shutdown(void)
{ {
#ifndef SIMULATOR #ifndef SIMULATOR
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
unsigned long val = 1; unsigned long val = 1;
mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &val, 1); /* Mute */ mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &val, 1); /* Mute */
#endif #endif
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
dac_volume(0, 0, false); dac_volume(0, 0, false);
#endif #endif
@ -489,7 +489,7 @@ void mp3_shutdown(void)
void mp3_play_init(void) void mp3_play_init(void)
{ {
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
init_playback(); init_playback();
#endif #endif
playing = false; playing = false;
@ -518,7 +518,7 @@ void mp3_play_data(const unsigned char* start, int size,
CHCR3 |= 0x0001; /* Enable DMA IRQ */ CHCR3 |= 0x0001; /* Enable DMA IRQ */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
demand_irq_enable(true); demand_irq_enable(true);
#endif #endif
} }
@ -557,7 +557,7 @@ void mp3_play_stop(void)
playing = false; playing = false;
mp3_play_pause(false); mp3_play_pause(false);
CHCR3 &= ~0x0001; /* Disable the DMA interrupt */ CHCR3 &= ~0x0001; /* Disable the DMA interrupt */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
demand_irq_enable(false); demand_irq_enable(false);
#endif #endif
} }
@ -591,7 +591,7 @@ unsigned char* mp3_get_pos(void)
#endif /* #ifndef SIMULATOR */ #endif /* #ifndef SIMULATOR */
#else /* CONFIG_HWCODEC != MASNONE */ #else /* CONFIG_CODEC != SWCODEC */
void mp3_init(int volume, int bass, int treble, int balance, int loudness, void mp3_init(int volume, int bass, int treble, int balance, int loudness,
int avc, int channel_config, int stereo_width, int avc, int channel_config, int stereo_width,
int mdb_strength, int mdb_harmonics, int mdb_strength, int mdb_harmonics,
@ -651,4 +651,4 @@ bool mp3_is_playing(void)
return playing; return playing;
} }
#endif /* CONFIG_HWCODEC == MASNONE */ #endif /* CONFIG_CODEC == SWCODEC */

View file

@ -100,7 +100,7 @@ static bool is_mp3frameheader(unsigned long head)
return false; return false;
if (!(head & LAYER_MASK)) /* no layer? */ if (!(head & LAYER_MASK)) /* no layer? */
return false; return false;
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
/* The MAS can't decode layer 1, so treat layer 1 data as invalid */ /* The MAS can't decode layer 1, so treat layer 1 data as invalid */
if ((head & LAYER_MASK) == LAYER_MASK) if ((head & LAYER_MASK) == LAYER_MASK)
return false; return false;

View file

@ -20,7 +20,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "config.h" #include "config.h"
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
#include "debug.h" #include "debug.h"
#include "panic.h" #include "panic.h"
@ -51,13 +51,13 @@
extern unsigned long mas_version_code; extern unsigned long mas_version_code;
#endif #endif
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
extern enum /* from mp3_playback.c */ extern enum /* from mp3_playback.c */
{ {
MPEG_DECODER, MPEG_DECODER,
MPEG_ENCODER MPEG_ENCODER
} mpeg_mode; } mpeg_mode;
#endif /* CONFIG_HWCODEC == MAS3587F */ #endif /* CONFIG_CODEC == MAS3587F */
extern char* playlist_peek(int steps); extern char* playlist_peek(int steps);
extern bool playlist_check(int steps); extern bool playlist_check(int steps);
@ -151,7 +151,7 @@ static long low_watermark; /* Dynamic low watermark level */
static long low_watermark_margin; /* Extra time in seconds for watermark */ static long low_watermark_margin; /* Extra time in seconds for watermark */
static long lowest_watermark_level; /* Debug value to observe the buffer static long lowest_watermark_level; /* Debug value to observe the buffer
usage */ usage */
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
static char recording_filename[MAX_PATH]; /* argument to thread */ static char recording_filename[MAX_PATH]; /* argument to thread */
static char delayed_filename[MAX_PATH]; /* internal copy of above */ static char delayed_filename[MAX_PATH]; /* internal copy of above */
@ -189,13 +189,13 @@ static unsigned long num_recorded_frames;
/* Shadow MAS registers */ /* Shadow MAS registers */
unsigned long shadow_encoder_control = 0; unsigned long shadow_encoder_control = 0;
#endif /* CONFIG_HWCODEC == MAS3587F */ #endif /* CONFIG_CODEC == MAS3587F */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
unsigned long shadow_io_control_main = 0; unsigned long shadow_io_control_main = 0;
unsigned long shadow_soft_mute = 0; unsigned long shadow_soft_mute = 0;
unsigned shadow_codec_reg0; unsigned shadow_codec_reg0;
#endif /* (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
const unsigned char empty_id3_header[] = const unsigned char empty_id3_header[] =
@ -211,7 +211,7 @@ static int get_playable_space(void);
static int get_unswapped_space(void); static int get_unswapped_space(void);
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
static void init_recording(void); static void init_recording(void);
static void start_prerecording(void); static void start_prerecording(void);
static void start_recording(void); static void start_recording(void);
@ -219,7 +219,7 @@ static void stop_recording(void);
static int get_unsaved_space(void); static int get_unsaved_space(void);
static void pause_recording(void); static void pause_recording(void);
static void resume_recording(void); static void resume_recording(void);
#endif /* CONFIG_HWCODEC == MAS3587F */ #endif /* CONFIG_CODEC == MAS3587F */
#ifndef SIMULATOR #ifndef SIMULATOR
@ -661,7 +661,7 @@ static int get_unswapped_space(void)
return space; return space;
} }
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
static int get_unsaved_space(void) static int get_unsaved_space(void)
{ {
int space = audiobuf_write - audiobuf_read; int space = audiobuf_write - audiobuf_read;
@ -772,7 +772,7 @@ void rec_tick(void)
} }
} }
} }
#endif /* CONFIG_HWCODEC == MAS3587F */ #endif /* CONFIG_CODEC == MAS3587F */
void playback_tick(void) void playback_tick(void)
{ {
@ -1029,10 +1029,10 @@ static void track_change(void)
{ {
DEBUGF("Track change\n"); DEBUGF("Track change\n");
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
/* Reset the AVC */ /* Reset the AVC */
sound_set(SOUND_AVC, -1); sound_set(SOUND_AVC, -1);
#endif /* (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
if (num_tracks_in_memory() > 0) if (num_tracks_in_memory() > 0)
{ {
@ -1157,14 +1157,14 @@ static void mpeg_thread(void)
int amount_to_read; int amount_to_read;
int t1, t2; int t1, t2;
int start_offset; int start_offset;
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
int amount_to_save; int amount_to_save;
int framelen; int framelen;
unsigned long saved_header = 0; unsigned long saved_header = 0;
int save_endpos = 0; int save_endpos = 0;
int rc; int rc;
long offset; long offset;
#endif /* CONFIG_HWCODEC == MAS3587F */ #endif /* CONFIG_CODEC == MAS3587F */
is_playing = false; is_playing = false;
play_pending = false; play_pending = false;
@ -1173,10 +1173,10 @@ static void mpeg_thread(void)
while(1) while(1)
{ {
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
if(mpeg_mode == MPEG_DECODER) if(mpeg_mode == MPEG_DECODER)
{ {
#endif /* CONFIG_HWCODEC == MAS3587F */ #endif /* CONFIG_CODEC == MAS3587F */
yield(); yield();
/* Swap if necessary, and don't block on the queue_wait() */ /* Swap if necessary, and don't block on the queue_wait() */
@ -1724,19 +1724,19 @@ static void mpeg_thread(void)
break; break;
#endif /* !USB_NONE */ #endif /* !USB_NONE */
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
case MPEG_INIT_RECORDING: case MPEG_INIT_RECORDING:
init_recording(); init_recording();
init_recording_done = true; init_recording_done = true;
break; break;
#endif /* CONFIG_HWCODEC == MAS3587F */ #endif /* CONFIG_CODEC == MAS3587F */
case SYS_TIMEOUT: case SYS_TIMEOUT:
if (playing) if (playing)
playlist_update_resume_info(audio_current_track()); playlist_update_resume_info(audio_current_track());
break; break;
} }
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
} }
else else
{ {
@ -2069,7 +2069,7 @@ static void mpeg_thread(void)
break; break;
} }
} }
#endif /* CONFIG_HWCODEC == MAS3587F */ #endif /* CONFIG_CODEC == MAS3587F */
} }
} }
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */
@ -2113,7 +2113,7 @@ bool audio_has_changed_track(void)
return false; return false;
} }
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
void audio_init_playback(void) void audio_init_playback(void)
{ {
init_playback_done = false; init_playback_done = false;
@ -2216,7 +2216,7 @@ static void init_recording(void)
buffer, because the silly MAS will not negate EOD until at least one buffer, because the silly MAS will not negate EOD until at least one
DMA transfer has taken place. DMA transfer has taken place.
Now let's wait for some data to be encoded. */ Now let's wait for some data to be encoded. */
sleep(20); sleep(HZ/5);
/* Now set it to Monitoring mode as default, saves power */ /* Now set it to Monitoring mode as default, saves power */
shadow_io_control_main = 0x525; shadow_io_control_main = 0x525;
@ -2630,7 +2630,7 @@ void mpeg_set_recording_options(int frequency, int quality,
(void)editable; (void)editable;
(void)prerecord_time; (void)prerecord_time;
} }
#endif /* CONFIG_HWCODEC == MAS3587F; SIMULATOR */ #endif /* CONFIG_CODEC == MAS3587F; SIMULATOR */
void audio_play(int offset) void audio_play(int offset)
{ {
@ -2786,13 +2786,13 @@ int audio_status(void)
if(paused) if(paused)
ret |= AUDIO_STATUS_PAUSE; ret |= AUDIO_STATUS_PAUSE;
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
if(is_recording && !is_prerecording) if(is_recording && !is_prerecording)
ret |= AUDIO_STATUS_RECORD; ret |= AUDIO_STATUS_RECORD;
if(is_prerecording) if(is_prerecording)
ret |= AUDIO_STATUS_PRERECORD; ret |= AUDIO_STATUS_PRERECORD;
#endif /* CONFIG_HWCODEC == MAS3587F */ #endif /* CONFIG_CODEC == MAS3587F */
if(mpeg_errno) if(mpeg_errno)
ret |= AUDIO_STATUS_ERROR; ret |= AUDIO_STATUS_ERROR;
@ -2846,12 +2846,12 @@ void audio_init(void)
memset(trackdata, sizeof(trackdata), 0); memset(trackdata, sizeof(trackdata), 0);
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
if(read_hw_mask() & PR_ACTIVE_HIGH) if(read_hw_mask() & PR_ACTIVE_HIGH)
and_b(~0x08, &PADRH); and_b(~0x08, &PADRH);
else else
or_b(0x08, &PADRH); or_b(0x08, &PADRH);
#endif /* CONFIG_HWCODEC == MAS3587F */ #endif /* CONFIG_CODEC == MAS3587F */
#ifdef DEBUG #ifdef DEBUG
dbg_timer_start(); dbg_timer_start();
@ -2859,4 +2859,4 @@ void audio_init(void)
#endif /* DEBUG */ #endif /* DEBUG */
} }
#endif /* CONFIG_HWCODEC != MASNONE */ #endif /* CONFIG_CODEC != SWCODEC */

View file

@ -31,7 +31,7 @@
#include "dac.h" #include "dac.h"
#include "system.h" #include "system.h"
#include "hwcompat.h" #include "hwcompat.h"
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
#include "pcm_playback.h" #include "pcm_playback.h"
#endif #endif
#endif #endif
@ -40,7 +40,7 @@
extern bool audio_is_initialized; extern bool audio_is_initialized;
#endif #endif
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
extern unsigned long shadow_io_control_main; extern unsigned long shadow_io_control_main;
extern unsigned shadow_codec_reg0; extern unsigned shadow_codec_reg0;
#endif #endif
@ -116,7 +116,7 @@ static const int steps[] =
static const int minval[] = static const int minval[] =
{ {
0, /* Volume */ 0, /* Volume */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
-12, /* Bass */ -12, /* Bass */
-12, /* Treble */ -12, /* Treble */
#elif defined(HAVE_UDA1380) #elif defined(HAVE_UDA1380)
@ -145,7 +145,7 @@ static const int minval[] =
static const int maxval[] = static const int maxval[] =
{ {
100, /* Volume */ 100, /* Volume */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
12, /* Bass */ 12, /* Bass */
12, /* Treble */ 12, /* Treble */
#elif defined(HAVE_UDA1380) #elif defined(HAVE_UDA1380)
@ -174,7 +174,7 @@ static const int maxval[] =
static const int defaultval[] = static const int defaultval[] =
{ {
70, /* Volume */ 70, /* Volume */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
6, /* Bass */ 6, /* Bass */
6, /* Treble */ 6, /* Treble */
#elif defined(HAVE_UDA1380) #elif defined(HAVE_UDA1380)
@ -231,7 +231,7 @@ int sound_default(int setting)
} }
#ifndef SIMULATOR #ifndef SIMULATOR
#if CONFIG_HWCODEC == MAS3507D /* volume/balance/treble/bass interdependency */ #if CONFIG_CODEC == MAS3507D /* volume/balance/treble/bass interdependency */
#define VOLUME_MIN -780 #define VOLUME_MIN -780
#define VOLUME_MAX 180 #define VOLUME_MAX 180
@ -351,7 +351,7 @@ static int tenthdb2master(int db) {
} }
#endif #endif
#if (CONFIG_HWCODEC == MAS3507D) || defined HAVE_UDA1380 #if (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380
/* volume/balance/treble/bass interdependency main part */ /* volume/balance/treble/bass interdependency main part */
#define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN) #define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN)
@ -371,7 +371,7 @@ static void set_prescaled_volume(void)
prescale = 0; /* no need to prescale if we don't boost prescale = 0; /* no need to prescale if we don't boost
bass or treble */ bass or treble */
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
mas_writereg(MAS_REG_KPRESCALE, prescale_table[prescale/10]); mas_writereg(MAS_REG_KPRESCALE, prescale_table[prescale/10]);
#else /* UDA1380 */ #else /* UDA1380 */
uda1380_set_mixer_vol(prescale*2/5, prescale*2/5); uda1380_set_mixer_vol(prescale*2/5, prescale*2/5);
@ -397,13 +397,13 @@ static void set_prescaled_volume(void)
r = VOLUME_MIN; r = VOLUME_MIN;
} }
#if CONFIG_HWCODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
dac_volume(tenthdb2reg(l), tenthdb2reg(r), false); dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);
#else /* UDA1380 */ #else /* UDA1380 */
uda1380_set_master_vol(tenthdb2master(l), tenthdb2master(r)); uda1380_set_master_vol(tenthdb2master(l), tenthdb2master(r));
#endif #endif
} }
#endif /* (CONFIG_HWCODEC == MAS3507D) || defined HAVE_UDA1380 */ #endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */
int channel_configuration = SOUND_CHAN_STEREO; int channel_configuration = SOUND_CHAN_STEREO;
@ -475,12 +475,12 @@ static void set_channel_config(void)
break; break;
} }
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LL, &val_ll, 1); /* LL */ mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LL, &val_ll, 1); /* LL */
mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LR, &val_lr, 1); /* LR */ mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LR, &val_lr, 1); /* LR */
mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RL, &val_rl, 1); /* RL */ mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RL, &val_rl, 1); /* RL */
mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RR, &val_rr, 1); /* RR */ mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RR, &val_rr, 1); /* RR */
#elif CONFIG_HWCODEC == MAS3507D #elif CONFIG_CODEC == MAS3507D
mas_writemem(MAS_BANK_D1, 0x7f8, &val_ll, 1); /* LL */ mas_writemem(MAS_BANK_D1, 0x7f8, &val_ll, 1); /* LL */
mas_writemem(MAS_BANK_D1, 0x7f9, &val_lr, 1); /* LR */ mas_writemem(MAS_BANK_D1, 0x7f9, &val_lr, 1); /* LR */
mas_writemem(MAS_BANK_D1, 0x7fa, &val_rl, 1); /* RL */ mas_writemem(MAS_BANK_D1, 0x7fa, &val_rl, 1); /* RL */
@ -489,7 +489,7 @@ static void set_channel_config(void)
} }
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
unsigned long mdb_shape_shadow = 0; unsigned long mdb_shape_shadow = 0;
unsigned long loudness_shadow = 0; unsigned long loudness_shadow = 0;
#endif #endif
@ -499,7 +499,7 @@ void sound_set(int setting, int value)
#ifdef SIMULATOR #ifdef SIMULATOR
setting = value; setting = value;
#else #else
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
int tmp; int tmp;
#endif #endif
@ -509,30 +509,30 @@ void sound_set(int setting, int value)
switch(setting) switch(setting)
{ {
case SOUND_VOLUME: case SOUND_VOLUME:
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
tmp = 0x7f00 * value / 100; tmp = 0x7f00 * value / 100;
mas_codec_writereg(0x10, tmp & 0xff00); mas_codec_writereg(0x10, tmp & 0xff00);
#elif (CONFIG_HWCODEC == MAS3507D) || defined HAVE_UDA1380 #elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380
current_volume = VOLUME_MIN + (value * VOLUME_RANGE / 100); current_volume = VOLUME_MIN + (value * VOLUME_RANGE / 100);
set_prescaled_volume(); /* tenth of dB */ set_prescaled_volume(); /* tenth of dB */
#endif #endif
break; break;
case SOUND_BALANCE: case SOUND_BALANCE:
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
tmp = ((value * 127 / 100) & 0xff) << 8; tmp = ((value * 127 / 100) & 0xff) << 8;
mas_codec_writereg(0x11, tmp & 0xff00); mas_codec_writereg(0x11, tmp & 0xff00);
#elif CONFIG_HWCODEC == MAS3507D || defined HAVE_UDA1380 #elif CONFIG_CODEC == MAS3507D || defined HAVE_UDA1380
current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */ current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */
set_prescaled_volume(); set_prescaled_volume();
#endif #endif
break; break;
case SOUND_BASS: case SOUND_BASS:
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
tmp = ((value * 8) & 0xff) << 8; tmp = ((value * 8) & 0xff) << 8;
mas_codec_writereg(0x14, tmp & 0xff00); mas_codec_writereg(0x14, tmp & 0xff00);
#elif CONFIG_HWCODEC == MAS3507D #elif CONFIG_CODEC == MAS3507D
mas_writereg(MAS_REG_KBASS, bass_table[value+15]); mas_writereg(MAS_REG_KBASS, bass_table[value+15]);
current_bass = value * 10; current_bass = value * 10;
set_prescaled_volume(); set_prescaled_volume();
@ -544,10 +544,10 @@ void sound_set(int setting, int value)
break; break;
case SOUND_TREBLE: case SOUND_TREBLE:
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
tmp = ((value * 8) & 0xff) << 8; tmp = ((value * 8) & 0xff) << 8;
mas_codec_writereg(0x15, tmp & 0xff00); mas_codec_writereg(0x15, tmp & 0xff00);
#elif CONFIG_HWCODEC == MAS3507D #elif CONFIG_CODEC == MAS3507D
mas_writereg(MAS_REG_KTREBLE, treble_table[value+15]); mas_writereg(MAS_REG_KTREBLE, treble_table[value+15]);
current_treble = value * 10; current_treble = value * 10;
set_prescaled_volume(); set_prescaled_volume();
@ -558,7 +558,7 @@ void sound_set(int setting, int value)
#endif #endif
break; break;
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
case SOUND_LOUDNESS: case SOUND_LOUDNESS:
loudness_shadow = (loudness_shadow & 0x04) | loudness_shadow = (loudness_shadow & 0x04) |
(MAX(MIN(value * 4, 0x44), 0) << 8); (MAX(MIN(value * 4, 0x44), 0) << 8);
@ -635,7 +635,7 @@ void sound_set(int setting, int value)
int sound_val2phys(int setting, int value) int sound_val2phys(int setting, int value)
{ {
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
int result = 0; int result = 0;
switch(setting) switch(setting)
@ -660,7 +660,7 @@ int sound_val2phys(int setting, int value)
#endif #endif
} }
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
/* This function works by telling the decoder that we have another /* This function works by telling the decoder that we have another
crystal frequency than we actually have. It will adjust its internal crystal frequency than we actually have. It will adjust its internal
parameters and the result is that the audio is played at another pitch. parameters and the result is that the audio is played at another pitch.

View file

@ -52,7 +52,7 @@ void samsung_set(int setting, int value)
case RADIO_FREQUENCY: case RADIO_FREQUENCY:
{ {
int pll_cnt; int pll_cnt;
#if CONFIG_HWCODEC == MAS3587F #if CONFIG_CODEC == MAS3587F
/* Shift the MAS internal clock away for certain frequencies to /* Shift the MAS internal clock away for certain frequencies to
* avoid interference. */ * avoid interference. */
int pitch = 1000; int pitch = 1000;

View file

@ -71,7 +71,7 @@ long pcm_get_bytes_waiting(void)
return 0; return 0;
} }
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
void audio_set_buffer_margin(int seconds) void audio_set_buffer_margin(int seconds)
{ {
(void)seconds; (void)seconds;
@ -273,7 +273,7 @@ void button_set_flip(bool yesno)
(void)yesno; (void)yesno;
} }
#if CONFIG_HWCODEC != MASNONE #if CONFIG_CODEC != SWCODEC
void talk_init(void) void talk_init(void)
{ {
} }

View file

@ -9,6 +9,6 @@ screenhack.c
thread.c thread.c
uibasic.c uibasic.c
visual.c visual.c
#if CONFIG_HWCODEC == MASNONE #if CONFIG_CODEC == SWCODEC
sound.c sound.c
#endif #endif