home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************************/
- /* */
- /* Module Name: HSSetDTMF */
- /* */
- /* File Name: HSSetDTMF.c */
- /* */
- /* © Apple Computer, Inc. 1994-1995 */
- /* All Rights Reserved */
- /* */
- /* Revision History: */
- /* */
- /* Date Who Modification */
- /* */
- /* 1994-07-29 Jaakko Railo Original version */
- /* */
- /************************************************************************************************/
-
- /****************************************** DESCRIPTION ******************************************
-
- *************************************************************************************************/
-
- /******************************************** HEADERS *******************************************/
-
- #ifndef __TELEPHONES__
- #include "Telephones.h"
- #endif
-
- #include "TestModule.h"
-
- /****************************************** DEFINITIONS *****************************************/
-
- #define rDisplayHSSetDTMFDLOG 10000
- #define kDTMFOnItem 2
- #define kDTMFOffItem 3
- #define kDTMFOn 1
- #define kDTMFOff 0
-
- /****************************************** PROTOTYPES ******************************************/
-
- short DisplayHSSetDTMF (void);
- void DoTest (CHRSPtr paramPtr);
-
- /************************************************************************************************/
- /************************************************************************************************/
-
-
- pascal short TestModule (CHRSPtr paramPtr)
- {
- short returnValue = noErr;
-
- if (paramPtr->version <= kTestModuleVersion) {
-
- DoTest (paramPtr);
-
- }
- else
- returnValue = kWrongVersion;
-
- return (returnValue);
- }
-
-
- short DisplayHSSetDTMF (void)
- {
- short itemHit;
- DialogPtr theDialog;
-
- if ((theDialog = GetNewDialog (rDisplayHSSetDTMFDLOG, nil, (WindowPtr)(-1L))) != nil) {
-
- ShowWindow (theDialog);
-
- ModalDialog (nil, &itemHit);
-
- DisposeDialog (theDialog);
- }
- else
- itemHit = -1;
-
- return (itemHit);
- }
-
-
- void DoTest (CHRSPtr paramPtr)
- {
- TELHandle termHand = GetCurrentTELHandle (paramPtr);
- short itemHit;
- OSErr errCode;
- Boolean dtmf;
-
- itemHit = DisplayHSSetDTMF ();
- if ((itemHit == kDTMFOnItem) || (itemHit == kDTMFOffItem)) {
-
- dtmf = (itemHit == kDTMFOnItem)?kDTMFOn:kDTMFOff;
-
- if ((errCode = TELHSSetDTMF (termHand, dtmf)) == noErr)
- Print (paramPtr, "TELHSSetDTMF --> DTMF = %s",
- ((dtmf==kDTMFOn)?"DTMFOn":"DTMFOff"));
- else
- Print (paramPtr, "### TELHSSetDTMF failed : %d", errCode);
- }
- else
- if (itemHit == -1)
- Print (paramPtr, "### Unable to get a DLOG resource");
- }
-
-
-