Yattm - unified GTK instant-messaging client logo
   [Generated for version 0.2-17 - Mon Jan 6 19:01:23 GMT+1 2003]

Home - Main Page - Data Structures - File List - Data Fields - Globals

speech.c

Go to the documentation of this file.
00001 /*
00002  * Yattm plug-in
00003  *
00004  * Copyright (C) 2000, Leigh L. Klotz, Jr. <klotz@graflex.org>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 /****************************
00023   Speak message
00024   ***************************/
00025 
00026 #include "intl.h"
00027 #include <stdlib.h>
00028 #include <string.h>
00029 #include <pthread.h>
00030 
00031 #include "util.h"
00032 #include "speech.h"
00033 #include "globals.h"
00034 
00035 #define DEFAULTMESSAGEBODYVOICE "`v2"
00036 
00037 void speak_message(eb_account * remote,
00038            gchar * voice,
00039            gchar * message) {
00040 
00041   char xbuff[1024];
00042   char mbuff[256];
00043 
00044   if (do_no_sound_when_away && is_away) return;
00045 
00046   strcpy(xbuff, message);
00047   strip_html(xbuff);
00048   // todo: convert "LOL" to "ha ha ha"?
00049   sprintf(mbuff, "%s says: ", remote->handle);
00050   say_strings(mbuff, 
00051           (voice == NULL ? DEFAULTMESSAGEBODYVOICE : voice), 
00052           xbuff);
00053 }
00054 
00055 void say_strings(gchar *s1, gchar *s2, gchar *s3) 
00056 {
00057      pid_t p = fork();
00058      if (p == 0) {
00059       execl(SpeechProgramFilename, SpeechProgramFilename,
00060         s1, s2, s3, NULL);
00061      }
00062 }

Contact: Andy Maloney     [Documentation generated by doxygen]