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: next step for the settings changes - the menus

next step for the settings changes - the menus

From: Jonathan Gordon <jdgordy_at_gmail.com>
Date: Sun, 28 Jan 2007 23:57:30 +1100

Hey all,
Ok, I am almost ready to get ready for the next lot of commiting re:
the settings tabulating.
The next step involves moving the menus to a simpler and more automatic system.
Attached is my diff as it is now, If you compile and run it, when you
enter the main menu all you will see is the option for the settings
menu and the Manage Settings menus. going into these puts you into the
old menu system and everything works.
The diff does not currently support making menus from just settings
(this will come ASAP, but wanted to get this email out).

My plan is this.
I want to move this in as swiftly as possible without breaking anything.
So first thing to get finished is enable building menus from settings
(example is at the bottom of what they will look like).
Then setup the main menu so everything there points to the current function.
I expect these would both be done before wednesday.
Then with approval I would commit those changes and then enlist as
much support as possible for the last step which is slowly converting
every leaf-menu item (that is, all the settings) to be able to be
used, 1 sub menu at a time.
This part I expect to take quite a while unless I get lots of help...

Moving settings to the new system would involve creating files in
apps/menus/ for each menu group to make it easier later, and editing
settings_list.c for each setting, and commenting out code in
apps/*_menus.c (with the eventual plan of removing them completly).

Does this sound reasonable?
Care to comment?

P.S for the interested.. an example of a submenu is... (this is the
entirety of the code needed to make the sound menu submenu. )

/***********************************/
/* SOUND MENU */
#if CONFIG_CODEC == SWCODEC
int soundmenu_callback(int action,const struct menu_item_ex *this_item)
{
    (void)this_item;
    switch (action)
    {
        case ACTION_ENTER_MENUITEM: /* on entering */
            pcmbuf_set_low_latency(true);
            break;
        case ACTION_STD_CANCEL: /* on exit */
            pcmbuf_set_low_latency(false);
            break;
    }
    return action;
}
#else
#define soundmenu_callback NULL
#endif

MAKE_SETTING_OPT(volume,NULL);
#ifndef HAVE_TLV320
MAKE_SETTING_OPT(bass,NULL);
MAKE_SETTING_OPT(treble,NULL);
#endif
MAKE_SETTING_OPT(balance,NULL);
MAKE_SETTING_OPT(channel_config,NULL);
static MAKE_SETTING_OPT(stereo_width,NULL);
#if CONFIG_CODEC == SWCODEC
MAKE_SETTING_OPT(crossfeed,NULL);
MAKE_SETTING_OPT(crossfeed_direct_gain,NULL);
MAKE_SETTING_OPT(crossfeed_cross_gain,NULL);
MAKE_SETTING_OPT(crossfeed_hf_attenuation,NULL);
MAKE_SETTING_OPT(crossfeed_hf_cutoff,NULL);
MAKE_MENU(crossfeed_menu,ID2P(LANG_CROSSFEED),NULL,
          &crossfeed, &crossfeed_direct_gain, &crossfeed_cross_gain,
          &crossfeed_hf_attenuation, &crossfeed_hf_cutoff);
MAKE_FUNCTION_CALL(equalizer_menu,ID2P(LANG_EQUALIZER),eq_menu, NULL);
MAKE_SETTING_OPT(dithering_enabled,NULL);
#ifdef HAVE_WM8758
MAKE_FUNCTION_CALL(hw_equalizer_menu,ID2P(LANG_EQUALIZER_HARDWARE),eq_hw_menu,
NULL);
#endif
#endif

#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
MAKE_SETTING_OPT(loudness,NULL);
MAKE_SETTING_OPT(avc,NULL);
MAKE_SETTING_OPT(superbass,NULL);
MAKE_SETTING_OPT(mdb_enable,NULL);
MAKE_SETTING_OPT(mdb_strength,NULL);
MAKE_SETTING_OPT(mdb_harmonics,NULL);
MAKE_SETTING_OPT(mdb_center,NULL);
MAKE_SETTING_OPT(mdb_shape,NULL);
#endif



MAKE_MENU(sound_settings,ID2P(LANG_SOUND_SETTINGS),soundmenu_callback,
          &volume,
#ifndef HAVE_TLV320
          &bass,&treble,
#endif
          &balance,&channel_config,&stereo_width
#if CONFIG_CODEC == SWCODEC
         ,&crossfeed_menu, &equalizer_menu,&dithering_enabled
#endif
#ifdef HAVE_WM8758
         ,&hw_equalizer_menu
#endif
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
         ,&loudness,&avc,&superbass,&mdb_enable,&mdb_strength
         ,&mdb_harmonics,&mdb_center,&mdb_shape
#endif
         );
/* SOUND MENU */
/***********************************/

  • application/octet-stream attachment: changes
Received on 2007-01-28

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