Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category
  • Assigned To
    Linus Nielsen Feltzing
  • Operating System
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by Alexandre Flament - 2003-05-04
Last edited by Alexandre 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
handlers_count);
- bool menu_run_custom(int m, KeyHandler* handlers, int
handlers_count);

the KeyHandler is called each time a key is pressed, so
we can define custom keyhandler for menu.
The result can be :
- MENU_ACTION_NONE
- MENU_ACTION_EXIT
- MENU_ACTION_PARSE
- MENU_ACTION_SELECT
- MENU_ACTION_PREVIOUS
- MENU_ACTION_NEXT
- MENU_ACTION_F1
- MENU_ACTION_F2
- MENU_ACTION_F3

The default key handler is menu_default_key_handler.

Closed by  Hristo Kovachev
2006-03-26 13:10
Reason for closing:  Out of Date
Alexandre Flament commented on 2003-05-04 23:39

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

Alexandre Flament commented on 2003-05-06 21:06

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
menu_init_with_keyhandler.

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)

Alexandre Flament commented on 2003-05-08 21:52

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)

Alexandre Flament commented on 2003-05-23 22:26

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 :
http://a.flament.free.fr/rockbox/ajbrec-20030524.ajz

Alexandre Flament commented on 2003-05-25 16:53

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

Admin
Björn Stenberg commented on 2003-06-05 11:17

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

Admin
Linus Nielsen Feltzing commented on 2004-07-05 14:37

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

Alexandre Flament commented on 2004-08-29 21:36

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.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing