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


C++ save_config函数代码示例

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


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

示例1: set_value

void AmConfigAudioDetect::set_audiodetect_config(AudioDetectParameters *config)
{
    uint32_t i;
    char* string = (char *)malloc(sizeof(char) * 128);
    if (AM_LIKELY(config)) {
        if (init()) {
            set_value("GENERAL:AudioChannelNumber", config->audio_channel_number);
            set_value("GENERAL:AudioSampleRate", config->audio_sample_rate);
            set_value("GENERAL:AudioChunkBytes", config->audio_chunk_bytes);
            set_value("ALERT_DETECT:EnableAlertDetect", config->enable_alert_detect);
            set_value("ALERT_DETECT:AudioAlertSensitivity", config->audio_alert_sensitivity);
            set_value("ALERT_DETECT:AudioAlertDirection", config->audio_alert_direction);
            set_value("ANALYSIS_DETECT:EnableAnalysisDetect", config->enable_analysis_detect);
            set_value("ANALYSIS_DETECT:AudioAnalysisDirection", config->audio_analysis_direction);
            set_value("ANALYSIS_DETECT:AudioAnalysisModNum", config->audio_analysis_mod_num);
            for (i = 0; i < config->audio_analysis_mod_num; i++) {
                sprintf(string, "%s%d", "ANALYSISDETECT:AudioAnalysisMod", i + 1);
                set_value(string, config->aa_param[i].aa_mod_names);
                sprintf(string, "%s%d", "ANALYSIS_DETECT:AudioAnalysisSensitivityMod", i + 1);
                set_value(string, config->aa_param[i].aa_mod_th);
            }
            config->config_changed = 0;
            save_config();
        } else {
            WARN("Failed openint %s, audio detect configuration NOT saved!", mConfigFile);
        }
    }
    free(string);
}
开发者ID:ShawnOfMisfit,项目名称:ambarella,代码行数:29,代码来源:am_config_audiodetect.cpp

示例2: save_config

void CommandLineHandlerBase::print_system_information(SuperLogger& logger)
{
    SaveLogFormatterConfig save_config(logger);
    logger.set_format(LogMessage::Info, "{message}");

    System::print_information(logger);
}
开发者ID:Rapternmn,项目名称:appleseed,代码行数:7,代码来源:commandlinehandlerbase.cpp

示例3: config_main_menu

void config_main_menu() {
    show_menu(config_opts);

    save_config(); // Save config when exiting.

    generate_patch_cache();
}
开发者ID:chaoskagami,项目名称:corbenik,代码行数:7,代码来源:menu.c

示例4: gui_SaveConfig

	void gui_SaveConfig()
{
	char savename[512];
	sprintf(savename, "%s/Vex3ds.cfg", config_base_path);  // using savename char buffer to save config
	save_config(savename);
	done = 1; 
}
开发者ID:nop90,项目名称:Vex3DS,代码行数:7,代码来源:gui.c

示例5: menu_main

void menu_main()
{
    while (1) {
        char *options[] = {"Boot CFW",
                           "Select Patches",
                           "More options...",
                           "Version info",
                           "Power off"};
        int result = draw_menu("CakesFW " CAKES_VERSION, 0, sizeof(options) / sizeof(char *), options);

        switch (result) {
            case 0:
                save_config();
                boot_cfw();
                break;
            case 1:
                menu_select_patches();
                break;
            case 2:
                menu_more();
                break;
            case 3:
                version_info();
                break;
            case 4:
                i2cWriteRegister(I2C_DEV_MCU, 0x20, 1);
                while(1);  // Won't break out of this one >:D
        }
    }
}
开发者ID:dark-samus,项目名称:CakesForeveryWan,代码行数:30,代码来源:main.c

示例6: PowerCallback

void PowerCallback (int unknown, int pwrflags)
{
	if (pwrflags & PSP_POWER_CB_HOLD_SWITCH)
	{
		extern bool8 g_bShowProfilerIno;
		g_bShowProfilerInfo = (! g_bShowProfilerInfo);
	}
	
	if (pwrflags & PSP_POWER_CB_POWER_SWITCH){
		if (g_bROMLoaded) {
			scePowerSetClockFrequency (222, 222, 111);
			S9xSetSoundMute           (TRUE);
			g_bSleep = true;
			save_config     ();
			Memory.SaveSRAM (S9xGetFilename ("srm"));
		}
	} else if (pwrflags & PSP_POWER_CB_RESUME_COMPLETE) {
		g_bSleep = false;
	}

	if (pwrflags & PSP_POWER_CB_BATTERY_LOW){
		scePowerSetClockFrequency (222,222,111);
		S9xSetInfoString          ("WARNING: PSP Battery is Low! (Automatically Throttling CPU)");
	}

	int cbid;
	cbid = sceKernelCreateCallback ("Power Callback", (SceKernelCallbackFunction)PowerCallback, NULL);
	scePowerRegisterCallback       (0, cbid);
}
开发者ID:joshdekock,项目名称:jim-pspware,代码行数:29,代码来源:psp2.cpp

示例7: on_quit

void on_quit(void)
{
	save_config();
	free(config_file);
	
	gtk_main_quit();
}
开发者ID:guineawheek,项目名称:olwtools,代码行数:7,代码来源:callbacks.c

示例8: save_config

/**
 * \brief Procedure called when closing the window.
 * \param event This event occured.
 */
void bf::main_frame::on_close( wxCloseEvent& event )
{
  save_config();

  bool quit = !event.CanVeto();

  if ( !quit )
    {
      quit = true;
      m_animation_edit->validate();

      if ( is_changed() )
        {
          wxMessageDialog dlg
            ( this,
              _("The animation is not saved."
                 " Do you want to save it now?"),
              _("Animation is not saved."), wxYES_NO | wxCANCEL );

          int answer = dlg.ShowModal();

          if ( answer == wxID_CANCEL )
            quit = false;
          else if ( answer == wxID_YES )
            quit = save();
        }
    }

  if ( quit )
    event.Skip();
  else
    event.Veto();
} // main_frame::on_close()
开发者ID:LibreGames,项目名称:bear,代码行数:37,代码来源:main_frame.cpp

示例9: cc26xx_web_demo_restore_defaults

/*---------------------------------------------------------------------------*/
void
cc26xx_web_demo_restore_defaults(void)
{
  cc26xx_web_demo_sensor_reading_t *reading = NULL;

  leds_on(LEDS_ALL);

  for(reading = list_head(sensor_list);
      reading != NULL;
      reading = list_item_next(reading)) {
    reading->publish = 1;
  }

#if CC26XX_WEB_DEMO_MQTT_CLIENT
  process_post_synch(&mqtt_client_process,
                     cc26xx_web_demo_load_config_defaults, NULL);
#endif

#if CC26XX_WEB_DEMO_NET_UART
  process_post_synch(&net_uart_process, cc26xx_web_demo_load_config_defaults,
                     NULL);
#endif

  save_config();

  leds_off(LEDS_ALL);
}
开发者ID:Abdellazizhammami,项目名称:contiki,代码行数:28,代码来源:cc26xx-web-demo.c

示例10: on_save_pref_button_clicked

void
on_save_pref_button_clicked (GtkButton * button, gpointer user_data)
{
  confirm_changes();	/* to save we simulate confirmation */
  save_config ();
  hide_pref_dialog();
}				/* on_save_pref_button_clicked */
开发者ID:IFGHou,项目名称:EtherApe,代码行数:7,代码来源:pref_dialog.c

示例11: save_config

void CommandLineHandler::print_program_usage(
    const char*     program_name,
    SuperLogger&    logger) const
{
    SaveLogFormatterConfig save_config(logger);
    logger.set_format(LogMessage::Info, "{message}");

    LOG_INFO(logger, "usage: %s [project.appleseed]", program_name);
    LOG_INFO(logger, "options:");

    parser().print_usage(logger);

#ifdef _WIN32

    const StringLogTarget& target =
        static_cast<const StringLogTarget&>(logger.get_log_target());
    const QString str = QString::fromStdString(target.get_string());

    QMessageBox msgbox;
    msgbox.setWindowTitle("appleseed.studio Program Usage");
    msgbox.setIcon(QMessageBox::Information);
    msgbox.setText("<pre>" + str + "</pre>");
    msgbox.setStandardButtons(QMessageBox::Ok);
    msgbox.setDefaultButton(QMessageBox::Ok);
    msgbox.exec();

#endif
}
开发者ID:caomw,项目名称:appleseed,代码行数:28,代码来源:commandlinehandler.cpp

示例12: chanlist_maxusers

static void
chanlist_maxusers (GtkSpinButton *wid, server *serv)
{
	serv->gui->chanlist_maxusers = gtk_spin_button_get_value_as_int (wid);
	prefs.hex_gui_chanlist_maxusers = serv->gui->chanlist_maxusers;
	save_config();
}
开发者ID:JimmJamm,项目名称:hexchat,代码行数:7,代码来源:chanlist.c

示例13: destroy_config

/* destroy_config:
 *  Destroys a config structure, writing it out to disk if the contents
 *  have changed.
 */
static void destroy_config(CONFIG *cfg)
{
   CONFIG_ENTRY *pos, *prev;

   if (cfg) {
      if (cfg->filename) {
		save_config(cfg);
	    free(cfg->filename);
      }

      /* destroy the variable list */
      pos = cfg->head;

      while (pos) {
	 prev = pos;
	 pos = pos->next;

	 if (prev->name)
	    free(prev->name);

	 if (prev->data)
	    free(prev->data);

	 free(prev);
      }

      free(cfg);
   }
}
开发者ID:cotodevel,项目名称:SnemulDS,代码行数:33,代码来源:conf.c

示例14: on_button_general_config_save_clicked

void
on_button_general_config_save_clicked  (GtkButton       *button,
                                        gpointer         user_data)
{
	gtk_general_settings_grab();
	save_config();
}
开发者ID:Plombo,项目名称:hugo,代码行数:7,代码来源:callbacks.c

示例15: save_settings

 // mc2: 0x0053B510
 bool save_settings() {
     if (this->requires_saving == false)
         return false;
     //return save_settings_force();
     save_config();
     return true;
 }
开发者ID:LRFLEW,项目名称:OpenMC2,代码行数:8,代码来源:Settings.hpp


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