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



Rockbox mail archive

Subject: Re: unique function for each button

Re: unique function for each button

From: <tp_at_diffenbach.org>
Date: Fri, 31 Jan 2003 09:38:09 -0800 (PST)

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
>
Received on 2003-01-31

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy