eudora-mac/Include/speechutil.h

1 line
7.7 KiB
C
Raw Normal View History

2018-05-23 09:59:15 +00:00
/* Copyright (c) 2017, Computer History Museum All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Computer History Museum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef SPEECH_ENABLED #ifdef TWO #ifndef SPEECHUTIL_H #define SPEECHUTIL_H #include <Speech.h> // // 'dict' resource (for which Apple hasn't created a data structure) // enum { kDictionaryAtom = FOUR_CHAR_CODE('dict'), kDictionaryAtomVersion = 1 }; enum { nullEntryField = 0x0000, textEntryField = 0x0021, phonEntryField = 0x0022 }; enum { pronunciationEntry = 0x0021, abbreviationEntry = 0x0022 }; typedef struct { UInt16 length; SInt16 type; } DictEntryFieldHeaderRec, *DictEntryFieldHeaderPtr, **DictEntryFieldHeaderHandle; typedef struct { UInt16 length; SInt16 type; UInt16 numFields; } DictEntryHeaderRec, *DictEntryHeaderPtr, **DictEntryHeaderHandle; typedef struct { UInt32 length; FourCharCode atom; SInt32 version; ScriptCode script; LangCode language; RegionCode region; UInt32 modDate; UInt8 reserved[16]; UInt32 numEntries; } DictHeaderRec, *DictHeaderPtr, **DictHeaderHandle; // // 'ACRY' resource (our own invention) // typedef unsigned char Str8[9]; typedef struct { Str8 letters; Str255 spokenAs; } AcronymRec, *AcronymPtr, **AcronymHandle; #define rAcronymResType 'ACRY' typedef struct { long paraOffset; Byte quoteLevel; } QuoteTableRec, *QuoteTablePtr, **QuoteTableHandle; #define SPEECH_PREF_FILE_TYPE 'pref' #define SPEECH_PREF_FILE_CREATOR 'pltk' // // Format of the Speech control panel's Talking Alerts preference // // (near as I can figure...) // #define rTalkingAlertResType 'SADt' // Talking Alerts pref resource type #define rTalkingAlertPrefResID -4033 // Talking Alerts pref resource ID #define rTalkingAlertPhraseListResID -4034 // Talking Alerts speak phrases resource ID #define kSpeakTheNextPhrase 0x0100 #define kSpeakARandomPhrase 0x0200 // // Format of the 'SADt' (-4033) resource // typedef struct { short unknown1; // ...perhaps the preference version? char unknown2; // ...search me Boolean speakPhrase; // State of the "Speak phrase" checkbox Boolean speakAlertText; // State of the "Speak alert text" checkbox char unknown3; // ...dunno short delayTicks; // Number of ticks to wait before speaking the alert short phraseModifier; // Speak a phrase other then the default phrase short phraseIndex; // Index of the alert phrase in the 'SADt' (-4034) resource (1 based) } TalkingAlertPrefRec, *TalkingAlertPrefPtr, **TalkingAlertPrefHandle; // // Format of the 'SADt' (-40