Don't save the in-out state of the recording screen as a setting. Fixes the statusbar icons if settings were saved while recording screen was on. Humbly may I suggest a global_state structure to do all this state checking more efficiently\? Ignore me if that's being worked on by someone.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12221 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2007-02-07 02:48:19 +00:00
parent 70ebc8feb1
commit ff3bb3aa18
5 changed files with 14 additions and 6 deletions

View file

@ -38,6 +38,7 @@
#include "statusbar.h" #include "statusbar.h"
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
#include "audio.h" #include "audio.h"
#include "recording.h"
#endif #endif
/* FIXME: should be removed from icon.h to avoid redefinition, /* FIXME: should be removed from icon.h to avoid redefinition,
@ -257,7 +258,8 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
#endif #endif
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
/* turn off volume display in recording screen */ /* turn off volume display in recording screen */
if (!global_settings.recscreen_on) bool recscreen_on = in_recording_screen();
if (!recscreen_on)
#endif #endif
bar->redraw_volume = gui_statusbar_icon_volume(bar, bar->info.volume); bar->redraw_volume = gui_statusbar_icon_volume(bar, bar->info.volume);
gui_statusbar_icon_play_state(display, current_playmode() + Icon_Play); gui_statusbar_icon_play_state(display, current_playmode() + Icon_Play);
@ -265,7 +267,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
/* If in recording screen, replace repeat mode, volume /* If in recording screen, replace repeat mode, volume
and shuffle icons with recording info */ and shuffle icons with recording info */
if (global_settings.recscreen_on) if (recscreen_on)
gui_statusbar_icon_recording_info(display); gui_statusbar_icon_recording_info(display);
else else
#endif #endif

View file

@ -70,6 +70,13 @@
#include "radio.h" #include "radio.h"
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
static bool in_screen = false;
bool in_recording_screen(void)
{
return in_screen;
}
#define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1) #define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1)
#if CONFIG_KEYPAD == RECORDER_PAD #if CONFIG_KEYPAD == RECORDER_PAD
@ -794,7 +801,7 @@ bool recording_screen(bool no_source)
struct audio_recording_options rec_options; struct audio_recording_options rec_options;
global_settings.recscreen_on = true; in_screen = true;
cursor = 0; cursor = 0;
#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
ata_set_led_enabled(false); ata_set_led_enabled(false);
@ -1764,7 +1771,7 @@ bool recording_screen(bool no_source)
peak_meter_trigger(false); peak_meter_trigger(false);
peak_meter_set_trigger_listener(NULL); peak_meter_set_trigger_listener(NULL);
global_settings.recscreen_on = false; in_screen = false;
sound_settings_apply(); sound_settings_apply();
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)

View file

@ -19,6 +19,7 @@
#ifndef RECORDING_H #ifndef RECORDING_H
#define RECORDING_H #define RECORDING_H
bool in_recording_screen(void);
bool recording_screen(bool no_source); bool recording_screen(bool no_source);
char *rec_create_filename(char *buf); char *rec_create_filename(char *buf);
int rec_create_directory(void); int rec_create_directory(void);

View file

@ -310,7 +310,6 @@ struct user_settings
int rec_left_gain; /* depends on target */ int rec_left_gain; /* depends on target */
int rec_right_gain; /* depands on target */ int rec_right_gain; /* depands on target */
bool rec_editable; /* true means that the bit reservoir is off */ bool rec_editable; /* true means that the bit reservoir is off */
bool recscreen_on; /* true if using the recording screen */
/* note: timesplit setting is not saved */ /* note: timesplit setting is not saved */
int rec_timesplit; /* 0 = off, int rec_timesplit; /* 0 = off,

View file

@ -382,7 +382,6 @@ const struct settings_list settings[] = {
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
/* recording */ /* recording */
OFFON_SETTING(0,recscreen_on,-1,false,"recscreen on",NULL),
OFFON_SETTING(0,rec_startup,LANG_RECORD_STARTUP,false, OFFON_SETTING(0,rec_startup,LANG_RECORD_STARTUP,false,
"rec screen on startup",NULL), "rec screen on startup",NULL),
{F_T_INT,GS(rec_timesplit), LANG_SPLIT_TIME, INT(0),"rec timesplit", {F_T_INT,GS(rec_timesplit), LANG_SPLIT_TIME, INT(0),"rec timesplit",