本文整理汇总了C++中ID2P函数的典型用法代码示例。如果您正苦于以下问题:C++ ID2P函数的具体用法?C++ ID2P怎么用?C++ ID2P使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ID2P函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: rectrigger
/**
* Displays a menu for editing the trigger settings.
*/
bool rectrigger(void)
{
int exit_request = false;
enum trigger_menu_option selected = TRIGGER_MODE;
bool retval = false;
int old_x_margin, old_y_margin;
#define TRIGGER_MODE_COUNT 3
static const unsigned char *trigger_modes[] = {
ID2P(LANG_OFF),
ID2P(LANG_RECORD_TRIG_NOREARM),
ID2P(LANG_RECORD_TRIG_REARM)
};
#define PRERECORD_TIMES_COUNT 31
static const unsigned char *prerecord_times[] = {
ID2P(LANG_OFF),"1s","2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s",
"10s", "11s", "12s", "13s", "14s", "15s", "16s", "17s", "18s", "19s",
"20s", "21s", "22s", "23s", "24s", "25s", "26s", "27s", "28s", "29s",
"30s"
};
static const unsigned char *option_name[] = {
[TRIGGER_MODE] = ID2P(LANG_RECORD_TRIGGER_MODE),
[PRERECORD_TIME] = ID2P(LANG_RECORD_PRERECORD_TIME),
[START_THRESHOLD] = ID2P(LANG_RECORD_START_THRESHOLD),
[START_DURATION] = ID2P(LANG_RECORD_MIN_DURATION),
[STOP_THRESHOLD] = ID2P(LANG_RECORD_STOP_THRESHOLD),
[STOP_POSTREC] = ID2P(LANG_RECORD_STOP_POSTREC),
[STOP_GAP] = ID2P(LANG_RECORD_STOP_GAP)
};
开发者ID:BackupTheBerlios,项目名称:bimmerbox,代码行数:34,代码来源:sound_menu.c
示例2: ft_play_playlist
/* Start playback of a playlist, checking for bookmark autoload, modified
* playlists, etc., as required. Returns false if playback wasn't started,
* or started via bookmark autoload, true otherwise.
*
* Pointers to both the full pathname and the separated parts needed to
* avoid allocating yet another path buffer on the stack (and save some
* code; the caller typically needs to create the full pathname anyway)...
*/
bool ft_play_playlist(char* pathname, char* dirname, char* filename)
{
if (global_settings.party_mode && audio_status())
{
splash(HZ, ID2P(LANG_PARTY_MODE));
return false;
}
if (bookmark_autoload(pathname))
{
return false;
}
splash(0, ID2P(LANG_WAIT));
/* about to create a new current playlist...
allow user to cancel the operation */
if (!warn_on_pl_erase())
return false;
if (playlist_create(dirname, filename) != -1)
{
if (global_settings.playlist_shuffle)
{
playlist_shuffle(current_tick, -1);
}
playlist_start(0, 0);
return true;
}
return false;
}
开发者ID:jdgordon,项目名称:rockbox,代码行数:41,代码来源:filetree.c
示例3: ft_load_font
static void ft_load_font(char *file)
{
int current_font_id;
enum screen_type screen = SCREEN_MAIN;
#if NB_SCREENS > 1
MENUITEM_STRINGLIST(menu, ID2P(LANG_CUSTOM_FONT), NULL,
ID2P(LANG_MAIN_SCREEN), ID2P(LANG_REMOTE_SCREEN))
switch (do_menu(&menu, NULL, NULL, false))
{
case 0: /* main lcd */
screen = SCREEN_MAIN;
set_file(file, (char *)global_settings.font_file, MAX_FILENAME);
break;
case 1: /* remote */
screen = SCREEN_REMOTE;
set_file(file, (char *)global_settings.remote_font_file, MAX_FILENAME);
break;
}
#else
set_file(file, (char *)global_settings.font_file, MAX_FILENAME);
#endif
splash(0, ID2P(LANG_WAIT));
current_font_id = global_status.font_id[screen];
if (current_font_id >= 0)
font_unload(current_font_id);
current_font_id = font_load(file);
if(screen==SCREEN_MAIN)
font_set_ui(current_font_id);
global_status.font_id[screen] = current_font_id;
viewportmanager_theme_changed(THEME_UI_VIEWPORT);
}
开发者ID:jdgordon,项目名称:rockbox,代码行数:31,代码来源:filetree.c
示例4: ID2P
static char *get_wps_item_name(int selected_item, void * data, char *buffer)
{
(void)selected_item; (void)data; (void)buffer;
if (audio_status())
return ID2P(LANG_NOW_PLAYING);
return ID2P(LANG_RESUME_PLAYBACK);
}
开发者ID:IlVerz,项目名称:rockbox,代码行数:7,代码来源:root_menu.c
示例5: lcd_settings_menu
static bool lcd_settings_menu(void)
{
int m;
bool result;
static const struct menu_item items[] = {
#ifdef CONFIG_BACKLIGHT
{ ID2P(LANG_BACKLIGHT), backlight_timer },
#ifdef HAVE_CHARGING
{ ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging },
#endif
{ ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight },
#if CONFIG_BACKLIGHT == BL_IRIVER
{ ID2P(LANG_BACKLIGHT_FADE_IN), backlight_fade_in },
{ ID2P(LANG_BACKLIGHT_FADE_OUT), backlight_fade_out },
#endif
#endif /* CONFIG_BACKLIGHT */
{ ID2P(LANG_CONTRAST), contrast },
#ifdef HAVE_LCD_BITMAP
{ ID2P(LANG_INVERT), invert },
{ ID2P(LANG_FLIP_DISPLAY), flip_display },
{ ID2P(LANG_INVERT_CURSOR), invert_cursor },
#endif
};
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
NULL, NULL, NULL);
result = menu_run(m);
menu_exit(m);
return result;
}
开发者ID:BackupTheBerlios,项目名称:bimmerbox,代码行数:31,代码来源:settings_menu.c
示例6: system_settings_menu
static bool system_settings_menu(void)
{
int m;
bool result;
static const struct menu_item items[] = {
{ ID2P(LANG_BATTERY_MENU), battery_settings_menu },
#ifndef HAVE_MMC
{ ID2P(LANG_DISK_MENU), disk_settings_menu },
#endif
#ifdef HAVE_RTC
{ ID2P(LANG_TIME_MENU), time_settings_menu },
#endif
{ ID2P(LANG_POWEROFF_IDLE), poweroff_idle_timer },
{ ID2P(LANG_SLEEP_TIMER), sleeptimer_screen },
#ifdef HAVE_ALARM_MOD
{ ID2P(LANG_ALARM_MOD_ALARM_MENU), alarm_screen },
#endif
{ ID2P(LANG_LIMITS_MENU), limits_settings_menu },
#if CONFIG_CODEC == MAS3507D
{ ID2P(LANG_LINE_IN), line_in },
#endif
#ifdef HAVE_CHARGING
{ ID2P(LANG_CAR_ADAPTER_MODE), car_adapter_mode },
#endif
};
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
NULL, NULL, NULL);
result = menu_run(m);
menu_exit(m);
return result;
}
开发者ID:BackupTheBerlios,项目名称:bimmerbox,代码行数:33,代码来源:settings_menu.c
示例7: bookmark_autobookmark
/* ----------------------------------------------------------------------- */
bool bookmark_autobookmark(bool prompt_ok)
{
char* bookmark;
bool update;
if (!bookmark_is_bookmarkable_state())
return false;
audio_pause(); /* first pause playback */
update = (global_settings.autoupdatebookmark && bookmark_exists());
bookmark = create_bookmark();
#if CONFIG_CODEC != SWCODEC
/* Workaround for inability to speak when paused: all callers will
just do audio_stop() when we return, so we can do it right
away. This makes it possible to speak the "Create a Bookmark?"
prompt and the "Bookmark Created" splash. */
audio_stop();
#endif
if (update)
return write_bookmark(true, bookmark);
switch (global_settings.autocreatebookmark)
{
case BOOKMARK_YES:
return write_bookmark(true, bookmark);
case BOOKMARK_NO:
return false;
case BOOKMARK_RECENT_ONLY_YES:
return write_bookmark(false, bookmark);
}
#ifdef HAVE_LCD_BITMAP
const char *lines[]={ID2P(LANG_AUTO_BOOKMARK_QUERY)};
const struct text_message message={lines, 1};
#else
const char *lines[]={ID2P(LANG_AUTO_BOOKMARK_QUERY),
str(LANG_CONFIRM_WITH_BUTTON)};
const struct text_message message={lines, 2};
#endif
if(prompt_ok && gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES)
{
if (global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK)
return write_bookmark(false, bookmark);
else
return write_bookmark(true, bookmark);
}
return false;
}
开发者ID:Rockbox,项目名称:rockbox,代码行数:52,代码来源:bookmark.c
示例8: display_settings_menu
static bool display_settings_menu(void)
{
int m;
bool result;
static const struct menu_item items[] = {
#ifdef HAVE_LCD_BITMAP
{ ID2P(LANG_CUSTOM_FONT), font_browse },
#endif
{ ID2P(LANG_WHILE_PLAYING), custom_wps_browse },
{ ID2P(LANG_LCD_MENU), lcd_settings_menu },
#ifdef HAVE_REMOTE_LCD
{ ID2P(LANG_LCD_REMOTE_MENU), lcd_remote_settings_menu },
#endif
{ ID2P(LANG_SCROLL_MENU), scroll_settings_menu },
#ifdef HAVE_LCD_BITMAP
{ ID2P(LANG_BARS_MENU), bars_settings_menu },
{ ID2P(LANG_PM_MENU), peak_meter_menu },
{ ID2P(LANG_BIDI_SUPPORT), bidi_support },
#endif
};
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
NULL, NULL, NULL);
result = menu_run(m);
menu_exit(m);
return result;
}
开发者ID:BackupTheBerlios,项目名称:bimmerbox,代码行数:28,代码来源:settings_menu.c
示例9: settings_save_config
bool settings_save_config(int options)
{
char filename[MAX_PATH];
char *folder, *namebase;
switch (options)
{
case SETTINGS_SAVE_THEME:
folder = THEME_DIR;
namebase = "theme";
break;
#ifdef HAVE_RECORDING
case SETTINGS_SAVE_RECPRESETS:
folder = RECPRESETS_DIR;
namebase = "recording";
break;
#endif
#if CONFIG_CODEC == SWCODEC
case SETTINGS_SAVE_EQPRESET:
folder = EQS_DIR;
namebase = "eq";
break;
#endif
case SETTINGS_SAVE_SOUND:
folder = ROCKBOX_DIR;
namebase = "sound";
break;
default:
folder = ROCKBOX_DIR;
namebase = "config";
break;
}
create_numbered_filename(filename, folder, namebase, ".cfg", 2
IF_CNFN_NUM_(, NULL));
/* allow user to modify filename */
while (true) {
if (!kbd_input(filename, sizeof filename)) {
break;
}
else {
return false;
}
}
if (settings_write_config(filename, options))
splash(HZ, ID2P(LANG_SETTINGS_SAVED));
else
splash(HZ, ID2P(LANG_FAILED));
return true;
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:50,代码来源:settings.c
示例10: dirs_to_scan
static int dirs_to_scan(void)
{
if (folder_select(global_settings.tagcache_scan_paths,
sizeof(global_settings.tagcache_scan_paths)))
{
static const char *lines[] = {ID2P(LANG_TAGCACHE_BUSY),
ID2P(LANG_TAGCACHE_FORCE_UPDATE)};
static const struct text_message message = {lines, 2};
if (gui_syncyesno_run(&message, NULL, NULL) == YESNO_YES)
tagcache_rebuild_with_splash();
}
return 0;
}
开发者ID:Brandon7357,项目名称:rockbox,代码行数:14,代码来源:settings_menu.c
示例11: clear_start_directory
static int clear_start_directory(void)
{
strcpy(global_settings.start_directory, "/");
settings_save();
splash(HZ, ID2P(LANG_RESET_DONE_CLEAR));
return false;
}
开发者ID:kugel-,项目名称:rockbox,代码行数:7,代码来源:settings_menu.c
示例12: limits_settings_menu
static bool limits_settings_menu(void)
{
int m;
bool result;
static const struct menu_item items[] = {
{ ID2P(LANG_MAX_FILES_IN_DIR), max_files_in_dir },
{ ID2P(LANG_MAX_FILES_IN_PLAYLIST), max_files_in_playlist },
};
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
NULL, NULL, NULL);
result = menu_run(m);
menu_exit(m);
return result;
}
开发者ID:BackupTheBerlios,项目名称:bimmerbox,代码行数:16,代码来源:settings_menu.c
示例13: time_settings_menu
static bool time_settings_menu(void)
{
int m;
bool result;
static const struct menu_item items[] = {
{ ID2P(LANG_TIME), timedate_set },
{ ID2P(LANG_TIMEFORMAT), timeformat_set },
};
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
NULL, NULL, NULL);
result = menu_run(m);
menu_exit(m);
return result;
}
开发者ID:BackupTheBerlios,项目名称:bimmerbox,代码行数:16,代码来源:settings_menu.c
示例14: wpsscrn
static int wpsscrn(void* param)
{
int ret_val = GO_TO_PREVIOUS;
(void)param;
if (audio_status())
{
talk_shutup();
ret_val = gui_wps_show();
}
else if ( global_status.resume_index != -1 )
{
DEBUGF("Resume index %X offset %lX\n",
global_status.resume_index,
(unsigned long)global_status.resume_offset);
if (playlist_resume() != -1)
{
playlist_start(global_status.resume_index,
global_status.resume_offset);
ret_val = gui_wps_show();
}
}
else
{
splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
}
return ret_val;
}
开发者ID:ntj,项目名称:rockbox,代码行数:27,代码来源:root_menu.c
示例15: volume_limit_callback
static int volume_limit_callback(int action,const struct menu_item_ex *this_item)
{
(void)this_item;
static struct int_setting volume_limit_int_setting;
volume_limit_int_setting.option_callback = NULL;
volume_limit_int_setting.unit = UNIT_DB;
volume_limit_int_setting.min = sound_min(SOUND_VOLUME);
volume_limit_int_setting.max = sound_max(SOUND_VOLUME);
volume_limit_int_setting.step = sound_steps(SOUND_VOLUME);
volume_limit_int_setting.formatter = NULL;
volume_limit_int_setting.get_talk_id = get_dec_talkid;
struct settings_list setting;
setting.flags = F_BANFROMQS|F_INT_SETTING|F_T_INT|F_NO_WRAP;
setting.lang_id = LANG_VOLUME_LIMIT;
setting.default_val.int_ = sound_max(SOUND_VOLUME);
setting.int_setting = &volume_limit_int_setting;
switch (action)
{
case ACTION_ENTER_MENUITEM:
setting.setting = &global_settings.volume_limit;
option_screen(&setting, NULL, false, ID2P(LANG_VOLUME_LIMIT));
case ACTION_EXIT_MENUITEM: /* on exit */
setvol();
break;
}
return action;
}
开发者ID:sdqinhao,项目名称:rockbox,代码行数:30,代码来源:sound_menu.c
示例16: wpsscrn
static int wpsscrn(void* param)
{
int ret_val = GO_TO_PREVIOUS;
(void)param;
push_current_activity(ACTIVITY_WPS);
if (audio_status())
{
talk_shutup();
ret_val = gui_wps_show();
}
else if ( global_status.resume_index != -1 )
{
DEBUGF("Resume index %X crc32 %lX offset %lX\n",
global_status.resume_index,
(unsigned long)global_status.resume_crc32,
(unsigned long)global_status.resume_offset);
if (playlist_resume() != -1)
{
playlist_resume_track(global_status.resume_index,
global_status.resume_crc32,
global_status.resume_elapsed,
global_status.resume_offset);
ret_val = gui_wps_show();
}
}
else
{
splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
}
pop_current_activity();
return ret_val;
}
开发者ID:Cortexelus,项目名称:rockbox,代码行数:32,代码来源:root_menu.c
示例17: gui_quickscreen_draw
static void gui_quickscreen_draw(const struct gui_quickscreen *qs,
struct screen *display,
struct viewport *parent,
struct viewport vps[QUICKSCREEN_ITEM_COUNT],
struct viewport *vp_icons)
{
int i;
char buf[MAX_PATH];
unsigned const char *title, *value;
void *setting;
int temp;
display->set_viewport(parent);
display->clear_viewport();
for (i = 0; i < QUICKSCREEN_ITEM_COUNT; i++)
{
struct viewport *vp = &vps[i];
if (!qs->items[i])
continue;
display->set_viewport(vp);
display->scroll_stop(vp);
title = P2STR(ID2P(qs->items[i]->lang_id));
setting = qs->items[i]->setting;
temp = option_value_as_int(qs->items[i]);
value = option_get_valuestring(qs->items[i],
buf, MAX_PATH, temp);
if (viewport_get_nb_lines(vp) < 2)
{
char text[MAX_PATH];
snprintf(text, MAX_PATH, "%s: %s", title, value);
display->puts_scroll(0, 0, text);
}
else
{
display->puts_scroll(0, 0, title);
display->puts_scroll(0, 1, value);
}
display->update_viewport();
}
/* draw the icons */
display->set_viewport(vp_icons);
display->mono_bitmap(bitmap_icons_7x8[Icon_UpArrow],
(vp_icons->width/2) - 4, 0, 7, 8);
display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
vp_icons->width - 8,
(vp_icons->height/2) - 4, 7, 8);
display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 0,
(vp_icons->height/2) - 4, 7, 8);
display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
(vp_icons->width/2) - 4,
vp_icons->height - 8, 7, 8);
display->set_viewport(parent);
display->update_viewport();
display->set_viewport(NULL);
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:59,代码来源:quickscreen.c
示例18: autoresume_callback
static int autoresume_callback(int action, const struct menu_item_ex *this_item)
{
(void)this_item;
if (action == ACTION_EXIT_MENUITEM /* on exit */
&& global_settings.autoresume_enable
&& !tagcache_is_usable())
{
static const char *lines[] = {ID2P(LANG_TAGCACHE_BUSY),
ID2P(LANG_TAGCACHE_FORCE_UPDATE)};
static const struct text_message message = {lines, 2};
if (gui_syncyesno_run(&message, NULL, NULL) == YESNO_YES)
tagcache_rebuild_with_splash();
}
return action;
}
开发者ID:kugel-,项目名称:rockbox,代码行数:17,代码来源:settings_menu.c
示例19: ff_rewind_settings_menu
static bool ff_rewind_settings_menu(void)
{
int m;
bool result;
static const struct menu_item items[] = {
{ ID2P(LANG_FFRW_STEP), ff_rewind_min_step },
{ ID2P(LANG_FFRW_ACCEL), ff_rewind_accel },
};
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
NULL, NULL, NULL);
result = menu_run(m);
menu_exit(m);
return result;
}
开发者ID:BackupTheBerlios,项目名称:bimmerbox,代码行数:17,代码来源:settings_menu.c
示例20: voice_menu
static bool voice_menu(void)
{
int m;
bool result;
static const struct menu_item items[] = {
{ ID2P(LANG_VOICE_MENU), voice_menus },
{ ID2P(LANG_VOICE_DIR), voice_dirs },
{ ID2P(LANG_VOICE_FILE), voice_files }
};
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
NULL, NULL, NULL);
result = menu_run(m);
menu_exit(m);
return result;
}
开发者ID:BackupTheBerlios,项目名称:bimmerbox,代码行数:17,代码来源:settings_menu.c
注:本文中的ID2P函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论