home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / SAMPLES / MM / ADMCT / SPICALLS.C < prev    next >
C/C++ Source or Header  |  1995-08-24  |  4KB  |  161 lines

  1. /********************* START OF SPECIFICATIONS *********************
  2. *
  3. * SUBROUTINE NAME: SPICALLS.C
  4. *
  5. * DESCRIPTIVE NAME: Contains routines to manipulate streams.
  6. *
  7. *
  8. *
  9. *              Copyright (c) IBM Corporation  1991, 1993
  10. *                        All Rights Reserved
  11. *
  12. * FUNCTION:
  13. *
  14. * NOTES: The following concepts are illustrated in the source file.
  15. *        A. Calling connection manager to control streams.
  16. *
  17. * ENTRY POINTS:
  18. *
  19. *********************** END OF SPECIFICATIONS **********************/
  20. #define INCL_BASE
  21. #define INCL_DOSMODULEMGR
  22. #define INCL_DOSSEMAPHORES
  23.  
  24.  
  25. #include <os2.h>                        // OS2 defines.
  26. #include <string.h>
  27. #include <os2medef.h>                   // MME includes files.
  28. #include <stdlib.h>                     // Math functions
  29. #include <ssm.h>                        // SSM Spi includes.
  30. #include <meerror.h>                    // MM Error Messages.
  31. #include <mmioos2.h>                    // MMIO Include.
  32. #include <mcios2.h>                     // MM System Include.
  33. #include <mcipriv.h>                    // MCI Connection stuff
  34. #include <mmdrvos2.h>                   // MCI Driver include.
  35. #include <mcd.h>                        // AudioIFDriverInterface.
  36. #include <hhpheap.h>                    // Heap Manager Definitions
  37. #include <qos.h>
  38. #include <audiomcd.h>                   // Component Definitions.
  39. #include "admcfunc.h"                   // Function Prototypes.
  40.  
  41.  
  42. // ****************
  43. // All calls to ADMCStopStream will have to send device id instead of hstream
  44.  
  45. #ifndef CONNECTION
  46. ULONG ADMCStopStream ( INSTANCE  *pInstance, ULONG ulFlags )
  47.  
  48. {
  49.  return (SpiStopStream( pInstance->StreamInfo.hStream, ulFlags ));
  50. }
  51. #else
  52. ULONG ADMCStopStream ( INSTANCE  *pInstance, ULONG ulFlags )
  53.  
  54. {
  55.   return( mciSendCommand( pInstance->usWaveDeviceID,
  56.                           MCIDRV_STOP,
  57.                           ulFlags,
  58.                           0,
  59.                           0) );
  60.  
  61. }
  62. #endif
  63.  
  64. /********************* START OF SPECIFICATIONS *******************************
  65. *
  66. * SUBROUTINE NAME: DestroyStream()
  67. *
  68. * DESCRIPTIVE NAME:
  69. *
  70. * FUNCTION: call SpiDestroyStream
  71. *
  72. *
  73. * NOTES:
  74. * ENTRY POINTS:
  75. *
  76. * INPUT:
  77. *
  78. * EXIT-NORMAL: Return Code 0.
  79. *
  80. * EXIT_ERROR:  Error Code.
  81. *
  82. * EFFECTS:
  83. *
  84. * INTERNAL REFERENCES: None
  85. *
  86. * EXTERNAL REFERENCES: None
  87. *
  88. *********************** END OF SPECIFICATIONS *******************************/
  89.  
  90. // CONNECTOR FEATURE--this function should not be called.
  91. #ifndef CONNECTION
  92. RC DestroyStream ( INSTANCE  *pInstance)
  93. {
  94.  
  95.   ULONG ulrc = MCIERR_SUCCESS;
  96.  
  97.   if ( pInstance->StreamInfo.hStream != (ULONG) NULL)
  98.  
  99.    {
  100.    ulrc = SpiDestroyStream( pInstance->StreamInfo.hStream );
  101.    }
  102.  
  103.    pInstance->StreamInfo.hStream = 0;
  104.  
  105.   return ( ulrc );
  106. } // DestroyStream
  107. #endif
  108.  
  109.  
  110.  
  111. #ifndef CONNECTION
  112. ULONG ADMCSeekStream ( INSTANCE  *pInstance,
  113.                        ULONG  ulFlags,
  114.                        LONG   lSeekPoint )  /*mmtime or other          */
  115.  
  116. {
  117.   return( SpiSeekStream( pInstance->StreamInfo.hStream, ulFlags, lSeekPoint ) );
  118. }
  119.  
  120. #else
  121. ULONG ADMCSeekStream ( INSTANCE  *pInstance,
  122.                        ULONG  ulFlags,
  123.                        LONG   lSeekPoint )  /*mmtime or other          */
  124.  
  125. {
  126.  return ( mciSendCommand( pInstance->usWaveDeviceID,
  127.                           MCIDRV_SEEK,
  128.                           ulFlags,
  129.                           (PVOID) lSeekPoint,
  130.                           0) );
  131.  
  132. } /* ADMCSeekStream */
  133. #endif
  134.  
  135. ULONG ADMCAssociate ( HSTREAM hstream, HID hid, PACB pacb )
  136.  
  137. {
  138.   return ( SpiAssociate( hstream, hid, pacb ) );
  139. }
  140.  
  141.  
  142. ULONG APIENTRY ADMCDisableEvent ( HEVENT hevent )
  143. {
  144.   return ( SpiDisableEvent( hevent ) );
  145. }
  146.  
  147.  
  148. ULONG APIENTRY ADMCEnableEvent ( PEVCB pevcb,
  149.                                 PHEVENT phevent )
  150.  
  151. {
  152.   return ( SpiEnableEvent( pevcb, phevent ) );
  153. }
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.