Fix whitespace in files for following commit.

Change-Id: I4adb8a152e9b99fcd26d95da7334d7d0cbe2a036
This commit is contained in:
Michael Sevakis 2013-07-12 12:03:20 -04:00
parent d85f796890
commit ffa8626b0c
8 changed files with 346 additions and 346 deletions

View file

@ -68,7 +68,7 @@
#define RESTORE_WPS_INSTANTLY 0l
#define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick))
#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */
#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */
/* 3% of 30min file == 54s step size */
#define MIN_FF_REWIND_STEP 500
@ -170,7 +170,7 @@ void unpause_action(bool may_fade, bool updatewps)
#endif
(void)may_fade;
}
}
#if CONFIG_CODEC != SWCODEC
void fade(bool fade_in, bool updatewps)
@ -189,7 +189,7 @@ void fade(bool fade_in, bool updatewps)
sleep(HZ/10); /* let audio thread run */
audio_resume();
if (updatewps)
update_non_static();
@ -227,7 +227,7 @@ void fade(bool fade_in, bool updatewps)
sound_set_volume(global_settings.volume);
}
}
#endif /* SWCODEC */
#endif /* SWCODEC */
static bool update_onvol_change(enum screen_type screen)
{
@ -298,8 +298,8 @@ static int skintouch_to_wps(struct wps_data *data)
bool ffwd_rew(int button)
{
unsigned int step = 0; /* current ff/rewind step */
unsigned int max_step = 0; /* maximum ff/rewind step */
unsigned int step = 0; /* current ff/rewind step */
unsigned int max_step = 0; /* maximum ff/rewind step */
int ff_rewind_count = 0; /* current ff/rewind count (in ticks) */
int direction = -1; /* forward=1 or backward=-1 */
bool exit = false;
@ -323,7 +323,7 @@ bool ffwd_rew(int button)
if (direction == 1)
{
/* fast forwarding, calc max step relative to end */
max_step = (skin_get_global_state()->id3->length -
max_step = (skin_get_global_state()->id3->length -
(skin_get_global_state()->id3->elapsed +
ff_rewind_count)) *
FF_REWIND_MAX_PERCENT / 100;
@ -360,7 +360,7 @@ bool ffwd_rew(int button)
FOR_NB_SCREENS(i)
skin_get_gwps(WPS, i)->display->stop_scroll();
#endif
if (direction > 0)
if (direction > 0)
status_set_ffmode(STATUS_FASTFORWARD);
else
status_set_ffmode(STATUS_FASTBACKWARD);
@ -489,8 +489,8 @@ static void change_dir(int direction)
audio_prev_dir();
else if (direction > 0)
audio_next_dir();
/* prevent the next dir to immediatly start being ffw'd */
action_wait_for_release();
/* prevent the next dir to immediatly start being ffw'd */
action_wait_for_release();
}
static void prev_track(unsigned long skip_thresh)
@ -644,7 +644,7 @@ static void gwps_leave_wps(void)
skin_backdrop_show(sb_get_backdrop(i));
#endif
viewportmanager_theme_undo(i, skin_has_sbs(i, skin_get_gwps(WPS, i)->data));
}
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
@ -676,7 +676,7 @@ static void gwps_enter_wps(void)
#if LCD_DEPTH > 1
if (display->depth > 1)
{
struct skin_viewport *svp = skin_find_item(VP_DEFAULT_LABEL_STRING,
struct skin_viewport *svp = skin_find_item(VP_DEFAULT_LABEL_STRING,
SKIN_FIND_VP, gwps->data);
if (svp)
{
@ -722,7 +722,7 @@ void wps_do_playpause(bool updatewps)
#endif
}
}
/* The WPS can be left in two ways:
* a) call a function, which draws over the wps. In this case, the wps
@ -755,7 +755,7 @@ long gui_wps_show(void)
ab_reset_markers();
#endif
wps_state_init();
while ( 1 )
{
bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false;
@ -773,7 +773,7 @@ long gui_wps_show(void)
#endif
}
}
button = skin_wait_for_action(WPS, CONTEXT_WPS|ALLOW_SOFTLOCK,
button = skin_wait_for_action(WPS, CONTEXT_WPS|ALLOW_SOFTLOCK,
restore ? 1 : HZ/5);
/* Exit if audio has stopped playing. This happens e.g. at end of
@ -820,17 +820,17 @@ long gui_wps_show(void)
{
bool hotkey = button == ACTION_WPS_HOTKEY;
gwps_leave_wps();
int retval = onplay(state->id3->path,
int retval = onplay(state->id3->path,
FILE_ATTR_AUDIO, CONTEXT_WPS, hotkey);
/* if music is stopped in the context menu we want to exit the wps */
if (retval == ONPLAY_MAINMENU
if (retval == ONPLAY_MAINMENU
|| !audio_status())
return GO_TO_ROOT;
else if (retval == ONPLAY_PLAYLIST)
return GO_TO_PLAYLIST_VIEWER;
#ifdef HAVE_PICTUREFLOW_INTEGRATION
else if (retval == ONPLAY_PICTUREFLOW)
return GO_TO_PICTUREFLOW;
return GO_TO_PICTUREFLOW;
#endif
restore = true;
}
@ -860,7 +860,7 @@ long gui_wps_show(void)
global_settings.volume--;
vol_changed = true;
break;
/* fast forward
/* fast forward
OR next dir if this is straight after ACTION_WPS_SKIPNEXT */
case ACTION_WPS_SEEKFWD:
if (global_settings.party_mode)
@ -880,7 +880,7 @@ long gui_wps_show(void)
ffwd_rew(ACTION_WPS_SEEKFWD);
last_right = last_left = 0;
break;
/* fast rewind
/* fast rewind
OR prev dir if this is straight after ACTION_WPS_SKIPPREV,*/
case ACTION_WPS_SEEKBACK:
if (global_settings.party_mode)

View file

@ -183,7 +183,7 @@ int main(void)
#ifdef AUTOROCK
{
char filename[MAX_PATH];
const char *file =
const char *file =
#ifdef APPLICATION
ROCKBOX_DIR
#else
@ -210,15 +210,15 @@ static int init_dircache(bool preinit)
#ifdef HAVE_DIRCACHE
int result = 0;
bool clear = false;
if (preinit)
dircache_init();
if (!global_settings.dircache)
return 0;
# ifdef HAVE_EEPROM_SETTINGS
if (firmware_settings.initialized && firmware_settings.disk_clean
if (firmware_settings.initialized && firmware_settings.disk_clean
&& preinit)
{
result = dircache_load();
@ -233,7 +233,7 @@ static int init_dircache(bool preinit)
splash(0, str(LANG_SCANNING_DISK));
clear = true;
}
dircache_build(global_status.dircache_size);
}
}
@ -242,7 +242,7 @@ static int init_dircache(bool preinit)
{
if (preinit)
return -1;
if (!dircache_is_enabled()
&& !dircache_is_initializing())
{
@ -253,7 +253,7 @@ static int init_dircache(bool preinit)
}
result = dircache_build(global_status.dircache_size);
}
if (result < 0)
{
/* Initialization of dircache failed. Manual action is
@ -263,7 +263,7 @@ static int init_dircache(bool preinit)
global_settings.dircache = false;
}
}
if (clear)
{
backlight_on();
@ -271,7 +271,7 @@ static int init_dircache(bool preinit)
global_status.dircache_size = dircache_get_cache_size();
status_save();
}
return result;
#else
(void)preinit;
@ -288,7 +288,7 @@ static void init_tagcache(void)
long talked_tick = 0;
#endif
tagcache_init();
while (!tagcache_is_initialized())
{
int ret = tagcache_get_commit_step();
@ -322,7 +322,7 @@ static void init_tagcache(void)
}
#else
lcd_double_height(false);
lcd_putsf(0, 1, " DB [%d/%d]", ret,
lcd_putsf(0, 1, " DB [%d/%d]", ret,
tagcache_get_max_commit_step());
lcd_update();
#endif
@ -370,7 +370,7 @@ static void init(void)
#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
notification_init();
#endif
lang_init(core_language_builtin, language_strings,
lang_init(core_language_builtin, language_strings,
LANG_LAST_INDEX_IN_ARRAY);
#ifdef DEBUG
debug_init();
@ -452,7 +452,7 @@ static void init(void)
#endif
i2c_init();
power_init();
enable_irq();
@ -471,13 +471,13 @@ static void init(void)
global_status.font_id[i] = FONT_SYSFIXED;
font_init();
#endif
settings_reset();
CHART(">show_logo");
show_logo();
CHART("<show_logo");
lang_init(core_language_builtin, language_strings,
lang_init(core_language_builtin, language_strings,
LANG_LAST_INDEX_IN_ARRAY);
#ifdef DEBUG
@ -676,7 +676,7 @@ static void init(void)
}
CHART(">settings_apply(true)");
settings_apply(true);
settings_apply(true);
CHART("<settings_apply(true)");
CHART(">init_dircache(false)");
init_dircache(false);

View file

@ -62,7 +62,7 @@ static int setcrossfadeonexit_callback(int action,const struct menu_item_ex *thi
/***********************************/
/* PLAYBACK MENU */
static int playback_callback(int action,const struct menu_item_ex *this_item);
MENUITEM_SETTING(shuffle_item, &global_settings.playlist_shuffle, playback_callback);
MENUITEM_SETTING(repeat_mode, &global_settings.repeat_mode, playback_callback);
MENUITEM_SETTING(play_selected, &global_settings.play_selected, NULL);
@ -84,7 +84,7 @@ static int buffermargin_callback(int action,const struct menu_item_ex *this_item
}
return action;
}
#else
#else
# define buffermargin_callback NULL
#endif
MENUITEM_SETTING(buffer_margin, &global_settings.buffer_margin,
@ -120,7 +120,7 @@ static int replaygain_callback(int action,const struct menu_item_ex *this_item)
(void)this_item;
switch (action)
{
case ACTION_EXIT_MENUITEM: /* on exit */
case ACTION_EXIT_MENUITEM: /* on exit */
replaygain_update();
break;
}
@ -137,7 +137,7 @@ MENUITEM_SETTING(replaygain_preamp,
replaygain_callback);
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 */
@ -155,7 +155,7 @@ static int audioscrobbler_callback(int action,const struct menu_item_ex *this_it
case ACTION_EXIT_MENUITEM: /* on exit */
if (!scrobbler_is_enabled() && global_settings.audioscrobbler)
scrobbler_init();
if(scrobbler_is_enabled() && !global_settings.audioscrobbler)
scrobbler_shutdown();
break;
@ -205,13 +205,13 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
Icon_Playback_menu,
&shuffle_item, &repeat_mode, &play_selected,
&ff_rewind_settings_menu,
#ifdef HAVE_DISK_STORAGE
#ifdef HAVE_DISK_STORAGE
&buffer_margin,
#endif
&fade_on_stop, &party_mode,
#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE)
&crossfade_settings_menu,
&crossfade_settings_menu,
#endif
#if CONFIG_CODEC == SWCODEC
@ -235,7 +235,7 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
,&play_frequency
#endif
);
static int playback_callback(int action,const struct menu_item_ex *this_item)
{
static bool old_shuffle = false;

View file

@ -1,10 +1,10 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 by Daniel Stenberg
@ -424,7 +424,7 @@ bool list_stop_handler(void)
if (TIME_BEFORE(current_tick, last_off + HZ/2))
{
if (charger_inserted())
if (charger_inserted())
{
charging_splash();
ret = true; /* screen is dirty, caller needs to refresh */
@ -1064,7 +1064,7 @@ void format_time(char* buf, int buf_size, long t)
int const seconds = time % 60;
const char * const sign = &"-"[t < 0 ? 0 : 1];
if ( hours == 0 )
if ( hours == 0 )
{
snprintf(buf, buf_size, "%s%d:%02d", sign, minutes, seconds);
}
@ -1177,7 +1177,7 @@ bool parse_color(enum screen_type screen, char *text, int *value)
{
(void)text; (void)value; /* silence warnings on mono bitmap */
(void)screen;
#ifdef HAVE_LCD_COLOR
if (screens[screen].depth > 2)
{
@ -1214,7 +1214,7 @@ int clamp_value_wrap(int value, int max, int min)
#endif
#endif
#define MAX_ACTIVITY_DEPTH 12
static enum current_activity
static enum current_activity
current_activity[MAX_ACTIVITY_DEPTH] = {ACTIVITY_UNKNOWN};
static int current_activity_top = 0;
void push_current_activity(enum current_activity screen)

View file

@ -382,7 +382,7 @@ static void set_elapsed(struct mp3entry* id3)
break;
}
}
i--;
if (i < 0)
i = 0;
@ -395,7 +395,7 @@ static void set_elapsed(struct mp3entry* id3)
}
else
{
nextpos = 256;
nextpos = 256;
}
remainder = id3->offset - (relpos * (id3->filesize / 256));
@ -425,7 +425,7 @@ int audio_get_file_pos(void)
{
int pos = -1;
struct mp3entry *id3 = audio_current_track();
if (id3->vbr)
{
if (id3->has_toc)
@ -433,20 +433,20 @@ int audio_get_file_pos(void)
/* Use the TOC to find the new position */
unsigned int percent, remainder;
int curtoc, nexttoc, plen;
percent = (id3->elapsed*100)/id3->length;
if (percent > 99)
percent = 99;
curtoc = id3->toc[percent];
if (percent < 99)
nexttoc = id3->toc[percent+1];
else
nexttoc = 256;
pos = (id3->filesize/256)*curtoc;
/* Use the remainder to get a more accurate position */
remainder = (id3->elapsed*100)%id3->length;
remainder = (remainder*100)/id3->length;
@ -478,7 +478,7 @@ int audio_get_file_pos(void)
/* skip past id3v2 tag and other leading garbage */
pos = id3->first_frame_offset;
}
return pos;
return pos;
}
unsigned long mpeg_get_last_header(void)
@ -637,9 +637,9 @@ static void recalculate_watermark(int bitrate)
and set a high threshold */
if(bitrate == 0)
bitrate = 320;
bytes_per_sec = bitrate * 1000 / 8;
if(time)
{
/* No drive spins up faster than 3.5s */
@ -693,7 +693,7 @@ void audio_get_debugdata(struct audio_debug *dbgdata)
static void dbg_timer_start(void)
{
/* We are using timer 2 */
TSTR &= ~0x04; /* Stop the timer */
TSNC &= ~0x04; /* No synchronization */
TMDR &= ~0x44; /* Operate normally */
@ -813,7 +813,7 @@ void rec_tick(void)
}
data = *(unsigned char *)0x04000000; /* read data byte */
xor_b(0x08, &PADRH); /* Set PR inactive */
mpeg_audiobuf[audiobuf_write++] = data;
@ -888,7 +888,7 @@ static void transfer_end(const void** ppbuf, size_t* psize)
audiobuf_read += last_dma_chunk_size;
if(audiobuf_read >= audiobuflen)
audiobuf_read = 0;
/* First, check if we are on a track boundary */
if (num_tracks_in_memory() > 1)
{
@ -901,17 +901,17 @@ static void transfer_end(const void** ppbuf, size_t* psize)
}
}
}
unplayed_space_left = get_unplayed_space();
space_until_end_of_buffer = audiobuflen - audiobuf_read;
if(!filling && unplayed_space_left < low_watermark)
{
filling = true;
queue_post(&mpeg_queue, MPEG_NEED_DATA, GENERATE_UNBUFFER_EVENTS);
}
if(unplayed_space_left)
{
last_dma_chunk_size = MIN(0x2000, unplayed_space_left);
@ -953,7 +953,7 @@ static void transfer_end(const void** ppbuf, size_t* psize)
/* Update the watermark debug level */
if(unplayed_space_left < lowest_watermark_level)
lowest_watermark_level = unplayed_space_left;
DEBUGF("DMA underrun.\n");
dma_underrun = true;
}
@ -975,7 +975,7 @@ static struct trackdata *add_track_to_tag_list(const char *filename)
{
struct trackdata *track;
bool send_nid3_event;
if(num_tracks_in_memory() >= MAX_TRACK_ENTRIES)
{
DEBUGF("Tag memory is full\n");
@ -983,7 +983,7 @@ static struct trackdata *add_track_to_tag_list(const char *filename)
}
track = &trackdata[track_write_idx];
/* grab id3 tag of new file and
remember where in memory it starts */
if(mp3info(&track->id3, filename))
@ -1032,14 +1032,14 @@ static int new_file(int steps)
start += track->load_ahead_index;
}
}
do {
trackname = playlist_peek(start + steps, name_buf, sizeof(name_buf));
if ( !trackname )
return -1;
DEBUGF("Loading %s\n", trackname);
mpeg_file = open(trackname, O_RDONLY);
if(mpeg_file < 0) {
DEBUGF("Couldn't open file: %s\n",trackname);
@ -1065,7 +1065,7 @@ static int new_file(int steps)
else
{
/* skip past id3v2 tag */
lseek(mpeg_file,
lseek(mpeg_file,
track->id3.first_frame_offset,
SEEK_SET);
track->id3.index = steps;
@ -1079,7 +1079,7 @@ static int new_file(int steps)
else
recalculate_watermark(
track->id3.bitrate);
}
}
@ -1212,7 +1212,7 @@ static void start_playback_if_ready(void)
playable_space = audiobuf_swapwrite - audiobuf_read;
if(playable_space < 0)
playable_space += audiobuflen;
/* See if we have started playing yet. If not, do it. */
if(play_pending || dma_underrun)
{
@ -1273,7 +1273,7 @@ static bool swap_one_chunk(void)
else
amount_to_swap = MIN(MPEG_SWAP_CHUNKSIZE, free_space_left);
}
if(audiobuf_write < audiobuf_swapwrite)
amount_to_swap = MIN(audiobuflen - audiobuf_swapwrite,
amount_to_swap);
@ -1342,7 +1342,7 @@ static void mpeg_thread(void)
}
start_playback_if_ready();
switch(ev.id)
{
case MPEG_PLAY:
@ -1376,8 +1376,8 @@ static void mpeg_thread(void)
}
else {
/* skip past id3v2 tag */
lseek(mpeg_file,
get_trackdata(0)->id3.first_frame_offset,
lseek(mpeg_file,
get_trackdata(0)->id3.first_frame_offset,
SEEK_SET);
}
@ -1421,7 +1421,7 @@ static void mpeg_thread(void)
if ( current_track_counter == pause_track )
last_dma_tick += current_tick - pause_tick;
else
last_dma_tick = current_tick;
last_dma_tick = current_tick;
pause_tick = 0;
mp3_play_pause(true);
}
@ -1481,7 +1481,7 @@ static void mpeg_thread(void)
/* Make it read more data */
filling = true;
queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
/* Tell the file loading code that we want
to start playing as soon as we have some data */
play_pending = true;
@ -1498,7 +1498,7 @@ static void mpeg_thread(void)
if (!playlist_check(-1))
break;
/* stop the current stream */
end_current_track();
@ -1540,7 +1540,7 @@ static void mpeg_thread(void)
id3->elapsed = oldtime;
break;
}
if (mpeg_file >= 0)
curpos = lseek(mpeg_file, 0, SEEK_CUR);
else
@ -1581,7 +1581,7 @@ static void mpeg_thread(void)
hasn't yet advanced up to the new location of the read
pointer. We just move it, there is no need to swap
data that won't be played anyway. */
if (unswapped_space_left > unplayed_space_left)
{
DEBUGF("Moved swapwrite\n");
@ -1599,9 +1599,9 @@ static void mpeg_thread(void)
else
{
/* resume will start at new position */
last_dma_chunk_size =
last_dma_chunk_size =
MIN(0x2000, get_unplayed_space_current_song());
mp3_play_data(mpeg_audiobuf + audiobuf_read,
mp3_play_data(mpeg_audiobuf + audiobuf_read,
last_dma_chunk_size, transfer_end);
dma_underrun = false;
}
@ -1696,7 +1696,7 @@ static void mpeg_thread(void)
/* Make sure that we don't fill the entire buffer */
free_space_left -= MPEG_HIGH_WATER;
if (ev.data == GENERATE_UNBUFFER_EVENTS)
generate_unbuffer_events();
@ -1748,12 +1748,12 @@ static void mpeg_thread(void)
static const unsigned char tag[] = "TAG";
int taglen = 128;
int tagptr = audiobuf_write + len - 128;
/* Really rare case: entire potential tag wasn't
read in this call AND audiobuf_write < 128 */
if (tagptr < 0)
tagptr += audiobuflen;
for(i = 0;i < 3;i++)
{
if(tagptr >= audiobuflen)
@ -1801,10 +1801,10 @@ static void mpeg_thread(void)
{
DEBUGF("MPEG read error\n");
}
close(mpeg_file);
mpeg_file = -1;
if(new_file(1) < 0)
{
/* No more data to play */
@ -1819,7 +1819,7 @@ static void mpeg_thread(void)
}
}
break;
case MPEG_TRACK_CHANGE:
track_change();
break;
@ -1838,7 +1838,7 @@ static void mpeg_thread(void)
usb_wait_for_disconnect(&mpeg_queue);
break;
#endif /* !USB_NONE */
#if CONFIG_CODEC == MAS3587F
case MPEG_INIT_RECORDING:
init_recording();
@ -1876,7 +1876,7 @@ static void mpeg_thread(void)
mpeg_audiobuf+startpos, startpos);
saved_header = mpeg_get_last_header();
mem_find_next_frame(startpos, &offset, 1800,
saved_header, mpeg_audiobuf,
audiobuflen);
@ -1912,10 +1912,10 @@ static void mpeg_thread(void)
/* delayed until buffer is saved, don't open yet */
strcpy(delayed_filename, recording_filename);
mpeg_file = -1;
mpeg_file = -1;
break;
case MPEG_STOP:
DEBUGF("MPEG_STOP\n");
@ -1974,7 +1974,7 @@ static void mpeg_thread(void)
mas_readmem(MAS_BANK_D0, MAS_D0_MPEG_FRAME_COUNT,
&frame_count_end, 1);
last_rec_time = current_tick - record_start_time;
record_start_time = current_tick;
if (paused)
@ -2014,7 +2014,7 @@ static void mpeg_thread(void)
queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0);
break;
case MPEG_SAVE_DATA:
case MPEG_SAVE_DATA:
if (saving_status == BUFFER_FULL)
save_endpos = audiobuf_write;
@ -2098,7 +2098,7 @@ static void mpeg_thread(void)
queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0);
break;
case MPEG_PRERECORDING_TICK:
if(!is_prerecording)
break;
@ -2118,21 +2118,21 @@ static void mpeg_thread(void)
break;
case MPEG_INIT_PLAYBACK:
/* Stop the prerecording */
/* Stop the prerecording */
stop_recording();
reset_mp3_buffer();
mp3_play_init();
init_playback_done = true;
break;
case MPEG_PAUSE_RECORDING:
pause_recording();
break;
case MPEG_RESUME_RECORDING:
resume_recording();
break;
case SYS_USB_CONNECTED:
/* We can safely go to USB mode if no recording
is taking place */
@ -2142,11 +2142,11 @@ static void mpeg_thread(void)
function, to put the MAS in monitoring mode,
to save power. */
stop_recording();
/* Tell the USB thread that we are safe */
DEBUGF("mpeg_thread got SYS_USB_CONNECTED\n");
usb_acknowledge(SYS_USB_CONNECTED_ACK);
/* Wait until the USB cable is extracted again */
usb_wait_for_disconnect(&mpeg_queue);
}
@ -2166,7 +2166,7 @@ struct mp3entry* audio_current_track(void)
if(num_tracks_in_memory())
{
struct mp3entry *id3 = &get_trackdata(0)->id3;
#endif
#endif
if (!checked_for_cuesheet && curr_cuesheet && id3->cuesheet == NULL)
{
checked_for_cuesheet = true; /* only check once per track */
@ -2239,9 +2239,9 @@ static void init_recording(void)
is_prerecording = false;
mpeg_stop_done = true;
mas_reset();
/* Enable the audio CODEC and the DSP core, max analog voltage range */
rc = mas_direct_config_write(MAS_CONTROL, 0x8c00);
if(rc < 0)
@ -2257,7 +2257,7 @@ static void init_recording(void)
/* Perform black magic as described by the data sheet */
if((mas_version_code & 0x0fff) == 0x0102)
{
{
DEBUGF("Performing MAS black magic for B2 version\n");
mas_writereg(0xa3, 0x98);
mas_writereg(0x94, 0xfffff);
@ -2272,7 +2272,7 @@ static void init_recording(void)
/* Copy left channel to right (mono mode) */
mas_codec_writereg(8, 0x8000);
/* ADC scale 0%, DSP scale 100%
We use the DSP output for monitoring, because it works with all
sources including S/PDIF */
@ -2282,7 +2282,7 @@ static void init_recording(void)
/* No mute */
shadow_soft_mute = 0;
mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &shadow_soft_mute, 1);
#ifdef HAVE_SPDIF_OUT
val = 0x09; /* Disable SDO and SDI, low impedance S/PDIF outputs */
#else
@ -2308,7 +2308,7 @@ static void init_recording(void)
DMA transfer has taken place.
Now let's wait for some data to be encoded. */
sleep(HZ/5);
/* Now set it to Monitoring mode as default, saves power */
shadow_io_control_main = 0x525;
mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &shadow_io_control_main, 1);
@ -2331,7 +2331,7 @@ static void init_recording(void)
void audio_record(const char *filename)
{
mpeg_errno = 0;
strlcpy(recording_filename, filename, MAX_PATH);
queue_post(&mpeg_queue, MPEG_RECORD, 0);
@ -2412,13 +2412,13 @@ static void start_prerecording(void)
unsigned long val;
DEBUGF("Starting prerecording\n");
prerecord_index = 0;
prerecord_count = 0;
prerecord_timeout = current_tick + HZ;
memset(prerecord_buffer, 0, sizeof(prerecord_buffer));
reset_mp3_buffer();
is_prerecording = true;
/* Stop monitoring and start the encoder */
@ -2431,7 +2431,7 @@ static void start_prerecording(void)
{
mas_readmem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &val,1);
} while(val & 1);
is_recording = true;
saving_status = NOT_SAVING;
@ -2463,7 +2463,7 @@ static void start_recording(void)
mas_readmem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &val,1);
} while(val & 1);
}
is_recording = true;
saving_status = NOT_SAVING;
paused = false;
@ -2493,7 +2493,7 @@ static void pause_recording(void)
static void resume_recording(void)
{
paused = false;
/* Clear the pause bit */
shadow_soft_mute &= ~2;
mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &shadow_soft_mute, 1);
@ -2515,7 +2515,7 @@ static void stop_recording(void)
if(!paused)
pause_recording();
sleep(HZ/5);
demand_irq_enable(false);
is_recording = false;
@ -2529,7 +2529,7 @@ static void stop_recording(void)
shadow_io_control_main |= (1 << 10);
mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &shadow_io_control_main, 1);
DEBUGF("mas_writemem(MAS_BANK_D0, IO_CONTROL_MAIN, %x)\n", shadow_io_control_main);
/* Wait until the DSP has accepted the settings */
do
{
@ -2565,7 +2565,7 @@ void audio_set_recording_options(struct audio_recording_options *options)
mas_store_pllfreq(24576000);
else
mas_store_pllfreq(22579000);
#endif
#endif
shadow_soft_mute = options->rec_editable?4:0;
mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &shadow_soft_mute,1);
@ -2647,7 +2647,7 @@ unsigned long audio_recorded_time(void)
{
if(is_prerecording)
return prerecord_count * HZ;
if(is_recording)
{
if(paused)
@ -2663,7 +2663,7 @@ unsigned long audio_num_recorded_bytes(void)
{
int num_bytes;
int index;
if(is_recording)
{
if(is_prerecording)
@ -2671,11 +2671,11 @@ unsigned long audio_num_recorded_bytes(void)
index = prerecord_index - prerecord_count;
if(index < 0)
index += prerecording_max_seconds;
num_bytes = audiobuf_write - prerecord_buffer[index].mempos;
if(num_bytes < 0)
num_bytes += audiobuflen;
return num_bytes;
}
else
@ -2796,7 +2796,7 @@ void audio_play(long offset)
int steps=0;
is_playing = true;
do {
trackname = playlist_peek(steps, name_buf, sizeof(name_buf));
if (!trackname)
@ -2849,7 +2849,7 @@ void audio_stop(void)
/* dummy */
void audio_stop_recording(void)
{
audio_stop();
audio_stop();
}
void audio_hard_stop(void)
@ -2966,7 +2966,7 @@ int audio_status(void)
if(paused)
ret |= AUDIO_STATUS_PAUSE;
#if (CONFIG_CODEC == MAS3587F) && !defined(SIMULATOR)
if(is_recording && !is_prerecording)
ret |= AUDIO_STATUS_RECORD;
@ -2977,7 +2977,7 @@ int audio_status(void)
if(mpeg_errno)
ret |= AUDIO_STATUS_ERROR;
return ret;
}

View file

@ -58,7 +58,7 @@ int playback_claim_aa_slot(struct dim *dim);
/*
* Releases the albumart slot with given id
*
*
* Save to call from other threads */
void playback_release_aa_slot(int slot);

View file

@ -140,7 +140,7 @@ static void write_cache(void)
fd = open(scrobbler_file, O_WRONLY | O_APPEND);
if(fd >= 0)
{
logf("SCROBBLER: writing %d entries", cache_pos);
logf("SCROBBLER: writing %d entries", cache_pos);
/* copy data to temporary storage in case data moves during I/O */
char temp_buf[SCROBBLER_CACHE_LEN];
for ( i=0; i < cache_pos; i++ )

File diff suppressed because it is too large Load diff