Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: unique function for each button
From: tp_at_diffenbach.org
Date: 2003-01-31


Of course the Rockbox can be in different states, so you'd need to set the mapping per state. The recorder has 10 buttons so,

typedef int ( *rockbox_function )( int, void* ) ;

#define BUTTON_COUNT 10 ;
#define STATE_COUNT 10 ;

static rockbox_function[ STATE_COUNT ][ BUTTON_COUNT ] = {
{ &default_button_1, def_button_2, ... } } ;

Now this is sizeof( func_ptr ) * STATE_COUNT * BUTTON_COUNT = 400 bytes, so we might want to investigate ways to slim it down.

Of course, it also requites writing wrappers for all major functions to conform to the rockbox_function signature, or nasty casting.

Quoting Gary Richardi <gary_pr_at_yahoo.com>:

> Making all button functions configurable by the user is a GREAT idea!
>
> --- tp_at_diffenbach.org wrote:
> >
> > My two cents: what this (any?) button does should be customizable by
> > the user.
> >
>
>
> =====
> --- Gary ---
> 4 Way Street (West) - CSN&Y Tribute band ---> http://4waystreet.net
> My original music ---> http://www.mp3.com/gpr
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa