home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 9
/
FreshFishVol9-CD2.bin
/
bbs
/
util
/
muispeechtoy-0.01.lha
/
MUISpeechToy
/
src
/
Speak.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-07-03
|
6KB
|
192 lines
#include <libraries/mui.h>
#include <proto/muimaster.h>
#include <clib/exec_protos.h>
#include <exec/memory.h>
#ifndef MAKE_ID
#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
#endif
#ifdef _DCC
#define __inline
#endif
/* ExTended KeyButton ( or Eric Totel KeyButton :-) ) */
/* to use with localization features */
static APTR __inline ETKeyButton(char *text)
{
return (KeyButton(&text[3], text[1]));
}
#include "Speak.h"
#include "SpeakStrings.h"
struct ObjApp * CreateApp( void )
{
struct ObjApp * Object;
if (!(Object = AllocVec( sizeof( struct ObjApp ), MEMF_PUBLIC|MEMF_CLEAR )))
return( NULL );
Object->STR_TX_label_0 = GetString( MSG_TX_label_0 );
Object->STR_CY_SEX [0] = GetString( MSG_CY_SEX0 );
Object->STR_CY_SEX [1] = GetString( MSG_CY_SEX1 );
Object->STR_CY_SEX [2] = NULL;
Object->STR_TX_label_1 = GetString( MSG_TX_label_1 );
Object->STR_CY_KIND [0] = GetString( MSG_CY_KIND0 );
Object->STR_CY_KIND [1] = GetString( MSG_CY_KIND1 );
Object->STR_CY_KIND [2] = GetString( MSG_CY_KIND2 );
Object->STR_CY_KIND [3] = NULL;
Object->STR_TX_label_2 = GetString( MSG_TX_label_2 );
Object->STR_TX_label_3 = GetString( MSG_TX_label_3 );
Object->STR_TX_label_4 = GetString( MSG_TX_label_4 );
Object->STR_TX_label_5 = GetString( MSG_TX_label_5 );
Object->STR_TX_label_6 = GetString( MSG_TX_label_6 );
Object->App = ApplicationObject,
MUIA_Application_Author, "Andreas Jung, Klosterstr. 21, D-66125 Saarbrücken, Germany",
MUIA_Application_Base, "MUISPEECHTOY",
MUIA_Application_Title, "MUI-Speechtoy",
MUIA_Application_Version, "$VER: MuiSpeechtoy 0.01 (03.07.94)",
MUIA_Application_Copyright, "This program is freely distributable ",
MUIA_Application_Description, GetString( MSG_AppDescription ),
SubWindow, Object->WIN_MAIN = WindowObject,
MUIA_Window_Title, GetString( MSG_WIN_MAIN ),
MUIA_Window_ID, MAKE_ID( '0','W','I','N' ),
WindowContents, GroupObject,
Child, GroupObject,
GroupFrameT( GetString( MSG_GR_grp_0 ) ),
MUIA_Group_Columns, 2,
Child, Object->TX_label_0 = TextObject,
MUIA_Background, 128,
MUIA_Text_Contents, Object->STR_TX_label_0,
MUIA_Text_SetMax, 0,
MUIA_Text_SetMin, 1,
MUIA_Frame, 0,
End,
Child, Object->CY_SEX = CycleObject,
MUIA_Cycle_Entries, Object->STR_CY_SEX,
End,
Child, Object->TX_label_1 = TextObject,
MUIA_Background, 128,
MUIA_Text_Contents, Object->STR_TX_label_1,
MUIA_Text_SetMax, 0,
MUIA_Text_SetMin, 1,
MUIA_Frame, 0,
End,
Child, Object->CY_KIND = CycleObject,
MUIA_Cycle_Entries, Object->STR_CY_KIND,
End,
Child, Object->TX_label_2 = TextObject,
MUIA_Background, 128,
MUIA_Text_Contents, Object->STR_TX_label_2,
MUIA_Text_SetMax, 0,
MUIA_Text_SetMin, 1,
MUIA_Frame, 0,
End,
Child, Object->SL_HEIGHT = SliderObject,
MUIA_Slider_Min, 65,
MUIA_Slider_Max, 320,
MUIA_Slider_Quiet, FALSE,
MUIA_Slider_Level, 65,
MUIA_Slider_Reverse, FALSE,
End,
Child, Object->TX_label_3 = TextObject,
MUIA_Background, 128,
MUIA_Text_Contents, Object->STR_TX_label_3,
MUIA_Text_SetMax, 0,
MUIA_Text_SetMin, 1,
MUIA_Frame, 0,
End,
Child, Object->SL_SPEED = SliderObject,
MUIA_Slider_Min, 40,
MUIA_Slider_Max, 400,
MUIA_Slider_Quiet, FALSE,
MUIA_Slider_Level, 100,
MUIA_Slider_Reverse, FALSE,
End,
Child, Object->TX_label_4 = TextObject,
MUIA_Background, 128,
MUIA_Text_Contents, Object->STR_TX_label_4,
MUIA_Text_SetMax, 0,
MUIA_Text_SetMin, 1,
MUIA_Frame, 0,
End,
Child, Object->SL_VOLUME = SliderObject,
MUIA_Slider_Min, 0,
MUIA_Slider_Max, 64,
MUIA_Slider_Quiet, FALSE,
MUIA_Slider_Level, 64,
MUIA_Slider_Reverse, FALSE,
End,
End,
Child, GroupObject,
GroupFrameT( GetString( MSG_GR_grp_3 ) ),
MUIA_Group_Columns, 2,
Child, Object->TX_label_5 = TextObject,
MUIA_Background, 128,
MUIA_Text_Contents, Object->STR_TX_label_5,
MUIA_Text_SetMax, 0,
MUIA_Text_SetMin, 1,
MUIA_Frame, 0,
End,
Child, Object->SL_ENTHUSIASMUS = SliderObject,
MUIA_Slider_Min, 0,
MUIA_Slider_Max, 255,
MUIA_Slider_Quiet, FALSE,
MUIA_Slider_Level, 0,
MUIA_Slider_Reverse, FALSE,
End,
Child, Object->TX_label_6 = TextObject,
MUIA_Background, 128,
MUIA_Text_Contents, Object->STR_TX_label_6,
MUIA_Text_SetMax, 0,
MUIA_Text_SetMin, 1,
MUIA_Frame, 0,
End,
Child, Object->SL_PERTUBATION = SliderObject,
MUIA_Slider_Min, 0,
MUIA_Slider_Max, 255,
MUIA_Slider_Quiet, FALSE,
MUIA_Slider_Level, 0,
MUIA_Slider_Reverse, FALSE,
End,
End,
Child, GroupObject,
Child, ColGroup( 2 ),
Child, Label2( GetString( MSG_STR_TEXT ) ),
Child, Object->STR_TEXT = StringObject,
StringFrame,
MUIA_String_MaxLen, 255,
MUIA_String_Format, 0,
End,
End,
Child, ColGroup( 2 ),
Child, Label2( GetString( MSG_STR_PHONEME ) ),
Child, Object->STR_PHONEME = StringObject,
StringFrame,
MUIA_String_MaxLen, 1000,
MUIA_String_Format, 0,
End,
End,
Child, Object->BT_SPEAK = ETKeyButton( GetString( MSG_BT_SPEAK ) ),
End,
End,
End,
End;
if (!(Object->App))
{
FreeVec(Object);
Object = NULL;
}
return( Object );
}
void DisposeApp( struct ObjApp * Object )
{
MUI_DisposeObject(Object->App);
FreeVec( Object );
}