forked from len0rd/rockbox
Added function pointer argument to set_option(). This allows for instantaneous response from the AVC and Channels sound options
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2253 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3b97474978
commit
75d77155dc
4 changed files with 32 additions and 20 deletions
|
|
@ -587,7 +587,7 @@ void set_bool_options(char* string, bool* variable, char* yes_str, char* no_str
|
|||
{
|
||||
char* names[] = { yes_str, no_str };
|
||||
int value = !*variable;
|
||||
set_option(string, &value, names, 2);
|
||||
set_option(string, &value, names, 2, NULL);
|
||||
*variable = !value;
|
||||
}
|
||||
|
||||
|
|
@ -675,7 +675,8 @@ void set_int(char* string,
|
|||
lcd_stop_scroll();
|
||||
}
|
||||
|
||||
void set_option(char* string, int* variable, char* options[], int numoptions )
|
||||
void set_option(char* string, int* variable, char* options[],
|
||||
int numoptions, void (*function)(int))
|
||||
{
|
||||
bool done = false;
|
||||
|
||||
|
|
@ -742,6 +743,9 @@ void set_option(char* string, int* variable, char* options[], int numoptions )
|
|||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( function )
|
||||
function(*variable);
|
||||
}
|
||||
lcd_stop_scroll();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue