Ejemplo n.º 1
0
static void find_preferred(int quiet)
{
	if (NULL == preferred)
		preferred = get_output_module("curses");

	if (NULL == preferred)
		preferred = get_output_module("ascii");

	if (NULL == preferred && !quiet)
		quit("No output module found.\n");
}
Ejemplo n.º 2
0
void
set_output(const char *name)
{
	static int set = 0;
	module_conf_t *ml, *m;

	if (set)
		return;
	set = 1;

	if (NULL == name || !strcasecmp(name, "list")) {
		list_output();
		exit(0);
	}
	
	ml = parse_module_param(name);

	for (m = ml; m; m = m->next) {
		preferred = get_output_module(ml->name);

		if (NULL == preferred)
			continue;

		if (preferred->om_set_opts)
			preferred->om_set_opts(ml->attrs);

		if (preferred->om_probe)
			if (preferred->om_probe())
				return;
	}
	
	quit("No (working) output module found\n");
}
Ejemplo n.º 3
0
int
output_speak(TSpeechDMessage *msg)
{
    OutputModule *output;
    int err;
    int ret;

    if(msg == NULL) return -1;

    output_lock();


    /* Determine which output module should be used */
    output = get_output_module(msg);
    if (output == NULL){
        MSG(3, "Output module doesn't work...");
        OL_RET(-1)
    }