author | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
---|---|---|
committer | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
commit | 39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91 (patch) (unidiff) | |
tree | 96e66fdc18dca4d4ab8611133e072f57dea224b9 /noncore/apps/opie-reader/flitecmd.cpp | |
parent | 279fc4fd1986074acbadd3a8e86fcf3968a8dd5c (diff) | |
download | opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.zip opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.gz opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.bz2 |
new opie-reader sources with support for ArriereGo, Reb input and flite output plugins
Diffstat (limited to 'noncore/apps/opie-reader/flitecmd.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/flitecmd.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/flitecmd.cpp b/noncore/apps/opie-reader/flitecmd.cpp new file mode 100644 index 0000000..bb7e303 --- a/dev/null +++ b/noncore/apps/opie-reader/flitecmd.cpp | |||
@@ -0,0 +1,43 @@ | |||
1 | #include <unistd.h> | ||
2 | #include <sys/types.h> | ||
3 | #include <sys/wait.h> | ||
4 | #include <errno.h> | ||
5 | #include "flitecmd.h" | ||
6 | |||
7 | void CFliteCmd::output(const QString& txt) | ||
8 | { | ||
9 | pid_t pid; | ||
10 | if ((pid = fork()) <0) | ||
11 | { | ||
12 | qDebug("No memory"); | ||
13 | } | ||
14 | else if (pid == 0) | ||
15 | { | ||
16 | execlp("flite", "flite", "-t", (const char*)txt, NULL); | ||
17 | _exit(127); | ||
18 | qDebug("Can't find flite"); | ||
19 | } | ||
20 | else | ||
21 | { | ||
22 | int status; | ||
23 | while (waitpid(pid, &status, 0) < 0) | ||
24 | { | ||
25 | if (errno != EINTR) | ||
26 | { | ||
27 | qDebug("Error from flite"); | ||
28 | break; | ||
29 | } | ||
30 | } | ||
31 | qDebug("flite status:%d", status); | ||
32 | } | ||
33 | } | ||
34 | |||
35 | QString CFliteCmd::about() | ||
36 | { | ||
37 | return QString("FliteCmd output codec (c) Tim Wentford\n"); | ||
38 | } | ||
39 | |||
40 | extern "C" | ||
41 | { | ||
42 | COutput* newcodec() { return new CFliteCmd; } | ||
43 | } | ||