home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / mm / admct / mcd.h < prev    next >
C/C++ Source or Header  |  1999-05-11  |  15KB  |  285 lines

  1. /**************************START OF SPECIFICATIONS **************************
  2. *                                                                          *
  3. * Module NAME:  MCD.H                                                      *
  4. *                                                                          *
  5. *                                                                          *
  6. * OS/2 2.x Multimedia Extensions MCD structures and definitions            *
  7. *                                                                          *
  8. * Copyright (c) International Business Machines Corporation 1990,1991      *
  9. *                         All Rights Reserved                              *
  10. *                                                                          *
  11. * The logical MCI Amp-mixer device is divided into two portions:           *
  12. *                                                                          *
  13. *   AMPMXMCD.DLL  << Device Independent >>                                 *
  14. *   xxxxxxxx.DLL  << Vendor Specific DLL>                                  *
  15. *                                                                          *
  16. * These two DLLs communicate via a shared instance which is passed in      *
  17. * on the VSD open in the pDevInfo field of the VSD_OPEN parms.  MCD.H      *
  18. * contains the definition of this shared instance.                         *
  19. *                                                                          *
  20. * This file contains a shared instance structure which is passed to an     *
  21. * audio VSD from the amp-mixer.  It is suggested that you use this         *
  22. * structure as your instance structure, however it is not required.  What  *
  23. * is required is that the fields indicated by REQUIRED by kept up to date. *
  24. *                                                                          *
  25. * The following fields must always be kept accurate:                       *
  26. *                                                                          *
  27. * Mixer related fields:                                                    *
  28. *                                                                          *
  29. *        LONG lLeftVolume;                                                 *
  30. *        LONG lBalance;                                                    *
  31. *        LONG lBass;                                                       *
  32. *        LONG lTreble;                                                     *
  33. *        LONG lPitch;                                                      *
  34. *        ULONG ulMasterVolume;                                             *
  35. *        LONG lMonitor;                                                    *
  36. *        ULONG ulGainLevel;                                                *
  37. *                                                                          *
  38. * AUDIO Mode fields                                                        *
  39. *                                                                          *
  40. *        LONG lSRate;                                                      *
  41. *        LONG lBitsPerSRate;                                               *
  42. *        SHORT sMode;                                                      *
  43. *        SHORT sChannels;                                                  *
  44. *        ULONG ulOperation;                                                *
  45. *                                                                          *
  46. *                                                                          *
  47. *                                                                          *
  48. *       ULONG ulBestFitBPS;                                                *
  49. *       ULONG ulBestFitChan;                                               *
  50. *       ULONG ulBestFitRate;                                               *
  51. *       SHORT sBestFitMode;                                                *
  52. *                                                                          *
  53. *        ULONG ulDataType;                                                 *
  54. *        ULONG ulSubType;                                                  *
  55. *                                                                          *
  56. * Capability fields                                                        *
  57. *                                                                          *
  58. *        ULONG ulCanRecord;                                                *
  59. *                                                                          *
  60. *                                                                          *
  61. *                                                                          *
  62. * If you are writing an AUDIODD VSD--then the following must be accurate:  *
  63. *                                                                          *
  64. *       HFILE hFile;                                                       *
  65. *       USHORT usDeviceID;                                                 *
  66. *       ULONG ulGlobalFile;                                                *
  67. *                                                                          *
  68. *                                                                          *
  69. ************************** END OF SPECIFICATIONS ***************************/
  70.  
  71. #ifndef _SSM_H_
  72. #define _SSM_H_
  73. #include <ssm.h>
  74. #include <dcb.h>
  75. #endif
  76.  
  77.  
  78. #define INCL_SEMAPHORES
  79. #define LIST_LEN           8
  80.  
  81. #define LINE_IN_ON                              0x00000001
  82. #define MIC_ON                                  0x00000002
  83. #define LINE_OUT_ON                             0x00000004
  84.  
  85.  
  86. #define VSD_SET_VOLUME          0x00000001
  87. #define VSD_SET_TREBLE          0x00000002
  88. #define VSD_SET_BASS            0x00000004
  89. #define VSD_SET_PITCH           0x00000008
  90. #define VSD_SET_GAIN            0x00000010
  91. #define VSD_SET_CONN            0x00000020
  92. #define VSD_SET_MONITOR         0x00000040
  93. #define VSD_SET_BALANCE         0x00000080
  94. #define VSD_SET_MASTER          0x00000100
  95. #define VSD_SET_ALL             0xffffffff
  96.  
  97. #define MIXER_MULTIPLIER        0xffff / 100 // mixer ranges--0 to ffff
  98.                                              // MCI 0 - 100.  Map ranges
  99.  
  100. #define REAL_MIXER              0x00000001
  101. /*-------------------------------------------------------------------------*
  102. * RIFF to ACPA Mode conversion Table
  103. *-------------------------------------------------------------------------*/
  104.  
  105. typedef struct
  106.         {
  107.         ULONG  ulDataType;
  108.         ULONG  ulAUDIODDMode;
  109.         } RIFFTABLE;
  110.  
  111.  
  112. typedef struct _VSD_MIXER {
  113.    PVOID        hvsd;       /* Handle to the vsd */
  114.    ULONG        hMix;       /* Handle to the mixer device */
  115.    ULONG        hConn;
  116.    ULONG        ulState;    /* State flag--who opened the device */
  117.    ULONG        ulMasterTreble;
  118.    ULONG        ulMasterBass;
  119.    ULONG        ulMasterBalance;
  120.    ULONG        ulMasterLoudness;
  121.    BOOL         fHardwareMix;
  122.    } VSD_MIX;
  123.  
  124. typedef VSD_MIX  *PVSD_MIX;
  125.  
  126.  
  127. #pragma pack(4)
  128. typedef struct _portlist {   /* devid */
  129.                        ULONG ulDevType;
  130.                        ULONG  ulDevNum;
  131.                       } MCI_PORT_LIST;
  132. #pragma pack()
  133.  
  134.  
  135. /*-------------------------------------------------------------------------*
  136. * Amp/Mixer instance structure declaration
  137. *-------------------------------------------------------------------------*/
  138.  
  139. #pragma pack(4)
  140.  
  141. typedef struct _MCI_AMP_INSTANCE
  142.         {
  143.         CHAR szDeviceName[MAX_PDD_NAME];  // INPUT--name of associated device driver
  144.                                           // used by AUDIODD VSD to figure out which
  145.                                           // DD to open.  VSDs for specific hardaware
  146.                                           // don't need this.
  147.         CHAR szDriverName[MAX_DEVICE_NAME]; // INPUT--NAME of device driver in MMPM2.INI
  148.         CHAR szProdInfo[MAX_PRODINFO];    // INPUT --product name
  149.  
  150.         HFILE hFile;                      // DosOpen FIle handle.  If streaming is used
  151.                                           // this field must be filled in.
  152.         USHORT usDeviceID;                // INPUT--Device id of mixer instance
  153.         ULONG ulGlobalFile;               // OUTPUT--from DosOpen, Global Filenumber
  154.                                           // this number is a unique identifier which
  155.                                           // should be created for each instance of the
  156.                                           // VSD.
  157.  
  158.         USHORT usMasterVolume;            // UNUSED
  159.         LONG lLeftVolume;                 // INPUT/OUPUT--status of volume
  160.         LONG  ( * APIENTRY pfnNewVSD) ( PVOID, LONG, LONG, PVOID );  // INPUT--ptr to VSD entry point.
  161.  
  162.         LONG lVolumeDelay;                // VSD PRIVATE--variable used to indicate the
  163.                                           // delay effect for volume
  164.         LONG lBalance;                    // INPUT/OUPUT--status of volume
  165.         LONG lBalanceDelay;               // VSD PRIVATE--variable used to indicate the
  166.                                           // delay effect for volume
  167.         LONG lBass;                       // INPUT/OUPUT--status of bass setting
  168.         LONG lTreble;                     // INPUT/OUPUT--status of treble
  169.         LONG lPitch;                      // INPUT/OUPUT--status of pitch
  170.  
  171.         LONG lSRate;                      // INPUT/OUPUT--sampling rate
  172.         LONG lBitsPerSRate;               // INPUT/OUPUT--bits/sample
  173.         ULONG fConnected;                 // AMP-mixer--state variable.
  174.         SHORT sMode;                      // INPUT/OUPUT--RIFF MODE to change device to
  175.         SHORT sChannels;                  // INPUT/OUPUT--channels to use
  176.         ULONG ulFlags;                    // Private field for VSD
  177.         LONG lMonitor;                    // INPUT/OUPUT--is input monitoring on?
  178.         ULONG ulAmpCaps;                  // Amp capability flags
  179.         LONG lOutput;                     // Unused
  180.         ULONG ulOperation;                // INPUT/OUPUT--Either OPERATION_PLAY or
  181.                                           // OPERATION_RECORD << Audio.H >>
  182.         ULONG ulGainLevel;                // INPUT/OUPUT--status of gain
  183.  
  184.         ULONG ulDosOpened;                // VSD private
  185.                                           // in Template--this indicates if DosOpen was performed
  186.  
  187.         ULONG ulInitOpen;                 // VSD private
  188.                                           // in Template--this indicates if AUDIO_INIT was called
  189.         ULONG ulMasterVolume;             // INPUT/OUPUT--status of master volume
  190.         ULONG ulActive;                   // INPUT/OUPUT
  191.                                           // in Template--this BOOLEAN indicates if the
  192.                                           // VSD is currently using the card.  If VSD_SAVE is
  193.                                           // called, ulActive will be set to false.
  194.  
  195.         ULONG ulBestFitBPS;               // OUTPUT--if vsd can't do an AUDIO_INIT
  196.         ULONG ulBestFitChan;              // OUTPUT--it sets the best fit fields up
  197.         ULONG ulBestFitRate;              // OUTPUT--with the appropriate values
  198.         SHORT sBestFitMode;               // OUTPUT
  199.         SHORT sStoreChannels;             // VSD private
  200.         ULONG ulSetAmpDefaults;           // VSD private
  201.         ULONG ulDefaultsSet;              // VSD private
  202.         ULONG ulOutputDev;                // VSD private
  203.         ULONG ulInputDev;                 // VSD private
  204.         ULONG ulResourcesUsed;            // VSD private
  205.         ULONG ulRestoreNotify;            // VSD private
  206.         ULONG ulCallback;                 // VSD private
  207.         SHORT sUserParm;                  // VSD private
  208.         LONG  lNotifyFlag;                // VSD private
  209.  
  210.         LONG  ( * APIENTRY pfnAUDIOIF) ( PVOID, LONG, LONG, PVOID );
  211.  
  212.         HMTX  hmtxInstanceSem;            // VSD private
  213.         ULONG ulClass;                    // VSD private
  214.         ULONG ulBlockAlignment;           // VSD private
  215.         ULONG ulHardwareMode;             // VSD private
  216.         MCI_PORT_LIST  rInputList [ LIST_LEN ];  // VSD private
  217.         MCI_PORT_LIST  rOutputList[ LIST_LEN ];  // VSD private
  218.         ULONG ulNumInputs;                // VSD private
  219.         ULONG ulNumOutputs;               // VSD private
  220.         ULONG ulDataType;                 // INPUT/OUTPUT--RIFF Datatype
  221.         ULONG ulSubType;                  // INPUT/OUTPUT--RIFF Subtype
  222.         ULONG ulBytesPerBlock;            //  Unused--excess field
  223.         ULONG ulMMTimePerBlock;           //  Unused--excess field
  224.         ULONG ulCanRecord;                // VSD private
  225.         ULONG ulVolControl;               // VSD private
  226.  
  227.         PVOID    pAudioModeData;      // pointer to dev. specific resource data
  228.         CHAR     pResourceDLL[ 128 ]; // INPUT--mixer fills in name of RESOURCE DLL (if any)
  229.                                       // for the VSD.
  230.  
  231.         PSZ        pProdInfo;         // pointer to the product name
  232.         ULONG      ulDeviceID;        // pointer to the device id.
  233.         ULONG      ulNumMappingRows;  // number of RIFF->AUDIODD mapping modes
  234.         ULONG      ulMatch;           // Private field for VSD
  235.         RIFFTABLE  *pMapTable;        // additional RIFF->AUDIODD mappings
  236.  
  237.         ULONG      ulNumDataTypes;    // number of datatypes to check
  238.         PVOID      pDataTypeTable;    // Private field for VSD
  239.         BOOL       fMute;             // Private field for VSD
  240.         ULONG      ulResourceID;      // offset in the resource dll to use
  241.         ULONG      ulConnDefaults;    // Default values for connectors
  242.         BOOL       fSSMState;         // Private field for VSD
  243.         ULONG      hStream;           // Private field for VSD
  244.         ULONG      ulLine;            // Current input line
  245.         PVOID      hvsd;              /* Handle to the vsd */
  246.         ULONG      hMix;              /* Handle to the mixer device */
  247.         BOOL       fHardwareMix;      // Private field for VSD
  248.         ULONG      ulState;           // not sure what this does anymore
  249.         BOOL       fDriverCaps;       // Private field for VSD
  250.         VSD_DCB    vsddcb;            /* Device Control Block for streaming */
  251.         SPCBKEY    spcbkey;           /* Streaming key which describes mixer mode */
  252.         } MCI_AMP_INSTANCE;
  253.  
  254.  
  255.  
  256. typedef MCI_AMP_INSTANCE FAR *PMCI_AMP_INSTANCE;
  257.  
  258. typedef MCI_AMP_INSTANCE  *PVSD_INSTANCE;
  259. typedef MCI_AMP_INSTANCE  VSD_INSTANCE;
  260. #pragma pack()
  261.  
  262.  
  263. /*********************************************************************/
  264. /*                                                                   */
  265. /*  CONCB prototype                                                  */
  266. /*                                                                   */
  267. /*********************************************************************/
  268.  
  269. typedef struct _CONCB {
  270.   ULONG    ulStructLength;
  271.   HID      hid;
  272.   PDCB     pdcb;
  273.   PSPCBKEY pspcbkey;
  274.   PEVCB    pevcb;
  275.   PEVFN    pevfn;
  276.   ULONG    ulFlags;
  277.   HSTREAM  hstreamAssoc;
  278.   HSTREAM  hstream;
  279.   PVOID    pMediaHeader;
  280.   ULONG    ulConnectorType;
  281.   ULONG    ulConnectorIndex;
  282.   struct _CONCB   *pConnectToConCB;
  283. } CONCB;
  284. typedef CONCB  *PCONCB;
  285.