home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CMIDI 2.2 / CMIDIOutputPort.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  1.5 KB  |  52 lines  |  [TEXT/KAHL]

  1. /*
  2.  *——— CMIDIOutputPort.h ———————————————————————————————————————————————————————
  3.  * Copyright © Paul Ferguson, 1990-94.  All rights reserved.
  4.  *
  5.  *    For use with Symantec C++ 6.0 and the THINK Class Library.
  6.  *
  7.  * Description:
  8.  *    This class defines a MIDI Manager output port object.
  9.  *
  10.  *    Refer to the CMIDI Programmer's Manual for a complete desciption of
  11.  *    this class.
  12.  *————————————————————————————————————————————————————————————————————————————
  13.  */
  14. #pragma once
  15. #include "CMIDIDataPort.h"
  16.  
  17. CLASS CMIDITimePort;
  18.  
  19. class CMIDIOutputPort : public CMIDIDataPort
  20. {
  21.  
  22. public:
  23.  
  24.     OSErr            IMIDIOutputPort(
  25.                         StringPtr        theName,         // Pascal format, 31 char max
  26.                         OSType            thePortID,
  27.                         Boolean            theVisibleFlag,
  28.                         CMIDITimePort *    theTimePort,
  29.                         long            theOffset);
  30.     OSErr            WritePacket(MIDIPacketPtr theMIDIPacket);
  31. #ifdef __cplusplus
  32.     OSErr            Write(char * theData, short theDataLen)
  33.                         { return DoMIDIWrite(theData, theDataLen, midiTimeStampCurrent, 0); };
  34.     OSErr            WriteTS(char * theData, short theDataLen, long theTimeStamp)
  35.                         { return DoMIDIWrite(theData, theDataLen, midiTimeStampValid, theTimeStamp); };
  36. #else
  37.     OSErr            Write(char * theData, short theDataLen);
  38.     OSErr            WriteTS(char * theData, short theDataLen, long theTimeStamp);
  39. #endif
  40. private:
  41.  
  42.     OSErr            DoMIDIWrite(
  43.                         char *            theData,
  44.                         short            theDataLen,
  45.                         unsigned char    theFlags,
  46.                         long            theTimeStamp);
  47.  
  48.     static pascal OSErr    (*midiWriteProc) (short refnum, MIDIPacketPtr packet);
  49. };
  50.  
  51. // end of CMIDIOutputPort.h
  52.