"restrictions. Destroying the pool...");
ret = sound_pool_destroy(pool);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_destroy(pool) returned %s value",
- __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_destroy(pool) returned %s value",
- __stringify_sound_pool_error(ret));
+
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_destroy(pool) returned %s value",
+ __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
ret = sound_pool_destroy(pools[idx]);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_destroy(pool) returned %s value",
- __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_destroy(pool) returned %s value",
- __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_destroy(pool) returned %s value",
+ __stringify_sound_pool_error(ret));
pools[idx] = NULL;
ret = sound_pool_activate(pools[idx]);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_set_state(pool, "
- "SOUND_POOL_STATE_ACTIVE) returned %s value",
- __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_set_state(pool, "
- "SOUND_POOL_STATE_ACTIVE) returned %s value",
- __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_set_state(pool, SOUND_POOL_STATE_ACTIVE) returned "
+ "%s value", __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int ret = sound_pool_deactivate(pools[idx]);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_set_state(pool, "
- "SOUND_POOL_STATE_INACTIVE) returned %s value",
- __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_set_state(pool, "
- "SOUND_POOL_STATE_INACTIVE) returned %s value",
- __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_set_state(pool, SOUND_POOL_STATE_INACTIVE) returned "
+ "%s value", __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
const char *str_state = (state == SOUND_POOL_STATE_ACTIVE ?
"SOUND_POOL_STATE_ACTIVE" : "SOUND_POOL_STATE_INACTIVE");
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_get_state(pool, state) returned %s value,"
- " state is %s", __stringify_sound_pool_error(ret), str_state);
- else
- _logger_log_err("sound_pool_get_state(pool, state) returned %s value,"
- " state is %s", __stringify_sound_pool_error(ret), str_state);
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_get_state(pool, state) returned %s value,"
+ " state is %s", __stringify_sound_pool_error(ret), str_state);
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int ret = sound_pool_set_volume(pools[idx], volume);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_set_global_volume(pool, %f) "
- "returned %s value", volume, __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_set_global_volume(pool, %f) "
- "returned %s value", volume, __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_set_global_volume(pool, %f) returned %s value",
+ volume, __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
float volume = .0f;
int ret = sound_pool_get_volume(pools[idx], &volume);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_get_global_volume(pool, volume) returned "
- "%s value, volume is %f", __stringify_sound_pool_error(ret),
- volume);
- else
- _logger_log_err("sound_pool_get_global_volume(pool, volume) returned "
- "%s value, volume is %f", __stringify_sound_pool_error(ret),
- volume);
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_get_global_volume(pool, volume) returned %s value, "
+ "volume is %f", __stringify_sound_pool_error(ret), volume);
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int ret = sound_pool_set_state_changed_cb(pools[idx], __sp_cb_msg,
messages[idx]);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_set_state_changed_cb(pool, cb, "
- "\"%s\") returned %s value", msg, __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_set_state_changed_cb(pool, cb, "
- "\"%s\") returned %s value", msg, __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_set_state_change_callback(pool, cb, \"%s\") "
+ "returned %s value", msg, __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int ret = sound_pool_set_state_changed_cb(pools[idx], __sp_cb_scr,
scripts[idx]);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_set_state_changed_cb(pool, cb, "
- "\"%s\") returned %s value", scr, __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_set_state_changed_cb(pool, cb, "
- "\"%s\") returned %s value", scr, __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_set_state_change_callback(pool, cb, \"%s\") "
+ "returned %s value", scr, __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
free(scripts[idx]);
scripts[idx] = NULL;
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_unset_state_changed_cb(pool) "
- "returned %s value", __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_unset_state_changed_cb(pool) "
- "returned %s value", __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_unset_state_change_callback(pool) "
+ "returned %s value", __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int ret = sound_pool_load_source_from_file(pools[idx], fname, tag);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_load_source_from_file(pool, \"%s\", "
- "\"%s\") returned %s value", fname, tag,
- __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_load_source_from_file(pool, \"%s\", "
- "\"%s\") returned %s value", fname, tag,
- __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_load_source_from_file(pool, \"%s\", \"%s\") returned "
+ "%s value", fname, tag, __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int ret = sound_pool_unload_source(pools[idx], tag);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_unload_source(pool, \"%s\") returned "
- "%s value", tag, __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_unload_source(pool, \"%s\") returned "
- "%s value", tag, __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_unload_source(pool, \"%s\") returned "
+ "%s value", tag, __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int loop = 0;
float volume = 1.0f;
unsigned rank = DEFAULT_STREAM_PRIORITY_RANK;
- sound_pool_stream_priority_policy_e priority_policy = SOUND_POOL_STREAM_PRIORITY_POLICY_MUTE;
+ sound_pool_stream_priority_policy_e priority_policy = SOUND_POOL_STREAM_PRIORITY_POLICY_MUTE;
char tag[MAX_PATH_LEN] = {'\0'};
int ret = sound_pool_stream_pause(pools[idx], stream_idx);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_pause_stream(pool, %i) returned %s "
- "value", stream_idx, __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_pause_stream(pool, %i) returned %s "
- "value", stream_idx, __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_pause_stream(pool, %i) returned %s value",
+ stream_idx, __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int ret = sound_pool_stream_resume(pools[idx], stream_idx);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_resume_stream(pool, %i) returned %s "
- "value", stream_idx, __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_resume_stream(pool, %i) returned %s "
- "value", stream_idx, __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_resume_stream(pool, %i) returned %s value",
+ stream_idx, __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int ret = sound_pool_stream_stop(pools[idx], stream_idx);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_stop_stream(pool, %i) returned %s "
- "value", stream_idx, __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_stop_stream(pool, %i) returned %s "
- "value", stream_idx, __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_stop_stream(pool, %i) returned %s value",
+ stream_idx, __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int ret = sound_pool_stream_set_volume(pools[idx], stream_idx, volume_val);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_stream_set_volume(pool, %i, %f) "
- "returned %s value", stream_idx, volume_val,
- __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_stream_set_volume(pool, %i, %f) "
- "returned %s value", stream_idx, volume_val,
- __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_stream_set_volume(pool, %i, %f) returned %s value",
+ stream_idx, volume_val, __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
float volume = .0f;
int ret = sound_pool_stream_get_volume(pools[idx], stream_idx, &volume);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_stream_get_volume(pool, %zu, volume) "
- "returned %s value, volume is %f", stream_idx,
- __stringify_sound_pool_error(ret), volume);
- else
- _logger_log_err("sound_pool_stream_get_volume(pool, %zu, volume) "
- "returned %s value, volume is %f", stream_idx,
- __stringify_sound_pool_error(ret), volume);
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_stream_get_volume(pool, %zu, volume) returned %s value, "
+ "volume is %f", stream_idx, __stringify_sound_pool_error(ret), volume);
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
int ret = sound_pool_stream_set_priority(pools[idx], stream_idx, rank);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_stream_set_priority(pool, %zu, %u) "
- "returned %s value", stream_idx, rank,
- __stringify_sound_pool_error(ret));
- else
- _logger_log_err("sound_pool_stream_set_priority(pool, %zu, %u) "
- "returned %s value", stream_idx, rank,
- __stringify_sound_pool_error(ret));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_stream_set_priority(pool, %zu, %u) returned %s value",
+ stream_idx, rank, __stringify_sound_pool_error(ret));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
unsigned rank = 0;
int ret = sound_pool_stream_get_priority(pools[idx], stream_idx, &rank);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_stream_get_priority(pool, %u, rank) "
- "returned %s value, rank value is %u", stream_idx,
- __stringify_sound_pool_error(ret), rank);
- else
- _logger_log_err("sound_pool_stream_get_priority(pool, %u, rank) "
- "returned %s value, rank value is %u", stream_idx,
- __stringify_sound_pool_error(ret), rank);
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_stream_get_priority(pool, %u, rank) returned %s value, "
+ "rank value is %u", stream_idx, __stringify_sound_pool_error(ret), rank);
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}
sound_pool_stream_state_e state = SOUND_POOL_STREAM_STATE_NONE;
int ret = sound_pool_stream_get_state(pools[idx], stream_idx, &state);
- if (ret == SOUND_POOL_ERROR_NONE)
- _logger_log_info("sound_pool_get_stream_state(pool, %zu, state) "
- "returned %s value, state is %s", stream_idx,
- __stringify_sound_pool_error(ret),
- __stringify_stream_state(state));
- else
- _logger_log_err("sound_pool_get_stream_state(pool, %zu, state) "
- "returned %s value, state is %s", stream_idx,
- __stringify_sound_pool_error(ret),
- __stringify_stream_state(state));
+ PRINT_INFO_OR_ERROR_INFO(ret == SOUND_POOL_ERROR_NONE,
+ "sound_pool_get_stream_state(pool, %zu, state) returned %s value, "
+ "state is %s", stream_idx, __stringify_sound_pool_error(ret),
+ __stringify_stream_state(state));
return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
}