home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / FACETV.ZIP / RESPWIND.H < prev    next >
C/C++ Source or Header  |  1994-01-05  |  3KB  |  112 lines

  1. /************************************************************************
  2. **
  3. ** @(#)respwind.h    01/05/94    Chris Ahlstrom
  4. **
  5. ** ---------------------------
  6. **   73340.26!compuserve.com
  7. ** ---------------------------
  8. **
  9. ** C++
  10. **
  11. **    This module supports showing annunciator lights in a TV window.
  12. ** The model is very strict, applicable only to 2- or 3-alternative
  13. ** forced choice tasks in psychoacoustics.  See the CPP file.
  14. **
  15. **    The FACE_TV (and FACE_WIN) versions are a little different from
  16. ** the code extracted from the MODAPP 2AFC-experiment code.
  17. **
  18. *************************************************************************/
  19.  
  20. #if !defined(RESPWIND_h)                // { RESPWIND_h
  21. #define RESPWIND_h
  22.  
  23. #include <dos.h>
  24. #include <conio.h>
  25.  
  26. #if !defined(__TTYPES_H)
  27. #include <ttypes.h>        // "Boolean" Turbo Vision definition
  28. #endif
  29.  
  30. #define Uses_TDeskTop
  31. #define Uses_TPallete
  32. #define Uses_TRect
  33. #define Uses_TView
  34. #define Uses_TWindow
  35. #include <tv.h>            // Turbo Vision code galore!!!
  36.  
  37. #include "rbuttons.h"        // ResponseButton class
  38. #include "respintr.h"        // ResponseInterior class
  39.  
  40.  
  41. /************************************************************************
  42. ** ResponseDevice
  43. **
  44. **    We override the version of startScreen, in
  45. ** in order to provide the extra function of waiting for the user.
  46. **
  47. **    We add a responseFeedback() routine to wait for a key press
  48. ** and show the feedback lights.
  49. **
  50. **    Note the defining of Turbo Vision color palettes, too.
  51. **
  52. *************************************************************************/
  53.  
  54. #define cpBlueWindow "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
  55. #define cpRespPalette cpBlueWindow    \
  56.     RESPONSE_PAL INTERVAL_PAL READY_PAL ANSWER_PAL BACK_PAL
  57.  
  58. class ResponseDevice : public TWindow
  59. {
  60.  
  61. public:
  62.  
  63.     ResponseDevice
  64.     (
  65.     ResponseType device,
  66.     const TRect& bounds,
  67.     const char *aTitle,
  68.     short aNumber
  69.     );
  70.     ~ResponseDevice();
  71.  
  72.     ResponseSet startScreen();        // bring up initial screen
  73.     void readyLight();            // Warning! Trial is starting!
  74.     void responseOff();
  75.     void intervalLight
  76.     (
  77.     ushort interval
  78.     );
  79.     void answerLight();
  80.     int responseFeedback
  81.     (
  82.     int stimulus
  83.     );
  84.     void pause ();
  85.     int lightMask2AFC
  86.     (
  87.     int stimulus,
  88.     int response
  89.     );
  90.  
  91.     ResponseInterior *subInterior;    // access to interior
  92.  
  93.     virtual TPalette& getPalette() const;
  94.  
  95. protected:
  96.  
  97.     ResponseButton *buttons;        // handles subject's input
  98.  
  99. };
  100.  
  101. #if 0
  102. #if defined(RESPWIND_cpp)
  103.     ResponseDevice *subBox;        // device window
  104. #else
  105.     extern ResponseDevice *subBox;    // device window
  106. #endif
  107. #endif
  108.  
  109.  
  110.  
  111. #endif                            // } RESPWIND_h
  112.