• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category
  • Assigned To
  • Operating System
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by flament - 2003-05-04
Last edited by flament - 2004-08-29

FS#1314 - Patch of radio menu

Modify :
- radio.c
- menu.c & menu.h

radio.c (patch from version 1.7) :
F1 : global menu for radio (nothing except a dummy entry)
F2 : list of presets, with contextual menu with F3
(modify or delete)
F3 : contextual menu for current radio :

  1. if preset exist : modify/delete
  2. if it doesn’t exist : add

menu.c, menu.h
Add :
- typedef int (*KeyHandler)(int, struct menu);
- int menu_default_key_handler(int key, struct menu);
- int menu_show_custom(int m, KeyHandler* handlers, int
- bool menu_run_custom(int m, KeyHandler* handlers, int

the KeyHandler is called each time a key is pressed, so
we can define custom keyhandler for menu.
The result can be :

The default key handler is menu_default_key_handler.

Closed by  bger
2006-03-26 13:10
Reason for closing:  Out of Date

2 notes :
- There is a refresh bug on F2 contextual menu
- There is a warning in menu.c

I changed menu.h again :

int menu_default_key_handler(int key, struct menu*);

int menu_init(struct menu_items* items, int count);
int menu_init_with_keyhandler(struct menu_items* items, int
count, KeyHandler* handlers, int handlerscount);
void menu_exit(int menu);
int menu_show(int m);

So all is the same than the orignal menu.h except the

There still is a bug of refresh with F2 contextual menu.
On F2 :
ON+UP : move up the selected entry
ON+DOWN isn't implemented yet
(the menu isn't refresh but by pressing twice F2 you can see
the effect)

radio20030508.patch adds :
- ON+FOWARD / ON+PREVIOUS to go on next/previous preset
- Default radio is first preset
- PLAY : mute/unmute radio (update status bar, perhaps a
special icon is need for radio)

- still bug move up/move down/delete with F2 menu (if
someone could help me with menu_key_handler in radio.c)

Suppress all of bug (except ON+UP, ON+DOWN on F2 menu)
Add on F1:
- Set sensitivity
- Force mono
- Frequency range

Add on F3:
- Record (go on recording screen with settings set for radio)

A compiled version can download here :

About radio-set.patch :
Add function radio_set which can set frequency, mute,
sensitivity, start IF measurement

About radio-format-fmr.patch :
Modify format of .fmr to store only used presets

Project Manager
zagor commented on 2003-06-05 11:17

I don't have an FM recorder. Assigning to Linus :-)

Project Manager

Thanks Alexandre! I have committed my version of most of
your stuff except for the sensitivity. That'll come too.

Thanks to commit my work ;)
Is it possible to implement also on+down/on+up on presets
menu ? (and perhaps on+right/on+left ?)

I have a question about radio.c revision 1.38 : why
status_draw() is call only when update_screen is true ?
When I want to watch time but I didn't press any button for
a while, I see a wrong time.


Available keyboard shortcuts


Task Details

Task Editing