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


C++ set_config函数代码示例

本文整理汇总了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;
}
开发者ID:DARKPOP,项目名称:hardware_qcom_audio,代码行数:29,代码来源:virtualizer.c

示例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;
}
开发者ID:wjfsanhe,项目名称:Android5.1_hardware,代码行数:30,代码来源:bass_boost.c

示例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();
}
开发者ID:SayCV,项目名称:flickernoise,代码行数:25,代码来源:videoin.c

示例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();

}
开发者ID:aprsworld,项目名称:tsTSelector,代码行数:25,代码来源:param_tsTselector.c

示例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;
}
开发者ID:cmusatyalab,项目名称:minirpc,代码行数:7,代码来源:config.c

示例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);
}
开发者ID:JohnChu,项目名称:Snoopy,代码行数:34,代码来源:gphoto2-cmd-config.c

示例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;
}
开发者ID:RonGokhale,项目名称:android_hardware_qcom_audio,代码行数:29,代码来源:equalizer.c

示例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);
}
开发者ID:JohnChu,项目名称:Snoopy,代码行数:26,代码来源:gphoto2-cmd-config.c

示例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);
}
开发者ID:JohnChu,项目名称:Snoopy,代码行数:28,代码来源:gphoto2-cmd-config.c

示例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);
}
开发者ID:carriercomm,项目名称:myboxfs,代码行数:26,代码来源:chkprog.c

示例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.");
}
开发者ID:OpticaMonografia,项目名称:QtOctave,代码行数:60,代码来源:general_menu.cpp

示例12: get_config

 int SimulatedPockels::setOpenVolts( f64 volts )
 {
   Config c = get_config();
   c.set_v_open(volts);
   set_config(c);
   return 1;
 }
开发者ID:davidackerman,项目名称:fetchUpgrades,代码行数:7,代码来源:pockels.cpp

示例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;
}
开发者ID:mls-m5,项目名称:lightpad,代码行数:32,代码来源:lightpad.c

示例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);
            }
        }
    }
}
开发者ID:Pvg08,项目名称:CStationClient_DS_PC,代码行数:34,代码来源:server.cpp

示例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;
}
开发者ID:cmusatyalab,项目名称:minirpc,代码行数:7,代码来源:config.c


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