当前位置: 首页>>代码示例>>C++>>正文


C++ resources_set_string函数代码示例

本文整理汇总了C++中resources_set_string函数的典型用法代码示例。如果您正苦于以下问题:C++ resources_set_string函数的具体用法?C++ resources_set_string怎么用?C++ resources_set_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了resources_set_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UI_MENU_CALLBACK

static UI_MENU_CALLBACK(start_recording_callback)
{
    char *parameter = (char *)param;

    if (activated) {
        resources_set_string("SoundRecordDeviceName", "");
        if (parameter != NULL) {
            char *name = NULL;

            name = sdl_ui_file_selection_dialog("Choose audio file to record to", FILEREQ_MODE_CHOOSE_FILE);
            if (name != NULL) {
                util_add_extension(&name, parameter);
                resources_set_string("SoundRecordDeviceArg", name);
                resources_set_string("SoundRecordDeviceName", parameter);
                lib_free(name);
            }
        }
    } else {
        if (parameter != NULL) {
            const char *w;

            resources_get_string("SoundRecordDeviceName", &w);
            if (!strcmp(w, parameter)) {
                return sdl_menu_text_tick;
            }
        }
    }
    return NULL;
}
开发者ID:AreaScout,项目名称:vice,代码行数:29,代码来源:menu_sound.c

示例2: plus4model_set

void plus4model_set(int model)
{
    int old_model;

    old_model = plus4model_get();

    if ((model == old_model) || (model == PLUS4MODEL_UNKNOWN)) {
        return;
    }

    resources_set_int("MachineVideoStandard", plus4models[model].video);
    resources_set_int("RamSize", plus4models[model].ramsize);

    resources_set_string("KernalName", plus4models[model].kernalname);
    resources_set_string("BasicName", plus4models[model].basicname);

    resources_set_string("FunctionLowName", plus4models[model].plus1loname);
    resources_set_string("FunctionHighName", plus4models[model].plus1hiname);

    resources_set_int("Acia1Enable", plus4models[model].hasacia);

    resources_set_int("SpeechEnabled", 0);
    if (plus4models[model].hasspeech) {
        resources_set_string("SpeechImage", "c2lo.364");
        resources_set_int("SpeechEnabled", 1);
    }

}
开发者ID:SMTDDR,项目名称:droidsound,代码行数:28,代码来源:plus4model.c

示例3: cbm2_set_model

int cbm2_set_model(const char *model, void *extra)
{
    int i;

    vsync_suspend_speed_eval();

    for (i = 0; modtab[i].model; i++) {
        if (strcmp(modtab[i].model, model))
            continue;

        resources_set_int("UseVicII", modtab[i].usevicii);
        resources_set_int("RamSize", modtab[i].ramsize);
        resources_set_string("BasicName", modtab[i].basic);
        resources_set_string("ChargenName", modtab[i].charrom);
        resources_set_string("KernalName", modtab[i].kernal);
        resources_set_int("ModelLine", modtab[i].line);

        cbm2_model = i;

        /* we have to wait until we did enough initialization */
        if (!cbm2_init_ok)
            return 0; 

        mem_powerup();
        mem_load();
        machine_trigger_reset(MACHINE_RESET_MODE_SOFT);
        return 0;
    }
    return -1;
}
开发者ID:twinaphex,项目名称:vice-next,代码行数:30,代码来源:cbm2mem.c

示例4: ui_sound_record_settings_dialog

void ui_sound_record_settings_dialog(video_canvas_t *canvas)
{
    APTR window;
    int val;

    sound_canvas = canvas;

    window = mui_make_simple_window(build_gui_record(), translate_text(IDS_SOUND_RECORD_SETTINGS));

    if (window != NULL) {
        mui_add_window(window);
        ui_get_to(ui_to_from_record);
        set(format, MUIA_Cycle_Active, 1);
        set(window, MUIA_Window_Open, TRUE);
        if (mui_run() == BTN_OK) {
            ui_get_from(ui_to_from_record);
            get(format, MUIA_Cycle_Active, (APTR)&val);
            resources_set_string("SoundRecordDeviceName", "");
            resources_set_string("SoundRecordDeviceName", ui_sound_formats[val]);
            ui_display_statustext(translate_text(IDS_SOUND_RECORDING_STARTED), 1);
        }
        set(window, MUIA_Window_Open, FALSE);
        mui_rem_window(window);
        MUI_DisposeObject(window);
    }
}
开发者ID:AreaScout,项目名称:vice,代码行数:26,代码来源:uisound.c

示例5: store_printer_dialog_results

static BOOL store_printer_dialog_results(HWND hwnd, unsigned int num)
{
    char printer_name[30];
  
    if (num == 0) {
        sprintf(printer_name, "PrinterUserport");
    } else {
        sprintf(printer_name, "Printer%d", num);
    }

    resources_set_int(printer_name, (int)SendMessage(GetDlgItem(hwnd, IDC_PRINTER_TYPE), CB_GETCURSEL, 0, 0));

    if (num == 6) {
        resources_set_string_sprintf("%sDriver", ui_plotter_driver_1520[SendMessage(GetDlgItem(hwnd, IDC_PRINTER_DRIVER), CB_GETCURSEL, 0, 0)], printer_name);
    } else {
        resources_set_string_sprintf("%sDriver", ui_printer_driver_ascii[SendMessage(GetDlgItem(hwnd, IDC_PRINTER_DRIVER), CB_GETCURSEL, 0, 0)], printer_name);
    }

    resources_set_string_sprintf("%sOutput", ui_printer_output_ascii[SendMessage(GetDlgItem(hwnd, IDC_PRINTER_OUTPUT), CB_GETCURSEL, 0, 0)], printer_name);

    resources_set_int_sprintf("%sTextDevice", (int)SendMessage(GetDlgItem(hwnd, IDC_PRINTER_TEXTOUT), CB_GETCURSEL, 0, 0), printer_name);
  
    resources_set_string("PrinterTextDevice1", printertextdevice[0]);
    resources_set_string("PrinterTextDevice2", printertextdevice[1]);
    resources_set_string("PrinterTextDevice3", printertextdevice[2]);

    if (num > 0 && (iec_available_busses() & IEC_BUS_IEC)) {
        resources_set_int_sprintf("IECDevice%d", (IsDlgButtonChecked(hwnd, IDC_PRINTER_USEIECDEVICE) == BST_CHECKED), num);
    }

    return 1;
}
开发者ID:AreaScout,项目名称:vice,代码行数:32,代码来源:uiperipheral.c

示例6: uilib_select_string

void uilib_select_string(const char *resname, const char *title,
                         const char *name)
{
    ui_button_t button;
    const char *value;
    char *new_value;
    int len;

    vsync_suspend_speed_eval();

    resources_get_string(resname, &value);

    if (value == NULL)
        value = "";

    len = strlen(value) * 2;
    if (len < 255)
        len = 255;

    new_value = lib_calloc(1, len + 1);
    strncpy(new_value, value, len);

    button = ui_input_string(title, name, new_value, len);

    if (button == UI_BUTTON_OK)
        resources_set_string(resname, new_value);

    lib_free(new_value);
}
开发者ID:martinpiper,项目名称:VICE,代码行数:29,代码来源:uilib.c

示例7: resources_get_string

const char *prepend_dir_to_path(const char *dir)
{
    const char *saved_path;
    char *new_path;

    resources_get_string("Directory", &saved_path);
    saved_path = lib_stralloc(saved_path);

    if (dir && *dir) {
        new_path = util_concat(dir,
                               ARCHDEP_FINDPATH_SEPARATOR_STRING,
                               saved_path,
                               NULL);
    } else {
        char *current_dir = ioutil_current_dir();
        new_path = util_concat(current_dir,
                               ARCHDEP_FINDPATH_SEPARATOR_STRING,
                               saved_path,
                               NULL);
        lib_free(current_dir);
    }

    resources_set_string("Directory", new_path);
    lib_free(new_path);

    return saved_path;
} 
开发者ID:EdCornejo,项目名称:emu-ex-plus-alpha,代码行数:27,代码来源:romset.c

示例8: pet_select_keymap

static void pet_select_keymap(ui_window_t w, int check, char *name, int sympos)
{
    char filename[0x20];
    const char *resname;
    int kindex;
    const char *wd;
    const char *maps[6] = {"x11_buks", "x11_bukp", "x11_bgrs", "x11_bgrp", "x11_bdes", "x11_bdep"};

    resources_get_int("KeymapIndex", &kindex);
    strcpy(filename, maps[kindex]);
    strcat(filename, name);
    kindex = (kindex & ~1) + sympos;
    resname = machine_keymap_res_name_list[kindex];

    if (name) {
        if (!check) {
            resources_set_string(resname, filename);
            ui_update_menus();
        } else {
            resources_get_string(resname, &wd);
            if (!strcmp(wd, filename)) {
                ui_menu_set_tick(w, 1);
            } else {
                ui_menu_set_tick(w, 0);
            }
        }
    }
}
开发者ID:AreaScout,项目名称:vice,代码行数:28,代码来源:petui.c

示例9: UI_CALLBACK

static UI_CALLBACK(select_user_keymap)
{
    char *filename;
    const char *resname;
    ui_button_t button;
    int kindex;
    static char *last_dir;
    uilib_file_filter_enum_t filter[] = { UILIB_FILTER_KEYMAP, UILIB_FILTER_ALL };

    resources_get_int("KeymapIndex", &kindex);
    kindex = (kindex & ~1) + vice_ptr_to_int(UI_MENU_CB_PARAM);
    resname = machine_keymap_res_name_list[kindex];

    vsync_suspend_speed_eval();
    filename = ui_select_file(_("Read Keymap File"), NULL, 0, last_dir, filter, sizeof(filter) / sizeof(*filter), &button, 0, NULL, UI_FC_LOAD);

    switch (button) {
        case UI_BUTTON_OK:
            resources_set_string(resname, filename);
            lib_free(last_dir);
            util_fname_split(filename, &last_dir, NULL);
            break;
        default:
            /* Do nothing special.  */
            break;
    }
    lib_free(filename);
}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:28,代码来源:uikeyboard.c

示例10: soundmovie_start

int soundmovie_start(soundmovie_funcs_t *f)
{
    funcs = f;

    resources_set_string("SoundRecordDeviceName", "soundmovie");
    resources_set_int("Sound", 1);
    return 0;
}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:8,代码来源:soundmovie.c

示例11: sound_record_stop

static void sound_record_stop(void)
{
    char *retval;

    resources_set_string("SoundRecordDeviceName", "");
    retval = util_concat(_("Sound Recording stopped"), "...", NULL);
    ui_display_statustext(retval, 10);
    lib_free(retval);
}
开发者ID:bobsummerwill,项目名称:VICE,代码行数:9,代码来源:uicommands.c

示例12: end_mmc64_dialog

static void end_mmc64_dialog(HWND hwnd)
{
    TCHAR st[MAX_PATH];
    char s[MAX_PATH];

    GetDlgItemText(hwnd, IDC_MMC64_BIOS_FILE, st, MAX_PATH);
    system_wcstombs(s, st, MAX_PATH);
    resources_set_string("MMC64BIOSfilename", s);

    GetDlgItemText(hwnd, IDC_MMC64_IMAGE_FILE, st, MAX_PATH);
    system_wcstombs(s, st, MAX_PATH);
    resources_set_string("MMC64imagefilename", s);
    resources_set_int("MMC64", (IsDlgButtonChecked(hwnd, IDC_MMC64_ENABLE) == BST_CHECKED ? 1 : 0 ));
    resources_set_int("MMC64_flashjumper", (IsDlgButtonChecked(hwnd, IDC_MMC64_FLASHJUMPER) == BST_CHECKED ? 1 : 0 ));
    resources_set_int("MMC64_bios_write", (IsDlgButtonChecked(hwnd, IDC_MMC64_BIOS_SAVE) == BST_CHECKED ? 1 : 0 ));
    resources_set_int("MMC64_RO", (IsDlgButtonChecked(hwnd, IDC_MMC64_IMAGE_RO) == BST_CHECKED ? 1 : 0 ));
    resources_set_int("MMC64_revision",(int)SendMessage(GetDlgItem(hwnd, IDC_MMC64_REVISION), CB_GETCURSEL, 0, 0));
    resources_set_int("MMC64_sd_type", (int)SendMessage(GetDlgItem(hwnd, IDC_MMC64_SDTYPE), CB_GETCURSEL, 0, 0));
}
开发者ID:AreaScout,项目名称:vice,代码行数:19,代码来源:uimmc64.c

示例13: netplay_update_resources

static void netplay_update_resources(void)
{
    const gchar *server_name;
    const gchar *server_bind_address;
    char p[256];
    long port;

    strncpy(p, gtk_entry_get_text(GTK_ENTRY(np_port)), 256);
    server_name = gtk_entry_get_text(GTK_ENTRY(np_server));
    server_bind_address = gtk_entry_get_text(GTK_ENTRY(np_server_bind));
    util_string_to_long(p, NULL, 10, &port);
    if (port < 1 || port > 0xFFFF) {
        ui_error(_("Invalid port number"));
        return;
    }
    resources_set_int("NetworkServerPort", (int)port);
    resources_set_string("NetworkServerName", server_name);
    resources_set_string("NetworkServerBindAddress", server_bind_address);
}
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:19,代码来源:uinetplay.c

示例14: end_sound_record_dialog

static void end_sound_record_dialog(HWND hwnd)
{
    TCHAR st[MAX_PATH];
    char s[MAX_PATH];
    int i;

    i = (int)SendMessage(GetDlgItem(hwnd, IDC_SOUND_RECORD_FORMAT), CB_GETCURSEL, 0, 0);

    GetDlgItemText(hwnd, IDC_SOUND_RECORD_FILE, st, MAX_PATH);
    system_wcstombs(s, st, MAX_PATH);

    util_add_extension_maxpath(s, sound_format[i], MAX_PATH);

    resources_set_string("SoundRecordDeviceName", "");
    resources_set_string("SoundRecordDeviceArg", s);
    resources_set_string("SoundRecordDeviceName", sound_format[i]);
    resources_set_int("Sound", 1);
    ui_display_statustext(translate_text(IDS_SOUND_RECORDING_STARTED), 1);
}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:19,代码来源:uisound.c

示例15: ui_set_language

static void ui_set_language(unsigned int lang_id)
{
    unsigned int i;

    for (i = 0; (ui_lang_menu_entries[i].lang_code != NULL) && (i < countof(ui_lang_menu_entries)); i++) {
        if (ui_lang_menu_entries[i].item_id == lang_id) {
            resources_set_string("Language", ui_lang_menu_entries[i].lang_code);
            break;
        }
    }
}
开发者ID:AreaScout,项目名称:vice,代码行数:11,代码来源:vsidui.c


注:本文中的resources_set_string函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。