[3/4] Completely remove HWCODEC support
'swcodec' is now always set (and recording_swcodec for recording-capable units) in feature.txt so the manual and language strings don't need to all be fixed up. Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
This commit is contained in:
parent
0c4f89370d
commit
8cb555460f
|
@ -19,7 +19,6 @@ menus/plugin_menu.c
|
|||
#if CONFIG_TUNER
|
||||
menus/radio_menu.c
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#ifdef HAVE_WM8978
|
||||
menus/audiohw_eq_menu.c
|
||||
#endif
|
||||
|
@ -27,9 +26,6 @@ menus/eq_menu.c
|
|||
buffering.c
|
||||
voice_thread.c
|
||||
rbcodec_helpers.c
|
||||
#else /* !SWCODEC */
|
||||
mpeg.c
|
||||
#endif
|
||||
menus/main_menu.c
|
||||
menus/playback_menu.c
|
||||
menus/playlist_menu.c
|
||||
|
@ -163,7 +159,6 @@ radio/radioart.c
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#if INPUT_SRC_CAPS != 0
|
||||
audio_path.c
|
||||
#endif /* INPUT_SRC_CAPS != 0 */
|
||||
|
@ -179,7 +174,6 @@ beep.c
|
|||
enc_config.c
|
||||
recorder/pcm_record.c
|
||||
#endif
|
||||
#endif
|
||||
#ifdef USB_ENABLE_HID
|
||||
usb_keymaps.c
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,6 @@ static inline bool ab_B_marker_set(void)
|
|||
}
|
||||
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
void ab_end_of_track_report(void)
|
||||
{
|
||||
if ( ab_A_marker_set() && ! ab_B_marker_set() )
|
||||
|
@ -47,38 +46,6 @@ void ab_end_of_track_report(void)
|
|||
ab_jump_to_A_marker();
|
||||
}
|
||||
}
|
||||
#else
|
||||
static int ab_audio_event_handler(unsigned short event, unsigned long data)
|
||||
{
|
||||
int rc = AUDIO_EVENT_RC_IGNORED;
|
||||
if ( ab_repeat_mode_enabled() )
|
||||
{
|
||||
switch(event)
|
||||
{
|
||||
case AUDIO_EVENT_POS_REPORT:
|
||||
{
|
||||
if ( ! (audio_status() & AUDIO_STATUS_PAUSE) &&
|
||||
ab_reached_B_marker(data) )
|
||||
{
|
||||
ab_jump_to_A_marker();
|
||||
rc = AUDIO_EVENT_RC_HANDLED;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AUDIO_EVENT_END_OF_TRACK:
|
||||
{
|
||||
if ( ab_A_marker_set() && ! ab_B_marker_set() )
|
||||
{
|
||||
ab_jump_to_A_marker();
|
||||
rc = AUDIO_EVENT_RC_HANDLED;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
void ab_repeat_init(void)
|
||||
{
|
||||
|
@ -86,10 +53,6 @@ void ab_repeat_init(void)
|
|||
if ( ! ab_initialized )
|
||||
{
|
||||
ab_initialized = true;
|
||||
#if (CONFIG_CODEC != SWCODEC)
|
||||
audio_register_event_handler(ab_audio_event_handler,
|
||||
AUDIO_EVENT_POS_REPORT | AUDIO_EVENT_END_OF_TRACK );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,16 +79,7 @@ reasonable amount of time for the typical user to react */
|
|||
|
||||
void ab_jump_to_A_marker(void)
|
||||
{
|
||||
#if (CONFIG_CODEC != SWCODEC)
|
||||
bool paused = (audio_status() & AUDIO_STATUS_PAUSE) != 0;
|
||||
if ( ! paused )
|
||||
audio_pause();
|
||||
#endif
|
||||
audio_ff_rewind(ab_A_marker);
|
||||
#if (CONFIG_CODEC != SWCODEC)
|
||||
if ( ! paused )
|
||||
audio_resume();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ab_reset_markers(void)
|
||||
|
|
|
@ -41,9 +41,7 @@ void ab_set_B_marker(unsigned int song_position);
|
|||
* The actual positions are returned via output parameter */
|
||||
bool ab_get_A_marker(unsigned int *song_position);
|
||||
bool ab_get_B_marker(unsigned int *song_position);
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
void ab_end_of_track_report(void);
|
||||
#endif
|
||||
|
||||
/* These functions really need to be inlined for speed */
|
||||
extern unsigned int ab_A_marker;
|
||||
|
@ -59,16 +57,9 @@ static inline bool ab_reached_B_marker(unsigned int song_position)
|
|||
/* following is the size of the window in which we'll detect that the B marker
|
||||
was hit; it must be larger than the frequency (in milliseconds) at which this
|
||||
function is called otherwise detection of the B marker will be unreliable */
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
/* On swcodec, the worst case seems to be 9600kHz with 1024 samples between
|
||||
* calls, meaning ~9 calls per second, look within 1/5 of a second */
|
||||
#define B_MARKER_DETECT_WINDOW 200
|
||||
#else
|
||||
/* we assume that this function will be called on each system tick and derive
|
||||
the window size from this with a generous margin of error (note: the number
|
||||
of ticks per second is given by HZ) */
|
||||
#define B_MARKER_DETECT_WINDOW ((1000/HZ)*10)
|
||||
#endif
|
||||
if (ab_B_marker != AB_MARKER_NONE)
|
||||
{
|
||||
if ( (song_position >= ab_B_marker)
|
||||
|
@ -78,7 +69,6 @@ of ticks per second is given by HZ) */
|
|||
return false;
|
||||
}
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
static inline void ab_position_report(unsigned long position)
|
||||
{
|
||||
if (ab_repeat_mode_enabled())
|
||||
|
@ -90,7 +80,6 @@ static inline void ab_position_report(unsigned long position)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -832,10 +832,8 @@ static inline int update_action_last(action_last_t *last, action_cur_t *cur)
|
|||
last->data = button_get_data();
|
||||
last->tick = current_tick;
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Produce keyclick */
|
||||
keyclick_click(false, action);
|
||||
#endif
|
||||
|
||||
return action;
|
||||
}
|
||||
|
|
|
@ -183,13 +183,6 @@ bool bookmark_autobookmark(bool prompt_ok)
|
|||
audio_pause(); /* first pause playback */
|
||||
update = (global_settings.autoupdatebookmark && bookmark_exists());
|
||||
bookmark = create_bookmark();
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
/* Workaround for inability to speak when paused: all callers will
|
||||
just do audio_stop() when we return, so we can do it right
|
||||
away. This makes it possible to speak the "Create a Bookmark?"
|
||||
prompt and the "Bookmark Created" splash. */
|
||||
audio_stop();
|
||||
#endif
|
||||
|
||||
if (update)
|
||||
return write_bookmark(true, bookmark);
|
||||
|
@ -415,13 +408,13 @@ static char* create_bookmark()
|
|||
snprintf(global_bookmark, sizeof(global_bookmark),
|
||||
/* new optional bookmark token descriptors should be inserted
|
||||
just before the "%s;%s" in this line... */
|
||||
#if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL)
|
||||
#if defined(HAVE_PITCHCONTROL)
|
||||
">%d;%d;%ld;%d;%ld;%d;%d;%ld;%ld;%s;%s",
|
||||
#else
|
||||
">%d;%d;%ld;%d;%ld;%d;%d;%s;%s",
|
||||
#endif
|
||||
/* ... their flags should go here ... */
|
||||
#if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL)
|
||||
#if defined(HAVE_PITCHCONTROL)
|
||||
BM_PITCH | BM_SPEED,
|
||||
#else
|
||||
0,
|
||||
|
@ -433,7 +426,7 @@ static char* create_bookmark()
|
|||
global_settings.repeat_mode,
|
||||
global_settings.playlist_shuffle,
|
||||
/* ...and their values should go here */
|
||||
#if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL)
|
||||
#if defined(HAVE_PITCHCONTROL)
|
||||
(long)sound_get_pitch(),
|
||||
(long)dsp_get_timestretch(),
|
||||
#endif
|
||||
|
@ -950,7 +943,6 @@ static void say_bookmark(const char* bookmark,
|
|||
|
||||
talk_number(bookmark_id + 1, false);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
bool is_dir = (global_temp_buffer[0]
|
||||
&& global_temp_buffer[strlen(global_temp_buffer)-1] == '/');
|
||||
|
||||
|
@ -965,9 +957,6 @@ static void say_bookmark(const char* bookmark,
|
|||
else talk_file_or_spell(NULL, global_temp_buffer,
|
||||
TALK_IDARRAY(LANG_PLAYLIST), true);
|
||||
}
|
||||
#else
|
||||
(void)show_playlist_name;
|
||||
#endif
|
||||
|
||||
if(bm.shuffle)
|
||||
talk_id(LANG_SHUFFLE, true);
|
||||
|
@ -977,13 +966,11 @@ static void say_bookmark(const char* bookmark,
|
|||
talk_id(LANG_TIME, true);
|
||||
talk_value(bm.resume_time / 1000, UNIT_TIME, true);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Track filename */
|
||||
if(!is_dir)
|
||||
global_temp_buffer[0] = 0;
|
||||
talk_file_or_spell(global_temp_buffer, global_filename,
|
||||
TALK_IDARRAY(VOICE_FILE), true);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
@ -992,7 +979,7 @@ static void say_bookmark(const char* bookmark,
|
|||
/* ------------------------------------------------------------------------*/
|
||||
static bool play_bookmark(const char* bookmark)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL)
|
||||
#if defined(HAVE_PITCHCONTROL)
|
||||
/* preset pitch and speed to 100% in case bookmark doesn't have info */
|
||||
bm.pitch = sound_get_pitch();
|
||||
bm.speed = dsp_get_timestretch();
|
||||
|
@ -1002,7 +989,7 @@ static bool play_bookmark(const char* bookmark)
|
|||
{
|
||||
global_settings.repeat_mode = bm.repeat_mode;
|
||||
global_settings.playlist_shuffle = bm.shuffle;
|
||||
#if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL)
|
||||
#if defined(HAVE_PITCHCONTROL)
|
||||
sound_set_pitch(bm.pitch);
|
||||
dsp_set_timestretch(bm.speed);
|
||||
#endif
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "lang.h"
|
||||
#include "keyboard.h"
|
||||
#include "buffering.h"
|
||||
#include "mp3_playback.h"
|
||||
#include "backlight.h"
|
||||
#include "storage.h"
|
||||
#include "talk.h"
|
||||
|
|
|
@ -313,14 +313,8 @@ static bool seek(unsigned long pos)
|
|||
}
|
||||
else
|
||||
{
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
audio_pre_ff_rewind();
|
||||
audio_ff_rewind(pos);
|
||||
#else
|
||||
audio_pause();
|
||||
audio_ff_rewind(pos);
|
||||
audio_resume();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "system.h"
|
||||
#include "font.h"
|
||||
#include "audio.h"
|
||||
#include "mp3_playback.h"
|
||||
#include "settings.h"
|
||||
#include "list.h"
|
||||
#include "statusbar.h"
|
||||
|
@ -88,14 +87,12 @@
|
|||
#endif
|
||||
#include "logfdisp.h"
|
||||
#include "core_alloc.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "pcmbuf.h"
|
||||
#include "buffering.h"
|
||||
#include "playback.h"
|
||||
#if defined(HAVE_SPDIF_OUT) || defined(HAVE_SPDIF_IN)
|
||||
#include "spdif.h"
|
||||
#endif
|
||||
#endif
|
||||
#ifdef IRIVER_H300_SERIES
|
||||
#include "pcf50606.h" /* for pcf50606_read */
|
||||
#endif
|
||||
|
@ -304,48 +301,6 @@ static bool dbg_cpuinfo(void)
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
#ifndef SIMULATOR
|
||||
static bool dbg_audio_thread(void)
|
||||
{
|
||||
struct audio_debug d;
|
||||
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
|
||||
while(1)
|
||||
{
|
||||
if (action_userabort(HZ/5))
|
||||
return false;
|
||||
|
||||
audio_get_debugdata(&d);
|
||||
|
||||
lcd_clear_display();
|
||||
|
||||
lcd_putsf(0, 0, "read: %x", d.audiobuf_read);
|
||||
lcd_putsf(0, 1, "write: %x", d.audiobuf_write);
|
||||
lcd_putsf(0, 2, "swap: %x", d.audiobuf_swapwrite);
|
||||
lcd_putsf(0, 3, "playing: %d", d.playing);
|
||||
lcd_putsf(0, 4, "playable: %x", d.playable_space);
|
||||
lcd_putsf(0, 5, "unswapped: %x", d.unswapped_space);
|
||||
|
||||
/* Playable space left */
|
||||
gui_scrollbar_draw(&screens[SCREEN_MAIN],0, 6*8, 112, 4, d.audiobuflen, 0,
|
||||
d.playable_space, HORIZONTAL);
|
||||
|
||||
/* Show the watermark limit */
|
||||
gui_scrollbar_draw(&screens[SCREEN_MAIN],0, 6*8+4, 112, 4, d.audiobuflen, 0,
|
||||
d.low_watermark_level, HORIZONTAL);
|
||||
|
||||
lcd_putsf(0, 7, "wm: %x - %x",
|
||||
d.low_watermark_level, d.lowest_watermark_level);
|
||||
|
||||
lcd_update();
|
||||
}
|
||||
lcd_setfont(FONT_UI);
|
||||
return false;
|
||||
}
|
||||
#endif /* !SIMULATOR */
|
||||
#else /* CONFIG_CODEC == SWCODEC */
|
||||
static unsigned int ticks, freq_sum;
|
||||
#ifndef CPU_MULTI_FREQUENCY
|
||||
static unsigned int boost_ticks;
|
||||
|
@ -487,7 +442,6 @@ static bool dbg_buffering_thread(void)
|
|||
|
||||
return false;
|
||||
}
|
||||
#endif /* CONFIG_CODEC */
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
static const char* bf_getname(int selected_item, void *data,
|
||||
|
@ -2606,11 +2560,7 @@ static const struct {
|
|||
{ "View database info", dbg_tagcache_info },
|
||||
#endif
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
{ "View buffering thread", dbg_buffering_thread },
|
||||
#elif !defined(SIMULATOR)
|
||||
{ "View audio thread", dbg_audio_thread },
|
||||
#endif
|
||||
#ifdef PM_DEBUG
|
||||
{ "pm histogram", peak_meter_histogram},
|
||||
#endif /* PM_DEBUG */
|
||||
|
|
|
@ -109,11 +109,7 @@ radio_remote
|
|||
|
||||
#if defined(HAVE_RECORDING)
|
||||
recording
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
recording_swcodec
|
||||
#else
|
||||
recording_hwcodec
|
||||
#endif
|
||||
#if defined(HAVE_LINE_IN)
|
||||
recording_linein
|
||||
#endif
|
||||
|
@ -151,11 +147,7 @@ spdif_power
|
|||
speaker
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
swcodec
|
||||
#else
|
||||
hwcodec
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_TAGCACHE)
|
||||
tagcache
|
||||
|
|
|
@ -41,11 +41,7 @@
|
|||
#include "logf.h"
|
||||
|
||||
/* max filetypes (plugins & icons stored here) */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#define MAX_FILETYPES 192
|
||||
#else
|
||||
#define MAX_FILETYPES 128
|
||||
#endif
|
||||
/* max viewer plugins */
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#define MAX_VIEWERS 56
|
||||
|
@ -58,8 +54,6 @@ static const struct filetype inbuilt_filetypes[] = {
|
|||
{ "mp3", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||
{ "mp2", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||
{ "mpa", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Temporary hack to allow playlist creation */
|
||||
{ "mp1", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||
{ "ogg", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||
{ "oga", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||
|
@ -121,7 +115,6 @@ static const struct filetype inbuilt_filetypes[] = {
|
|||
{ "vgz", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||
{ "kss", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||
{ "aac", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||
#endif
|
||||
{ "m3u", FILE_ATTR_M3U, Icon_Playlist, LANG_PLAYLIST },
|
||||
{ "m3u8",FILE_ATTR_M3U, Icon_Playlist, LANG_PLAYLIST },
|
||||
{ "cfg", FILE_ATTR_CFG, Icon_Config, VOICE_EXT_CFG },
|
||||
|
|
|
@ -317,10 +317,6 @@ static void gui_list_put_selection_on_screen(struct gui_synclist * gui_list,
|
|||
|
||||
static void edge_beep(struct gui_synclist * gui_list, bool wrap)
|
||||
{
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
(void)gui_list;
|
||||
(void)wrap;
|
||||
#else
|
||||
if (global_settings.keyclick)
|
||||
{
|
||||
list_speak_item *cb = gui_list->callback_speak_item;
|
||||
|
@ -354,7 +350,6 @@ static void edge_beep(struct gui_synclist * gui_list, bool wrap)
|
|||
talk_force_shutup();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void _gui_synclist_speak_item(struct gui_synclist *lists)
|
||||
|
@ -615,7 +610,6 @@ static void gui_synclist_scroll_left(struct gui_synclist * lists)
|
|||
}
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
bool gui_synclist_keyclick_callback(int action, void* data)
|
||||
{
|
||||
struct gui_synclist *lists = (struct gui_synclist *)data;
|
||||
|
@ -633,7 +627,6 @@ bool gui_synclist_keyclick_callback(int action, void* data)
|
|||
|
||||
return action != ACTION_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Magic to make sure the list gets updated correctly if the skin does
|
||||
|
@ -864,9 +857,7 @@ bool list_do_action(int context, int timeout,
|
|||
do_button, and places the action from get_action in *action. */
|
||||
{
|
||||
timeout = list_do_action_timeout(lists, timeout);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
keyclick_set_callback(gui_synclist_keyclick_callback, lists);
|
||||
#endif
|
||||
*action = get_action(context, timeout);
|
||||
return gui_synclist_do_button(lists, action, wrap);
|
||||
}
|
||||
|
|
|
@ -170,9 +170,7 @@ extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists,
|
|||
extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists,
|
||||
enum screen_type screen, int item);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
extern bool gui_synclist_keyclick_callback(int action, void* data);
|
||||
#endif
|
||||
/*
|
||||
* Do the action implied by the given button,
|
||||
* returns true if the action was handled.
|
||||
|
|
|
@ -38,9 +38,7 @@
|
|||
#include "misc.h"
|
||||
#include "pitchscreen.h"
|
||||
#include "settings.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "tdspeed.h"
|
||||
#endif
|
||||
|
||||
#define ICON_BORDER 12 /* icons are currently 7x8, so add ~2 pixels */
|
||||
/* on both sides when drawing */
|
||||
|
@ -167,13 +165,9 @@ static bool at_limit = false;
|
|||
|
||||
static void speak_pitch_mode(bool enqueue)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
bool timestretch_mode = global_settings.pitch_mode_timestretch && dsp_timestretch_available();
|
||||
if (timestretch_mode)
|
||||
talk_id(VOICE_PITCH_TIMESTRETCH_MODE, enqueue);
|
||||
#else
|
||||
#define timestretch_mode 0
|
||||
#endif
|
||||
if (global_settings.pitch_mode_semitone)
|
||||
talk_id(VOICE_PITCH_SEMITONE_MODE, timestretch_mode ? true : enqueue);
|
||||
else
|
||||
|
@ -238,9 +232,7 @@ static void pitchscreen_draw_icons(struct screen *display,
|
|||
static void pitchscreen_draw(struct screen *display, int max_lines,
|
||||
struct viewport pitch_viewports[PITCH_ITEM_COUNT],
|
||||
int32_t pitch, int32_t semitone
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
,int32_t speed
|
||||
#endif
|
||||
)
|
||||
{
|
||||
const char* ptr;
|
||||
|
@ -308,7 +300,6 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
|
|||
/* Middle section upper line - hide for a small screen */
|
||||
if ((show_lang_pitch = (max_lines >= 3)))
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if(global_settings.pitch_mode_timestretch)
|
||||
{
|
||||
/* Pitch:XXX.X% */
|
||||
|
@ -330,7 +321,6 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
|
|||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Rate */
|
||||
snprintf(buf, sizeof(buf), "%s:", str(LANG_PLAYBACK_RATE));
|
||||
|
@ -344,7 +334,6 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
|
|||
|
||||
/* Middle section lower line */
|
||||
/* "Speed:XXX%" */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if(global_settings.pitch_mode_timestretch)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_SPEED),
|
||||
|
@ -352,7 +341,6 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
|
|||
(speed % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if(global_settings.pitch_mode_semitone)
|
||||
{
|
||||
|
@ -396,13 +384,11 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
|
|||
/* Middle section left/right labels */
|
||||
const char *leftlabel = "-2%";
|
||||
const char *rightlabel = "+2%";
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (global_settings.pitch_mode_timestretch)
|
||||
{
|
||||
leftlabel = "<<";
|
||||
rightlabel = ">>";
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Only display if they fit */
|
||||
display->getstringsize(leftlabel, &w, &h);
|
||||
|
@ -423,16 +409,12 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
|
|||
}
|
||||
|
||||
static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cutoff
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* need this to maintain correct pitch/speed caps */
|
||||
, int32_t speed
|
||||
#endif
|
||||
)
|
||||
{
|
||||
int32_t new_pitch;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
int32_t new_stretch;
|
||||
#endif
|
||||
at_limit = false;
|
||||
|
||||
if (pitch_delta < 0)
|
||||
|
@ -480,7 +462,6 @@ static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cut
|
|||
/* pitch_delta == 0 -> no real change */
|
||||
return pitch;
|
||||
}
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (dsp_timestretch_available())
|
||||
{
|
||||
/* increase the multiple to increase precision of this calculation */
|
||||
|
@ -504,7 +485,6 @@ static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cut
|
|||
at_limit = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
sound_set_pitch(new_pitch);
|
||||
|
||||
|
@ -579,9 +559,7 @@ static int32_t get_pitch_from_semitone(int32_t semitone)
|
|||
static int32_t pitch_increase_semitone(int32_t pitch,
|
||||
int32_t current_semitone,
|
||||
int32_t semitone_delta
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
, int32_t speed
|
||||
#endif
|
||||
)
|
||||
{
|
||||
int32_t new_semitone = current_semitone;
|
||||
|
@ -613,7 +591,6 @@ static int32_t pitch_increase_semitone(int32_t pitch,
|
|||
|
||||
int32_t new_pitch = get_pitch_from_semitone(new_semitone);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
int32_t new_stretch = GET_STRETCH(new_pitch, speed);
|
||||
|
||||
/* clamp the pitch so it doesn't go beyond the stretch limits */
|
||||
|
@ -629,12 +606,9 @@ static int32_t pitch_increase_semitone(int32_t pitch,
|
|||
new_semitone = get_semitone_from_pitch(new_pitch);
|
||||
at_limit = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
pitch_increase(pitch, new_pitch - pitch, false
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
, speed
|
||||
#endif
|
||||
);
|
||||
|
||||
return new_semitone;
|
||||
|
@ -765,7 +739,6 @@ int gui_syncpitchscreen_run(void)
|
|||
|
||||
push_current_activity(ACTIVITY_PITCHSCREEN);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
int32_t new_speed = 0, new_stretch;
|
||||
|
||||
/* the speed variable holds the apparent speed of the playback */
|
||||
|
@ -785,7 +758,6 @@ int gui_syncpitchscreen_run(void)
|
|||
global_settings.pitch_mode_timestretch = false;
|
||||
settings_save();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Count decimals for speaking */
|
||||
for (i = PITCH_SPEED_PRECISION; i >= 10; i /= 10)
|
||||
|
@ -806,23 +778,17 @@ int gui_syncpitchscreen_run(void)
|
|||
/* also, draw the icons now, it's only needed once */
|
||||
pitchscreen_draw_icons(&screens[i], &parent[i]);
|
||||
}
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
pcmbuf_set_low_latency(true);
|
||||
#endif
|
||||
|
||||
while (!exit)
|
||||
{
|
||||
FOR_NB_SCREENS(i)
|
||||
pitchscreen_draw(&screens[i], max_lines[i],
|
||||
pitch_viewports[i], pitch, semitone
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
, speed
|
||||
#endif
|
||||
);
|
||||
pitch_delta = 0;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
new_speed = 0;
|
||||
#endif
|
||||
|
||||
if (global_settings.talk_menu && updated)
|
||||
{
|
||||
|
@ -835,29 +801,23 @@ int gui_syncpitchscreen_run(void)
|
|||
else
|
||||
talk_value_decimal(pitch, UNIT_PERCENT, decimals, false);
|
||||
break;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
case 2:
|
||||
talk_value_decimal(speed, UNIT_PERCENT, decimals, false);
|
||||
break;
|
||||
#endif
|
||||
case 3:
|
||||
speak_pitch_mode(false);
|
||||
break;
|
||||
case 4:
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (global_settings.pitch_mode_timestretch && dsp_timestretch_available())
|
||||
talk_id(LANG_PITCH, false);
|
||||
else
|
||||
#endif
|
||||
talk_id(LANG_PLAYBACK_RATE, false);
|
||||
talk_value_decimal(pitch, UNIT_PERCENT, decimals, true);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (global_settings.pitch_mode_timestretch && dsp_timestretch_available())
|
||||
{
|
||||
talk_id(LANG_SPEED, true);
|
||||
talk_value_decimal(speed, UNIT_PERCENT, decimals, true);
|
||||
}
|
||||
#endif
|
||||
speak_pitch_mode(true);
|
||||
break;
|
||||
default:
|
||||
|
@ -910,24 +870,17 @@ int gui_syncpitchscreen_run(void)
|
|||
break;
|
||||
|
||||
case ACTION_PS_NUDGE_RIGHT:
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (!global_settings.pitch_mode_timestretch)
|
||||
{
|
||||
#endif
|
||||
new_pitch = pitch_increase(pitch, PITCH_NUDGE_DELTA, false
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
, speed
|
||||
#endif
|
||||
);
|
||||
nudged = (new_pitch != pitch);
|
||||
pitch = new_pitch;
|
||||
semitone = get_semitone_from_pitch(pitch);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
speed = pitch;
|
||||
#endif
|
||||
updated = nudged ? 1 : 0;
|
||||
break;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -948,19 +901,14 @@ int gui_syncpitchscreen_run(void)
|
|||
updated = 2;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ACTION_PS_NUDGE_RIGHTOFF:
|
||||
if (nudged)
|
||||
{
|
||||
pitch = pitch_increase(pitch, -PITCH_NUDGE_DELTA, false
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
, speed
|
||||
#endif
|
||||
);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
speed = pitch;
|
||||
#endif
|
||||
semitone = get_semitone_from_pitch(pitch);
|
||||
nudged = false;
|
||||
updated = 1;
|
||||
|
@ -968,24 +916,17 @@ int gui_syncpitchscreen_run(void)
|
|||
break;
|
||||
|
||||
case ACTION_PS_NUDGE_LEFT:
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (!global_settings.pitch_mode_timestretch)
|
||||
{
|
||||
#endif
|
||||
new_pitch = pitch_increase(pitch, -PITCH_NUDGE_DELTA, false
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
, speed
|
||||
#endif
|
||||
);
|
||||
nudged = (new_pitch != pitch);
|
||||
pitch = new_pitch;
|
||||
semitone = get_semitone_from_pitch(pitch);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
speed = pitch;
|
||||
#endif
|
||||
updated = nudged ? 1 : 0;
|
||||
break;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1006,19 +947,14 @@ int gui_syncpitchscreen_run(void)
|
|||
updated = 2;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ACTION_PS_NUDGE_LEFTOFF:
|
||||
if (nudged)
|
||||
{
|
||||
pitch = pitch_increase(pitch, PITCH_NUDGE_DELTA, false
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
, speed
|
||||
#endif
|
||||
);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
speed = pitch;
|
||||
#endif
|
||||
semitone = get_semitone_from_pitch(pitch);
|
||||
nudged = false;
|
||||
updated = 1;
|
||||
|
@ -1028,21 +964,18 @@ int gui_syncpitchscreen_run(void)
|
|||
case ACTION_PS_RESET:
|
||||
pitch = PITCH_SPEED_100;
|
||||
sound_set_pitch(pitch);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
speed = PITCH_SPEED_100;
|
||||
if (dsp_timestretch_available())
|
||||
{
|
||||
dsp_set_timestretch(PITCH_SPEED_100);
|
||||
at_limit = false;
|
||||
}
|
||||
#endif
|
||||
semitone = get_semitone_from_pitch(pitch);
|
||||
updated = 4;
|
||||
break;
|
||||
|
||||
case ACTION_PS_TOGGLE_MODE:
|
||||
global_settings.pitch_mode_semitone = !global_settings.pitch_mode_semitone;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
||||
if (dsp_timestretch_available() && !global_settings.pitch_mode_semitone)
|
||||
{
|
||||
|
@ -1055,7 +988,6 @@ int gui_syncpitchscreen_run(void)
|
|||
}
|
||||
}
|
||||
settings_save();
|
||||
#endif
|
||||
updated = 3;
|
||||
break;
|
||||
|
||||
|
@ -1073,22 +1005,17 @@ int gui_syncpitchscreen_run(void)
|
|||
if (global_settings.pitch_mode_semitone)
|
||||
{
|
||||
semitone = pitch_increase_semitone(pitch, semitone, pitch_delta
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
, speed
|
||||
#endif
|
||||
);
|
||||
pitch = get_pitch_from_semitone(semitone);
|
||||
}
|
||||
else
|
||||
{
|
||||
pitch = pitch_increase(pitch, pitch_delta, true
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
, speed
|
||||
#endif
|
||||
);
|
||||
semitone = get_semitone_from_pitch(pitch);
|
||||
}
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (global_settings.pitch_mode_timestretch)
|
||||
{
|
||||
/* do this to make sure we properly obey the stretch limits */
|
||||
|
@ -1098,10 +1025,8 @@ int gui_syncpitchscreen_run(void)
|
|||
{
|
||||
speed = pitch;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if(new_speed)
|
||||
{
|
||||
new_stretch = GET_STRETCH(pitch, new_speed);
|
||||
|
@ -1135,11 +1060,8 @@ int gui_syncpitchscreen_run(void)
|
|||
/* when needed */
|
||||
new_speed = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
pcmbuf_set_low_latency(false);
|
||||
#endif
|
||||
pop_current_activity();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -57,9 +57,7 @@
|
|||
#endif
|
||||
|
||||
#include "cuesheet.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "playback.h"
|
||||
#endif
|
||||
#include "backdrop.h"
|
||||
#include "viewport.h"
|
||||
#if CONFIG_TUNER
|
||||
|
|
|
@ -47,10 +47,8 @@
|
|||
#include "albumart.h"
|
||||
#endif
|
||||
#include "playlist.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "playback.h"
|
||||
#include "tdspeed.h"
|
||||
#endif
|
||||
#include "viewport.h"
|
||||
#include "tagcache.h"
|
||||
|
||||
|
@ -558,7 +556,6 @@ static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename)
|
|||
static char filename_buf[MAX_PATH + 1];
|
||||
fname = playlist_peek(offset, filename_buf, sizeof(filename_buf));
|
||||
*filename = (char*)fname;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
static struct mp3entry tempid3;
|
||||
if (
|
||||
#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
|
||||
|
@ -569,7 +566,6 @@ static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename)
|
|||
{
|
||||
pid3 = &tempid3;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return pid3;
|
||||
}
|
||||
|
@ -1224,7 +1220,6 @@ const char *get_token_value(struct gui_wps *gwps,
|
|||
}
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
case SKIN_TOKEN_CROSSFADE:
|
||||
#ifdef HAVE_CROSSFADE
|
||||
if (intval)
|
||||
|
@ -1277,7 +1272,6 @@ const char *get_token_value(struct gui_wps *gwps,
|
|||
}
|
||||
return buf;
|
||||
}
|
||||
#endif /* (CONFIG_CODEC == SWCODEC) */
|
||||
|
||||
#if defined (HAVE_PITCHCONTROL)
|
||||
case SKIN_TOKEN_SOUND_PITCH:
|
||||
|
@ -1294,7 +1288,7 @@ const char *get_token_value(struct gui_wps *gwps,
|
|||
}
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL)
|
||||
#if defined (HAVE_PITCHCONTROL)
|
||||
case SKIN_TOKEN_SOUND_SPEED:
|
||||
{
|
||||
int32_t pitch = sound_get_pitch();
|
||||
|
@ -1462,7 +1456,6 @@ const char *get_token_value(struct gui_wps *gwps,
|
|||
return NULL;
|
||||
case SKIN_TOKEN_REC_FREQ: /* order from REC_FREQ_CFG_VAL_LIST */
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
unsigned long samprk;
|
||||
int rec_freq = global_settings.rec_frequency;
|
||||
|
||||
|
@ -1528,26 +1521,8 @@ const char *get_token_value(struct gui_wps *gwps,
|
|||
}
|
||||
}
|
||||
snprintf(buf, buf_size, "%lu.%1lu", samprk/1000,samprk%1000);
|
||||
#else /* HWCODEC */
|
||||
|
||||
static const char * const freq_strings[] =
|
||||
{"--", "44", "48", "32", "22", "24", "16"};
|
||||
int freq = 1 + global_settings.rec_frequency;
|
||||
#ifdef HAVE_SPDIF_REC
|
||||
if (global_settings.rec_source == AUDIO_SRC_SPDIF)
|
||||
{
|
||||
/* Can't measure S/PDIF sample rate on Archos/Sim yet */
|
||||
freq = 0;
|
||||
}
|
||||
#endif /* HAVE_SPDIF_IN */
|
||||
if (intval)
|
||||
*intval = freq+1; /* so the token gets a value 1<=x<=7 */
|
||||
snprintf(buf, buf_size, "%s\n",
|
||||
freq_strings[global_settings.rec_frequency]);
|
||||
#endif
|
||||
return buf;
|
||||
}
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
case SKIN_TOKEN_REC_ENCODER:
|
||||
{
|
||||
int rec_format = global_settings.rec_format+1; /* WAV, AIFF, WV, MPEG */
|
||||
|
@ -1568,9 +1543,7 @@ const char *get_token_value(struct gui_wps *gwps,
|
|||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case SKIN_TOKEN_REC_BITRATE:
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (global_settings.rec_format == REC_FORMAT_MPA_L3)
|
||||
{
|
||||
if (intval)
|
||||
|
@ -1632,12 +1605,6 @@ const char *get_token_value(struct gui_wps *gwps,
|
|||
}
|
||||
else
|
||||
return NULL; /* Fixme later */
|
||||
#else /* CONFIG_CODEC == HWCODEC */
|
||||
if (intval)
|
||||
*intval = global_settings.rec_quality+1;
|
||||
snprintf(buf, buf_size, "%d", global_settings.rec_quality);
|
||||
return buf;
|
||||
#endif
|
||||
case SKIN_TOKEN_REC_MONO:
|
||||
if (!global_settings.rec_channels)
|
||||
return "m";
|
||||
|
|
|
@ -199,7 +199,7 @@ void splashf(int ticks, const char *fmt, ...)
|
|||
|
||||
void splash(int ticks, const char *str)
|
||||
{
|
||||
#if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC
|
||||
#if !defined(SIMULATOR)
|
||||
long id;
|
||||
/* fmt may be a so called virtual pointer. See settings.h. */
|
||||
if((id = P2ID((const unsigned char*)str)) >= 0)
|
||||
|
|
|
@ -27,9 +27,7 @@
|
|||
#include "sound.h"
|
||||
#include "settings.h"
|
||||
#include "viewport.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "metadata.h"
|
||||
#endif
|
||||
#include "icons.h"
|
||||
#include "powermgmt.h"
|
||||
#include "usb.h"
|
||||
|
@ -602,7 +600,6 @@ static void gui_statusbar_time(struct screen * display, struct tm *time)
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_RECORDING
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/**
|
||||
* Write a number to the display using bitmaps and return new position
|
||||
*/
|
||||
|
@ -695,58 +692,14 @@ static void gui_statusbar_write_samplerate_info(struct screen * display)
|
|||
STATUSBAR_Y_POS, BM_GLYPH_WIDTH,
|
||||
STATUSBAR_HEIGHT);
|
||||
}
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
static void gui_statusbar_icon_recording_info(struct screen * display)
|
||||
{
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
char buffer[3];
|
||||
const char *p = buffer;
|
||||
int width, height;
|
||||
display->setfont(FONT_SYSFIXED);
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
|
||||
/* Display Codec info in statusbar */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
gui_statusbar_write_format_info(display);
|
||||
#else /* !SWCODEC */
|
||||
display->mono_bitmap(bitmap_icons_5x8[Icon_q],
|
||||
STATUSBAR_ENCODER_X_POS + 8, STATUSBAR_Y_POS,
|
||||
5, STATUSBAR_HEIGHT);
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "%d", global_settings.rec_quality);
|
||||
display->getstringsize(buffer, &width, &height);
|
||||
if (height <= STATUSBAR_HEIGHT)
|
||||
display->putsxy(STATUSBAR_ENCODER_X_POS + 13, STATUSBAR_Y_POS, buffer);
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/* Display Samplerate info in statusbar */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* SWCODEC targets use bitmaps for glyphs */
|
||||
gui_statusbar_write_samplerate_info(display);
|
||||
#else /* !SWCODEC */
|
||||
/* hwcodec targets have sysfont characters */
|
||||
#ifdef HAVE_SPDIF_REC
|
||||
if (global_settings.rec_source == AUDIO_SRC_SPDIF)
|
||||
{
|
||||
/* Can't measure S/PDIF sample rate on Archos/Sim yet */
|
||||
p = "--";
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_SPDIF_IN */
|
||||
{
|
||||
static const char * const freq_strings[] =
|
||||
{"44", "48", "32", "22", "24", "16"};
|
||||
p = freq_strings[global_settings.rec_frequency];
|
||||
}
|
||||
|
||||
display->getstringsize(p, &width, &height);
|
||||
|
||||
if (height <= STATUSBAR_HEIGHT)
|
||||
display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, p);
|
||||
|
||||
display->setfont(FONT_UI);
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/* Display Channel status in status bar */
|
||||
if(global_settings.rec_channels)
|
||||
|
|
128
apps/gui/wps.c
128
apps/gui/wps.c
|
@ -33,7 +33,6 @@
|
|||
#include "filetypes.h"
|
||||
#include "settings.h"
|
||||
#include "skin_engine/skin_engine.h"
|
||||
#include "mp3_playback.h"
|
||||
#include "audio.h"
|
||||
#include "usb.h"
|
||||
#include "status.h"
|
||||
|
@ -124,26 +123,17 @@ static void update_non_static(void)
|
|||
|
||||
void pause_action(bool may_fade, bool updatewps)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Do audio first, then update, unless skin were to use its local
|
||||
status in which case, reverse it */
|
||||
audio_pause();
|
||||
|
||||
if (updatewps)
|
||||
update_non_static();
|
||||
#else
|
||||
if (may_fade && global_settings.fade_on_stop)
|
||||
fade(false, updatewps);
|
||||
else
|
||||
audio_pause();
|
||||
#endif
|
||||
|
||||
if (global_settings.pause_rewind) {
|
||||
long newpos;
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
audio_pre_ff_rewind();
|
||||
#endif
|
||||
newpos = audio_current_track()->elapsed
|
||||
- global_settings.pause_rewind * 1000;
|
||||
audio_ff_rewind(newpos > 0 ? newpos : 0);
|
||||
|
@ -154,80 +144,16 @@ void pause_action(bool may_fade, bool updatewps)
|
|||
|
||||
void unpause_action(bool may_fade, bool updatewps)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Do audio first, then update, unless skin were to use its local
|
||||
status in which case, reverse it */
|
||||
audio_resume();
|
||||
|
||||
if (updatewps)
|
||||
update_non_static();
|
||||
#else
|
||||
if (may_fade && global_settings.fade_on_stop)
|
||||
fade(true, updatewps);
|
||||
else
|
||||
audio_resume();
|
||||
#endif
|
||||
|
||||
(void)may_fade;
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
void fade(bool fade_in, bool updatewps)
|
||||
{
|
||||
int fp_global_vol = global_settings.volume << 8;
|
||||
int fp_min_vol = sound_min(SOUND_VOLUME) << 8;
|
||||
int fp_step = (fp_global_vol - fp_min_vol) / 10;
|
||||
|
||||
skin_get_global_state()->is_fading = !fade_in;
|
||||
if (fade_in) {
|
||||
/* fade in */
|
||||
int fp_volume = fp_min_vol;
|
||||
|
||||
/* zero out the sound */
|
||||
sound_set_volume(fp_min_vol >> 8);
|
||||
|
||||
sleep(HZ/10); /* let audio thread run */
|
||||
audio_resume();
|
||||
|
||||
if (updatewps)
|
||||
update_non_static();
|
||||
|
||||
while (fp_volume < fp_global_vol - fp_step) {
|
||||
fp_volume += fp_step;
|
||||
sound_set_volume(fp_volume >> 8);
|
||||
sleep(1);
|
||||
}
|
||||
sound_set_volume(global_settings.volume);
|
||||
}
|
||||
else {
|
||||
/* fade out */
|
||||
int fp_volume = fp_global_vol;
|
||||
|
||||
if (updatewps)
|
||||
update_non_static();
|
||||
|
||||
while (fp_volume > fp_min_vol + fp_step) {
|
||||
fp_volume -= fp_step;
|
||||
sound_set_volume(fp_volume >> 8);
|
||||
sleep(1);
|
||||
}
|
||||
audio_pause();
|
||||
|
||||
skin_get_global_state()->is_fading = false;
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
#ifndef SIMULATOR
|
||||
/* let audio thread run and wait for the mas to run out of data */
|
||||
while (!mp3_pause_done())
|
||||
#endif
|
||||
sleep(HZ/10);
|
||||
#endif
|
||||
|
||||
/* reset volume to what it was before the fade */
|
||||
sound_set_volume(global_settings.volume);
|
||||
}
|
||||
}
|
||||
#endif /* SWCODEC */
|
||||
|
||||
static bool update_onvol_change(enum screen_type screen)
|
||||
{
|
||||
skin_update(WPS, screen, SKIN_REFRESH_NON_STATIC);
|
||||
|
@ -264,17 +190,8 @@ static int skintouch_to_wps(struct wps_data *data)
|
|||
#endif
|
||||
case ACTION_TOUCH_SCROLLBAR:
|
||||
skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/100;
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
audio_pre_ff_rewind();
|
||||
#else
|
||||
if (!skin_get_global_state()->paused)
|
||||
audio_pause();
|
||||
#endif
|
||||
audio_ff_rewind(skin_get_global_state()->id3->elapsed);
|
||||
#if (CONFIG_CODEC != SWCODEC)
|
||||
if (!skin_get_global_state()->paused)
|
||||
audio_resume();
|
||||
#endif
|
||||
return ACTION_TOUCHSCREEN;
|
||||
case ACTION_TOUCH_VOLUME:
|
||||
{
|
||||
|
@ -344,12 +261,7 @@ bool ffwd_rew(int button)
|
|||
if ( (audio_status() & AUDIO_STATUS_PLAY) &&
|
||||
skin_get_global_state()->id3 && skin_get_global_state()->id3->length )
|
||||
{
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
audio_pre_ff_rewind();
|
||||
#else
|
||||
if (!skin_get_global_state()->paused)
|
||||
audio_pause();
|
||||
#endif
|
||||
if (direction > 0)
|
||||
status_set_ffmode(STATUS_FASTFORWARD);
|
||||
else
|
||||
|
@ -393,10 +305,6 @@ bool ffwd_rew(int button)
|
|||
skin_get_global_state()->ff_rewind_count = 0;
|
||||
skin_get_global_state()->ff_rewind = false;
|
||||
status_set_ffmode(0);
|
||||
#if (CONFIG_CODEC != SWCODEC)
|
||||
if (!skin_get_global_state()->paused)
|
||||
audio_resume();
|
||||
#endif
|
||||
exit = true;
|
||||
break;
|
||||
|
||||
|
@ -495,19 +403,8 @@ static void prev_track(unsigned long skip_thresh)
|
|||
return;
|
||||
}
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
audio_pre_ff_rewind();
|
||||
#else
|
||||
if (!state->paused)
|
||||
audio_pause();
|
||||
#endif
|
||||
|
||||
audio_ff_rewind(0);
|
||||
|
||||
#if (CONFIG_CODEC != SWCODEC)
|
||||
if (!state->paused)
|
||||
audio_resume();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -573,9 +470,7 @@ static void play_hop(int direction)
|
|||
}
|
||||
else if (direction == 1 && step >= remaining)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
system_sound_play(SOUND_TRACK_NO_MORE);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
else if (direction == -1 && elapsed < step)
|
||||
|
@ -588,21 +483,10 @@ static void play_hop(int direction)
|
|||
}
|
||||
if(audio_status() & AUDIO_STATUS_PLAY)
|
||||
{
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
audio_pre_ff_rewind();
|
||||
#else
|
||||
if (!state->paused)
|
||||
audio_pause();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
audio_ff_rewind(elapsed);
|
||||
#else
|
||||
audio_ff_rewind(state->id3->elapsed = elapsed);
|
||||
if (!state->paused)
|
||||
audio_resume();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -867,12 +751,7 @@ long gui_wps_show(void)
|
|||
{
|
||||
if (state->id3->cuesheet)
|
||||
{
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
audio_pre_ff_rewind();
|
||||
#else
|
||||
if (!state->paused)
|
||||
audio_pause();
|
||||
#endif
|
||||
audio_ff_rewind(0);
|
||||
}
|
||||
else
|
||||
|
@ -1128,13 +1007,8 @@ long gui_wps_show(void)
|
|||
}
|
||||
|
||||
if (exit) {
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if (global_settings.fade_on_stop)
|
||||
fade(false, true);
|
||||
#else
|
||||
audio_pause();
|
||||
update_non_static();
|
||||
#endif
|
||||
if (bookmark)
|
||||
bookmark_autobookmark(true);
|
||||
audio_stop();
|
||||
|
@ -1200,11 +1074,9 @@ static void wps_state_init(void)
|
|||
/* add the WPS track event callbacks */
|
||||
add_event(PLAYBACK_EVENT_TRACK_CHANGE, track_info_callback);
|
||||
add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, track_info_callback);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Use the same callback as ..._TRACK_CHANGE for when remaining handles have
|
||||
finished */
|
||||
add_event(PLAYBACK_EVENT_CUR_TRACK_READY, track_info_callback);
|
||||
#endif
|
||||
#ifdef AUDIO_FAST_SKIP_PREVIEW
|
||||
add_event(PLAYBACK_EVENT_TRACK_SKIP, track_info_callback);
|
||||
#endif
|
||||
|
|
|
@ -5367,23 +5367,6 @@
|
|||
recording: "No settings available"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_RECORDING_QUALITY
|
||||
desc: in the recording settings
|
||||
user: core
|
||||
<source>
|
||||
*: none
|
||||
recording_hwcodec: "Quality"
|
||||
</source>
|
||||
<dest>
|
||||
*: none
|
||||
recording_hwcodec: "Quality"
|
||||
</dest>
|
||||
<voice>
|
||||
*: none
|
||||
recording_hwcodec: "Quality"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_FREQUENCY
|
||||
desc: in recording and playback settings
|
||||
|
@ -5489,23 +5472,6 @@
|
|||
recording: "Line In"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_RECORDING_EDITABLE
|
||||
desc: Editable recordings setting
|
||||
user: core
|
||||
<source>
|
||||
*: none
|
||||
recording_hwcodec: "Independent Frames"
|
||||
</source>
|
||||
<dest>
|
||||
*: none
|
||||
recording_hwcodec: "Independent Frames"
|
||||
</dest>
|
||||
<voice>
|
||||
*: none
|
||||
recording_hwcodec: "Independent Frames"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_RECORD_TIMESPLIT
|
||||
desc: Record split menu
|
||||
|
@ -9463,23 +9429,6 @@
|
|||
recording: "Mono"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_SYSFONT_RECORDING_QUALITY
|
||||
desc: in the recording settings
|
||||
user: core
|
||||
<source>
|
||||
*: none
|
||||
recording_hwcodec: "Quality"
|
||||
</source>
|
||||
<dest>
|
||||
*: none
|
||||
recording_hwcodec: "Quality"
|
||||
</dest>
|
||||
<voice>
|
||||
*: none
|
||||
recording_hwcodec: "Quality"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_SYSFONT_RECORDING_FREQUENCY
|
||||
desc: in the recording settings
|
||||
|
|
49
apps/main.c
49
apps/main.c
|
@ -45,7 +45,6 @@
|
|||
#include "serial.h"
|
||||
#endif
|
||||
#include "audio.h"
|
||||
#include "mp3_playback.h"
|
||||
#include "settings.h"
|
||||
#include "backlight.h"
|
||||
#include "status.h"
|
||||
|
@ -87,12 +86,10 @@
|
|||
#include "iap.h"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
#include "audio_thread.h"
|
||||
#include "playback.h"
|
||||
#include "tdspeed.h"
|
||||
#endif
|
||||
#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && !defined(SIMULATOR)
|
||||
#if defined(HAVE_RECORDING) && !defined(SIMULATOR)
|
||||
#include "pcm_record.h"
|
||||
#endif
|
||||
|
||||
|
@ -258,7 +255,7 @@ static void init_tagcache(void) INIT_ATTR;
|
|||
static void init_tagcache(void)
|
||||
{
|
||||
bool clear = false;
|
||||
#if 0 /* CONFIG_CODEC == SWCODEC */
|
||||
#if 0
|
||||
long talked_tick = 0;
|
||||
#endif
|
||||
tagcache_init();
|
||||
|
@ -269,7 +266,7 @@ static void init_tagcache(void)
|
|||
|
||||
if (ret > 0)
|
||||
{
|
||||
#if 0 /* FIXME: Audio isn't even initialized yet! */ /* CONFIG_CODEC == SWCODEC */
|
||||
#if 0 /* FIXME: Audio isn't even initialized yet! */
|
||||
/* hwcodec can't use voice here, as the database commit
|
||||
* uses the audio buffer. */
|
||||
if(global_settings.talk_menu
|
||||
|
@ -365,10 +362,8 @@ static void init(void)
|
|||
viewportmanager_init();
|
||||
|
||||
storage_init();
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
pcm_init();
|
||||
dsp_init();
|
||||
#endif
|
||||
settings_reset();
|
||||
settings_load(SETTINGS_ALL);
|
||||
settings_apply(true);
|
||||
|
@ -384,23 +379,6 @@ static void init(void)
|
|||
playlist_init();
|
||||
shortcuts_init();
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
mp3_init( global_settings.volume,
|
||||
global_settings.bass,
|
||||
global_settings.treble,
|
||||
global_settings.balance,
|
||||
global_settings.loudness,
|
||||
global_settings.avc,
|
||||
global_settings.channel_config,
|
||||
global_settings.stereo_width,
|
||||
global_settings.mdb_strength,
|
||||
global_settings.mdb_harmonics,
|
||||
global_settings.mdb_center,
|
||||
global_settings.mdb_shape,
|
||||
global_settings.mdb_enable,
|
||||
global_settings.superbass);
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
|
||||
if (global_settings.audioscrobbler)
|
||||
scrobbler_init();
|
||||
|
||||
|
@ -599,10 +577,8 @@ static void init(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
pcm_init();
|
||||
dsp_init();
|
||||
#endif
|
||||
|
||||
#if defined(SETTINGS_RESET) || (CONFIG_KEYPAD == IPOD_4G_PAD) || \
|
||||
(CONFIG_KEYPAD == IRIVER_H10_PAD)
|
||||
|
@ -669,25 +645,6 @@ static void init(void)
|
|||
|
||||
shortcuts_init();
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
/* No buffer allocation (see buffer.c) may take place after the call to
|
||||
audio_init() since the mpeg thread takes the rest of the buffer space */
|
||||
mp3_init( global_settings.volume,
|
||||
global_settings.bass,
|
||||
global_settings.treble,
|
||||
global_settings.balance,
|
||||
global_settings.loudness,
|
||||
global_settings.avc,
|
||||
global_settings.channel_config,
|
||||
global_settings.stereo_width,
|
||||
global_settings.mdb_strength,
|
||||
global_settings.mdb_harmonics,
|
||||
global_settings.mdb_center,
|
||||
global_settings.mdb_shape,
|
||||
global_settings.mdb_enable,
|
||||
global_settings.superbass);
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
|
||||
CHART(">audio_init");
|
||||
audio_init();
|
||||
CHART("<audio_init");
|
||||
|
|
|
@ -391,9 +391,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
|
|||
{
|
||||
int new_audio_status;
|
||||
redraw_lists = false;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
keyclick_set_callback(gui_synclist_keyclick_callback, &lists);
|
||||
#endif
|
||||
action = get_action(CONTEXT_MAINMENU,
|
||||
list_do_action_timeout(&lists, HZ));
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "list.h"
|
||||
#include "menu.h"
|
||||
#include "action.h"
|
||||
#include "mp3_playback.h"
|
||||
#include "settings.h"
|
||||
#include "screens.h"
|
||||
#include "icons.h"
|
||||
|
|
|
@ -25,11 +25,8 @@
|
|||
#include "action.h"
|
||||
#include "menu.h"
|
||||
#include "menu_common.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "pcmbuf.h"
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Use this callback if your menu adjusts DSP settings. */
|
||||
int lowlatency_callback(int action,
|
||||
const struct menu_item_ex *this_item,
|
||||
|
@ -48,5 +45,3 @@ int lowlatency_callback(int action,
|
|||
}
|
||||
return action;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -24,11 +24,9 @@
|
|||
#include "menu.h"
|
||||
#include "config.h"
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
int lowlatency_callback(int action,
|
||||
const struct menu_item_ex *this_item,
|
||||
struct gui_synclist *this_list);
|
||||
#endif
|
||||
|
||||
#endif /* _MENU_COMMON_H */
|
||||
|
||||
|
|
|
@ -35,16 +35,13 @@
|
|||
#include "audio.h"
|
||||
#include "cuesheet.h"
|
||||
#include "misc.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "playback.h"
|
||||
#include "pcm_sampr.h"
|
||||
#ifdef HAVE_PLAY_FREQ
|
||||
#include "talk.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE)
|
||||
#if defined(HAVE_CROSSFADE)
|
||||
static int setcrossfadeonexit_callback(int action,
|
||||
const struct menu_item_ex *this_item,
|
||||
struct gui_synclist *this_list)
|
||||
|
@ -60,7 +57,7 @@ static int setcrossfadeonexit_callback(int action,
|
|||
return action;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
#endif /* HAVE_CROSSFADE */
|
||||
|
||||
/***********************************/
|
||||
/* PLAYBACK MENU */
|
||||
|
@ -77,7 +74,6 @@ MENUITEM_SETTING(ff_rewind_min_step, &global_settings.ff_rewind_min_step, NULL);
|
|||
MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, Icon_NOICON,
|
||||
&ff_rewind_min_step, &ff_rewind_accel);
|
||||
#ifdef HAVE_DISK_STORAGE
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
static int buffermargin_callback(int action,
|
||||
const struct menu_item_ex *this_item,
|
||||
struct gui_synclist *this_list)
|
||||
|
@ -92,16 +88,12 @@ static int buffermargin_callback(int action,
|
|||
}
|
||||
return action;
|
||||
}
|
||||
#else
|
||||
# define buffermargin_callback NULL
|
||||
#endif
|
||||
MENUITEM_SETTING(buffer_margin, &global_settings.buffer_margin,
|
||||
buffermargin_callback);
|
||||
#endif /*HAVE_DISK_STORAGE */
|
||||
MENUITEM_SETTING(fade_on_stop, &global_settings.fade_on_stop, NULL);
|
||||
MENUITEM_SETTING(party_mode, &global_settings.party_mode, NULL);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#ifdef HAVE_CROSSFADE
|
||||
/* crossfade submenu */
|
||||
MENUITEM_SETTING(crossfade, &global_settings.crossfade, setcrossfadeonexit_callback);
|
||||
|
@ -150,7 +142,6 @@ MAKE_MENU(replaygain_settings_menu,ID2P(LANG_REPLAYGAIN),0, Icon_NOICON,
|
|||
&replaygain_type, &replaygain_noclip, &replaygain_preamp);
|
||||
|
||||
MENUITEM_SETTING(beep, &global_settings.beep ,NULL);
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#ifdef HAVE_SPDIF_POWER
|
||||
MENUITEM_SETTING(spdif_enable, &global_settings.spdif_enable, NULL);
|
||||
|
@ -188,13 +179,7 @@ static int cuesheet_callback(int action,
|
|||
switch (action)
|
||||
{
|
||||
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
audio_set_cuesheet(global_settings.cuesheet);
|
||||
#else
|
||||
if (global_settings.cuesheet)
|
||||
splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
return action;
|
||||
}
|
||||
|
@ -209,9 +194,7 @@ MAKE_MENU(unplug_menu, ID2P(LANG_HEADPHONE_UNPLUG), 0, Icon_NOICON,
|
|||
|
||||
MENUITEM_SETTING(skip_length, &global_settings.skip_length, NULL);
|
||||
MENUITEM_SETTING(prevent_skip, &global_settings.prevent_skip, NULL);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
MENUITEM_SETTING(resume_rewind, &global_settings.resume_rewind, NULL);
|
||||
#endif
|
||||
MENUITEM_SETTING(pause_rewind, &global_settings.pause_rewind, NULL);
|
||||
#ifdef HAVE_PLAY_FREQ
|
||||
MENUITEM_SETTING(play_frequency, &global_settings.play_frequency,
|
||||
|
@ -227,13 +210,11 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
|
|||
#endif
|
||||
&fade_on_stop, &party_mode,
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE)
|
||||
#if defined(HAVE_CROSSFADE)
|
||||
&crossfade_settings_menu,
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
&replaygain_settings_menu, &beep,
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SPDIF_POWER
|
||||
&spdif_enable,
|
||||
|
@ -244,9 +225,7 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
|
|||
#endif
|
||||
,&skip_length, &prevent_skip
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
,&resume_rewind
|
||||
#endif
|
||||
,&pause_rewind
|
||||
#ifdef HAVE_PLAY_FREQ
|
||||
,&play_frequency
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#ifdef HAVE_RECORDING
|
||||
#include "recording.h" /* recording_screen() */
|
||||
|
||||
#if defined(HAVE_FMRADIO_REC) && CONFIG_CODEC == SWCODEC
|
||||
#if defined(HAVE_FMRADIO_REC)
|
||||
#define FM_RECORDING_SCREEN
|
||||
static int fm_recording_screen(void)
|
||||
{
|
||||
|
@ -53,30 +53,20 @@ static int fm_recording_screen(void)
|
|||
|
||||
MENUITEM_FUNCTION(recscreen_item, 0, ID2P(LANG_RECORDING),
|
||||
fm_recording_screen, NULL, NULL, Icon_Recording);
|
||||
#endif /* defined(HAVE_FMRADIO_REC) && CONFIG_CODEC == SWCODEC */
|
||||
#endif /* defined(HAVE_FMRADIO_REC) */
|
||||
|
||||
#if defined(HAVE_FMRADIO_REC) || CONFIG_CODEC != SWCODEC
|
||||
#if defined(HAVE_FMRADIO_REC)
|
||||
#define FM_RECORDING_SETTINGS
|
||||
static int fm_recording_settings(void)
|
||||
{
|
||||
int ret = recording_menu(true);
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if (!ret)
|
||||
{
|
||||
struct audio_recording_options rec_options;
|
||||
rec_init_recording_options(&rec_options);
|
||||
rec_options.rec_source = AUDIO_SRC_LINEIN;
|
||||
rec_set_recording_options(&rec_options);
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
MENUITEM_FUNCTION(recsettings_item, 0, ID2P(LANG_RECORDING_SETTINGS),
|
||||
fm_recording_settings, NULL, NULL, Icon_Recording);
|
||||
#endif /* defined(HAVE_FMRADIO_REC) || CONFIG_CODEC != SWCODEC */
|
||||
#endif /* defined(HAVE_FMRADIO_REC) */
|
||||
#endif /* HAVE_RECORDING */
|
||||
|
||||
#ifndef FM_PRESET
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "lcd.h"
|
||||
#include "menu.h"
|
||||
#include "button.h"
|
||||
#include "mp3_playback.h"
|
||||
#include "settings.h"
|
||||
#include "screens.h"
|
||||
#include "icons.h"
|
||||
|
@ -51,14 +50,12 @@
|
|||
#include "peakmeter.h"
|
||||
#endif
|
||||
#include "splash.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "metadata.h"
|
||||
#include "menus/eq_menu.h"
|
||||
#ifdef HAVE_RECORDING
|
||||
#include "enc_config.h"
|
||||
#endif
|
||||
#include "general.h"
|
||||
#endif
|
||||
#include "action.h"
|
||||
#include "recording.h"
|
||||
#include "sound_menu.h"
|
||||
|
@ -101,7 +98,6 @@ static int recsource_func(void)
|
|||
MENUITEM_FUNCTION(recsource, 0, ID2P(LANG_RECORDING_SOURCE),
|
||||
recsource_func, NULL, recmenu_callback, Icon_Menu_setting);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Makes an options list from a source list of options and indexes */
|
||||
static void make_options_from_indexes(const struct opt_items *src_names,
|
||||
const long *src_indexes,
|
||||
|
@ -112,12 +108,8 @@ static void make_options_from_indexes(const struct opt_items *src_names,
|
|||
dst_names[n_indexes] = src_names[src_indexes[n_indexes]];
|
||||
} /* make_options_from_indexes */
|
||||
|
||||
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
static int recfrequency_func(void)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
static const struct opt_items names[REC_NUM_FREQ] = {
|
||||
REC_HAVE_96_([REC_FREQ_96] = { "96kHz", TALK_ID(96, UNIT_KHZ) },)
|
||||
REC_HAVE_88_([REC_FREQ_88] = { "88.2kHz", TALK_ID(88, UNIT_KHZ) },)
|
||||
|
@ -195,7 +187,6 @@ static int recfrequency_func(void)
|
|||
}
|
||||
|
||||
return ret;
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
} /* recfrequency */
|
||||
MENUITEM_FUNCTION(recfrequency, 0, ID2P(LANG_FREQUENCY),
|
||||
recfrequency_func, NULL, NULL, Icon_Menu_setting);
|
||||
|
@ -208,7 +199,6 @@ static int recchannels_func(void)
|
|||
[CHN_MODE_MONO] = { STR(LANG_CHANNEL_MONO) }
|
||||
};
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
struct opt_items opts[CHN_NUM_MODES];
|
||||
long table[CHN_NUM_MODES];
|
||||
struct encoder_caps caps;
|
||||
|
@ -238,13 +228,10 @@ static int recchannels_func(void)
|
|||
global_settings.rec_channels = table[rec_channels];
|
||||
|
||||
return ret;
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
}
|
||||
MENUITEM_FUNCTION(recchannels, 0, ID2P(LANG_CHANNELS),
|
||||
recchannels_func, NULL, NULL, Icon_Menu_setting);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
||||
static int recmonomode_func(void)
|
||||
{
|
||||
static const struct opt_items names[3] = {
|
||||
|
@ -293,9 +280,6 @@ MENUITEM_FUNCTION(enc_global_config_menu_item, 0, ID2P(LANG_ENCODER_SETTINGS),
|
|||
enc_global_config_menu,
|
||||
NULL, NULL, Icon_Submenu);
|
||||
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
|
||||
static int recmenu_callback(int action,
|
||||
const struct menu_item_ex *this_item,
|
||||
struct gui_synclist *this_list)
|
||||
|
@ -603,14 +587,10 @@ MENUITEM_FUNCTION(save_recpresets_item, 0, ID2P(LANG_SAVE_SETTINGS),
|
|||
|
||||
MAKE_MENU(recording_settings_menu, ID2P(LANG_RECORDING_SETTINGS),
|
||||
NULL, Icon_Recording,
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
&recformat, &enc_global_config_menu_item,
|
||||
#endif
|
||||
&recfrequency, &recsource, /* recsource not shown if no_source */
|
||||
&recchannels,
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
&recmonomode,
|
||||
#endif
|
||||
&filesplitoptionsmenu,
|
||||
&rec_prerecord_time,
|
||||
&clear_rec_directory_item,
|
||||
|
|
|
@ -38,9 +38,7 @@
|
|||
#include "yesno.h"
|
||||
#include "talk.h"
|
||||
#include "powermgmt.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "playback.h"
|
||||
#endif
|
||||
#if CONFIG_RTC
|
||||
#include "screens.h"
|
||||
#endif
|
||||
|
@ -326,7 +324,6 @@ MAKE_MENU(limits_menu, ID2P(LANG_LIMITS_MENU), 0, Icon_NOICON,
|
|||
|
||||
|
||||
/* Keyclick menu */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
MENUITEM_SETTING(keyclick, &global_settings.keyclick, NULL);
|
||||
MENUITEM_SETTING(keyclick_repeats, &global_settings.keyclick_repeats, NULL);
|
||||
#ifdef HAVE_HARDWARE_CLICK
|
||||
|
@ -337,7 +334,6 @@ MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON,
|
|||
MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON,
|
||||
&keyclick, &keyclick_repeats);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_CHARGING
|
||||
MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL);
|
||||
|
@ -437,9 +433,7 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
|||
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
||||
&buttonlight_brightness,
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
&keyclick_menu,
|
||||
#endif
|
||||
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
|
||||
&touchpad_sensitivity,
|
||||
#endif
|
||||
|
@ -619,7 +613,6 @@ MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0,
|
|||
/***********************************/
|
||||
/* AUTORESUME MENU */
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
||||
static int autoresume_callback(int action,
|
||||
const struct menu_item_ex *this_item,
|
||||
|
@ -674,7 +667,6 @@ MAKE_MENU(autoresume_menu, ID2P(LANG_AUTORESUME),
|
|||
0, Icon_NOICON,
|
||||
&autoresume_enable, &autoresume_automatic);
|
||||
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
#endif /* HAVE_TAGCACHE */
|
||||
/* AUTORESUME MENU */
|
||||
/***********************************/
|
||||
|
@ -758,9 +750,7 @@ MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
|
|||
&startup_shutdown_menu,
|
||||
&bookmark_settings_menu,
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
&autoresume_menu,
|
||||
#endif
|
||||
#endif
|
||||
&browse_langs, &voice_settings_menu,
|
||||
#ifdef HAVE_HOTKEY
|
||||
|
|
|
@ -108,18 +108,10 @@ MENUITEM_SETTING(treble_cutoff, &global_settings.treble_cutoff, NULL);
|
|||
|
||||
MENUITEM_SETTING(balance, &global_settings.balance, NULL);
|
||||
MENUITEM_SETTING(channel_config, &global_settings.channel_config,
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
lowlatency_callback
|
||||
#else
|
||||
NULL
|
||||
#endif
|
||||
);
|
||||
MENUITEM_SETTING(stereo_width, &global_settings.stereo_width,
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
lowlatency_callback
|
||||
#else
|
||||
NULL
|
||||
#endif
|
||||
);
|
||||
|
||||
#ifdef AUDIOHW_HAVE_DEPTH_3D
|
||||
|
@ -134,7 +126,6 @@ MENUITEM_SETTING(roll_off, &global_settings.roll_off, NULL);
|
|||
MENUITEM_SETTING(func_mode, &global_settings.func_mode, NULL);
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Crossfeed Submenu */
|
||||
MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, lowlatency_callback);
|
||||
MENUITEM_SETTING(crossfeed_direct_gain,
|
||||
|
@ -216,7 +207,6 @@ static int timestretch_callback(int action,
|
|||
MAKE_MENU(compressor_menu,ID2P(LANG_COMPRESSOR), NULL, Icon_NOICON,
|
||||
&compressor_threshold, &compressor_gain, &compressor_ratio,
|
||||
&compressor_knee, &compressor_attack, &compressor_release);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SPEAKER
|
||||
MENUITEM_SETTING(speaker_mode, &global_settings.speaker_mode, NULL);
|
||||
|
@ -253,14 +243,12 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
|
|||
#ifdef AUDIOHW_HAVE_FUNCTIONAL_MODE
|
||||
,&func_mode
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
,&crossfeed_menu, &equalizer_menu, &dithering_enabled
|
||||
,&surround_menu, &pbe_menu, &afr_enabled
|
||||
#ifdef HAVE_PITCHCONTROL
|
||||
,×tretch_enabled
|
||||
#endif
|
||||
,&compressor_menu
|
||||
#endif
|
||||
#ifdef HAVE_SPEAKER
|
||||
,&speaker_mode
|
||||
#endif
|
||||
|
|
31
apps/misc.c
31
apps/misc.c
|
@ -91,11 +91,7 @@
|
|||
#include "bookmark.h"
|
||||
#include "wps.h"
|
||||
#include "playback.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "voice_thread.h"
|
||||
#else
|
||||
#include "mp3_playback.h"
|
||||
#endif
|
||||
|
||||
#ifdef BOOTFILE
|
||||
#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) \
|
||||
|
@ -302,7 +298,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
|
|||
#endif
|
||||
{
|
||||
bool batt_safe = battery_level_safe();
|
||||
#if CONFIG_CODEC != SWCODEC || defined(HAVE_RECORDING)
|
||||
#if defined(HAVE_RECORDING)
|
||||
int audio_stat = audio_status();
|
||||
#endif
|
||||
|
||||
|
@ -339,19 +335,12 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
|
|||
splashf(0, "%s %s", str(LANG_WARNING_BATTERY_EMPTY),
|
||||
str(LANG_SHUTTINGDOWN));
|
||||
}
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if (global_settings.fade_on_stop
|
||||
&& (audio_stat & AUDIO_STATUS_PLAY))
|
||||
{
|
||||
fade(false, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DISK_STORAGE
|
||||
if (batt_safe) /* do not save on critical battery */
|
||||
#endif
|
||||
{
|
||||
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
|
||||
#if defined(HAVE_RECORDING)
|
||||
if (audio_stat & AUDIO_STATUS_RECORD)
|
||||
{
|
||||
rec_command(RECORDING_CMD_STOP);
|
||||
|
@ -368,13 +357,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
|
|||
if (callback != NULL)
|
||||
callback(parameter);
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
/* wait for audio_stop or audio_stop_recording to complete */
|
||||
while (audio_status())
|
||||
sleep(1);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
|
||||
#if defined(HAVE_RECORDING)
|
||||
audio_close_recording();
|
||||
#endif
|
||||
scrobbler_shutdown(true);
|
||||
|
@ -403,9 +386,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
|
|||
enqueue = true;
|
||||
}
|
||||
talk_id(LANG_SHUTTINGDOWN, enqueue);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
voice_wait();
|
||||
#endif
|
||||
}
|
||||
|
||||
shutdown_hw();
|
||||
|
@ -426,10 +407,6 @@ bool list_stop_handler(void)
|
|||
{
|
||||
if (!global_settings.party_mode)
|
||||
{
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if (global_settings.fade_on_stop)
|
||||
fade(false, false);
|
||||
#endif
|
||||
bookmark_autobookmark(true);
|
||||
audio_stop();
|
||||
ret = true; /* bookmarking can make a refresh necessary */
|
||||
|
@ -894,7 +871,6 @@ char *strip_extension(char* buffer, int buffer_size, const char *filename)
|
|||
return buffer;
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Play a standard sound */
|
||||
void system_sound_play(enum system_sound sound)
|
||||
{
|
||||
|
@ -1046,7 +1022,6 @@ void replaygain_update(void)
|
|||
settings.type = replaygain_setting_mode(settings.type);
|
||||
dsp_replaygain_set_settings(&settings);
|
||||
}
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/* format a sound value like: -1.05 dB */
|
||||
int format_sound_value(char *buf, size_t size, int snd, int val)
|
||||
|
|
|
@ -181,7 +181,6 @@ enum current_activity {
|
|||
ACTIVITY_USBSCREEN
|
||||
};
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
void beep_play(unsigned int frequency, unsigned int duration,
|
||||
unsigned int amplitude);
|
||||
|
||||
|
@ -209,9 +208,6 @@ void keyclick_click(bool rawbutton, int action);
|
|||
struct mp3entry;
|
||||
int id3_get_replaygain_mode(const struct mp3entry *id3);
|
||||
void replaygain_update(void);
|
||||
#else
|
||||
static inline void replaygain_update(void) {}
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
void push_current_activity(enum current_activity screen);
|
||||
void pop_current_activity(void);
|
||||
|
|
1979
apps/mpeg.c
1979
apps/mpeg.c
File diff suppressed because it is too large
Load Diff
28
apps/mpeg.h
28
apps/mpeg.h
|
@ -1,28 +0,0 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 by Linus Nielsen Feltzing
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifndef _MPEG_H_
|
||||
#define _MPEG_H_
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
unsigned long mpeg_get_last_header(void);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -26,7 +26,6 @@
|
|||
#include <stdlib.h>
|
||||
#include "config.h"
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Including the code for fast previews is entirely optional since it
|
||||
does add two more mp3entry's - for certain targets it may be less
|
||||
beneficial such as flash-only storage */
|
||||
|
@ -34,8 +33,6 @@
|
|||
#define AUDIO_FAST_SKIP_PREVIEW
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#ifdef HAVE_ALBUMART
|
||||
|
||||
#include "bmp.h"
|
||||
|
|
|
@ -647,11 +647,7 @@ static int create_and_play_dir(int direction, bool play_last)
|
|||
else
|
||||
index = 0;
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
current_playlist.started = true;
|
||||
#else
|
||||
playlist_start(index, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* we've overwritten the dircache when getting the next/previous dir,
|
||||
|
@ -1090,7 +1086,6 @@ static int calculate_step_count(const struct playlist_info *playlist, int steps)
|
|||
return steps;
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Marks the index of the track to be skipped that is "steps" away from
|
||||
* current playing track.
|
||||
*/
|
||||
|
@ -1112,7 +1107,6 @@ void playlist_skip_entry(struct playlist_info *playlist, int steps)
|
|||
|
||||
playlist->indices[index] |= PLAYLIST_SKIPPED;
|
||||
}
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/*
|
||||
* returns the index of the track that is "steps" away from current playing
|
||||
|
@ -2649,11 +2643,9 @@ const char* playlist_peek(int steps, char* buf, size_t buf_size)
|
|||
if (index < 0)
|
||||
return NULL;
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Just testing - don't care about the file name */
|
||||
if (!buf || !buf_size)
|
||||
return "";
|
||||
#endif
|
||||
|
||||
control_file = playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK;
|
||||
seek = playlist->indices[index] & PLAYLIST_SEEK_MASK;
|
||||
|
@ -2730,11 +2722,7 @@ int playlist_next(int steps)
|
|||
sort_playlist(playlist, false, false);
|
||||
randomise_playlist(playlist, current_tick, false, true);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
playlist->started = true;
|
||||
#else
|
||||
playlist_start(0, 0, 0);
|
||||
#endif
|
||||
playlist->index = 0;
|
||||
index = 0;
|
||||
}
|
||||
|
@ -2780,7 +2768,6 @@ int playlist_next(int steps)
|
|||
return index;
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* try playing next or previous folder */
|
||||
bool playlist_next_dir(int direction)
|
||||
{
|
||||
|
@ -2790,7 +2777,6 @@ bool playlist_next_dir(int direction)
|
|||
|
||||
return create_and_play_dir(direction, false) >= 0;
|
||||
}
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/* Get resume info for current playing song. If return value is -1 then
|
||||
settings shouldn't be saved. */
|
||||
|
|
|
@ -139,9 +139,7 @@ void playlist_start(int start_index, unsigned long elapsed,
|
|||
bool playlist_check(int steps);
|
||||
const char *playlist_peek(int steps, char* buf, size_t buf_size);
|
||||
int playlist_next(int steps);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
bool playlist_next_dir(int direction);
|
||||
#endif
|
||||
int playlist_get_resume_info(int *resume_index);
|
||||
int playlist_update_resume_info(const struct mp3entry* id3);
|
||||
int playlist_get_display_index(void);
|
||||
|
@ -165,9 +163,7 @@ int playlist_insert_directory(struct playlist_info* playlist,
|
|||
bool recurse);
|
||||
int playlist_insert_playlist(struct playlist_info* playlist, const char *filename,
|
||||
int position, bool queue);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
void playlist_skip_entry(struct playlist_info *playlist, int steps);
|
||||
#endif
|
||||
int playlist_delete(struct playlist_info* playlist, int index);
|
||||
int playlist_move(struct playlist_info* playlist, int index, int new_index);
|
||||
int playlist_randomise(struct playlist_info* playlist, unsigned int seed,
|
||||
|
|
|
@ -466,7 +466,6 @@ static const struct plugin_api rockbox_api = {
|
|||
thread_self,
|
||||
thread_exit,
|
||||
thread_wait,
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
thread_thaw,
|
||||
#ifdef HAVE_PRIORITY_SCHEDULING
|
||||
thread_set_priority,
|
||||
|
@ -474,7 +473,6 @@ static const struct plugin_api rockbox_api = {
|
|||
mutex_init,
|
||||
mutex_lock,
|
||||
mutex_unlock,
|
||||
#endif
|
||||
#ifdef HAVE_SEMAPHORE_OBJECTS
|
||||
semaphore_init,
|
||||
semaphore_wait,
|
||||
|
@ -517,13 +515,11 @@ static const struct plugin_api rockbox_api = {
|
|||
queue_delete,
|
||||
queue_post,
|
||||
queue_wait_w_tmo,
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
queue_enable_queue_send,
|
||||
queue_empty,
|
||||
queue_wait,
|
||||
queue_send,
|
||||
queue_reply,
|
||||
#endif
|
||||
|
||||
#ifdef RB_PROFILE
|
||||
profile_thread,
|
||||
|
@ -601,7 +597,7 @@ static const struct plugin_api rockbox_api = {
|
|||
#ifdef AUDIOHW_HAVE_EQ
|
||||
sound_enum_hw_eq_band_setting,
|
||||
#endif
|
||||
#if ((CONFIG_CODEC == SWCODEC)) && defined (HAVE_PITCHCONTROL)
|
||||
#if defined (HAVE_PITCHCONTROL)
|
||||
sound_set_pitch,
|
||||
#endif
|
||||
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||
|
@ -609,11 +605,7 @@ static const struct plugin_api rockbox_api = {
|
|||
mp3_play_pause,
|
||||
mp3_play_stop,
|
||||
mp3_is_playing,
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
bitswap,
|
||||
#endif
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
&audio_master_sampr_list[0],
|
||||
&hw_freq_sampr[0],
|
||||
pcm_apply_settings,
|
||||
|
@ -667,7 +659,6 @@ static const struct plugin_api rockbox_api = {
|
|||
pcmbuf_fade,
|
||||
system_sound_play,
|
||||
keyclick_click,
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/* metadata */
|
||||
get_metadata,
|
||||
|
@ -716,9 +707,6 @@ static const struct plugin_api rockbox_api = {
|
|||
audio_current_track,
|
||||
audio_flush_and_reload_tracks,
|
||||
audio_get_file_pos,
|
||||
#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
|
||||
mpeg_get_last_header,
|
||||
#endif
|
||||
|
||||
/* menu */
|
||||
root_menu_get_options,
|
||||
|
@ -783,7 +771,6 @@ static const struct plugin_api rockbox_api = {
|
|||
#ifdef ROCKBOX_HAS_LOGF
|
||||
_logf,
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
codec_thread_do_callback,
|
||||
codec_load_file,
|
||||
codec_run_proc,
|
||||
|
@ -792,7 +779,6 @@ static const struct plugin_api rockbox_api = {
|
|||
find_array_ptr,
|
||||
remove_array_ptr,
|
||||
round_value_to_list32,
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
read_bmp_file,
|
||||
|
|
|
@ -66,9 +66,8 @@ void* plugin_get_buffer(size_t *buffer_size);
|
|||
#include "scroll_engine.h"
|
||||
#include "metadata.h"
|
||||
#include "sound.h"
|
||||
#include "mpeg.h"
|
||||
#include "audio.h"
|
||||
#include "mp3_playback.h"
|
||||
#include "voice_thread.h"
|
||||
#include "root_menu.h"
|
||||
#include "talk.h"
|
||||
#include "lang_enum.h"
|
||||
|
@ -77,7 +76,6 @@ void* plugin_get_buffer(size_t *buffer_size);
|
|||
#endif
|
||||
#include "misc.h"
|
||||
#include "pathfuncs.h"
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
#include "pcm_mixer.h"
|
||||
#include "dsp-util.h"
|
||||
#include "dsp_core.h"
|
||||
|
@ -88,7 +86,6 @@ void* plugin_get_buffer(size_t *buffer_size);
|
|||
#ifdef HAVE_RECORDING
|
||||
#include "recording.h"
|
||||
#endif
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
#include "settings.h"
|
||||
#include "timer.h"
|
||||
#include "playlist.h"
|
||||
|
@ -526,7 +523,6 @@ struct plugin_api {
|
|||
unsigned int (*thread_self)(void);
|
||||
void (*thread_exit)(void);
|
||||
void (*thread_wait)(unsigned int thread_id);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
void (*thread_thaw)(unsigned int thread_id);
|
||||
#ifdef HAVE_PRIORITY_SCHEDULING
|
||||
int (*thread_set_priority)(unsigned int thread_id, int priority);
|
||||
|
@ -534,7 +530,6 @@ struct plugin_api {
|
|||
void (*mutex_init)(struct mutex *m);
|
||||
void (*mutex_lock)(struct mutex *m);
|
||||
void (*mutex_unlock)(struct mutex *m);
|
||||
#endif
|
||||
#ifdef HAVE_SEMAPHORE_OBJECTS
|
||||
void (*semaphore_init)(struct semaphore *s, int max, int start);
|
||||
int (*semaphore_wait)(struct semaphore *s, int timeout);
|
||||
|
@ -580,7 +575,6 @@ struct plugin_api {
|
|||
void (*queue_post)(struct event_queue *q, long id, intptr_t data);
|
||||
void (*queue_wait_w_tmo)(struct event_queue *q, struct queue_event *ev,
|
||||
int ticks);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
void (*queue_enable_queue_send)(struct event_queue *q,
|
||||
struct queue_sender_list *send,
|
||||
unsigned int thread_id);
|
||||
|
@ -589,7 +583,6 @@ struct plugin_api {
|
|||
intptr_t (*queue_send)(struct event_queue *q, long id,
|
||||
intptr_t data);
|
||||
void (*queue_reply)(struct event_queue *q, intptr_t retval);
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#ifdef RB_PROFILE
|
||||
void (*profile_thread)(void);
|
||||
|
@ -673,7 +666,7 @@ struct plugin_api {
|
|||
int (*sound_enum_hw_eq_band_setting)(unsigned int band,
|
||||
unsigned int band_setting);
|
||||
#endif /* AUDIOHW_HAVE_EQ */
|
||||
#if ((CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL))
|
||||
#if defined (HAVE_PITCHCONTROL)
|
||||
void (*sound_set_pitch)(int32_t pitch);
|
||||
#endif
|
||||
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||
|
@ -682,11 +675,7 @@ struct plugin_api {
|
|||
void (*mp3_play_pause)(bool play);
|
||||
void (*mp3_play_stop)(void);
|
||||
bool (*mp3_is_playing)(void);
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
void (*bitswap)(unsigned char *data, int length);
|
||||
#endif
|
||||
#endif /* PLATFORM_NATIVE */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
const unsigned long *audio_master_sampr_list;
|
||||
const unsigned long *hw_freq_sampr;
|
||||
void (*pcm_apply_settings)(void);
|
||||
|
@ -752,7 +741,6 @@ struct plugin_api {
|
|||
void (*pcmbuf_fade)(bool fade, bool in);
|
||||
void (*system_sound_play)(enum system_sound sound);
|
||||
void (*keyclick_click)(bool rawbutton, int action);
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/* metadata */
|
||||
bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname);
|
||||
|
@ -817,9 +805,6 @@ struct plugin_api {
|
|||
struct mp3entry* (*audio_current_track)(void);
|
||||
void (*audio_flush_and_reload_tracks)(void);
|
||||
int (*audio_get_file_pos)(void);
|
||||
#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
|
||||
unsigned long (*mpeg_get_last_header)(void);
|
||||
#endif
|
||||
|
||||
/* menu */
|
||||
struct menu_table *(*root_menu_get_options)(int *nb_options);
|
||||
|
@ -902,7 +887,6 @@ struct plugin_api {
|
|||
#ifdef ROCKBOX_HAS_LOGF
|
||||
void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
void (*codec_thread_do_callback)(void (*fn)(void),
|
||||
unsigned int *audio_thread_id);
|
||||
int (*codec_load_file)(const char* codec, struct codec_api *api);
|
||||
|
@ -915,7 +899,6 @@ struct plugin_api {
|
|||
const unsigned long list[],
|
||||
int count,
|
||||
bool signd);
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
int (*read_bmp_file)(const char* filename, struct bitmap *bm, int maxsize,
|
||||
|
|
|
@ -46,17 +46,12 @@ remote_control.c
|
|||
lamp.c
|
||||
#endif /* HAVE_BACKLIGHT */
|
||||
|
||||
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#if defined(HAVE_RECORDING) && (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN))
|
||||
pitch_detector.c
|
||||
#endif
|
||||
|
||||
mp3_encoder.c
|
||||
wav2wv.c
|
||||
#endif /* CONFIG_CODEC */
|
||||
|
||||
|
||||
#if CONFIG_RTC
|
||||
alarmclock.c
|
||||
|
@ -99,15 +94,6 @@ pictureflow.c
|
|||
|
||||
#endif /* PLUGIN_BUFFER_SIZE <= 0x20000 && HAVE_LCD_BITMAP */
|
||||
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
|
||||
#if defined(HAVE_LCD_BITMAP)
|
||||
splitedit.c
|
||||
#endif
|
||||
|
||||
#endif /* HWCODEC */
|
||||
|
||||
#if defined(IRIVER_H100_SERIES)
|
||||
iriver_flash.c
|
||||
#endif
|
||||
|
@ -207,9 +193,7 @@ superdom.c
|
|||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
test_boost.c
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
test_codec.c
|
||||
#endif
|
||||
#ifdef HAVE_JPEG
|
||||
test_core_jpeg.c
|
||||
#endif
|
||||
|
@ -232,9 +216,7 @@ test_mem_jpeg.c
|
|||
#ifdef HAVE_LCD_COLOR
|
||||
test_resize.c
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
test_sampr.c
|
||||
#endif
|
||||
#ifdef HAVE_TOUCHSCREEN
|
||||
test_touchscreen.c
|
||||
#endif
|
||||
|
|
|
@ -23,9 +23,7 @@ test_fps.c
|
|||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
test_boost.c
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
test_codec.c
|
||||
#endif
|
||||
#ifdef HAVE_JPEG
|
||||
test_core_jpeg.c
|
||||
#endif
|
||||
|
@ -46,9 +44,7 @@ test_mem_jpeg.c
|
|||
#ifdef HAVE_LCD_COLOR
|
||||
test_resize.c
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
test_sampr.c
|
||||
#endif
|
||||
test_viewports.c
|
||||
#endif /* HAVE_TEST_PLUGINS */
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ rockboy
|
|||
pictureflow
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC && PLUGIN_BUFFER_SIZE > 0x20000
|
||||
#if PLUGIN_BUFFER_SIZE > 0x20000
|
||||
fft
|
||||
#endif
|
||||
|
||||
|
@ -70,9 +70,6 @@ pacbox
|
|||
doom
|
||||
#endif
|
||||
|
||||
/* For all the swcodec targets */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
||||
#if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */
|
||||
midi
|
||||
mikmod
|
||||
|
@ -91,8 +88,6 @@ pdbox
|
|||
mpegplayer
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/* Lua needs at least 160 KB to work in */
|
||||
#if PLUGIN_BUFFER_SIZE >= 0x80000
|
||||
lua
|
||||
|
|
|
@ -10,7 +10,7 @@ lua
|
|||
lua_scripts
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC && PLUGIN_BUFFER_SIZE > 0x20000
|
||||
#if PLUGIN_BUFFER_SIZE > 0x20000
|
||||
fft
|
||||
#endif
|
||||
|
||||
|
@ -23,11 +23,8 @@ pictureflow
|
|||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
/* For all the swcodec targets */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
||||
#if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */
|
||||
mikmod
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
#endif /* HAVE_TOUCHSCREEN */
|
||||
|
|
|
@ -50,12 +50,10 @@ invadrox_fire.6x6x1.bmp
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* MPEGplayer */
|
||||
mpegplayer_status_icons_8x8x1.bmp
|
||||
mpegplayer_status_icons_12x12x1.bmp
|
||||
mpegplayer_status_icons_16x16x1.bmp
|
||||
#endif
|
||||
|
||||
#if LCD_WIDTH == 160 && LCD_HEIGHT == 128 && LCD_DEPTH < 16
|
||||
superdom_boarditems.160x128x1.bmp
|
||||
|
|
|
@ -957,7 +957,7 @@ rockboxlogo.91x32x1.bmp
|
|||
/* Pitch detector */
|
||||
/* The following preprocessor condition must match the condition */
|
||||
/* for pitch detector from plugins/SOURCES */
|
||||
#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && \
|
||||
#if defined(HAVE_RECORDING) && \
|
||||
(defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN))
|
||||
#if (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) && (LCD_DEPTH >= 16)
|
||||
pitch_notes.320x240x16.bmp
|
||||
|
|
|
@ -1331,39 +1331,11 @@ static byte chip8_keymap[16];
|
|||
static unsigned long starttimer; /* Timer value at the beginning */
|
||||
static unsigned long cycles; /* Number of update cycles (50Hz) */
|
||||
|
||||
#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
|
||||
static bool is_playing;
|
||||
|
||||
/* one frame of bitswapped mp3 data */
|
||||
static unsigned char beep[]={255,
|
||||
223, 28, 35, 0,192,210, 35,226, 72,188,242, 1,128,166, 16, 68,146,252,151, 19,
|
||||
10,180,245,127, 96,184, 3,184, 30, 0,118, 59,128,121,102, 6,212, 0, 97, 6,
|
||||
42, 65, 28,134,192,145, 57, 38,136, 73, 29, 38,132, 15, 21, 70, 91,185, 99,198,
|
||||
15,192, 83, 6, 33,129, 20, 6, 97, 33, 4, 6,245,128, 92, 6, 24, 0, 86, 6,
|
||||
56,129, 44, 24,224, 25, 13, 48, 50, 82,180, 11,251,106,249, 59, 24, 82,175,223,
|
||||
252,119, 76,134,120,236,149,250,247,115,254,145,173,174,168,180,255,107,195, 89,
|
||||
24, 25, 48,131,192, 61, 48, 64, 10,176, 49, 64, 1,152, 50, 32, 8,140, 48, 16,
|
||||
5,129, 51,196,187, 41,177, 23,138, 70, 50, 8, 10,242, 48,192, 3,248,226, 0,
|
||||
20,100, 18, 96, 41, 96, 78,102, 7,201,122, 76,119, 20,137, 37,177, 15,132,224,
|
||||
20, 17,191, 67,147,187,116,211, 41,169, 63,172,182,186,217,155,111,140,104,254,
|
||||
111,181,184,144, 17,148, 21,101,166,227,100, 86, 85, 85, 85};
|
||||
/* callback to request more mp3 data */
|
||||
static void callback(const void** start, size_t* size)
|
||||
{
|
||||
*start = beep; /* give it the same frame again */
|
||||
*size = sizeof(beep);
|
||||
}
|
||||
#endif /* PLATFORM_NATIVE */
|
||||
|
||||
/****************************************************************************/
|
||||
/* Turn sound on */
|
||||
/****************************************************************************/
|
||||
static void chip8_sound_on (void)
|
||||
{
|
||||
#if(CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
|
||||
if (!is_playing)
|
||||
rb->mp3_play_pause(true); /* kickoff audio */
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
@ -1371,10 +1343,6 @@ static void chip8_sound_on (void)
|
|||
/****************************************************************************/
|
||||
static void chip8_sound_off (void)
|
||||
{
|
||||
#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
|
||||
if (!is_playing)
|
||||
rb->mp3_play_pause(false); /* pause audio */
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
@ -1576,27 +1544,12 @@ static bool chip8_run(const char* file)
|
|||
rb->lcd_drawrect(CHIP8_X-1,CHIP8_Y-1,CHIP8_LCDWIDTH+2,CHIP8_HEIGHT+2);
|
||||
#endif
|
||||
rb->lcd_update();
|
||||
#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
|
||||
/* init sound */
|
||||
is_playing = rb->mp3_is_playing(); /* would we disturb playback? */
|
||||
if (!is_playing) /* no? then we can make sound */
|
||||
{ /* prepare */
|
||||
rb->mp3_play_data(beep, sizeof(beep), callback);
|
||||
}
|
||||
#endif
|
||||
starttimer = *rb->current_tick;
|
||||
|
||||
chip8_iperiod=15;
|
||||
cycles = 0;
|
||||
chip8();
|
||||
|
||||
#if (CONFIG_CODEC != SWCODEC) && !defined(SIMULATOR)
|
||||
if (!is_playing)
|
||||
{ /* stop it if we used audio */
|
||||
rb->mp3_play_stop(); /* Stop audio playback */
|
||||
}
|
||||
#endif
|
||||
|
||||
if (chip8_running == 3) {
|
||||
/* unsupported instruction */
|
||||
rb->splash(HZ, "Error: Unsupported"
|
||||
|
|
|
@ -487,7 +487,7 @@ RB_WRAP(sound)
|
|||
lua_pushstring (L, rb->sound_unit(setting));
|
||||
return 1;
|
||||
break;
|
||||
#if ((CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL))
|
||||
#if defined (HAVE_PITCHCONTROL)
|
||||
case SOUND_SET_PITCH:
|
||||
rb->sound_set_pitch(setting);
|
||||
return 1;/*nil*/
|
||||
|
@ -507,7 +507,6 @@ RB_WRAP(sound)
|
|||
return 1;
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
RB_WRAP(pcm)
|
||||
{
|
||||
enum e_pcm {PCM_APPLYSETTINGS = 0, PCM_ISPLAYING, PCM_ISPAUSED,
|
||||
|
@ -579,7 +578,6 @@ RB_WRAP(mixer_frequency)
|
|||
lua_pushinteger(L, result);
|
||||
return 1;
|
||||
}
|
||||
#endif /*CONFIG_CODEC == SWCODEC*/
|
||||
|
||||
/* DEVICE LIGHTING CONTROL */
|
||||
RB_WRAP(backlight_onoff)
|
||||
|
@ -953,10 +951,8 @@ static const luaL_Reg rocklib[] =
|
|||
RB_FUNC(audio),
|
||||
RB_FUNC(playlist),
|
||||
RB_FUNC(sound),
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
RB_FUNC(pcm),
|
||||
RB_FUNC(mixer_frequency),
|
||||
#endif
|
||||
|
||||
/* DEVICE LIGHTING CONTROL */
|
||||
RB_FUNC(backlight_onoff),
|
||||
|
|
|
@ -123,143 +123,6 @@ const struct button_mapping *plugin_contexts[] =
|
|||
};
|
||||
#define PLA_ARRAY_COUNT sizeof(plugin_contexts)/sizeof(plugin_contexts[0])
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
#ifndef SIMULATOR
|
||||
/* MP3 tick sounds */
|
||||
static unsigned char tick_sound[] =
|
||||
{
|
||||
255,251,112,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 73,110,102,111, 0, 0, 0, 15, 0, 0, 0, 3, 0, 0, 4,229, 0, 85, 85
|
||||
, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
|
||||
, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,170,170,170,170,170,170,170,170,170
|
||||
,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170
|
||||
,170,170,170,170,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
|
||||
,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0
|
||||
, 57, 76, 65, 77, 69, 51, 46, 57, 57,114, 1,205, 0, 0, 0, 0, 46,102, 0, 0
|
||||
, 20, 96, 36, 3, 64, 66, 0, 0, 96, 0, 0, 4,229,101,175,184,232, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,251,112,196, 0, 0, 13
|
||||
, 92,189,103, 52,194,128, 2,165,176,176,247, 51, 16, 2, 0, 0, 24, 32, 0, 12
|
||||
,204,204,204,204,207,215,221,121,229, 74,224,152, 1,128, 24, 19, 17,207,217,246
|
||||
,252,132,212,226,225,192, 16, 0, 0, 0, 0, 32,163,100,111,255, 66, 7, 0, 48
|
||||
, 12, 14, 31, 59,255,255,234,112,248,112, 56, 40,223,193, 0, 64, 16, 4, 1, 51
|
||||
,229, 29,234, 4,193,240,124, 31, 62, 15,135,255, 7,193, 0, 64, 16, 12, 9, 1
|
||||
, 15,168, 16, 1,131,224,254,254,146,224,254, 8, 28, 88,127,255,148, 4, 32,128
|
||||
, 32,196,182,166,245,242,214,222,214, 73, 45,110, 52,137, 81, 39,107,255, 44, 76
|
||||
,148,140, 8,250, 66,148,195, 43, 3, 41, 15, 18,163, 80, 5, 20,248,174,140,138
|
||||
,115, 1,146, 50, 49, 32, 44,201,152,157, 53, 32, 33,157, 8, 34, 85,135, 88,105
|
||||
,186,131,252, 48,143,168,162, 44,209,142, 16, 88,221, 10,214, 94, 51, 52, 46,148
|
||||
,133, 36, 38,129,165, 36,164,139, 64,211, 11,115,101, 49, 5,136, 33,157, 18,241
|
||||
,137, 50, 53,194,213,173, 78,241,108, 1, 24,172,129,146,141,136, 24,119, 73, 51
|
||||
, 85,162,138,146, 51, 20,101,163,242,129, 56,212, 84,233, 44, 94, 11, 97,117, 74
|
||||
, 73, 37,162, 58, 20,146, 95,203, 31,246, 50, 55,111,214,223,205,213,230, 31,232
|
||||
,122,143,183, 14, 39, 91, 57, 15,251,186, 21,185,149, 48, 1,100, 64,200, 16,121
|
||||
,155, 72,110, 24,130, 98,255,251,114,196, 7,128, 17,169,247, 95,221,152,128, 10
|
||||
, 80, 62,233,185,150,170,113,174,203,251, 59, 12,190,170, 98, 4,156,122,140, 97
|
||||
,155, 60, 39, 8,145,195,116, 22,164, 82,118,116, 42,116,157, 68, 88, 70, 64, 93
|
||||
, 17, 35, 39,163,118,118, 77, 75, 82,187,215, 89,140, 46,100,112,151, 75, 73,169
|
||||
,107,181,157,170,251, 45,140, 75, 34,122, 28,228,146,111,255,235,210, 81,124,114
|
||||
,199, 52,180,138,174,207,255,235, 82,210, 64,123, 34,197,101, 47,255,254,234, 91
|
||||
, 14, 74, 68,234,219,255,254,206,131,143,162,120,234,210,191,255,245, 93, 18,200
|
||||
,225, 42, 29,171,255,254,165,164,196, 24,137, 32,223, 90, 93, 96, 64,217, 78, 35
|
||||
, 32, 53,185,107,237, 43,113, 98, 80,107,161, 3,206, 60,192, 10, 78,226,219,199
|
||||
,158,146,158, 47, 59, 90,253,154,221,198,138,147,100,150,206,233, 32, 39,192, 73
|
||||
, 23, 76,150,201, 41,209,186,217, 37,250,233, 38,198, 34, 24, 18, 33,130, 38,158
|
||||
, 73, 54, 69,146, 91, 36,182, 75,235, 64,216,196,138, 9,201, 69,174,138,157,244
|
||||
,154,150,208,246, 57, 72, 71, 2,148, 23, 76,115, 83,255,210,218,161, 56, 3, 68
|
||||
, 81, 49,190,139,253,125, 81,205, 25, 13,202,146,156,173,255,250,234,194, 8, 69
|
||||
, 13,142,255,255,209, 88,136, 73, 6,145,235, 26,142,191,255, 85,100,154,104,178
|
||||
,131,213, 0, 34, 0, 17,132, 0, 7,227, 82,135, 11,113, 70,110,105, 94,118, 22
|
||||
,255,251,112,196, 9, 0, 17, 61,249, 41,128,101,163, 73,217,178,153, 88,147, 21
|
||||
, 48,158,206,220,162,156,221, 7,209, 69, 20,117,163, 69,146, 68,145, 26,131,150
|
||||
, 0, 4,132, 41, 8,214,202,209, 69, 30,191,116, 76,156,240, 41,194,118, 23,147
|
||||
, 67,173, 87,255,233, 29, 64,216, 73,129, 10, 28,227,197,217, 43,255,254,203, 40
|
||||
,140, 48,129, 5,201, 21, 58, 95,255,232,180,168, 70,136,131,201,146,255,254,182
|
||||
,169,206, 5,216,101, 36,146,217,109,255,250,169, 38, 96, 35, 69, 51,167,157,191
|
||||
,255, 82,158,152,225, 46, 14, 99,235,100,159,255,253, 22, 29,162, 98, 84,108,210
|
||||
,202,128, 74, 16, 23,220, 23, 96,152, 17, 5,129,242, 49,137, 75, 60, 81, 16, 80
|
||||
, 34,106, 74, 91,255,222, 53, 18, 64,160, 70, 1,195, 5,139,230, 84,118,254,236
|
||||
, 44, 29, 1,130,196,195,130,236,237,255,253,156, 84, 60, 17, 10, 10, 19, 35,179
|
||||
,255,254,206,198, 14,132,130,194,196, 14, 67,179,255,254,198, 40,144,136, 80, 80
|
||||
, 76, 64,228, 57, 29,191,251, 57, 76, 34, 18, 8,132, 66,132,200,114, 59, 63,255
|
||||
,220,166, 17, 18, 18, 26, 32,112,201,159,240,144,184,169, 23,127,197,133, 69, 85
|
||||
, 76, 65, 77, 69, 51, 46, 57, 57, 46, 53, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
|
||||
, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
|
||||
, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
|
||||
};
|
||||
static unsigned char tock_sound[] =
|
||||
{
|
||||
255,251,112,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 73,110,102,111, 0, 0, 0, 15, 0, 0, 0, 3, 0, 0, 4,229, 0, 85, 85
|
||||
, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
|
||||
, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,170,170,170,170,170,170,170,170,170
|
||||
,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170
|
||||
,170,170,170,170,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
|
||||
,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0
|
||||
, 57, 76, 65, 77, 69, 51, 46, 57, 57,114, 1,205, 0, 0, 0, 0, 46,100, 0, 0
|
||||
, 20, 96, 36, 3, 64, 66, 0, 0, 96, 0, 0, 4,229,187,155,119, 17, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,251,112,196, 0, 0, 13
|
||||
,105, 19,104,212,146,128, 10,164, 41,175,119, 51, 32, 0, 2, 32, 41, 84, 9,130
|
||||
, 96,152,109,228, 0, 16, 0, 6, 9,209,163,111,127,154, 48, 0, 0, 0, 0,129
|
||||
,194, 19,212,226, 97,240,248,187,255, 65, 0,248,124, 92,255,144,130, 1,192,225
|
||||
, 9,249,206,115,138, 16,158,132, 57,206,115,191,242, 16,132,111,212,231, 14, 7
|
||||
, 8, 70,243,156,231, 57,206,121,207,200, 66, 16, 92,231,255,134, 0, 0, 0,127
|
||||
,244, 60, 60, 51,255,192, 3,195,207,252, 0, 0, 0, 29, 39,244, 60, 48, 3,255
|
||||
,195,219,177,171,179,181, 8,157,251,239,155,104,162, 80, 5,194, 16,165,199, 42
|
||||
,104,133, 19,109, 88, 96, 61,104,242,117,118, 94,135, 29, 53, 72, 67, 85, 11, 54
|
||||
, 59, 64,154,155,128,195, 23,148, 98, 43,186, 43,139, 64,218, 82, 68,160,197,168
|
||||
,125, 10, 50, 41, 16,240, 30, 6,228, 52,117, 0, 51,130,146,122,152,109,162,201
|
||||
, 45,154, 30, 11, 66, 30, 76, 73,145,224, 52,149, 17, 55,138,112,105, 51, 36,147
|
||||
, 22,130, 89, 20,138, 36,114,212,145, 3,199,107,101,213, 25, 21,222,196,209,162
|
||||
, 40,168,168,165,162,100,142,163,220,186,250, 72,106, 54, 75, 48,243, 79,153, 54
|
||||
,163, 93,179,171,204,144,232,190,115, 19,208, 90,172,244, 40, 98,126, 35,161,234
|
||||
,122,143,221, 39,250,159, 61, 35,111,250,213,216, 6,252, 9,138, 17, 64, 1, 13
|
||||
, 56, 80, 58,104,184, 37,255,251,114,196, 7,128, 17,250, 1, 97,189,152, 0, 10
|
||||
, 44,192, 41,253,151,169,185,237, 56, 3,131,220, 24,180,204,165,221,129,107,210
|
||||
,192, 50,130, 26, 22, 26,180, 77, 81, 85,221,146, 33,197,224,198,197,228,146, 89
|
||||
,162,210, 69,100,233, 13, 25,145, 61, 19,206,151,232,172,212, 58,162,149, 53, 70
|
||||
,234,234, 81,176,186, 28, 39,145,253, 87, 33,130,150, 43, 36,187,245,169,141,200
|
||||
, 41,178,191,230, 68,233,170,255,230, 37,227,101,183,237, 49, 56,109,255,115,134
|
||||
,232,223,247,156, 62,191,250, 43, 42,169,127,245, 26,160,255,234,151,157,191,215
|
||||
, 46,164,223,235, 98,137,118,223,238,112,189,111,247, 56, 94,106, 16, 1, 77, 8
|
||||
, 25, 4,204, 0, 0,134, 96, 41,151,170, 74,147,135, 11,136, 28,220, 96,102,179
|
||||
, 16,145, 89,202, 11,197,114, 72, 0,241, 77, 88,211, 70,174,171, 10, 11, 84,163
|
||||
, 5, 53,191,241,191,106,245,209,114, 21,240,208, 75,172,190,150,103,205,178,252
|
||||
, 78, 36,166,139,132,106,231, 86,253,130, 80,178,201,254,193, 68, 20,207,254,206
|
||||
, 49, 19, 78,127,253,159,255, 33, 37, 37, 95,238,112,188, 89, 37, 79,238,165, 5
|
||||
,163,151,249,168,130,215,255,169,223,249,231, 15,149,191,161,227,209,235, 63,232
|
||||
,166, 10,198,183,232,150, 34,119,255,213, 17,255,231, 17, 44, 8, 2, 96, 1,101
|
||||
,184,243,226,216, 18, 60,216,132,105,150,250,101,165, 64,237,172,186, 35,114,126
|
||||
,255,251,112,196, 12,128,144,142, 3, 44,140,180,241, 1,207, 47,217, 72,244, 10
|
||||
, 48, 29, 88, 20, 21,128, 36,231,157,173,100,202, 35,136,119,133,228,209, 55,186
|
||||
,218,198,197,208,217, 11,233,178,254,186,137,128, 8,110, 71,253,212,136,138, 45
|
||||
,118,253,216, 34, 7, 74, 99,255, 60, 22,144,101,111,209, 72,136,196,175,254, 58
|
||||
, 15, 76, 71,249,184,138, 45, 30,127,234,199, 21, 35,191,245, 17, 75, 63,252,120
|
||||
,108, 58,223,209,199, 74,141, 91,254,131, 98, 70,255,212, 69, 42, 71,254,172, 54
|
||||
,127,252,116,107,255,168,212,194, 64, 61,126, 46,224,170, 52, 71,208,229, 19,209
|
||||
,148, 64,203,225,206,126, 29,230, 1,134,123,159,138,246, 67,199, 93,127,253, 50
|
||||
,148, 81, 37, 13, 40,145, 8, 37, 12, 6, 4, 49, 67,204,186,186,255,255,213,149
|
||||
,149,137, 16,132,162, 8,128, 90, 58, 93, 95,255,121,138, 96,161,131, 3, 33,200
|
||||
,118,127,255,238, 83, 5, 10, 8,228, 58, 47,255,252,197, 48, 96,104,116, 84, 84
|
||||
, 69,255,251, 24, 40, 80, 74, 69, 69, 64, 96,193, 7,141, 1, 89,203, 5,113, 81
|
||||
, 70,255,245,139, 85, 76, 65, 77, 69, 51, 46, 57, 57, 46, 53, 85, 85, 85, 85, 85
|
||||
, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
|
||||
, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
|
||||
, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85
|
||||
};
|
||||
#endif /* SIMULATOR */
|
||||
#else
|
||||
/* raw PCM */
|
||||
static signed short tick_sound[] =
|
||||
{
|
||||
|
@ -641,7 +504,6 @@ static signed short tock_sound[] =
|
|||
,-3,2,-1,0,1,-1,0,0,1,-1,1
|
||||
,-2,3
|
||||
};
|
||||
#endif
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
Utilities from pdbox plugin (Copyright (C) 2009 Wincent Balin) --- am I
|
||||
|
@ -941,51 +803,6 @@ static int bpm_step_counter = 0;
|
|||
|
||||
static bool sound_trigger = false;
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
|
||||
#ifdef SIMULATOR
|
||||
|
||||
/* No audio in HWCODEC simulator build. */
|
||||
#define MET_IS_PLAYING 0
|
||||
#define MET_PLAY_STOP do {} while(0)
|
||||
static void play_tick(void){ printf("tick\n"); }
|
||||
static void play_tock(void){ printf("tock\n"); }
|
||||
|
||||
#else
|
||||
|
||||
#define MET_IS_PLAYING rb->mp3_is_playing()
|
||||
#define MET_PLAY_STOP rb->mp3_play_stop()
|
||||
|
||||
static void callback(const void** start, size_t* size)
|
||||
{
|
||||
(void)start; /* unused parameter, avoid warning */
|
||||
*size = 0; /* end of data */
|
||||
sound_active = false;
|
||||
rb->led(0);
|
||||
}
|
||||
|
||||
/* Wondering: Should one prevent playing again while sound_active == true? */
|
||||
|
||||
static void play_tick(void)
|
||||
{
|
||||
sound_active = true;
|
||||
rb->led(1);
|
||||
rb->mp3_play_data(tick_sound, sizeof(tick_sound), callback);
|
||||
rb->mp3_play_pause(true); /* kickoff audio */
|
||||
}
|
||||
|
||||
static void play_tock(void)
|
||||
{
|
||||
sound_active = true;
|
||||
rb->led(1);
|
||||
rb->mp3_play_data(tock_sound, sizeof(tock_sound), callback);
|
||||
rb->mp3_play_pause(true); /* kickoff audio */
|
||||
}
|
||||
|
||||
#endif /* SIMULATOR */
|
||||
|
||||
#else /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#define MET_IS_PLAYING rb->pcm_is_playing()
|
||||
#define MET_PLAY_STOP rb->audio_stop()
|
||||
|
||||
|
@ -1014,8 +831,6 @@ static void play_tock(void)
|
|||
rb->pcm_play_data(NULL, NULL, tock_buf, sizeof(tock_buf));
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
|
||||
/* State: 0: blank/title, 1: tick, 2: tock 3: silent klick */
|
||||
/* TODO: Could use more smart placement, using
|
||||
lcd_getstringsize() and such. */
|
||||
|
@ -1446,9 +1261,7 @@ static void cleanup(void)
|
|||
MET_PLAY_STOP; /* stop audio ISR */
|
||||
tweak_volume(0);
|
||||
rb->led(0);
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1786,12 +1599,6 @@ enum plugin_status plugin_start(const void* file)
|
|||
|
||||
if(MET_IS_PLAYING) MET_PLAY_STOP; /* stop audio IS */
|
||||
|
||||
#if (CONFIG_CODEC != SWCODEC)
|
||||
#ifndef SIMULATOR
|
||||
rb->bitswap(tick_sound, sizeof(tick_sound));
|
||||
rb->bitswap(tock_sound, sizeof(tock_sound));
|
||||
#endif
|
||||
#else
|
||||
prepare_buffers();
|
||||
#if INPUT_SRC_CAPS != 0
|
||||
/* Select playback */
|
||||
|
@ -1799,7 +1606,6 @@ enum plugin_status plugin_start(const void* file)
|
|||
rb->audio_set_output_source(AUDIO_SRC_PLAYBACK);
|
||||
#endif
|
||||
rb->pcm_set_frequency(SAMPR_44);
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
|
||||
if(file)
|
||||
{
|
||||
|
|
|
@ -1245,7 +1245,6 @@ static void display_options(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
static void audio_options(void)
|
||||
{
|
||||
int selected = 0;
|
||||
|
@ -1307,7 +1306,6 @@ static void audio_options(void)
|
|||
menu_quit = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void resume_options(void)
|
||||
{
|
||||
|
|
|
@ -902,19 +902,11 @@ static int last_right;
|
|||
|
||||
static void get_peaks(int *left, int *right)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
static struct pcm_peaks peaks;
|
||||
rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
|
||||
&peaks);
|
||||
*left = peaks.left;
|
||||
*right = peaks.right;
|
||||
#elif defined (SIMULATOR)
|
||||
*left = rand() % 0x8000;
|
||||
*right = rand() % 0x8000;
|
||||
#else
|
||||
*left = 0;
|
||||
*right = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static long get_next_delay(void)
|
||||
|
|
|
@ -112,13 +112,9 @@ static bool file_properties(const char* selected_file)
|
|||
|
||||
num_properties = 5;
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
int fd = rb->open(selected_file, O_RDONLY);
|
||||
if (fd >= 0 &&
|
||||
rb->get_metadata(&id3, fd, selected_file))
|
||||
#else
|
||||
if (!rb->mp3info(&id3, selected_file))
|
||||
#endif
|
||||
{
|
||||
long dur = id3.length / 1000; /* seconds */
|
||||
rb->snprintf(str_artist, sizeof str_artist,
|
||||
|
@ -145,9 +141,7 @@ static bool file_properties(const char* selected_file)
|
|||
num_properties++;
|
||||
}
|
||||
}
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
rb->close(fd);
|
||||
#endif
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -7,8 +7,6 @@ struct pcm pcm IBSS_ATTR;
|
|||
#define N_BUFS 2
|
||||
#define BUF_SIZE 2048
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
||||
bool doneplay=1;
|
||||
bool bufnum=0;
|
||||
|
||||
|
@ -88,27 +86,3 @@ int rockboy_pcm_submit(void)
|
|||
pcm.pos = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void rockboy_pcm_init(void)
|
||||
{
|
||||
pcm.hz = 44100;
|
||||
pcm.stereo = 1;
|
||||
pcm.buf = NULL;
|
||||
pcm.len = 0;
|
||||
pcm.pos = 0;
|
||||
}
|
||||
|
||||
void rockboy_pcm_close(void)
|
||||
{
|
||||
memset(&pcm, 0, sizeof pcm);
|
||||
}
|
||||
|
||||
int rockboy_pcm_submit(void)
|
||||
{
|
||||
pcm.pos =0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -220,7 +220,6 @@ static int plugin_main(void)
|
|||
rb->sleep(1);
|
||||
rb->lcd_clear_display();
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
/* This will make the stars pulse to the music */
|
||||
if(pulse){
|
||||
|
||||
|
@ -255,7 +254,7 @@ static int plugin_main(void)
|
|||
starfield.z_move = avg_peak;
|
||||
|
||||
} /* if pulse */
|
||||
#endif
|
||||
|
||||
starfield_move_and_draw(&starfield);
|
||||
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
|
|
|
@ -469,10 +469,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
|
||||
#define mas_codec_readreg(x) rand()%MAX_PEAK
|
||||
#endif
|
||||
|
||||
/* Defines x positions on a logarithmic (dBfs) scale. */
|
||||
unsigned char analog_db_scale[LCD_WIDTH/2];
|
||||
|
||||
|
@ -780,13 +776,11 @@ static void draw_digital_minimeters(void) {
|
|||
|
||||
static void analog_meter(void) {
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
static struct pcm_peaks peaks;
|
||||
rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
|
||||
&peaks);
|
||||
#define left_peak peaks.left
|
||||
#define right_peak peaks.right
|
||||
#endif
|
||||
|
||||
if(vumeter_settings.analog_use_db_scale) {
|
||||
left_needle_top_x = analog_db_scale[left_peak * half_width / MAX_PEAK];
|
||||
|
@ -837,13 +831,11 @@ static void analog_meter(void) {
|
|||
}
|
||||
|
||||
static void digital_meter(void) {
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
static struct pcm_peaks peaks;
|
||||
rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
|
||||
&peaks);
|
||||
#define left_peak peaks.left
|
||||
#define right_peak peaks.right
|
||||
#endif
|
||||
|
||||
if(vumeter_settings.digital_use_db_scale) {
|
||||
num_left_leds = digital_db_scale[left_peak * 44 / MAX_PEAK];
|
||||
|
|
|
@ -290,7 +290,7 @@ static void options_menu(void){
|
|||
no_yes, 2, NULL);
|
||||
if (new_setting != settings.sound )
|
||||
settings.sound=new_setting;
|
||||
#if CONFIG_CODEC == SWCODEC && !defined SIMULATOR
|
||||
#if !defined SIMULATOR
|
||||
rb->pcm_play_stop();
|
||||
#endif
|
||||
break;
|
||||
|
@ -318,7 +318,7 @@ static void options_menu(void){
|
|||
/* menu */
|
||||
static bool zxbox_menu(void)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC && !defined SIMULATOR
|
||||
#if !defined SIMULATOR
|
||||
rb->pcm_play_stop();
|
||||
#endif
|
||||
int selected=0;
|
||||
|
|
|
@ -104,7 +104,7 @@ grey_show(false);
|
|||
grey_release();
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC && !defined SIMULATOR
|
||||
#if !defined SIMULATOR
|
||||
rb->pcm_play_stop();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ extern int intkeys[5];
|
|||
#define SPECT_MEM 1
|
||||
|
||||
/* Define if sound driver is available. */
|
||||
#if CONFIG_CODEC == SWCODEC && !defined SIMULATOR
|
||||
#if !defined SIMULATOR
|
||||
#define HAVE_SOUND
|
||||
#endif
|
||||
|
||||
|
|
|
@ -54,9 +54,7 @@
|
|||
#include "viewport.h"
|
||||
#include "skin_engine/skin_engine.h"
|
||||
#include "statusbar-skinned.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "playback.h"
|
||||
#endif
|
||||
#include "presets.h"
|
||||
|
||||
#if CONFIG_TUNER
|
||||
|
@ -353,14 +351,6 @@ void radio_screen(void)
|
|||
int lastbutton = BUTTON_NONE;
|
||||
unsigned long rec_lastclick = 0;
|
||||
#endif
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
int timeout = current_tick + HZ/10;
|
||||
#if !defined(SIMULATOR)
|
||||
unsigned int last_seconds = 0;
|
||||
unsigned int seconds = 0;
|
||||
struct audio_recording_options rec_options;
|
||||
#endif /* SIMULATOR */
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
#ifndef HAVE_NOISY_IDLE_MODE
|
||||
int button_timeout = current_tick + (2*HZ);
|
||||
#endif
|
||||
|
@ -383,29 +373,7 @@ void radio_screen(void)
|
|||
|
||||
fms_fix_displays(FMS_ENTER);
|
||||
|
||||
#ifndef SIMULATOR
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
rec_create_directory();
|
||||
audio_init_recording();
|
||||
|
||||
sound_settings_apply();
|
||||
/* Yes, we use the D/A for monitoring */
|
||||
peak_meter_playback(true);
|
||||
|
||||
peak_meter_enable(true);
|
||||
|
||||
rec_init_recording_options(&rec_options);
|
||||
rec_options.rec_source = AUDIO_SRC_LINEIN;
|
||||
rec_set_recording_options(&rec_options);
|
||||
|
||||
audio_set_recording_gain(sound_default(SOUND_LEFT_GAIN),
|
||||
sound_default(SOUND_RIGHT_GAIN), AUDIO_GAIN_LINEIN);
|
||||
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
#endif /* ndef SIMULATOR */
|
||||
/* turn on radio */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* This should be done before touching audio settings */
|
||||
while (!pcm_is_initialized())
|
||||
sleep(0);
|
||||
|
@ -413,10 +381,6 @@ void radio_screen(void)
|
|||
audio_set_input_source(AUDIO_SRC_FMRADIO,
|
||||
(radio_status == FMRADIO_PAUSED) ?
|
||||
SRCF_FMRADIO_PAUSED : SRCF_FMRADIO_PLAYING);
|
||||
#else
|
||||
if (radio_status == FMRADIO_OFF)
|
||||
radio_start();
|
||||
#endif
|
||||
|
||||
if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN)))
|
||||
presets_scan(NULL);
|
||||
|
@ -468,13 +432,6 @@ void radio_screen(void)
|
|||
switch(button)
|
||||
{
|
||||
case ACTION_FM_STOP:
|
||||
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
|
||||
if(audio_status() == AUDIO_STATUS_RECORD)
|
||||
{
|
||||
audio_stop();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
done = true;
|
||||
if(presets_have_changed())
|
||||
|
@ -513,18 +470,11 @@ void radio_screen(void)
|
|||
rec_command(RECORDING_CMD_START);
|
||||
update_type = SKIN_REFRESH_ALL;
|
||||
}
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
last_seconds = 0;
|
||||
#endif
|
||||
#endif /* SIMULATOR */
|
||||
break;
|
||||
#endif /* #ifdef FM_RECORD */
|
||||
|
||||
case ACTION_FM_EXIT:
|
||||
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
|
||||
if(audio_status() == AUDIO_STATUS_RECORD)
|
||||
audio_stop();
|
||||
#endif
|
||||
keep_playing = true;
|
||||
done = true;
|
||||
if(presets_have_changed())
|
||||
|
@ -629,10 +579,6 @@ void radio_screen(void)
|
|||
#endif /* FM_FREEZE */
|
||||
|
||||
case SYS_USB_CONNECTED:
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
/* Only accept USB connection when not recording */
|
||||
if(audio_status() != AUDIO_STATUS_RECORD)
|
||||
#endif
|
||||
{
|
||||
default_event_handler(SYS_USB_CONNECTED);
|
||||
screen_freeze = true; /* Cosmetic: makes sure the
|
||||
|
@ -688,10 +634,6 @@ void radio_screen(void)
|
|||
default_event_handler(button);
|
||||
if (!tuner_get(RADIO_PRESENT))
|
||||
{
|
||||
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
|
||||
if(audio_status() == AUDIO_STATUS_RECORD)
|
||||
audio_stop();
|
||||
#endif
|
||||
keep_playing = false;
|
||||
done = true;
|
||||
if(presets_have_changed())
|
||||
|
@ -713,21 +655,10 @@ void radio_screen(void)
|
|||
lastbutton = button;
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
peak_meter_peek();
|
||||
#endif
|
||||
|
||||
if(!screen_freeze)
|
||||
{
|
||||
/* Only display the peak meter when not recording */
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if(TIME_AFTER(current_tick, timeout))
|
||||
{
|
||||
timeout = current_tick + HZ;
|
||||
#else /* SWCODEC */
|
||||
{
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/* keep "mono" from always being displayed when paused */
|
||||
if (radio_status != FMRADIO_PAUSED)
|
||||
{
|
||||
|
@ -742,15 +673,8 @@ void radio_screen(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
|
||||
seconds = audio_recorded_time() / HZ;
|
||||
if (update_type || seconds > last_seconds)
|
||||
{
|
||||
last_seconds = seconds;
|
||||
#else
|
||||
if (update_type)
|
||||
{
|
||||
#endif
|
||||
FOR_NB_SCREENS(i)
|
||||
skin_update(FM_SCREEN, i, update_type);
|
||||
if (update_type == (int)SKIN_REFRESH_ALL)
|
||||
|
@ -774,13 +698,6 @@ void radio_screen(void)
|
|||
enqueue);
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if(audio_status() & AUDIO_STATUS_ERROR)
|
||||
{
|
||||
done = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_NOISY_IDLE_MODE
|
||||
if (TIME_AFTER(current_tick, button_timeout))
|
||||
{
|
||||
|
@ -790,23 +707,6 @@ void radio_screen(void)
|
|||
} /*while(!done)*/
|
||||
|
||||
#ifndef SIMULATOR
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if(audio_status() & AUDIO_STATUS_ERROR)
|
||||
{
|
||||
splash(0, str(LANG_DISK_FULL));
|
||||
audio_error_clear();
|
||||
|
||||
while(1)
|
||||
{
|
||||
button = get_action(CONTEXT_FM|ALLOW_SOFTLOCK, TIMEOUT_BLOCK);
|
||||
if(button == ACTION_FM_STOP)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
audio_init_playback();
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
|
||||
sound_settings_apply();
|
||||
#endif /* SIMULATOR */
|
||||
|
||||
|
@ -814,23 +714,12 @@ void radio_screen(void)
|
|||
{
|
||||
/* Catch FMRADIO_PLAYING status for the sim. */
|
||||
#ifndef SIMULATOR
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
/* Enable the Left and right A/D Converter */
|
||||
audio_set_recording_gain(sound_default(SOUND_LEFT_GAIN),
|
||||
sound_default(SOUND_RIGHT_GAIN),
|
||||
AUDIO_GAIN_LINEIN);
|
||||
mas_codec_writereg(6, 0x4000);
|
||||
#endif
|
||||
end_search();
|
||||
#endif /* SIMULATOR */
|
||||
}
|
||||
else
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
audio_set_input_source(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK);
|
||||
#else
|
||||
radio_stop();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef HAVE_NOISY_IDLE_MODE
|
||||
|
|
|
@ -48,9 +48,6 @@ char* default_radio_skin(enum screen_type screen)
|
|||
"%Sx(Mode:) %?tm<%Sx(Scan)|%Sx(Preset)>\n"
|
||||
#ifdef HAVE_RADIO_RSSI
|
||||
"%Sx(Signal strength:) %tr dBuV\n"
|
||||
#endif
|
||||
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
|
||||
"%?Rr<%Sx(Time:) %Rh:%Rn:%Rs|%?St(prerecording time)<%pm|%Sx(Prerecord Time) %Rs>>\n"
|
||||
#endif
|
||||
"%pb\n"
|
||||
#ifdef HAVE_RDS_CAP
|
||||
|
|
|
@ -40,10 +40,6 @@ const unsigned char bitmap_icons_5x8[][5] =
|
|||
{0x7f, 0x22, 0x1c, 0x22, 0x7f}, /* Stereo recording */
|
||||
[Icon_Mono] =
|
||||
{0x00, 0x1c, 0x22, 0x7f, 0x00}, /* Mono recording */
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
[Icon_q] =
|
||||
{0x1e, 0x21, 0x31, 0x21, 0x5e} /* Q icon */
|
||||
#endif
|
||||
};
|
||||
|
||||
const unsigned char bitmap_icons_7x8[][7] =
|
||||
|
@ -68,7 +64,7 @@ const unsigned char bitmap_icons_7x8[][7] =
|
|||
{0x7f,0x04,0x4e,0x5f,0x44,0x38,0x7f} /* Repeat-AB playmode */
|
||||
};
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING)
|
||||
#if defined(HAVE_RECORDING)
|
||||
const unsigned char bitmap_glyphs_4x8[][4] =
|
||||
{
|
||||
/* Keep digits together and first! */
|
||||
|
@ -116,7 +112,7 @@ const unsigned char bitmap_formats_18x8[Format_18x8Last][18]=
|
|||
{0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x0a,
|
||||
0x0a, 0x0a, 0x3c, 0x00, 0x0e, 0x10, 0x20, 0x10, 0x0e}, /* WAV */
|
||||
};
|
||||
#endif /* CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) */
|
||||
#endif /* defined(HAVE_RECORDING) */
|
||||
|
||||
/* Disk/MMC activity */
|
||||
const unsigned char bitmap_icon_disk[12] =
|
||||
|
|
|
@ -42,9 +42,6 @@ enum icons_5x8 {
|
|||
Icon_Lock_Remote,
|
||||
Icon_Stereo,
|
||||
Icon_Mono,
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
Icon_q,
|
||||
#endif
|
||||
Icon5x8Last
|
||||
};
|
||||
|
||||
|
@ -70,7 +67,7 @@ enum icons_7x8 {
|
|||
Icon7x8Last
|
||||
};
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING)
|
||||
#if defined (HAVE_RECORDING)
|
||||
#define BM_GLYPH_WIDTH 4
|
||||
enum Glyphs_4x8 {
|
||||
Glyph_4x8_0 = 0,
|
||||
|
@ -100,7 +97,7 @@ enum rec_format_18x8 {
|
|||
};
|
||||
extern const unsigned char bitmap_formats_18x8[Format_18x8Last][18];
|
||||
|
||||
#endif /* CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) */
|
||||
#endif /* defined (HAVE_RECORDING) */
|
||||
|
||||
extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5];
|
||||
extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7];
|
||||
|
|
|
@ -1218,16 +1218,12 @@ static void kbd_move_cursor(struct edit_state *state, int dir)
|
|||
else if (state->editpos > state->len_utf8)
|
||||
{
|
||||
state->editpos = 0;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (global_settings.talk_menu) beep_play(1000, 150, 1500);
|
||||
#endif
|
||||
}
|
||||
else if (state->editpos < 0)
|
||||
{
|
||||
state->editpos = state->len_utf8;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (global_settings.talk_menu) beep_play(1000, 150, 1500);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
#include "config.h"
|
||||
#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
|
||||
#include <stdlib.h> /* sim uses rand for peakmeter simulation */
|
||||
#endif
|
||||
#include "thread.h"
|
||||
#include "kernel.h"
|
||||
#include "settings.h"
|
||||
|
@ -42,7 +39,6 @@
|
|||
#endif
|
||||
#include "action.h"
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "pcm.h"
|
||||
#include "pcm_mixer.h"
|
||||
|
||||
|
@ -50,17 +46,12 @@
|
|||
#include "pcm_record.h"
|
||||
#endif
|
||||
|
||||
#if !(CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||
static bool pm_playback = true; /* selects between playback and recording peaks */
|
||||
#endif
|
||||
|
||||
static struct meter_scales scales[NB_SCREENS];
|
||||
|
||||
#if !defined(SIMULATOR) && CONFIG_CODEC != SWCODEC
|
||||
/* Data source */
|
||||
static int pm_src_left = MAS_REG_DQPEAK_L;
|
||||
static int pm_src_right = MAS_REG_DQPEAK_R;
|
||||
#endif
|
||||
|
||||
/* Current values and cumulation */
|
||||
static int pm_cur_left; /* current values (last peak_meter_peek) */
|
||||
static int pm_cur_right;
|
||||
|
@ -554,16 +545,8 @@ void peak_meter_playback(bool playback)
|
|||
{
|
||||
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||
(void)playback;
|
||||
#elif CONFIG_CODEC == SWCODEC
|
||||
pm_playback = playback;
|
||||
#else
|
||||
if (playback) {
|
||||
pm_src_left = MAS_REG_DQPEAK_L;
|
||||
pm_src_right = MAS_REG_DQPEAK_R;
|
||||
} else {
|
||||
pm_src_left = MAS_REG_QPEAK_L;
|
||||
pm_src_right = MAS_REG_QPEAK_R;
|
||||
}
|
||||
pm_playback = playback;
|
||||
#endif
|
||||
/* reset the scales just in case recording and playback
|
||||
use different viewport sizes. Normally we should be checking viewport
|
||||
|
@ -599,7 +582,10 @@ void peak_meter_peek(void)
|
|||
bool was_clipping = pm_clip_left || pm_clip_right;
|
||||
#endif
|
||||
/* read current values */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||
pm_cur_left = left = 8000;
|
||||
pm_cur_right = right = 9000;
|
||||
#else
|
||||
if (pm_playback)
|
||||
{
|
||||
static struct pcm_peaks chan_peaks; /* *MUST* be static */
|
||||
|
@ -614,14 +600,6 @@ void peak_meter_peek(void)
|
|||
#endif
|
||||
left = pm_cur_left;
|
||||
right = pm_cur_right;
|
||||
#else
|
||||
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||
pm_cur_left = left = mas_codec_readreg(pm_src_left);
|
||||
pm_cur_right = right = mas_codec_readreg(pm_src_right);
|
||||
#else
|
||||
pm_cur_left = left = 8000;
|
||||
pm_cur_right = right = 9000;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* check for clips
|
||||
|
@ -632,22 +610,12 @@ void peak_meter_peek(void)
|
|||
a real clip. For software codecs, the peak is already
|
||||
the max of a bunch of samples, so use one max value
|
||||
or you fail to detect clipping! */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (left == MAX_PEAK - 1) {
|
||||
#else
|
||||
if ((left == pm_max_left) &&
|
||||
(left == MAX_PEAK - 1)) {
|
||||
#endif
|
||||
pm_clip_left = true;
|
||||
pm_clip_timeout_l = current_tick + pm_clip_hold;
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (right == MAX_PEAK - 1) {
|
||||
#else
|
||||
if ((right == pm_max_right) &&
|
||||
(right == MAX_PEAK - 1)) {
|
||||
#endif
|
||||
pm_clip_right = true;
|
||||
pm_clip_timeout_r = current_tick + pm_clip_hold;
|
||||
}
|
||||
|
@ -668,14 +636,12 @@ void peak_meter_peek(void)
|
|||
pm_max_right = MAX(pm_max_right, right);
|
||||
|
||||
#ifdef HAVE_RECORDING
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Ignore any unread peakmeter data */
|
||||
#define MAX_DROP_TIME HZ/7 /* this value may need tweaking. Increase if you are
|
||||
getting trig events when you shouldn't with
|
||||
trig_stp_hold = 0 */
|
||||
if (!trig_stp_hold)
|
||||
trig_stp_hold = MAX_DROP_TIME;
|
||||
#endif
|
||||
|
||||
switch (trig_status) {
|
||||
case TRIG_READY:
|
||||
|
@ -735,11 +701,7 @@ void peak_meter_peek(void)
|
|||
|| (right > trig_stp_threshold)) {
|
||||
/* restart hold time countdown */
|
||||
trig_lowtime = current_tick;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
} else if (current_tick - trig_lowtime > MAX_DROP_TIME){
|
||||
#else
|
||||
} else {
|
||||
#endif
|
||||
set_trig_status(TRIG_POSTREC);
|
||||
trig_hightime = current_tick;
|
||||
}
|
||||
|
@ -797,11 +759,9 @@ void peak_meter_peek(void)
|
|||
}
|
||||
break;
|
||||
}
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* restore stop hold value */
|
||||
if (trig_stp_hold == MAX_DROP_TIME)
|
||||
trig_stp_hold = 0;
|
||||
#endif
|
||||
#endif
|
||||
/* check levels next time peakmeter drawn */
|
||||
level_check = true;
|
||||
|
@ -822,11 +782,6 @@ static int peak_meter_read_l(void)
|
|||
by peak_meter_peek since the last call of peak_meter_read_l */
|
||||
int retval;
|
||||
|
||||
#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
|
||||
srand(current_tick);
|
||||
pm_max_left = rand()%MAX_PEAK;
|
||||
#endif
|
||||
|
||||
retval = pm_max_left;
|
||||
|
||||
#if defined(HAVE_HISTOGRAM) || defined(HAVE_AGC)
|
||||
|
@ -855,11 +810,6 @@ static int peak_meter_read_r(void)
|
|||
by peak_meter_peek since the last call of peak_meter_read_r */
|
||||
int retval;
|
||||
|
||||
#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
|
||||
srand(current_tick);
|
||||
pm_max_right = rand()%MAX_PEAK;
|
||||
#endif
|
||||
|
||||
retval = pm_max_right;
|
||||
|
||||
#if defined(HAVE_HISTOGRAM) || defined(HAVE_AGC)
|
||||
|
@ -1128,11 +1078,7 @@ static void peak_meter_draw(struct screen *display, struct meter_scales *scales,
|
|||
/* cliplight */
|
||||
if ((pm_clip_left || pm_clip_right) &&
|
||||
global_settings.cliplight &&
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
!pm_playback)
|
||||
#else
|
||||
!(audio_status() & (AUDIO_STATUS_PLAY | AUDIO_STATUS_ERROR)))
|
||||
#endif
|
||||
{
|
||||
/* if clipping, cliplight setting on and in recording screen */
|
||||
if (global_settings.cliplight <= 2)
|
||||
|
@ -1375,16 +1321,7 @@ int peak_meter_draw_get_btn(int action_context, int x[], int y[],
|
|||
long next_refresh = current_tick;
|
||||
long next_big_refresh = current_tick + HZ / 10;
|
||||
int i;
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
bool highperf = false;
|
||||
#else
|
||||
/* On MAS targets, we need to poll as often as possible in order to not
|
||||
* miss a peak, as the MAS does only provide a quasi-peak. When the disk
|
||||
* is active, it must not draw too much CPU power or a buffer overrun can
|
||||
* happen when saving a recording. As a compromise, poll only once per tick
|
||||
* when the disk is active, otherwise spin around as fast as possible. */
|
||||
bool highperf = !storage_disk_is_active();
|
||||
#endif
|
||||
bool dopeek = true;
|
||||
|
||||
while (TIME_BEFORE(current_tick, next_big_refresh)) {
|
||||
|
|
|
@ -31,17 +31,14 @@
|
|||
#include "lcd.h"
|
||||
#include "led.h"
|
||||
#include "audio.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "thread.h"
|
||||
#include "enc_config.h"
|
||||
#include "playback.h"
|
||||
#if defined(HAVE_SPDIF_IN) || defined(HAVE_SPDIF_OUT)
|
||||
#include "spdif.h"
|
||||
#endif
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
#include "pcm_record.h"
|
||||
#include "recording.h"
|
||||
#include "mp3_playback.h"
|
||||
#include "button.h"
|
||||
#include "kernel.h"
|
||||
#include "settings.h"
|
||||
|
@ -166,19 +163,9 @@ static bool update_list = false; /* (GIU) list needs updating */
|
|||
static int file_number = -1;
|
||||
#endif /* CONFIG_RTC */
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
||||
#define REC_FILE_ENDING(rec_format) \
|
||||
(audio_formats[rec_format_afmt[rec_format]].ext_list)
|
||||
|
||||
#else /* CONFIG_CODEC != SWCODEC */
|
||||
|
||||
/* default record file extension for HWCODEC */
|
||||
#define REC_FILE_ENDING(rec_format) \
|
||||
(audio_formats[AFMT_MPA_L3].ext_list)
|
||||
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
/* path for current file */
|
||||
static char path_buffer[MAX_PATH];
|
||||
|
||||
|
@ -607,18 +594,12 @@ void rec_init_recording_options(struct audio_recording_options *options)
|
|||
options->rec_frequency = global_settings.rec_frequency;
|
||||
options->rec_channels = global_settings.rec_channels;
|
||||
options->rec_prerecord_time = global_settings.rec_prerecord_time;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
options->rec_mono_mode = global_settings.rec_mono_mode;
|
||||
options->rec_source_flags = 0;
|
||||
options->enc_config.rec_format = global_settings.rec_format;
|
||||
global_to_encoder_config(&options->enc_config);
|
||||
#else
|
||||
options->rec_quality = global_settings.rec_quality;
|
||||
options->rec_editable = global_settings.rec_editable;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
void rec_set_source(int source, unsigned flags)
|
||||
{
|
||||
/* Set audio input source, power up/down devices */
|
||||
|
@ -628,14 +609,11 @@ void rec_set_source(int source, unsigned flags)
|
|||
peak_meter_playback((flags & SRCF_RECORDING) == 0);
|
||||
peak_meter_enable(true);
|
||||
}
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
void rec_set_recording_options(struct audio_recording_options *options)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
rec_set_source(options->rec_source,
|
||||
options->rec_source_flags | SRCF_RECORDING);
|
||||
#endif
|
||||
audio_set_recording_options(options);
|
||||
}
|
||||
|
||||
|
@ -646,9 +624,7 @@ void rec_command(enum recording_command cmd)
|
|||
case RECORDING_CMD_STOP_SHUTDOWN:
|
||||
pm_activate_clipcount(false);
|
||||
audio_stop_recording();
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
audio_close_recording();
|
||||
#endif
|
||||
sys_poweroff();
|
||||
break;
|
||||
case RECORDING_CMD_STOP:
|
||||
|
@ -695,12 +671,6 @@ static void trigger_listener(int trigger_status)
|
|||
if(!(audio_status() & AUDIO_STATUS_RECORD))
|
||||
{
|
||||
rec_status |= RCSTAT_HAVE_RECORDED;
|
||||
rec_command(RECORDING_CMD_START);
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
/* give control to mpeg thread so that it can start
|
||||
recording */
|
||||
yield(); yield(); yield();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* if we're already recording this is a retrigger */
|
||||
|
@ -791,14 +761,9 @@ enum rec_list_items_mono {
|
|||
#ifdef HAVE_SPDIF_REC
|
||||
enum rec_list_items_spdif {
|
||||
ITEM_VOLUME_D = 0,
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
ITEM_SAMPLERATE_D = 6,
|
||||
ITEM_FILENAME_D = 7,
|
||||
ITEM_COUNT_D = 3,
|
||||
#else
|
||||
ITEM_FILENAME_D = 7,
|
||||
ITEM_COUNT_D = 2,
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -892,13 +857,11 @@ static const char* reclist_get_name(int selected_item, void * data,
|
|||
buf3, sizeof(buf3)));
|
||||
break;
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#ifdef HAVE_SPDIF_REC
|
||||
case ITEM_SAMPLERATE_D:
|
||||
snprintf(buffer, buffer_len, "%s: %lu",
|
||||
str(LANG_FREQUENCY), pcm_rec_sample_rate());
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
case ITEM_FILENAME:
|
||||
{
|
||||
|
@ -973,16 +936,12 @@ bool recording_screen(bool no_source)
|
|||
const unsigned long split_seconds = (unsigned) global_settings.rec_timesplit * 60;
|
||||
const unsigned long split_bytes = rec_sizesplit_bytes();
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
int warning_counter = 0;
|
||||
#define WARNING_PERIOD 7
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#ifdef HAVE_SPDIF_REC
|
||||
unsigned long prev_sample_rate = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FMRADIO_REC
|
||||
/* Radio is left on if:
|
||||
|
@ -1030,7 +989,6 @@ bool recording_screen(bool no_source)
|
|||
ata_set_led_enabled(false);
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* hardware samplerate gets messed up so prevent mixer playing */
|
||||
int keyclick = global_settings.keyclick;
|
||||
global_settings.keyclick = 0;
|
||||
|
@ -1039,11 +997,6 @@ bool recording_screen(bool no_source)
|
|||
talk_disable(true);
|
||||
/* audio_init_recording stops anything playing when it takes the audio
|
||||
buffer */
|
||||
#else
|
||||
/* Yes, we use the D/A for monitoring */
|
||||
peak_meter_enable(true);
|
||||
peak_meter_playback(true);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AGC
|
||||
peak_meter_get_peakhold(&peak_l, &peak_r);
|
||||
|
@ -1175,7 +1128,7 @@ bool recording_screen(bool no_source)
|
|||
goto rec_abort;
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC && CONFIG_RTC == 0
|
||||
#if CONFIG_RTC == 0
|
||||
/* If format changed, a new number is required */
|
||||
rec_init_filename();
|
||||
#endif
|
||||
|
@ -1202,12 +1155,8 @@ bool recording_screen(bool no_source)
|
|||
if(global_settings.rec_source == AUDIO_SRC_SPDIF)
|
||||
{
|
||||
listid_to_enum[0] = ITEM_VOLUME_D;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
listid_to_enum[1] = ITEM_SAMPLERATE_D;
|
||||
listid_to_enum[2] = ITEM_FILENAME_D;
|
||||
#else
|
||||
listid_to_enum[1] = ITEM_FILENAME_D;
|
||||
#endif
|
||||
|
||||
gui_synclist_set_nb_items(&lists, ITEM_COUNT_D); /* spdif */
|
||||
}
|
||||
|
@ -1452,10 +1401,6 @@ bool recording_screen(bool no_source)
|
|||
}
|
||||
else
|
||||
{
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
peak_meter_playback(true);
|
||||
peak_meter_enable(false);
|
||||
#endif
|
||||
done = 1;
|
||||
}
|
||||
update_countdown = 0; /* Update immediately */
|
||||
|
@ -1543,11 +1488,7 @@ bool recording_screen(bool no_source)
|
|||
update_countdown = 0; /* Update immediately */
|
||||
break;
|
||||
case ACTION_STD_MENU:
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if(!(audio_stat & AUDIO_STATUS_RECORD))
|
||||
#else
|
||||
if(audio_stat != AUDIO_STATUS_RECORD)
|
||||
#endif
|
||||
{
|
||||
#if (CONFIG_LED == LED_REAL)
|
||||
/* led is restored at begin of loop / end of function */
|
||||
|
@ -1622,7 +1563,6 @@ bool recording_screen(bool no_source)
|
|||
dsize = split_bytes;
|
||||
num_recorded_bytes = audio_num_recorded_bytes();
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if ((audio_stat & AUDIO_STATUS_WARNING)
|
||||
&& (warning_counter++ % WARNING_PERIOD) < WARNING_PERIOD/2)
|
||||
{
|
||||
|
@ -1635,7 +1575,6 @@ bool recording_screen(bool no_source)
|
|||
(unsigned long)pcm_rec_get_warnings());
|
||||
}
|
||||
else
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
if ((global_settings.rec_sizesplit) &&
|
||||
(global_settings.rec_split_method))
|
||||
{
|
||||
|
@ -1657,16 +1596,11 @@ bool recording_screen(bool no_source)
|
|||
|
||||
if(audio_stat & AUDIO_STATUS_PRERECORD)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Tracks amount of prerecorded data in buffer */
|
||||
snprintf(buf, sizeof(buf), "%s (%lu/%ds)...",
|
||||
str(LANG_RECORD_PRERECORD),
|
||||
audio_prerecorded_time() / HZ,
|
||||
global_settings.rec_prerecord_time);
|
||||
#else /* !SWCODEC */
|
||||
snprintf(buf, sizeof(buf), "%s...",
|
||||
str(LANG_RECORD_PRERECORD));
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1782,7 +1716,6 @@ bool recording_screen(bool no_source)
|
|||
}
|
||||
#endif /* HAVE_AGC */
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#ifdef HAVE_SPDIF_REC
|
||||
if((global_settings.rec_source == AUDIO_SRC_SPDIF) &&
|
||||
(prev_sample_rate != pcm_rec_sample_rate()))
|
||||
|
@ -1791,7 +1724,6 @@ bool recording_screen(bool no_source)
|
|||
prev_sample_rate = pcm_rec_sample_rate();
|
||||
update_list = true;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if(update_list)
|
||||
|
@ -1824,11 +1756,9 @@ bool recording_screen(bool no_source)
|
|||
FOR_NB_SCREENS(i)
|
||||
screens[i].update();
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* stop recording first and try to finish saving whatever it can */
|
||||
rec_command(RECORDING_CMD_STOP);
|
||||
audio_close_recording();
|
||||
#endif
|
||||
|
||||
audio_error_clear();
|
||||
|
||||
|
@ -1841,7 +1771,6 @@ bool recording_screen(bool no_source)
|
|||
|
||||
rec_abort:
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
rec_command(RECORDING_CMD_STOP);
|
||||
audio_close_recording();
|
||||
|
||||
|
@ -1861,9 +1790,6 @@ rec_abort:
|
|||
|
||||
/* restore keyclick */
|
||||
global_settings.keyclick = keyclick;
|
||||
#else /* !SWCODEC */
|
||||
audio_init_playback();
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#ifdef HAVE_SPEAKER
|
||||
/* Re-enable speaker */
|
||||
|
@ -1895,12 +1821,10 @@ rec_abort:
|
|||
return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0;
|
||||
} /* recording_screen */
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
void audio_beep(int duration)
|
||||
{
|
||||
/* dummy */
|
||||
(void)duration;
|
||||
}
|
||||
#endif /* #ifdef CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#endif /* HAVE_RECORDING */
|
||||
|
|
|
@ -33,17 +33,14 @@ void settings_apply_trigger(void);
|
|||
/* If true, start recording automatically when recording_sreen() is entered */
|
||||
extern bool recording_start_automatic;
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* handles device powerup, sets audio source and peakmeter mode */
|
||||
void rec_set_source(int source, unsigned flags);
|
||||
#endif /* CONFIG_CODEC == SW_CODEC */
|
||||
|
||||
/* Initializes a recording_options structure with global settings.
|
||||
pass returned data to audio_set_recording_options or
|
||||
rec_set_recording_options */
|
||||
void rec_init_recording_options(struct audio_recording_options *options);
|
||||
/* steals mp3 buffer, sets source and then options */
|
||||
/* SRCF_RECORDING is implied for SWCODEC */
|
||||
void rec_set_recording_options(struct audio_recording_options *options);
|
||||
|
||||
enum recording_command
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "icons.h"
|
||||
#include "font.h"
|
||||
#include "audio.h"
|
||||
#include "mp3_playback.h"
|
||||
#include "usb.h"
|
||||
#include "settings.h"
|
||||
#include "status.h"
|
||||
|
@ -380,10 +379,8 @@ static const int id3_headers[]=
|
|||
LANG_ID3_PLAYLIST,
|
||||
LANG_ID3_BITRATE,
|
||||
LANG_ID3_FREQUENCY,
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
LANG_ID3_TRACK_GAIN,
|
||||
LANG_ID3_ALBUM_GAIN,
|
||||
#endif
|
||||
LANG_FILESIZE,
|
||||
LANG_ID3_PATH,
|
||||
};
|
||||
|
@ -423,7 +420,6 @@ static void say_number_and_spell(char *buf, bool year_style)
|
|||
}
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Say a replaygain ID3 value from its text form */
|
||||
static void say_gain(char *buf)
|
||||
{
|
||||
|
@ -479,7 +475,6 @@ static void say_gain(char *buf)
|
|||
}else /* we didn't find a number, just spell everything */
|
||||
talk_spell(buf, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
static const char * id3_get_or_speak_info(int selected_item, void* data,
|
||||
char *buffer, size_t buffer_len,
|
||||
|
@ -619,7 +614,6 @@ static const char * id3_get_or_speak_info(int selected_item, void* data,
|
|||
if(say_it)
|
||||
talk_value(id3->frequency, UNIT_HERTZ, true);
|
||||
break;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
case LANG_ID3_TRACK_GAIN:
|
||||
replaygain_itoa(buffer, buffer_len, id3->track_level);
|
||||
val=(id3->track_level) ? buffer : NULL; /* only show level!=0 */
|
||||
|
@ -632,7 +626,6 @@ static const char * id3_get_or_speak_info(int selected_item, void* data,
|
|||
if(say_it && val)
|
||||
say_gain(val);
|
||||
break;
|
||||
#endif
|
||||
case LANG_ID3_PATH:
|
||||
val=id3->path;
|
||||
if(say_it && val)
|
||||
|
|
|
@ -226,9 +226,7 @@ static void scrobbler_finish_event(unsigned short id, void *data)
|
|||
|
||||
/* add entry using the currently ending track */
|
||||
if (pending && (te->flags & TEF_CURRENT)
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
&& !(te->flags & TEF_REWIND)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
pending = false;
|
||||
|
|
|
@ -77,14 +77,12 @@
|
|||
struct user_settings global_settings;
|
||||
struct system_status global_status;
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "dsp_proc_settings.h"
|
||||
#include "playback.h"
|
||||
#ifdef HAVE_RECORDING
|
||||
#include "enc_config.h"
|
||||
#endif
|
||||
#include "pcm_sampr.h"
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#define NVRAM_DATA_START 8
|
||||
#ifdef HAVE_RTC_RAM
|
||||
|
@ -589,12 +587,10 @@ static bool settings_write_config(const char* filename, int options)
|
|||
continue;
|
||||
break;
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
case SETTINGS_SAVE_EQPRESET:
|
||||
if ((settings[i].flags&F_EQSETTING) == 0)
|
||||
continue;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
cfg_to_string(i, value, MAX_PATH);
|
||||
|
@ -675,12 +671,10 @@ bool settings_save_config(int options)
|
|||
namebase = "recording";
|
||||
break;
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
case SETTINGS_SAVE_EQPRESET:
|
||||
folder = EQS_DIR;
|
||||
namebase = "eq";
|
||||
break;
|
||||
#endif
|
||||
case SETTINGS_SAVE_SOUND:
|
||||
folder = ROCKBOX_DIR;
|
||||
namebase = "sound";
|
||||
|
@ -982,7 +976,6 @@ void settings_apply(bool read_disk)
|
|||
lcd_scroll_delay(global_settings.scroll_delay);
|
||||
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#ifdef HAVE_PLAY_FREQ
|
||||
/* before crossfade */
|
||||
audio_set_playback_frequency(global_settings.play_frequency);
|
||||
|
@ -1016,7 +1009,6 @@ void settings_apply(bool read_disk)
|
|||
dsp_timestretch_enable(global_settings.timestretch_enabled);
|
||||
#endif
|
||||
dsp_set_compressor(&global_settings.compressor_settings);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SPDIF_POWER
|
||||
spdif_power_enable(global_settings.spdif_enable);
|
||||
|
@ -1068,7 +1060,7 @@ void settings_apply(bool read_disk)
|
|||
#endif
|
||||
|
||||
/* This should stay last */
|
||||
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
|
||||
#if defined(HAVE_RECORDING)
|
||||
enc_global_settings_apply();
|
||||
#endif
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
@ -1114,7 +1106,7 @@ void settings_reset(void)
|
|||
{
|
||||
for(int i=0; i<nb_settings; i++)
|
||||
reset_setting(&settings[i], settings[i].setting);
|
||||
#if defined (HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
|
||||
#if defined (HAVE_RECORDING)
|
||||
enc_global_settings_reset();
|
||||
#endif
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
|
|
@ -30,10 +30,8 @@
|
|||
#include "statusbar.h" /* for the statusbar values */
|
||||
#include "quickscreen.h"
|
||||
#include "button.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "audio.h"
|
||||
#include "dsp_proc_settings.h"
|
||||
#endif
|
||||
#include "rbpaths.h"
|
||||
|
||||
struct opt_items {
|
||||
|
@ -218,9 +216,7 @@ enum {
|
|||
#ifdef HAVE_RECORDING
|
||||
SETTINGS_SAVE_RECPRESETS,
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
SETTINGS_SAVE_EQPRESET,
|
||||
#endif
|
||||
};
|
||||
bool settings_save_config(int options);
|
||||
|
||||
|
@ -307,17 +303,6 @@ struct user_settings
|
|||
int channel_config; /* Stereo, Mono, Custom, Mono left, Mono right, Karaoke */
|
||||
int stereo_width; /* 0-255% */
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
int loudness; /* loudness eq: 0-100 0=off 100=max */
|
||||
int avc; /* auto volume correct: 0=off, 1=20ms, 2=2s 3=4s 4=8s */
|
||||
int mdb_strength; /* 0-127dB */
|
||||
int mdb_harmonics; /* 0-100% */
|
||||
int mdb_center; /* 20-300Hz */
|
||||
int mdb_shape; /* 50-300Hz */
|
||||
bool mdb_enable; /* true/false */
|
||||
bool superbass; /* true/false */
|
||||
#endif
|
||||
|
||||
#ifdef AUDIOHW_HAVE_BASS_CUTOFF
|
||||
int bass_cutoff;
|
||||
#endif
|
||||
|
@ -325,7 +310,6 @@ struct user_settings
|
|||
int treble_cutoff;
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#ifdef HAVE_CROSSFADE
|
||||
/* Crossfade */
|
||||
int crossfade; /* Enable crossfade (0=off, 1=shuffle, 2=trackskip,
|
||||
|
@ -360,10 +344,8 @@ struct user_settings
|
|||
#ifdef HAVE_PITCHCONTROL
|
||||
bool timestretch_enabled;
|
||||
#endif
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#ifdef HAVE_RECORDING
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
int rec_format; /* record format index */
|
||||
int rec_mono_mode; /* how to create mono: L, R, L+R */
|
||||
|
||||
|
@ -377,9 +359,6 @@ struct user_settings
|
|||
#endif
|
||||
/* Encoder Settings End */
|
||||
|
||||
#else
|
||||
int rec_quality; /* 0-7 */
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
int rec_source; /* 0=mic, 1=line, 2=S/PDIF, 2 or 3=FM Radio */
|
||||
int rec_frequency; /* 0 = 44.1kHz (depends on target)
|
||||
1 = 48kHz
|
||||
|
@ -754,9 +733,7 @@ struct user_settings
|
|||
#ifdef HAVE_PITCHCONTROL
|
||||
/* pitch screen settings */
|
||||
bool pitch_mode_semitone;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
bool pitch_mode_timestretch;
|
||||
#endif
|
||||
#endif
|
||||
/* If values are just added to the end, no need to bump plugin API
|
||||
version. */
|
||||
|
@ -778,9 +755,7 @@ struct user_settings
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
struct compressor_settings compressor_settings;
|
||||
#endif
|
||||
|
||||
int sleeptimer_duration; /* In minutes; 0=off */
|
||||
bool sleeptimer_on_startup;
|
||||
|
@ -797,10 +772,8 @@ struct user_settings
|
|||
int hotkey_tree;
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* When resuming playback (after a stop), rewind this number of seconds */
|
||||
int resume_rewind;
|
||||
#endif
|
||||
|
||||
#ifdef AUDIOHW_HAVE_DEPTH_3D
|
||||
int depth_3d;
|
||||
|
@ -830,9 +803,7 @@ struct user_settings
|
|||
#endif /* AUDIOHW_HAVE_EQ */
|
||||
|
||||
#ifdef HAVE_HARDWARE_CLICK
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
bool keyclick_hardware; /* hardware piezo keyclick */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
char start_directory[MAX_PATHNAME+1];
|
||||
|
|
|
@ -310,7 +310,6 @@ static const char graphic_numeric[] = "graphic,numeric";
|
|||
|
||||
#ifdef HAVE_RECORDING
|
||||
/* these should be in the config.h files */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
# ifdef HAVE_UDA1380
|
||||
# define DEFAULT_REC_MIC_GAIN 16
|
||||
# define DEFAULT_REC_LEFT_GAIN 0
|
||||
|
@ -332,7 +331,6 @@ static const char graphic_numeric[] = "graphic,numeric";
|
|||
# define DEFAULT_REC_LEFT_GAIN 0
|
||||
# define DEFAULT_REC_RIGHT_GAIN 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_RECORDING */
|
||||
|
||||
|
@ -472,8 +470,6 @@ static const char* scanaccel_formatter(char *buffer, size_t buffer_size,
|
|||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
||||
static const char* formatter_unit_0_is_off(char *buffer, size_t buffer_size,
|
||||
int val, const char *unit)
|
||||
{
|
||||
|
@ -591,7 +587,6 @@ static void eq_set_default(void* setting, void* defaultval)
|
|||
{
|
||||
memcpy(setting, defaultval, sizeof(struct eq_band_setting));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_QUICKSCREEN
|
||||
static int find_setting_by_name(char*name)
|
||||
|
@ -1213,15 +1208,11 @@ const struct settings_list settings[] = {
|
|||
"seek acceleration", "very fast,fast,normal,slow,very slow", NULL, 5,
|
||||
ID2P(LANG_VERY_FAST), ID2P(LANG_FAST), ID2P(LANG_NORMAL),
|
||||
ID2P(LANG_SLOW) , ID2P(LANG_VERY_SLOW)),
|
||||
#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_DISK_STORAGE)
|
||||
#if defined(HAVE_DISK_STORAGE)
|
||||
TABLE_SETTING(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS, buffer_margin,
|
||||
LANG_MP3BUFFER_MARGIN, 5, "antiskip", NULL, UNIT_SEC,
|
||||
NULL, NULL,
|
||||
NULL,8, 5,15,30,60,120,180,300,600),
|
||||
#elif defined(HAVE_DISK_STORAGE)
|
||||
INT_SETTING(F_TIME_SETTING, buffer_margin, LANG_MP3BUFFER_MARGIN, 0,
|
||||
"antiskip", UNIT_SEC, 0, 7, 1, formatter_time_unit_0_is_off,
|
||||
getlang_time_unit_0_is_off, audio_set_buffer_margin),
|
||||
#endif
|
||||
/* disk */
|
||||
#ifdef HAVE_DISK_STORAGE
|
||||
|
@ -1348,10 +1339,8 @@ const struct settings_list settings[] = {
|
|||
TALK_ID(1792, UNIT_MB)),
|
||||
{F_T_INT|F_RECSETTING, &global_settings.rec_channels, LANG_CHANNELS, INT(0),
|
||||
"rec channels","stereo,mono",UNUSED},
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
{F_T_INT|F_RECSETTING, &global_settings.rec_mono_mode,
|
||||
LANG_RECORDING_MONO_MODE, INT(0), "rec mono mode","L+R,L,R",UNUSED},
|
||||
#endif
|
||||
CHOICE_SETTING(F_RECSETTING, rec_split_type, LANG_SPLIT_TYPE, 0,
|
||||
"rec split type", "Split,Stop,Shutdown", NULL, 3,
|
||||
ID2P(LANG_START_NEW_FILE), ID2P(LANG_STOP_RECORDING),ID2P(LANG_STOP_RECORDING_AND_SHUTDOWN)),
|
||||
|
@ -1398,7 +1387,6 @@ const struct settings_list settings[] = {
|
|||
INT(DEFAULT_REC_RIGHT_GAIN),
|
||||
"rec right gain",NULL,UNUSED},
|
||||
#endif /* DEFAULT_REC_RIGHT_GAIN */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
{F_T_INT|F_RECSETTING,&global_settings.rec_frequency,
|
||||
LANG_FREQUENCY,INT(REC_FREQ_DEFAULT),
|
||||
"rec frequency",REC_FREQ_CFG_VAL_LIST,UNUSED},
|
||||
|
@ -1417,7 +1405,6 @@ const struct settings_list settings[] = {
|
|||
/* wavpack_enc */
|
||||
/* (no settings yet) */
|
||||
/** Encoder settings end **/
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
/* values for the trigger */
|
||||
INT_SETTING(F_RECSETTING, rec_start_thres_db, LANG_RECORD_START_THRESHOLD, -35,
|
||||
"trigger start threshold dB", UNIT_DB, -89, 0, 1, NULL, NULL, NULL),
|
||||
|
@ -1465,7 +1452,6 @@ const struct settings_list settings[] = {
|
|||
LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL),
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
BOOL_SETTING(0, autoresume_enable, LANG_AUTORESUME, false,
|
||||
"autoresume enable", off_on,
|
||||
LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL),
|
||||
|
@ -1478,7 +1464,6 @@ const struct settings_list settings[] = {
|
|||
ID2P(LANG_AUTORESUME_CUSTOM)),
|
||||
TEXT_SETTING(0, autoresume_paths, "autoresume next track paths",
|
||||
"/podcast:/podcasts", NULL, NULL),
|
||||
#endif
|
||||
|
||||
OFFON_SETTING(0, runtimedb, LANG_RUNTIMEDB_ACTIVE, false,
|
||||
"gather runtime data", NULL),
|
||||
|
@ -1486,7 +1471,6 @@ const struct settings_list settings[] = {
|
|||
DEFAULT_TAGCACHE_SCAN_PATHS, NULL, NULL),
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* replay gain */
|
||||
CHOICE_SETTING(F_SOUNDSETTING, replaygain_settings.type,
|
||||
LANG_REPLAYGAIN_MODE, REPLAYGAIN_SHUFFLE, "replaygain type",
|
||||
|
@ -1747,7 +1731,6 @@ const struct settings_list settings[] = {
|
|||
LANG_COMPRESSOR_RELEASE, 500,
|
||||
"compressor release time", UNIT_MS, 100, 1000,
|
||||
100, NULL, NULL, compressor_set),
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#ifdef AUDIOHW_HAVE_BASS_CUTOFF
|
||||
SOUND_SETTING(F_NO_WRAP, bass_cutoff, LANG_BASS_CUTOFF,
|
||||
|
@ -2023,7 +2006,6 @@ const struct settings_list settings[] = {
|
|||
3, "list_accel_wait", UNIT_SEC, 1, 10, 1,
|
||||
scanaccel_formatter, NULL, NULL),
|
||||
#endif /* HAVE_WHEEL_ACCELERATION */
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* keyclick */
|
||||
#ifdef HAVE_HARDWARE_CLICK
|
||||
CHOICE_SETTING(0, keyclick, LANG_KEYCLICK_SOFTWARE, 0,
|
||||
|
@ -2042,7 +2024,6 @@ const struct settings_list settings[] = {
|
|||
OFFON_SETTING(0, keyclick_repeats, LANG_KEYCLICK_REPEATS, false,
|
||||
"keyclick repeats", NULL),
|
||||
#endif
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
TEXT_SETTING(0, playlist_catalog_dir, "playlist catalog directory",
|
||||
PLAYLIST_CATALOG_DEFAULT_DIR, NULL, NULL),
|
||||
INT_SETTING(F_TIME_SETTING, sleeptimer_duration, LANG_SLEEP_TIMER_DURATION,
|
||||
|
@ -2117,11 +2098,9 @@ const struct settings_list settings[] = {
|
|||
#ifdef HAVE_PITCHCONTROL
|
||||
OFFON_SETTING(0, pitch_mode_semitone, LANG_SEMITONE, false,
|
||||
"Semitone pitch change", NULL),
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
OFFON_SETTING(0, pitch_mode_timestretch, LANG_TIMESTRETCH, false,
|
||||
"Timestretch mode", NULL),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USB_ENABLE_HID
|
||||
OFFON_SETTING(0, usb_hid, LANG_USB_HID, true, "usb hid", usb_set_hid),
|
||||
|
@ -2187,11 +2166,9 @@ const struct settings_list settings[] = {
|
|||
HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_INSERT, HOTKEY_INSERT_SHUFFLED),
|
||||
#endif
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
INT_SETTING(F_TIME_SETTING, resume_rewind, LANG_RESUME_REWIND, 0,
|
||||
"resume rewind", UNIT_SEC, 0, 60, 5,
|
||||
formatter_time_unit_0_is_off, getlang_time_unit_0_is_off, NULL),
|
||||
#endif
|
||||
CUSTOM_SETTING(0, root_menu_customized,
|
||||
LANG_ROCKBOX_TITLE, /* lang string here is never actually used */
|
||||
NULL, "root menu order",
|
||||
|
|
|
@ -1779,7 +1779,6 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename)
|
|||
if (id3->bitrate == 0)
|
||||
id3->bitrate = 1;
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (global_settings.autoresume_enable)
|
||||
{
|
||||
id3->elapsed = get_tag_numeric(entry, tag_lastelapsed, idx_id);
|
||||
|
@ -1790,7 +1789,6 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename)
|
|||
logf("tagcache_fill_tags: Set offset for %s to %lX\n",
|
||||
id3->title, id3->offset);
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -879,7 +879,6 @@ static void tagtree_buffer_event(unsigned short id, void *ev_data)
|
|||
logf("-> %ld/%ld", id3->playcount, id3->playtime);
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (autoresume)
|
||||
{
|
||||
/* Load current file resume info if not already defined (by
|
||||
|
@ -900,7 +899,6 @@ static void tagtree_buffer_event(unsigned short id, void *ev_data)
|
|||
str_or_empty(id3->title), id3->offset);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Store our tagcache index pointer. */
|
||||
id3->tagcache_idx = tcs.idx_id+1;
|
||||
|
@ -922,25 +920,20 @@ static void tagtree_track_finish_event(unsigned short id, void *ev_data)
|
|||
}
|
||||
tagcache_idx--;
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC /* HWCODEC doesn't have automatic_skip */
|
||||
bool auto_skip = te->flags & TEF_AUTO_SKIP;
|
||||
#endif
|
||||
bool runtimedb = global_settings.runtimedb;
|
||||
bool autoresume = global_settings.autoresume_enable;
|
||||
|
||||
/* Don't process unplayed tracks, or tracks interrupted within the
|
||||
first 15 seconds but always process autoresume point */
|
||||
if (runtimedb && (id3->elapsed == 0
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|| (id3->elapsed < 15 * 1000 && !auto_skip)
|
||||
#endif
|
||||
))
|
||||
{
|
||||
logf("not db logging unplayed or skipped track");
|
||||
runtimedb = false;
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* 3s because that is the threshold the WPS uses to rewind instead
|
||||
of skip backwards */
|
||||
if (autoresume && (id3->elapsed == 0
|
||||
|
@ -949,7 +942,6 @@ static void tagtree_track_finish_event(unsigned short id, void *ev_data)
|
|||
logf("not logging autoresume");
|
||||
autoresume = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Do not gather data unless proper setting has been enabled and at least
|
||||
one is still slated to be recorded */
|
||||
|
@ -987,7 +979,6 @@ static void tagtree_track_finish_event(unsigned short id, void *ev_data)
|
|||
tagcache_update_numeric(tagcache_idx, tag_lastplayed, lastplayed);
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if (autoresume)
|
||||
{
|
||||
unsigned long elapsed = auto_skip ? 0 : id3->elapsed;
|
||||
|
@ -998,7 +989,6 @@ static void tagtree_track_finish_event(unsigned short id, void *ev_data)
|
|||
logf("tagtree_track_finish_event: Save resume for %s: %lX %lX",
|
||||
str_or_empty(id3->title), elapsed, offset);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int tagtree_export(void)
|
||||
|
|
105
apps/talk.c
105
apps/talk.c
|
@ -32,11 +32,7 @@
|
|||
#include "settings.h"
|
||||
#include "settings_list.h"
|
||||
#include "splash.h"
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
#include "voice_thread.h"
|
||||
#else
|
||||
#include "mp3_playback.h"
|
||||
#endif
|
||||
#include "audio.h"
|
||||
#include "lang.h"
|
||||
#include "talk.h"
|
||||
|
@ -107,7 +103,7 @@ struct voicefile_header /* file format of our voice file */
|
|||
|
||||
/***************** Globals *****************/
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC && MEMORYSIZE <= 2)
|
||||
#if MEMORYSIZE <= 2
|
||||
/* On low memory swcodec targets the entire voice file wouldn't fit in memory
|
||||
* together with codecs, so we load clips each time they are accessed. */
|
||||
#define TALK_PROGRESSIVE_LOAD
|
||||
|
@ -131,15 +127,10 @@ static bool force_enqueue_next; /* enqueue next utterance even if enqueue is fal
|
|||
static int queue_write; /* write index of queue, by application */
|
||||
static int queue_read; /* read index of queue, by ISR context */
|
||||
static enum talk_status talk_status = TALK_STATUS_OK;
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* protects queue_read, queue_write and thumbnail_buf_used */
|
||||
static struct mutex queue_mutex SHAREDBSS_ATTR;
|
||||
#define talk_queue_lock() ({ mutex_lock(&queue_mutex); })
|
||||
#define talk_queue_unlock() ({ mutex_unlock(&queue_mutex); })
|
||||
#else
|
||||
#define talk_queue_lock() ({ })
|
||||
#define talk_queue_unlock() ({ })
|
||||
#endif /* CONFIG_CODEC */
|
||||
static int sent; /* how many bytes handed over to playback, owned by ISR */
|
||||
static unsigned char curr_hd[3]; /* current frame header, for re-sync */
|
||||
static unsigned char last_lang[MAX_FILENAME+1]; /* name of last used lang file (in talk_init) */
|
||||
|
@ -186,16 +177,8 @@ static int move_callback(int handle, void *current, void *new)
|
|||
|
||||
static struct mutex read_buffer_mutex;
|
||||
|
||||
|
||||
/* on HWCODEC only voice xor audio can be active at a time */
|
||||
static bool check_audio_status(void)
|
||||
static inline bool check_audio_status(void)
|
||||
{
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if (audio_status()) /* busy, buffer in use */
|
||||
return false;
|
||||
/* ensure playback is given up on the buffer */
|
||||
audio_hard_stop();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -670,20 +653,16 @@ static bool load_voicefile_data(int fd)
|
|||
return true;
|
||||
}
|
||||
|
||||
/* Use a static buffer to avoid difficulties with buflib during DMA
|
||||
* (hwcodec)/buffer passing to the voice_thread (swcodec). Clips
|
||||
* can be played in chunks so the size is not that important */
|
||||
/* Use a static buffer to avoid difficulties with buflib during
|
||||
* buffer passing to the voice_thread (swcodec). Clips can be played
|
||||
in chunks so the size is not that important */
|
||||
static unsigned char commit_buffer[2<<10];
|
||||
|
||||
static void* commit_transfer(struct queue_entry *qe, size_t *size)
|
||||
{
|
||||
void *buf = NULL; /* shut up gcc */
|
||||
static unsigned char *bufpos = commit_buffer;
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
sent = MIN(qe->remaining, 0xFFFF);
|
||||
#else
|
||||
sent = qe->remaining;
|
||||
#endif
|
||||
sent = MIN((size_t)sent, sizeof(commit_buffer));
|
||||
buf = buflib_get_data(&clip_ctx, qe->handle);
|
||||
/* adjust buffer position to what has been played already */
|
||||
|
@ -706,13 +685,11 @@ static inline bool is_silence(struct queue_entry *qe)
|
|||
static void mp3_callback(const void** start, size_t* size)
|
||||
{
|
||||
struct queue_entry *qe = &queue[queue_read];
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* voice_thread.c hints us how many of the buffer we provided it actually
|
||||
* consumed. Because buffers have to be frame-aligned for speex
|
||||
* it might be less than what we presented */
|
||||
if (*size)
|
||||
sent = *size;
|
||||
#endif
|
||||
qe->remaining -= sent; /* we completed this */
|
||||
|
||||
if (qe->remaining > 0) /* current clip not finished? */
|
||||
|
@ -757,55 +734,7 @@ static void mp3_callback(const void** start, size_t* size)
|
|||
/* stop the playback and the pending clips */
|
||||
void talk_force_shutup(void)
|
||||
{
|
||||
/* Most of this is MAS only */
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
#ifdef SIMULATOR
|
||||
return;
|
||||
#endif
|
||||
unsigned char* pos;
|
||||
unsigned char* search;
|
||||
unsigned char* end;
|
||||
int len;
|
||||
if (QUEUE_LEVEL == 0) /* has ended anyway */
|
||||
return;
|
||||
|
||||
/* search next frame boundary and continue up to there */
|
||||
pos = search = mp3_get_pos();
|
||||
end = buflib_get_data(&clip_ctx, queue[queue_read].handle);
|
||||
len = queue[queue_read].length;
|
||||
|
||||
if (pos >= end && pos <= (end+len)) /* really our clip? */
|
||||
{ /* (for strange reasons this isn't nesessarily the case) */
|
||||
/* find the next frame boundary */
|
||||
while (search < (end+len)) /* search the remaining data */
|
||||
{
|
||||
if (*search++ != 0xFF) /* quick search for frame sync byte */
|
||||
continue; /* (this does the majority of the job) */
|
||||
|
||||
/* look at the (bitswapped) rest of header candidate */
|
||||
if (search[0] == curr_hd[0] /* do the quicker checks first */
|
||||
&& search[2] == curr_hd[2]
|
||||
&& (search[1] & 0x30) == (curr_hd[1] & 0x30)) /* sample rate */
|
||||
{
|
||||
search--; /* back to the sync byte */
|
||||
break; /* From looking at it, this is our header. */
|
||||
}
|
||||
}
|
||||
|
||||
if (search-pos)
|
||||
{ /* play old data until the frame end, to keep the MAS in sync */
|
||||
sent = search-pos;
|
||||
|
||||
queue_write = (queue_read + 1) & QUEUE_MASK; /* will be empty after next callback */
|
||||
queue[queue_read].length = sent; /* current one ends after this */
|
||||
|
||||
thumbnail_buf_used = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
|
||||
/* Either SWCODEC, or MAS had nothing to do (was frame boundary or not our clip) */
|
||||
/* Had nothing to do (was frame boundary or not our clip) */
|
||||
mp3_play_stop();
|
||||
talk_queue_lock();
|
||||
queue_write = queue_read = 0; /* reset the queue */
|
||||
|
@ -885,9 +814,7 @@ void talk_init(void)
|
|||
|
||||
if(!talk_initialized)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
mutex_init(&queue_mutex);
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
mutex_init(&read_buffer_mutex);
|
||||
}
|
||||
|
||||
|
@ -957,11 +884,9 @@ void talk_init(void)
|
|||
|
||||
load_voicefile_data(filehandle);
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Initialize the actual voice clip playback engine as well */
|
||||
if (talk_voice_required())
|
||||
voice_thread_init();
|
||||
#endif
|
||||
|
||||
out:
|
||||
close(filehandle); /* close again, this was just to detect presence */
|
||||
|
@ -1062,9 +987,6 @@ static int _talk_file(const char* filename,
|
|||
int fd;
|
||||
int size;
|
||||
int handle, oldest = -1;
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
struct mp3entry info;
|
||||
#endif
|
||||
|
||||
/* reload needed? */
|
||||
if (talk_temp_disable_count > 0)
|
||||
|
@ -1080,13 +1002,6 @@ static int _talk_file(const char* filename,
|
|||
close(fd);
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if(mp3info(&info, filename)) /* use this to find real start */
|
||||
{
|
||||
return 0; /* failed to open, or invalid */
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!enqueue)
|
||||
/* shutup now to free the thumbnail buffer */
|
||||
talk_shutup();
|
||||
|
@ -1098,10 +1013,6 @@ static int _talk_file(const char* filename,
|
|||
}
|
||||
size = filesize(fd);
|
||||
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
size -= lseek(fd, info.first_frame_offset, SEEK_SET); /* behind ID data */
|
||||
#endif
|
||||
|
||||
/* free clips from cache until this one succeeds to allocate */
|
||||
while ((handle = buflib_alloc(&clip_ctx, size)) < 0)
|
||||
oldest = free_oldest_clip();
|
||||
|
@ -1116,10 +1027,6 @@ static int _talk_file(const char* filename,
|
|||
struct queue_entry clip;
|
||||
clip.handle = handle;
|
||||
clip.length = clip.remaining = size;
|
||||
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
|
||||
/* bitswap doesnt yield() */
|
||||
bitswap(buflib_get_data(&clip_ctx, handle), size);
|
||||
#endif
|
||||
if(prefix_ids)
|
||||
/* prefix thumbnail by speaking these ids, but only now
|
||||
that we know there's actually a thumbnail to be
|
||||
|
|
12
apps/tree.c
12
apps/tree.c
|
@ -650,9 +650,7 @@ static int dirbrowse(void)
|
|||
if (tc.dirlevel < 0)
|
||||
tc.dirlevel = 0; /* shouldnt be needed.. this code needs work! */
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
keyclick_set_callback(gui_synclist_keyclick_callback, &tree_lists);
|
||||
#endif
|
||||
button = get_action(CONTEXT_TREE,
|
||||
list_do_action_timeout(&tree_lists, HZ/2));
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
@ -1175,11 +1173,6 @@ static void say_filetype(int attr)
|
|||
|
||||
static int ft_play_dirname(char* name)
|
||||
{
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if (audio_status() & AUDIO_STATUS_PLAY)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
return talk_file(tc.currdir, name, dir_thumbnail_name, NULL,
|
||||
global_settings.talk_filetype ?
|
||||
TALK_IDARRAY(VOICE_DIR) : NULL,
|
||||
|
@ -1188,11 +1181,6 @@ static int ft_play_dirname(char* name)
|
|||
|
||||
static int ft_play_filename(char *dir, char *file, int attr)
|
||||
{
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
if (audio_status() & AUDIO_STATUS_PLAY)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
if (strlen(file) >= strlen(file_thumbnail_ext)
|
||||
&& strcasecmp(&file[strlen(file) - strlen(file_thumbnail_ext)],
|
||||
file_thumbnail_ext))
|
||||
|
|
|
@ -76,11 +76,9 @@ Core code (Mid-level)
|
|||
:DSP: Michael Sevakis,Thom Johansen
|
||||
:LCD/Graphics API: Jens Arnold
|
||||
:Buffering engine: Nicolas Pennequin
|
||||
:Playback engine (HWCODEC):
|
||||
:Playback engine (SWCODEC): Michael Sevakis, Nicolas Pennequin
|
||||
:PCM playback API (SWCODEC): Michael Sevakis
|
||||
:PCM recording API (SWCODEC): Michael Sevakis
|
||||
:Recording API (HWCODEC):
|
||||
:Playback engine: Michael Sevakis, Nicolas Pennequin
|
||||
:PCM playback API: Michael Sevakis
|
||||
:PCM recording API: Michael Sevakis
|
||||
:Fonts and Unicode:
|
||||
:Replaygain: Magnus Holmgren
|
||||
:Profiling:
|
||||
|
|
|
@ -111,20 +111,20 @@ void audio_resume(void)
|
|||
|
||||
void audio_set_input_source(int source, unsigned flags)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC) && (INPUT_SRC_CAPS != 0)
|
||||
\conditions (INPUT_SRC_CAPS != 0)
|
||||
\param source
|
||||
\param flags
|
||||
\description
|
||||
|
||||
void audio_set_output_source(int monitor)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC) && (INPUT_SRC_CAPS != 0)
|
||||
\conditions (INPUT_SRC_CAPS != 0)
|
||||
\param monitor
|
||||
\description
|
||||
|
||||
void audio_set_recording_gain(int left, int right, int type)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING))
|
||||
\conditions (defined(HAVE_RECORDING))
|
||||
\param left
|
||||
\param right
|
||||
\param type
|
||||
|
@ -191,16 +191,8 @@ unsigned short *bidi_l2v( const unsigned char *str, int orientation )
|
|||
\return
|
||||
\description
|
||||
|
||||
void bitswap(unsigned char *data, int length)
|
||||
\group sound
|
||||
\conditions (!defined(SIMULATOR)) && (CONFIG_CODEC != SWCODEC)
|
||||
\param data
|
||||
\param length
|
||||
\description Swap the bits for each element of array =data= of size =length=
|
||||
|
||||
int bufadvance(int handle_id, off_t offset)
|
||||
\group buffering API
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\param offset
|
||||
\return
|
||||
|
@ -208,7 +200,6 @@ int bufadvance(int handle_id, off_t offset)
|
|||
|
||||
int bufalloc(const void *src, size_t size, enum data_type type)
|
||||
\group buffering API
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param src
|
||||
\param size
|
||||
\param type
|
||||
|
@ -217,14 +208,12 @@ int bufalloc(const void *src, size_t size, enum data_type type)
|
|||
|
||||
bool bufclose(int handle_id)
|
||||
\group buffering API
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\return
|
||||
\description
|
||||
|
||||
ssize_t bufcuttail(int handle_id, size_t size)
|
||||
\group buffering API
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\param size
|
||||
\return
|
||||
|
@ -232,7 +221,6 @@ ssize_t bufcuttail(int handle_id, size_t size)
|
|||
|
||||
ssize_t bufgetdata(int handle_id, size_t size, void **data)
|
||||
\group buffering API
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\param size
|
||||
\param data
|
||||
|
@ -241,7 +229,6 @@ ssize_t bufgetdata(int handle_id, size_t size, void **data)
|
|||
|
||||
ssize_t bufgettail(int handle_id, size_t size, void **data)
|
||||
\group buffering API
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\param size
|
||||
\param data
|
||||
|
@ -250,7 +237,6 @@ ssize_t bufgettail(int handle_id, size_t size, void **data)
|
|||
|
||||
int bufopen(const char *file, size_t offset, enum data_type type)
|
||||
\group buffering API
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param file
|
||||
\param offset
|
||||
\param type
|
||||
|
@ -259,7 +245,6 @@ int bufopen(const char *file, size_t offset, enum data_type type)
|
|||
|
||||
ssize_t bufread(int handle_id, size_t size, void *dest)
|
||||
\group buffering API
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\param size
|
||||
\param dest
|
||||
|
@ -268,37 +253,31 @@ ssize_t bufread(int handle_id, size_t size, void *dest)
|
|||
|
||||
int bufseek(int handle_id, size_t newpos)
|
||||
\group buffering API
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\param newpos
|
||||
\return
|
||||
\description
|
||||
|
||||
ssize_t buf_get_offset(int handle_id, void *ptr)
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\param ptr
|
||||
\return
|
||||
\description
|
||||
|
||||
ssize_t buf_handle_offset(int handle_id)
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\return
|
||||
\description
|
||||
|
||||
void buf_request_buffer_handle(int handle_id)
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\description
|
||||
|
||||
void buf_set_base_handle(int handle_id)
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\param handle_id
|
||||
\description
|
||||
|
||||
size_t buf_used(void)
|
||||
\conditions ((CONFIG_CODEC == SWCODEC))
|
||||
\return
|
||||
\description
|
||||
|
||||
|
@ -410,7 +389,6 @@ int closedir(DIR* dir)
|
|||
|
||||
int codec_load_file(const char* codec, struct codec_api *api)
|
||||
\group misc
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param codec
|
||||
\param api
|
||||
\return
|
||||
|
@ -540,7 +518,6 @@ int do_menu(const struct menu_item_ex *menu, int *start_selected, struct viewpor
|
|||
|
||||
intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param dsp
|
||||
\param setting
|
||||
\param value
|
||||
|
@ -549,13 +526,11 @@ intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value)
|
|||
|
||||
void dsp_dither_enable(bool enable)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param enable
|
||||
\description
|
||||
|
||||
int dsp_process(struct dsp_config *dsp, char *dest, const char *src[], int count)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param dsp
|
||||
\param dest
|
||||
\param src[]
|
||||
|
@ -565,13 +540,11 @@ int dsp_process(struct dsp_config *dsp, char *dest, const char *src[], int count
|
|||
|
||||
void dsp_set_crossfeed(bool enable)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param enable
|
||||
\description
|
||||
|
||||
void dsp_set_eq(bool enable)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param enable
|
||||
\description
|
||||
|
||||
|
@ -666,7 +639,6 @@ int get_action(int context, int timeout)
|
|||
|
||||
const char *get_codec_filename(int cod_spec)
|
||||
\group misc
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param cod_spec
|
||||
\return
|
||||
\description
|
||||
|
@ -681,7 +653,6 @@ int get_custom_action(int context,int timeout, const struct button_mapping* (*ge
|
|||
|
||||
bool get_metadata(struct mp3entry* id3, int fd, const char* trackname)
|
||||
\group misc
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param id3
|
||||
\param fd
|
||||
\param trackname
|
||||
|
@ -1342,19 +1313,17 @@ void logf(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2)
|
|||
|
||||
const unsigned long *audio_master_sampr_list
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\return
|
||||
\description
|
||||
|
||||
const unsigned long *hw_freq_sampr
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\return
|
||||
\description
|
||||
|
||||
const unsigned long *rec_freq_sampr
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING))
|
||||
\conditions defined(HAVE_RECORDING)
|
||||
\return
|
||||
\description
|
||||
|
||||
|
@ -1443,27 +1412,18 @@ void mp3_play_stop(void)
|
|||
\conditions (!defined(SIMULATOR))
|
||||
\description Stops playback
|
||||
|
||||
unsigned long mpeg_get_last_header(void)
|
||||
\group playback control
|
||||
\conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC))
|
||||
\return
|
||||
\description
|
||||
|
||||
void mutex_init(struct mutex *m)
|
||||
\group kernel/ system
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param m
|
||||
\description
|
||||
|
||||
void mutex_lock(struct mutex *m)
|
||||
\group kernel/ system
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param m
|
||||
\description
|
||||
|
||||
void mutex_unlock(struct mutex *m)
|
||||
\group kernel/ system
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param m
|
||||
\description
|
||||
|
||||
|
@ -1484,54 +1444,48 @@ bool option_screen(const struct settings_list *setting, struct viewport parent[N
|
|||
|
||||
void pcm_apply_settings(void)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\description
|
||||
|
||||
void pcm_calculate_peaks(int *left, int *right)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param left
|
||||
\param right
|
||||
\description
|
||||
|
||||
void pcm_calculate_rec_peaks(int *left, int *right)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING))
|
||||
\conditions defined(HAVE_RECORDING)
|
||||
\param left
|
||||
\param right
|
||||
\description
|
||||
|
||||
void pcm_close_recording(void)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING))
|
||||
\conditions defined(HAVE_RECORDING)
|
||||
\description
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\return
|
||||
\description
|
||||
|
||||
void pcm_init_recording(void)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING))
|
||||
\conditions defined(HAVE_RECORDING)
|
||||
\description
|
||||
|
||||
bool pcm_is_paused(void)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\return true if playback is paused, else false
|
||||
\description
|
||||
|
||||
bool pcm_is_playing(void)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\return true unless playback is paused
|
||||
\description
|
||||
|
||||
void pcm_play_data(pcm_more_callback_type get_more, unsigned char* start, size_t size)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param get_more Optional callback
|
||||
\param start is the address of raw 16-16, interleaved PCM data
|
||||
\param size is the size of the data to play
|
||||
|
@ -1539,28 +1493,24 @@ void pcm_play_data(pcm_more_callback_type get_more, unsigned char* start, size_t
|
|||
|
||||
void pcm_play_lock(void)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\description
|
||||
|
||||
void pcm_play_pause(bool play)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param play
|
||||
\description Pauses or unpauses the playback depending on the truth value of =play=
|
||||
|
||||
void pcm_play_stop(void)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\description Stops the playback and empties the audio buffer unlike [F[pcm_play_pause]]
|
||||
|
||||
void pcm_play_unlock(void)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\description
|
||||
|
||||
void pcm_record_data(pcm_more_callback_type2 more_ready, void *start, size_t size)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING))
|
||||
\conditions defined(HAVE_RECORDING)
|
||||
\param more_ready
|
||||
\param start
|
||||
\param size
|
||||
|
@ -1568,20 +1518,19 @@ void pcm_record_data(pcm_more_callback_type2 more_ready, void *start, size_t siz
|
|||
|
||||
void pcm_record_more(void *start, size_t size)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING))
|
||||
\conditions defined(HAVE_RECORDING)
|
||||
\param start
|
||||
\param size
|
||||
\description
|
||||
|
||||
void pcm_set_frequency(unsigned int frequency)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param frequency
|
||||
\description
|
||||
|
||||
void pcm_stop_recording(void)
|
||||
\group sound
|
||||
\conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING))
|
||||
\conditions defined(HAVE_RECORDING)
|
||||
\description
|
||||
|
||||
int playlist_amount(void)
|
||||
|
@ -1757,13 +1706,11 @@ void queue_delete(struct event_queue *q)
|
|||
\description
|
||||
|
||||
bool queue_empty(const struct event_queue *q)
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param q
|
||||
\return
|
||||
\description
|
||||
|
||||
void queue_enable_queue_send(struct event_queue *q, struct queue_sender_list *send, struct thread_entry *owner)
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param q
|
||||
\param send
|
||||
\param owner
|
||||
|
@ -1781,13 +1728,11 @@ void queue_post(struct event_queue *q, long id, intptr_t data)
|
|||
\description
|
||||
|
||||
void queue_reply(struct event_queue *q, intptr_t retval)
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param q
|
||||
\param retval
|
||||
\description
|
||||
|
||||
intptr_t queue_send(struct event_queue *q, long id, intptr_t data)
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param q
|
||||
\param id
|
||||
\param data
|
||||
|
@ -1795,7 +1740,6 @@ intptr_t queue_send(struct event_queue *q, long id, intptr_t data)
|
|||
\description
|
||||
|
||||
void queue_wait(struct event_queue *q, struct queue_event *ev)
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param q
|
||||
\param ev
|
||||
\description
|
||||
|
@ -2066,7 +2010,6 @@ void sound_set(int setting, int value)
|
|||
|
||||
void sound_set_pitch(int pitch)
|
||||
\group playback control
|
||||
\conditions (CONFIG_CODEC == SWCODEC)
|
||||
\param pitch
|
||||
\description
|
||||
|
||||
|
|
|
@ -425,8 +425,6 @@ drivers/rds.c
|
|||
/* Sound */
|
||||
sound.c
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
||||
#ifndef BOOTLOADER
|
||||
pcm_sampr.c
|
||||
pcm.c
|
||||
|
@ -440,7 +438,6 @@ enc_base.c
|
|||
|
||||
drivers/audio/audiohw-swcodec.c
|
||||
#endif /* BOOTLOADER */
|
||||
#endif /* SWCODEC */
|
||||
|
||||
/* Audio codec */
|
||||
#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER)
|
||||
|
@ -505,13 +502,13 @@ drivers/audio/rocker_codec.c
|
|||
drivers/audio/xduoolinux_codec.c
|
||||
#elif defined(HAVE_SDL_AUDIO)
|
||||
drivers/audio/sdl.c
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
||||
#if (CONFIG_PLATFORM & PLATFORM_MAEMO5)
|
||||
target/hosted/maemo/pcm-gstreamer.c
|
||||
#else
|
||||
target/hosted/sdl/pcm-sdl.c
|
||||
#endif /* (CONFIG_PLATFORM & PLATFORM_MAEMO) */
|
||||
#endif /* CONFIG_CODEC == SWCODEC */
|
||||
|
||||
#endif
|
||||
#endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER) */
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ void audiohw_set_volume(int volume)
|
|||
#ifdef HAVE_SW_VOLUME_CONTROL
|
||||
volume = sdl_volume_level(volume);
|
||||
pcm_set_master_volume(volume, volume);
|
||||
#elif CONFIG_CODEC == SWCODEC
|
||||
#else
|
||||
extern void pcm_set_mixer_volume(int volume);
|
||||
pcm_set_mixer_volume(volume);
|
||||
#endif
|
||||
|
@ -87,14 +87,6 @@ void audiohw_set_bass(int value) { (void)value; }
|
|||
void audiohw_set_treble(int value) { (void)value; }
|
||||
#endif
|
||||
#endif /* HAVE_SW_TONE_CONTROLS */
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
void audiohw_set_channel(int value) { (void)value; }
|
||||
void audiohw_set_stereo_width(int value){ (void)value; }
|
||||
#ifdef HAVE_PITCHCONTROL
|
||||
void audiohw_set_pitch(int32_t value) { (void)value; }
|
||||
int32_t audiohw_get_pitch(void) { return PITCH_SPEED_100; }
|
||||
#endif
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
#if defined(AUDIOHW_HAVE_BASS_CUTOFF)
|
||||
void audiohw_set_bass_cutoff(int value) { (void)value; }
|
||||
#endif
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifndef AUDIO_H
|
||||
#define AUDIO_H
|
||||
#ifndef __AUDIO_H
|
||||
#define __AUDIO_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <string.h> /* 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 */
|
||||
|
|
|
@ -53,9 +53,6 @@
|
|||
#define RDA5802 0x80 /* RDA Microelectronics */
|
||||
#define STFM1000 0x100 /* Sigmatel */
|
||||
|
||||
/* CONFIG_CODEC */
|
||||
#define SWCODEC 1 /* if codec is done by SW */
|
||||
|
||||
/* CONFIG_CPU */
|
||||
#define MCF5249 5249
|
||||
#define MCF5250 5250
|
||||
|
@ -903,7 +900,6 @@ Lyre prototype 1 */
|
|||
#define HAVE_PICTUREFLOW_INTEGRATION
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
#ifdef BOOTLOADER
|
||||
|
||||
#ifdef HAVE_BOOTLOADER_USB_MODE
|
||||
|
@ -975,8 +971,6 @@ Lyre prototype 1 */
|
|||
#define HAVE_CROSSFADE
|
||||
#endif
|
||||
|
||||
#endif /* (CONFIG_CODEC == SWCODEC) */
|
||||
|
||||
/* Determine if accesses should be strictly long aligned. */
|
||||
#if defined(CPU_ARM) || defined(CPU_MIPS)
|
||||
#define ROCKBOX_STRICT_ALIGN 1
|
||||
|
@ -1248,19 +1242,16 @@ Lyre prototype 1 */
|
|||
#define HAVE_PCM_FULL_DUPLEX
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC)
|
||||
#define HAVE_PITCHCONTROL
|
||||
#endif
|
||||
|
||||
/* enable logging messages to disk*/
|
||||
#if !defined(BOOTLOADER) && !defined(__PCTOOL__) && (CONFIG_CODEC == SWCODEC)
|
||||
#if !defined(BOOTLOADER) && !defined(__PCTOOL__)
|
||||
#define ROCKBOX_HAS_LOGDISKF
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SDL_AUDIO) \
|
||||
&& !(CONFIG_PLATFORM & PLATFORM_MAEMO5) \
|
||||
&& !defined(HAVE_SW_VOLUME_CONTROL) \
|
||||
&& CONFIG_CODEC == SWCODEC
|
||||
&& !defined(HAVE_SW_VOLUME_CONTROL)
|
||||
/* SW volume is needed for accurate control and no double buffering should be
|
||||
* required. If target uses SW volume, then its definitions are used instead
|
||||
* so things are as on target. */
|
||||
|
|
|
@ -75,8 +75,8 @@
|
|||
/* The number of bytes reserved for loadable plugins */
|
||||
#define PLUGIN_BUFFER_SIZE 0x100000
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
#define HAVE_ROCKER_CODEC
|
||||
|
||||
#define HAVE_HEADPHONE_DETECTION
|
||||
|
|
|
@ -67,8 +67,8 @@
|
|||
|
||||
#define AB_REPEAT_ENABLE
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
#define HAVE_MULTIMEDIA_KEYS
|
||||
#define CONFIG_KEYPAD ANDROID_PAD
|
||||
|
|
|
@ -107,8 +107,8 @@
|
|||
|
||||
#define AB_REPEAT_ENABLE
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* The D2 uses a WM8985 codec */
|
||||
#define HAVE_WM8985
|
||||
|
|
|
@ -89,8 +89,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 320
|
||||
|
|
|
@ -90,8 +90,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 128
|
||||
|
|
|
@ -87,8 +87,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 132
|
||||
|
|
|
@ -94,8 +94,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 320
|
||||
|
|
|
@ -97,8 +97,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 240
|
||||
|
|
|
@ -97,8 +97,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* Define this if you have a speaker */
|
||||
#define HAVE_SPEAKER
|
||||
|
|
|
@ -94,8 +94,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 320
|
||||
|
|
|
@ -80,8 +80,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* define this if you have a real-time clock */
|
||||
//#define CONFIG_RTC RTC_RX5X348AB
|
||||
|
|
|
@ -69,8 +69,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* define this if you have a real-time clock */
|
||||
#define CONFIG_RTC RTC_S3C2440
|
||||
|
|
|
@ -59,8 +59,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* define this if you have a real-time clock */
|
||||
#define CONFIG_RTC RTC_MC13783
|
||||
|
|
|
@ -85,8 +85,8 @@
|
|||
/* define this if the target has volume keys which can be used in the lists */
|
||||
#define HAVE_VOLUME_IN_LIST
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* define this if you have a real-time clock. The HDD16x0 has a PCF8563 RTC,
|
||||
but it's register compatible with the E8564. */
|
||||
|
|
|
@ -85,8 +85,8 @@
|
|||
/* define this if the target has volume keys which can be used in the lists */
|
||||
#define HAVE_VOLUME_IN_LIST
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* define this if you have a real-time clock. The HDD16x0 has a PCF8563 RTC,
|
||||
but it's register compatible with the E8564. */
|
||||
|
|
|
@ -68,8 +68,8 @@
|
|||
/* define this if the target has volume keys which can be used in the lists */
|
||||
#define HAVE_VOLUME_IN_LIST
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
/* There is no hardware tone control */
|
||||
#define HAVE_SW_TONE_CONTROLS
|
||||
|
|
|
@ -75,8 +75,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
#define CONFIG_LCD LCD_ILI9342
|
||||
|
||||
|
|
|
@ -75,8 +75,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
#define CONFIG_LCD LCD_ILI9342C
|
||||
|
||||
|
|
|
@ -75,8 +75,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
#define CONFIG_LCD LCD_ILI9342
|
||||
|
||||
|
|
|
@ -75,8 +75,8 @@
|
|||
/* Define this to enable morse code input */
|
||||
#define HAVE_MORSE_INPUT
|
||||
|
||||
/* Define this if you do software codec */
|
||||
#define CONFIG_CODEC SWCODEC
|
||||
|
||||
|
||||
|
||||
#define CONFIG_LCD LCD_ILI9342C
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue