summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-09-05 19:17:23 +0000
committerJens Arnold <amiconn@rockbox.org>2005-09-05 19:17:23 +0000
commit1e0b5aabcb9637b7e7423bc1ca198899be98abbd (patch)
tree07b6f47cfef0de2be35f44bf3a335c04c600f242
parentfaa4404da9ab451ca7898ae76af3825e70d84726 (diff)
Ondio FM button assignment: The recording screen now uses up/down to select the setting, and left/right to adjust it, like the recorders. Start/pause recording is short MODE. The radio screen now requires a MODE doubleclick to start recording. This should prevent unwanted recordings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7474 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/recorder/radio.c16
-rw-r--r--apps/recorder/recording.c24
2 files changed, 32 insertions, 8 deletions
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index 68d36dddd3..ba8fc7e7c2 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -76,6 +76,7 @@
#define FM_EXIT (BUTTON_SELECT | BUTTON_REL)
#elif CONFIG_KEYPAD == ONDIO_PAD /* restricted keypad */
#define FM_MENU (BUTTON_MENU | BUTTON_REPEAT)
+#define FM_RECORD_DBLPRE BUTTON_MENU
#define FM_RECORD (BUTTON_MENU | BUTTON_REL)
#define FM_STOP (BUTTON_OFF | BUTTON_REL)
#define FM_EXIT (BUTTON_OFF | BUTTON_REPEAT)
@@ -182,6 +183,9 @@ bool radio_screen(void)
char buf[MAX_PATH];
bool done = false;
int button, lastbutton = BUTTON_NONE;
+#ifdef FM_RECORD_DBLPRE
+ unsigned long rec_lastclick = 0;
+#endif
int freq;
bool tuned;
bool stereo = false;
@@ -323,6 +327,18 @@ bool radio_screen(void)
#ifdef FM_RECORD
case FM_RECORD:
+#ifdef FM_RECORD_DBLPRE
+ if (lastbutton != FM_RECORD_DBLPRE)
+ {
+ rec_lastclick = 0;
+ break;
+ }
+ if (current_tick - rec_lastclick > HZ/2)
+ {
+ rec_lastclick = current_tick;
+ break;
+ }
+#endif
#ifndef SIMULATOR
if(audio_status() == AUDIO_STATUS_RECORD)
{
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 3fcf97b177..e6bb833584 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -66,18 +66,23 @@
#define REC_SETTINGS BUTTON_F1
#define REC_F2 BUTTON_F2
#define REC_F3 BUTTON_F3
+
#elif CONFIG_KEYPAD == ONDIO_PAD /* only limited features */
#define REC_STOPEXIT BUTTON_OFF
-#define REC_RECPAUSE BUTTON_RIGHT
-#define REC_INC BUTTON_UP
-#define REC_DEC BUTTON_DOWN
-#define REC_NEXT (BUTTON_MENU | BUTTON_REL)
+#define REC_RECPAUSE_PRE BUTTON_MENU
+#define REC_RECPAUSE (BUTTON_MENU | BUTTON_REL)
+#define REC_INC BUTTON_RIGHT
+#define REC_DEC BUTTON_LEFT
+#define REC_NEXT BUTTON_DOWN
+#define REC_PREV BUTTON_UP
#define REC_SETTINGS (BUTTON_MENU | BUTTON_REPEAT)
+
#elif CONFIG_KEYPAD == IRIVER_H100_PAD
#define REC_STOPEXIT BUTTON_OFF
#define REC_RECPAUSE BUTTON_ON
#define REC_INC BUTTON_RIGHT
#define REC_DEC BUTTON_LEFT
+
#elif CONFIG_KEYPAD == GMINI100_PAD
#define REC_STOPEXIT BUTTON_OFF
#define REC_RECPAUSE BUTTON_ON
@@ -150,11 +155,7 @@ void adjust_cursor(void)
cursor = 0;
if(cursor > 2)
-#ifdef REC_PREV /* normal case, stop at the end */
cursor = 2;
-#else
- cursor = 0; /* only 1 button, cycle through */
-#endif
}
else
{
@@ -254,6 +255,7 @@ static void trigger_listener(int trigger_status)
bool recording_screen(void)
{
long button;
+ long lastbutton = BUTTON_NONE;
bool done = false;
char buf[32];
char buf2[32];
@@ -395,6 +397,10 @@ bool recording_screen(void)
break;
case REC_RECPAUSE:
+#ifdef REC_RECPAUSE_PRE
+ if (lastbutton != REC_RECPAUSE_PRE)
+ break;
+#endif
/* Only act if the mpeg is stopped */
if(!(audio_stat & AUDIO_STATUS_RECORD))
{
@@ -622,6 +628,8 @@ bool recording_screen(void)
default_event_handler(button);
break;
}
+ if (button != BUTTON_NONE)
+ lastbutton = button;
lcd_setfont(FONT_SYSFIXED);