本文整理汇总了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);
}
示例2: save_config
void CommandLineHandlerBase::print_system_information(SuperLogger& logger)
{
SaveLogFormatterConfig save_config(logger);
logger.set_format(LogMessage::Info, "{message}");
System::print_information(logger);
}
示例3: config_main_menu
void config_main_menu() {
show_menu(config_opts);
save_config(); // Save config when exiting.
generate_patch_cache();
}
示例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;
}
示例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
}
}
}
示例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);
}
示例7: on_quit
void on_quit(void)
{
save_config();
free(config_file);
gtk_main_quit();
}
示例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()
示例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);
}
示例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 */
示例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
}
示例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();
}
示例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);
}
}
示例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();
}
示例15: save_settings
// mc2: 0x0053B510
bool save_settings() {
if (this->requires_saving == false)
return false;
//return save_settings_force();
save_config();
return true;
}