summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-02-07 02:48:19 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-02-07 02:48:19 +0000
commitff3bb3aa18e71860d644a50632088ec282968de4 (patch)
tree8cd33aa24b5db5684cceeffd4c3cbca2dd7d54ea
parent70ebc8feb156613d586b3330d309ec72d1e30c2d (diff)
downloadrockbox-ff3bb3aa18e71860d644a50632088ec282968de4.tar.gz
rockbox-ff3bb3aa18e71860d644a50632088ec282968de4.zip
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
-rw-r--r--apps/gui/statusbar.c6
-rw-r--r--apps/recorder/recording.c11
-rw-r--r--apps/recorder/recording.h1
-rw-r--r--apps/settings.h1
-rw-r--r--apps/settings_list.c1
5 files changed, 14 insertions, 6 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index 2f6dfafc81..d3f4813e37 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -38,6 +38,7 @@
38#include "statusbar.h" 38#include "statusbar.h"
39#ifdef HAVE_RECORDING 39#ifdef HAVE_RECORDING
40#include "audio.h" 40#include "audio.h"
41#include "recording.h"
41#endif 42#endif
42 43
43/* FIXME: should be removed from icon.h to avoid redefinition, 44/* 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)
257#endif 258#endif
258#ifdef HAVE_RECORDING 259#ifdef HAVE_RECORDING
259 /* turn off volume display in recording screen */ 260 /* turn off volume display in recording screen */
260 if (!global_settings.recscreen_on) 261 bool recscreen_on = in_recording_screen();
262 if (!recscreen_on)
261#endif 263#endif
262 bar->redraw_volume = gui_statusbar_icon_volume(bar, bar->info.volume); 264 bar->redraw_volume = gui_statusbar_icon_volume(bar, bar->info.volume);
263 gui_statusbar_icon_play_state(display, current_playmode() + Icon_Play); 265 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)
265#ifdef HAVE_RECORDING 267#ifdef HAVE_RECORDING
266 /* If in recording screen, replace repeat mode, volume 268 /* If in recording screen, replace repeat mode, volume
267 and shuffle icons with recording info */ 269 and shuffle icons with recording info */
268 if (global_settings.recscreen_on) 270 if (recscreen_on)
269 gui_statusbar_icon_recording_info(display); 271 gui_statusbar_icon_recording_info(display);
270 else 272 else
271#endif 273#endif
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index a4662ab42e..cb934877a9 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -70,6 +70,13 @@
70#include "radio.h" 70#include "radio.h"
71#ifdef HAVE_RECORDING 71#ifdef HAVE_RECORDING
72 72
73static bool in_screen = false;
74
75bool in_recording_screen(void)
76{
77 return in_screen;
78}
79
73#define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1) 80#define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1)
74 81
75#if CONFIG_KEYPAD == RECORDER_PAD 82#if CONFIG_KEYPAD == RECORDER_PAD
@@ -794,7 +801,7 @@ bool recording_screen(bool no_source)
794 801
795 struct audio_recording_options rec_options; 802 struct audio_recording_options rec_options;
796 803
797 global_settings.recscreen_on = true; 804 in_screen = true;
798 cursor = 0; 805 cursor = 0;
799#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) 806#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
800 ata_set_led_enabled(false); 807 ata_set_led_enabled(false);
@@ -1764,7 +1771,7 @@ bool recording_screen(bool no_source)
1764 peak_meter_trigger(false); 1771 peak_meter_trigger(false);
1765 peak_meter_set_trigger_listener(NULL); 1772 peak_meter_set_trigger_listener(NULL);
1766 1773
1767 global_settings.recscreen_on = false; 1774 in_screen = false;
1768 sound_settings_apply(); 1775 sound_settings_apply();
1769 1776
1770 FOR_NB_SCREENS(i) 1777 FOR_NB_SCREENS(i)
diff --git a/apps/recorder/recording.h b/apps/recorder/recording.h
index a67337b9b6..1b313ecab5 100644
--- a/apps/recorder/recording.h
+++ b/apps/recorder/recording.h
@@ -19,6 +19,7 @@
19#ifndef RECORDING_H 19#ifndef RECORDING_H
20#define RECORDING_H 20#define RECORDING_H
21 21
22bool in_recording_screen(void);
22bool recording_screen(bool no_source); 23bool recording_screen(bool no_source);
23char *rec_create_filename(char *buf); 24char *rec_create_filename(char *buf);
24int rec_create_directory(void); 25int rec_create_directory(void);
diff --git a/apps/settings.h b/apps/settings.h
index db78cb62a1..7321d39cf5 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -310,7 +310,6 @@ struct user_settings
310 int rec_left_gain; /* depends on target */ 310 int rec_left_gain; /* depends on target */
311 int rec_right_gain; /* depands on target */ 311 int rec_right_gain; /* depands on target */
312 bool rec_editable; /* true means that the bit reservoir is off */ 312 bool rec_editable; /* true means that the bit reservoir is off */
313 bool recscreen_on; /* true if using the recording screen */
314 313
315 /* note: timesplit setting is not saved */ 314 /* note: timesplit setting is not saved */
316 int rec_timesplit; /* 0 = off, 315 int rec_timesplit; /* 0 = off,
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 939f83aea4..8641cd83b9 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -382,7 +382,6 @@ const struct settings_list settings[] = {
382 382
383#ifdef HAVE_RECORDING 383#ifdef HAVE_RECORDING
384 /* recording */ 384 /* recording */
385 OFFON_SETTING(0,recscreen_on,-1,false,"recscreen on",NULL),
386 OFFON_SETTING(0,rec_startup,LANG_RECORD_STARTUP,false, 385 OFFON_SETTING(0,rec_startup,LANG_RECORD_STARTUP,false,
387 "rec screen on startup",NULL), 386 "rec screen on startup",NULL),
388 {F_T_INT,GS(rec_timesplit), LANG_SPLIT_TIME, INT(0),"rec timesplit", 387 {F_T_INT,GS(rec_timesplit), LANG_SPLIT_TIME, INT(0),"rec timesplit",