本文整理汇总了C++中set_config函数的典型用法代码示例。如果您正苦于以下问题:C++ set_config函数的具体用法?C++ set_config怎么用?C++ set_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_config函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: virtualizer_init
int virtualizer_init(effect_context_t *context)
{
ALOGV("%s", __func__);
virtualizer_context_t *virt_ctxt = (virtualizer_context_t *)context;
context->config.inputCfg.accessMode = EFFECT_BUFFER_ACCESS_READ;
context->config.inputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
context->config.inputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
context->config.inputCfg.samplingRate = 44100;
context->config.inputCfg.bufferProvider.getBuffer = NULL;
context->config.inputCfg.bufferProvider.releaseBuffer = NULL;
context->config.inputCfg.bufferProvider.cookie = NULL;
context->config.inputCfg.mask = EFFECT_CONFIG_ALL;
context->config.outputCfg.accessMode = EFFECT_BUFFER_ACCESS_ACCUMULATE;
context->config.outputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
context->config.outputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
context->config.outputCfg.samplingRate = 44100;
context->config.outputCfg.bufferProvider.getBuffer = NULL;
context->config.outputCfg.bufferProvider.releaseBuffer = NULL;
context->config.outputCfg.bufferProvider.cookie = NULL;
context->config.outputCfg.mask = EFFECT_CONFIG_ALL;
set_config(context, &context->config);
virt_ctxt->temp_disabled = false;
memset(&(virt_ctxt->offload_virt), 0, sizeof(struct virtualizer_params));
return 0;
}
示例2: bassboost_init
int bassboost_init(effect_context_t *context)
{
bassboost_context_t *bass_ctxt = (bassboost_context_t *)context;
ALOGV("%s: ctxt %p", __func__, bass_ctxt);
context->config.inputCfg.accessMode = EFFECT_BUFFER_ACCESS_READ;
context->config.inputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
context->config.inputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
context->config.inputCfg.samplingRate = 44100;
context->config.inputCfg.bufferProvider.getBuffer = NULL;
context->config.inputCfg.bufferProvider.releaseBuffer = NULL;
context->config.inputCfg.bufferProvider.cookie = NULL;
context->config.inputCfg.mask = EFFECT_CONFIG_ALL;
context->config.outputCfg.accessMode = EFFECT_BUFFER_ACCESS_ACCUMULATE;
context->config.outputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
context->config.outputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
context->config.outputCfg.samplingRate = 44100;
context->config.outputCfg.bufferProvider.getBuffer = NULL;
context->config.outputCfg.bufferProvider.releaseBuffer = NULL;
context->config.outputCfg.bufferProvider.cookie = NULL;
context->config.outputCfg.mask = EFFECT_CONFIG_ALL;
set_config(context, &context->config);
bass_ctxt->hw_acc_fd = -1;
bass_ctxt->temp_disabled = false;
memset(&(bass_ctxt->offload_bass), 0, sizeof(struct bass_boost_params));
return 0;
}
示例3: slide_callback
static void slide_callback(mtk_event *e, void *arg)
{
unsigned int control = (unsigned int)arg;
unsigned int val;
char *guiname;
guiname = NULL;
switch(control) {
case CONTROL_BRIGHTNESS:
guiname = "s_brightness.value";
break;
case CONTROL_CONTRAST:
guiname = "s_contrast.value";
break;
case CONTROL_HUE:
guiname = "s_hue.value";
break;
default:
return;
}
val = mtk_req_i(appid, guiname);
set_value(control, val);
set_config();
}
示例4: write_default_param_file
void write_default_param_file() {
/* all LEDs for 1.5 seconds */
#if 0
timers.led_on_a=150;
timers.led_on_b=150;
timers.led_on_c=150;
timers.led_on_d=150;
#else
output_high(LED_A);
output_high(LED_B);
output_high(LED_C);
output_high(LED_D);
delay_ms(1500);
output_low(LED_A);
output_low(LED_B);
output_low(LED_C);
output_low(LED_D);
#endif
set_config();
/* write them so next time we use from EEPROM */
write_param_file();
}
示例5: mrpc_set_accept_backoff
exported int mrpc_set_accept_backoff(struct mrpc_conn_set *set, unsigned ms)
{
if (set == NULL || ms == 0)
return EINVAL;
set_config(set, accept_backoff, ms);
return 0;
}
示例6: show_range_int
static int
show_range_int (CmdConfig *cmd_config, CameraWidget *range)
{
CDKSLIDER *slider = NULL;
float value, min, max, increment;
const char *label;
char title[1024];
int selection;
CHECK (gp_widget_get_value (range, &value));
CHECK (gp_widget_get_label (range, &label));
snprintf (title, sizeof (title), "<C></5>%s", label);
CHECK (gp_widget_get_range (range, &min, &max, &increment));
slider = newCDKSlider (cmd_config->screen, CENTER, CENTER, title,
_("Value: "), '-',
50, (int) value, min, max,
increment,
MAX (increment, (max - min)/20.0),
TRUE,
FALSE);
if (!slider)
return (GP_ERROR);
selection = activateCDKSlider (slider, 0);
if (slider->exitType == vNORMAL) {
value = selection;
gp_widget_set_value (range, &value);
set_config (cmd_config);
}
destroyCDKSlider (slider);
return (GP_OK);
}
示例7: equalizer_init
int equalizer_init(effect_context_t *context)
{
ALOGV("%s: ctxt %p", __func__, context);
equalizer_context_t *eq_ctxt = (equalizer_context_t *)context;
context->config.inputCfg.accessMode = EFFECT_BUFFER_ACCESS_READ;
context->config.inputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
context->config.inputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
context->config.inputCfg.samplingRate = 44100;
context->config.inputCfg.bufferProvider.getBuffer = NULL;
context->config.inputCfg.bufferProvider.releaseBuffer = NULL;
context->config.inputCfg.bufferProvider.cookie = NULL;
context->config.inputCfg.mask = EFFECT_CONFIG_ALL;
context->config.outputCfg.accessMode = EFFECT_BUFFER_ACCESS_ACCUMULATE;
context->config.outputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
context->config.outputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
context->config.outputCfg.samplingRate = 44100;
context->config.outputCfg.bufferProvider.getBuffer = NULL;
context->config.outputCfg.bufferProvider.releaseBuffer = NULL;
context->config.outputCfg.bufferProvider.cookie = NULL;
context->config.outputCfg.mask = EFFECT_CONFIG_ALL;
set_config(context, &context->config);
memset(&(eq_ctxt->offload_eq), 0, sizeof(struct eq_params));
offload_eq_set_preset(&(eq_ctxt->offload_eq), INVALID_PRESET);
return 0;
}
示例8: show_text
static int
show_text (CmdConfig *cmd_config, CameraWidget *text)
{
CDKENTRY *entry = NULL;
const char *label, *value;
char title[1024], *info;
CHECK (gp_widget_get_value (text, &value));
CHECK (gp_widget_get_label (text, &label));
snprintf (title, sizeof (title), "<C></5>%s", label);
entry = newCDKEntry (cmd_config->screen, CENTER, CENTER, title,
_("Value: "), A_NORMAL, ' ', vMIXED, 40, 0,
256, TRUE, FALSE);
if (!entry)
return (GP_ERROR);
setCDKEntryValue (entry, (char*) value);
info = activateCDKEntry (entry, 0);
if (entry->exitType == vNORMAL) {
gp_widget_set_value (text, info);
set_config (cmd_config);
}
destroyCDKEntry (entry);
return (GP_OK);
}
示例9: show_toggle
static int
show_toggle (CmdConfig *cmd_config, CameraWidget *toggle)
{
CDKITEMLIST *list = NULL;
int value, selection;
const char *label;
char title[1024], *info[] = {N_("Yes"), N_("No")};
CHECK (gp_widget_get_value (toggle, &value));
CHECK (gp_widget_get_label (toggle, &label));
snprintf (title, sizeof (title), "<C></5>%s", label);
list = newCDKItemlist (cmd_config->screen, CENTER, CENTER, title, "",
info, 2, 1 - value, TRUE, FALSE);
if (!list)
return (GP_ERROR);
selection = activateCDKItemlist (list, 0);
if (list->exitType == vNORMAL) {
selection = 1 - selection;
gp_widget_set_value (toggle, &selection);
set_config (cmd_config);
}
destroyCDKItemlist (list);
return (GP_OK);
}
示例10: check_config
static int check_config(void) {
DIR *dir;
struct dirent *entry;
char *name;
int n;
struct stat sb;
char status[32];
char buf[1023];
listcnt=0;
if((dir = opendir(DIRCHECK)) == NULL) return(1);
for(;;) {
if((entry = readdir(dir)) == NULL) {
closedir(dir);
return(1);
}
name = entry->d_name;
if(!strcmp(name,".") || !strcmp(name,"..")) continue;
sprintf(status, "%s/%s", DIRCHECK, name);
if(stat(status, &sb)) continue;
if(read_oneline(status, buf) < 0) continue;
trim(buf);trim(name);
set_config(name,buf,listcnt);
listcnt++;
}
return(0);
}
示例11: CHECK_TO_STRING
void General_Menu::apply_config()
{
QMap<QString,QString> config;
config["external_editor"] = CHECK_TO_STRING(ui.use_external_editor->checkState());
config["editor"]=ui.editor_lineEdit->text();
config["help_path"]=ui.help_path_lineEdit->text();
config["terminal_font"]=config_font.toString();
config["terminal_foreground_color"]=foreground_color.name();
config["terminal_background_color"]=background_color.name();
config["terminal_error_color"]=error_color.name();
config["lines_in_terminal"]=ui.max_line_num_lineEdit->text();
config["lines_in_history"]=ui.lines_in_history_lineEdit->text();
config["cols_in_terminal"]=ui.max_col_in_terminal_lineEdit->text();
config["octave_arguments"]=ui.octaveArgs_lineEdit->text();
config["octave_path"]=ui.octave_path_lineEdit->text();
config["syntaxHighlighting"]=CHECK_TO_STRING(ui.syntaxHighlighting_checkBox->checkState());
config["bracketsMatch"]=CHECK_TO_STRING(ui.bracketsMatch_checkBox->checkState());
config["autoCompletion"]=CHECK_TO_STRING(ui.autoCompletion_checkBox->checkState());
config["simple_rcs"]=CHECK_TO_STRING(ui.simple_rcs_checkBox->checkState());
config["show_ide_commands"]=CHECK_TO_STRING(ui.show_ide_commands_checkBox->checkState());
config["qtinfo_ok"]=CHECK_TO_STRING(ui.qtinfo_ok_checkBox->checkState());
if(ui.autoindent_statements_radioButton->isChecked())
{
config["autoindent"]="true";
config["autoindent_statements"]="true";
}
else if(ui.autoindent_radioButton->isChecked())
{
config["autoindent"]="true";
config["autoindent_statements"]="false";
}
else
{
config["autoindent"]="false";
config["autoindent_statements"]="false";
}
config["textEditFont"]=text_edit_font.family();
config["textEditFontSize"]=QString::number(text_edit_font.pointSize());
// Directory list
QString str, tmp;
QListWidgetItem *item;
for(int i = 0; (item = ui.octaveDir_list->item(i)); i++)
{
tmp = item->text();
tmp.replace('"', "\\\"");
str += "\"" + tmp + "\",";
}
config["octave_folders"] = str;
config["easy_plot_active"] = CHECK_TO_STRING(ui.easy_plot_checkBox->checkState());
config["easy_plot_path"] = ui.easy_plot_path_lineEdit->text();
set_config(config);
QMessageBox::information(this, "Note","Reload QtOctave to apply changes.");
}
示例12: get_config
int SimulatedPockels::setOpenVolts( f64 volts )
{
Config c = get_config();
c.set_v_open(volts);
set_config(c);
return 1;
}
示例13: init_config
static int
init_config(void) {
GKeyFile *cfg;
const char *path;
char *file;
gboolean loaded = FALSE;
cfg = g_key_file_new();
path = g_get_user_config_dir();
file = g_build_filename(path, "lightpad/lightpad.cfg", NULL);
g_free((gpointer)path);
loaded = g_key_file_load_from_file(cfg, file, G_KEY_FILE_NONE, NULL);
for(const char *const *dir = g_get_system_config_dirs(); !loaded && *dir; dir++) {
file = g_build_filename(*dir, "/lightpad/lightpad.cfg", NULL);
loaded = g_key_file_load_from_file(cfg, file, G_KEY_FILE_NONE, NULL);
}
if(loaded)
set_config(cfg);
else {
g_fprintf(stderr,
"Error: cannot find a configuration file!\nPlease make sure Lightpad is installed correctly.\n");
return -1;
}
g_free(file);
g_key_file_free(cfg);
return 0;
}
示例14: in
void Server::recieveData()
{
QTcpSocket* tcpSocket = remote_server_socket;
if (tcpSocket && tcpSocket->bytesAvailable()>0) {
int size = tcpSocket->bytesAvailable();
QDataStream in(tcpSocket);
in.setVersion(QDataStream::Qt_4_0);
char *mem = new char[size];
in.readRawData(mem, size);
QString message = QString::fromUtf8(mem, size);
delete mem;
emit write_message(tr("Recieved data (size=%1) from %2. Content: \"%3\"").arg(size).arg(tcpSocket->peerAddress().toString()).arg(message));
if (!is_config_mode) {
QHash<QString, ClientAction *>::const_iterator i = actions->constBegin();
while (i != actions->constEnd()) {
if (i.value() && i.value()->isEnabled() && !i.value()->getPrefix().isEmpty() && message.startsWith(i.value()->getPrefix()+"=")) {
QString params_message = message;
params_message.replace(QRegExp("^("+i.value()->getPrefix()+")\\="), "");
i.value()->setParamsFromMessage(params_message);
i.value()->runAction();
}
++i;
}
} else if(message.startsWith("DS_SETUP:\r\n")) {
QStringList params_message = message.split("\r\n");
params_message.removeFirst();
if (!params_message.isEmpty() && params_message.length()>=4) {
device_id = params_message.value(3, "0").toInt();
remoteIPAddress = params_message.value(2, "");
emit set_config(remoteIPAddress, device_id);
}
}
}
}
示例15: mrpc_set_keepalive_enabled
exported int mrpc_set_keepalive_enabled(struct mrpc_conn_set *set, int enabled)
{
if (set == NULL)
return EINVAL;
set_config(set, keepalive_enabled, enabled);
return 0;
}