2 * Navit, a modular navigation system.
3 * Copyright (C) 2005-2008 Navit Team
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
28 struct speech_priv *priv;
29 struct speech_methods meth;
33 speech_new(struct attr *parent, struct attr **attrs)
36 struct speech_priv *(*speech_new)(struct speech_methods *meth, struct attr **attrs);
39 type=attr_search(attrs, NULL, attr_type);
41 dbg(0,"type missing\n");
44 dbg(1,"type='%s'\n", type->u.str);
45 speech_new=plugin_get_speech_type(type->u.str);
46 dbg(1,"new=%p\n", speech_new);
48 dbg(0,"wrong type '%s'\n", type->u.str);
51 this_=g_new0(struct speech, 1);
52 this_->priv=speech_new(&this_->meth, attrs);
53 dbg(1, "say=%p\n", this_->meth.say);
54 dbg(1,"priv=%p\n", this_->priv);
59 dbg(1,"return %p\n", this_);
64 speech_say(struct speech *this_, const char *text)
66 dbg(1, "this_=%p text='%s' calling %p\n", this_, text, this_->meth.say);
67 return (this_->meth.say)(this_->priv, text);