Lines Matching defs:state

262 static int parse_log_target(pa_config_parser_state *state) {
265 pa_assert(state);
267 c = state->data;
269 if (pa_daemon_conf_set_log_target(c, state->rvalue) < 0) {
270 pa_log(_("[%s:%u] Invalid log target '%s'."), state->filename, state->lineno, state->rvalue);
277 static int parse_log_level(pa_config_parser_state *state) {
280 pa_assert(state);
282 c = state->data;
284 if (pa_daemon_conf_set_log_level(c, state->rvalue) < 0) {
285 pa_log(_("[%s:%u] Invalid log level '%s'."), state->filename, state->lineno, state->rvalue);
292 static int parse_resample_method(pa_config_parser_state *state) {
295 pa_assert(state);
297 c = state->data;
299 if (pa_daemon_conf_set_resample_method(c, state->rvalue) < 0) {
300 pa_log(_("[%s:%u] Invalid resample method '%s'."), state->filename, state->lineno, state->rvalue);
308 static int parse_rlimit(pa_config_parser_state *state) {
311 pa_assert(state);
313 r = state->data;
315 if (state->rvalue[strspn(state->rvalue, "\t ")] == 0) {
321 if (pa_atoi(state->rvalue, &k) < 0) {
322 pa_log(_("[%s:%u] Invalid rlimit '%s'."), state->filename, state->lineno, state->rvalue);
333 static int parse_sample_format(pa_config_parser_state *state) {
337 pa_assert(state);
339 c = state->data;
341 if ((f = pa_parse_sample_format(state->rvalue)) < 0) {
342 pa_log(_("[%s:%u] Invalid sample format '%s'."), state->filename, state->lineno, state->rvalue);
350 static int parse_sample_rate(pa_config_parser_state *state) {
354 pa_assert(state);
356 c = state->data;
358 if (pa_atou(state->rvalue, &r) < 0 || !pa_sample_rate_valid(r)) {
359 pa_log(_("[%s:%u] Invalid sample rate '%s'."), state->filename, state->lineno, state->rvalue);
367 static int parse_alternate_sample_rate(pa_config_parser_state *state) {
371 pa_assert(state);
373 c = state->data;
375 if (pa_atou(state->rvalue, &r) < 0 || !pa_sample_rate_valid(r)) {
376 pa_log(_("[%s:%u] Invalid sample rate '%s'."), state->filename, state->lineno, state->rvalue);
390 static int parse_sample_channels(pa_config_parser_state *state) {
394 pa_assert(state);
396 i = state->data;
398 if (pa_atoi(state->rvalue, &n) < 0 || !pa_channels_valid(n)) {
399 pa_log(_("[%s:%u] Invalid sample channels '%s'."), state->filename, state->lineno, state->rvalue);
408 static int parse_channel_map(pa_config_parser_state *state) {
411 pa_assert(state);
413 i = state->data;
415 if (!pa_channel_map_parse(&i->conf->default_channel_map, state->rvalue)) {
416 pa_log(_("[%s:%u] Invalid channel map '%s'."), state->filename, state->lineno, state->rvalue);
424 static int parse_fragments(pa_config_parser_state *state) {
428 pa_assert(state);
430 c = state->data;
432 if (pa_atoi(state->rvalue, &n) < 0 || n < 2) {
433 pa_log(_("[%s:%u] Invalid number of fragments '%s'."), state->filename, state->lineno, state->rvalue);
441 static int parse_fragment_size_msec(pa_config_parser_state *state) {
445 pa_assert(state);
447 c = state->data;
449 if (pa_atoi(state->rvalue, &n) < 0 || n < 1) {
450 pa_log(_("[%s:%u] Invalid fragment size '%s'."), state->filename, state->lineno, state->rvalue);
458 static int parse_nice_level(pa_config_parser_state *state) {
462 pa_assert(state);
464 c = state->data;
466 if (pa_atoi(state->rvalue, &level) < 0 || level < -20 || level > 19) {
467 pa_log(_("[%s:%u] Invalid nice level '%s'."), state->filename, state->lineno, state->rvalue);
475 static int parse_rtprio(pa_config_parser_state *state) {
481 pa_assert(state);
484 pa_log("[%s:%u] Realtime priority not available on win32.", state->filename, state->lineno);
487 c = state->data;
489 if (pa_atoi(state->rvalue, &rtprio) < 0 || rtprio < sched_get_priority_min(SCHED_FIFO) || rtprio > sched_get_priority_max(SCHED_FIFO)) {
490 pa_log("[%s:%u] Invalid realtime priority '%s'.", state->filename, state->lineno, state->rvalue);
501 static int parse_disable_lfe_remix(pa_config_parser_state *state) {
505 pa_assert(state);
506 c = state->data;
508 if ((k = pa_parse_boolean(state->rvalue)) < 0) {
509 pa_log("[%s:%u] Failed to parse boolean value: %s", state->filename, state->lineno, state->rvalue);
515 pa_log("[%s:%u] Deprecated option 'disable-lfe-remixing' found.", state->filename, state->lineno);
517 state->filename, state->lineno, pa_yes_no(c->remixing_produce_lfe));
522 static int parse_enable_lfe_remix(pa_config_parser_state *state) {
526 pa_assert(state);
527 c = state->data;
529 if ((k = pa_parse_boolean(state->rvalue)) < 0) {
530 pa_log("[%s:%u] Failed to parse boolean value: %s", state->filename, state->lineno, state->rvalue);
536 pa_log("[%s:%u] Deprecated option 'enable-lfe-remixing' found.", state->filename, state->lineno);
538 state->filename, state->lineno, pa_yes_no(c->remixing_produce_lfe));
544 static int parse_server_type(pa_config_parser_state *state) {
547 pa_assert(state);
549 c = state->data;
551 if (pa_daemon_conf_set_local_server_type(c, state->rvalue) < 0) {
552 pa_log(_("[%s:%u] Invalid server type '%s'."), state->filename, state->lineno, state->rvalue);