yes i've taken a look at the main menu file that accesses the credits and it's doing pretty much the same thing (mine is not in a conditional). Here's my modification in settings.h:
#define FMPRESET_PATH ROCKBOX_DIR "/fmpresets"
#define VIEWERS_CONFIG ROCKBOX_DIR "/viewers.config"
#define CONFIGFILE ROCKBOX_DIR "/config.cfg"
#define FIXEDSETTINGSFILE ROCKBOX_DIR "/fixed.cfg"
#define CUBE PLUGIN_DEMOS_DIR "/cube.rock"
#define MAX_FILENAME 32
#define BOOKMARK_NO 0
#define BOOKMARK_YES 1
#define BOOKMARK_ASK 2
And here is what i'm doing in onplay.c to modify the wps context menu:
static void cube_demo(void)
{
api->audio_stop();
plugin_load(CUBE, NULL);
return;
}
MENUITEM_FUNCTION(view_cue_item, 0, ID2P(LANG_BROWSE_CUESHEET),
view_cue, NULL, view_cue_item_callback, Icon_NOICON);
/* CONTEXT_WPS items */
MENUITEM_FUNCTION(browse_id3_item, 0, ID2P(LANG_MENU_SHOW_ID3_INFO),
browse_id3, NULL, NULL, Icon_NOICON);
#ifdef HAVE_PITCHSCREEN
MENUITEM_FUNCTION(pitch_screen_item, 0, ID2P(LANG_PITCH),
pitch_screen, NULL, NULL, Icon_Audio);
#endif
MENUITEM_FUNCTION(goto_demo, 0, "Goto Demo", cube_demo, NULL, NULL, Icon_NOICON);
...and further down the menu is made:
MAKE_ONPLAYMENU( wps_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
onplaymenu_callback, Icon_Audio,
&sound_settings, &wps_playlist_menu, &cat_playlist_menu,
&goto_demo,
#ifdef HAVE_TAGCACHE
&rating_item,
#endif
Everything compiles fine and the option is added to the context menu but whenever I select the item audio stops (like i wanted it too), but then everything just freezes. So I'm not sure if the audio is actually stopping because I told it too or because of the freeze. This makes me think that there is something wrong with the function, but I can't find anything.