diff options
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index 45b18608e8..b65d2fe62f 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -1011,6 +1011,41 @@ MENUITEM_FUNCTION(eq_browse_presets_item, 0, ID2P(LANG_EQUALIZER_BROWSE), | |||
1011 | eq_browse_presets, NULL, NULL, Icon_Audio); | 1011 | eq_browse_presets, NULL, NULL, Icon_Audio); |
1012 | #endif | 1012 | #endif |
1013 | 1013 | ||
1014 | /* study mode setting toggling */ | ||
1015 | |||
1016 | static char* study_mode_toggle_get_name(int selected_item, void * data, | ||
1017 | char *buffer) | ||
1018 | { | ||
1019 | (void)selected_item; | ||
1020 | (void)data; | ||
1021 | snprintf(buffer, MAX_PATH, | ||
1022 | global_settings.study_mode ? str(LANG_DISABLE_STUDY_MODE) | ||
1023 | : str(LANG_ENABLE_STUDY_MODE)); | ||
1024 | return buffer; | ||
1025 | } | ||
1026 | |||
1027 | static int study_mode_toggle_speak_item(int selected_item, void * data) | ||
1028 | { | ||
1029 | (void)selected_item; | ||
1030 | (void)data; | ||
1031 | talk_id(global_settings.study_mode ? LANG_DISABLE_STUDY_MODE | ||
1032 | : LANG_ENABLE_STUDY_MODE, false); | ||
1033 | return 0; | ||
1034 | } | ||
1035 | |||
1036 | static int toggle_study_mode(void * param) | ||
1037 | { | ||
1038 | (void)param; | ||
1039 | global_settings.study_mode ^= 1; | ||
1040 | return 0; | ||
1041 | } | ||
1042 | |||
1043 | MENUITEM_FUNCTION_DYNTEXT(study_mode_toggle, 0, | ||
1044 | toggle_study_mode, NULL, | ||
1045 | study_mode_toggle_get_name, | ||
1046 | study_mode_toggle_speak_item, | ||
1047 | NULL, NULL, Icon_NOICON); | ||
1048 | |||
1014 | /* CONTEXT_[TREE|ID3DB] items */ | 1049 | /* CONTEXT_[TREE|ID3DB] items */ |
1015 | static int clipboard_callback(int action,const struct menu_item_ex *this_item); | 1050 | static int clipboard_callback(int action,const struct menu_item_ex *this_item); |
1016 | MENUITEM_FUNCTION(rename_file_item, 0, ID2P(LANG_RENAME), | 1051 | MENUITEM_FUNCTION(rename_file_item, 0, ID2P(LANG_RENAME), |
@@ -1152,6 +1187,7 @@ MAKE_ONPLAYMENU( wps_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE), | |||
1152 | #if CONFIG_CODEC == SWCODEC | 1187 | #if CONFIG_CODEC == SWCODEC |
1153 | &eq_menu_graphical_item, &eq_browse_presets_item, | 1188 | &eq_menu_graphical_item, &eq_browse_presets_item, |
1154 | #endif | 1189 | #endif |
1190 | &study_mode_toggle, | ||
1155 | ); | 1191 | ); |
1156 | /* used when onplay() is not called in the CONTEXT_WPS context */ | 1192 | /* used when onplay() is not called in the CONTEXT_WPS context */ |
1157 | MAKE_ONPLAYMENU( tree_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE), | 1193 | MAKE_ONPLAYMENU( tree_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE), |