home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / midas / vu.inc < prev    next >
Text File  |  1994-08-06  |  4KB  |  136 lines

  1. ;*    VU.INC
  2. ;*
  3. ;* Real VU meter routines
  4. ;*
  5. ;* Copyright 1994 Petteri Kangaslampi and Jarno Paananen
  6. ;*
  7. ;* This file is part of the MIDAS Sound System, and may only be
  8. ;* used, modified and distributed under the terms of the MIDAS
  9. ;* Sound System license, LICENSE.TXT. By continuing to use,
  10. ;* modify or distribute this file you indicate that you have
  11. ;* read the license and understand and accept it fully.
  12. ;*
  13.  
  14.  
  15.  
  16. ;/***************************************************************************\
  17. ;*     struct vuInstrument
  18. ;*     -------------------
  19. ;* Description:  VU-meter internal instrument structure
  20. ;\***************************************************************************/
  21.  
  22. STRUC    vuInstrument
  23.     vuInfo        DD    ?    ; pointer to VU information or NULL
  24.     slength     DW    ?    ; sample length
  25.     loopStart    DW    ?    ; sample loop start
  26.     loopEnd     DW    ?    ; sample loop end or 0 if no looping
  27. ENDS
  28.  
  29.  
  30.  
  31.  
  32. ;/***************************************************************************\
  33. ;*
  34. ;* Function:     int vuInit(void);
  35. ;*
  36. ;* Description:  Initializes VU-meters, allocating room for MAXINSTS
  37. ;*               instruments.
  38. ;*
  39. ;* Returns:      MIDAS error code
  40. ;*
  41. ;\***************************************************************************/
  42.  
  43. GLOBAL  LANG vuInit : far
  44.  
  45.  
  46.  
  47.  
  48. ;/***************************************************************************\
  49. ;*
  50. ;* Function:     int vuClose(void);
  51. ;*
  52. ;* Description:  Uninitializes VU-meters
  53. ;*
  54. ;* Returns:      MIDAS error code
  55. ;*
  56. ;\***************************************************************************/
  57.  
  58. GLOBAL  LANG vuClose : far
  59.  
  60.  
  61.  
  62.  
  63. ;/***************************************************************************\
  64. ;*
  65. ;* Function:     int vuPrepare(ushort inst, uchar *sample, ushort slength,
  66. ;*                             ushort loopStart, ushort loopEnd
  67. ;*
  68. ;* Description:  Prepares the VU information for an instrument
  69. ;*
  70. ;* Input:        ushort inst             instrument number
  71. ;*               uchar *sample           pointer to sample data
  72. ;*               ushort slength          sample length
  73. ;*               ushort loopStart        sample loop start
  74. ;*               ushort loopEnd          sample loop end (0 if no looping)
  75. ;*
  76. ;* Returns:      MIDAS error code
  77. ;*
  78. ;\***************************************************************************/
  79.  
  80. GLOBAL  LANG vuPrepare : far
  81.  
  82.  
  83.  
  84.  
  85. ;/***************************************************************************\
  86. ;*
  87. ;* Function:     int vuRemove(ushort inst);
  88. ;*
  89. ;* Description:  Removes and deallocates the VU information for an instrument
  90. ;*
  91. ;* Input:        ushort inst             instrument number
  92. ;*
  93. ;* Returns:      MIDAS error code
  94. ;*
  95. ;\***************************************************************************/
  96.  
  97. GLOBAL  LANG vuRemove : far
  98.  
  99.  
  100.  
  101.  
  102. ;/***************************************************************************\
  103. ;*
  104. ;* Function:     int vuMeter(ushort inst, ulong rate, ushort pos,
  105. ;*                           ushort volume, ushort *meter);
  106. ;*
  107. ;* Description:  Calculates the VU-meter value (0-64) for the next 1/50th of
  108. ;*               a second
  109. ;*
  110. ;* Input:        ushort inst             instrument that is played
  111. ;*               ushort rate             playing rate
  112. ;*               ushort volume           playing volume (0-64)
  113. ;*               ushort *meter           pointer to VU-meter value
  114. ;*
  115. ;* Returns:      MIDAS error code.
  116. ;*               VU-meter value (0-64) is stored in *meter
  117. ;*
  118. ;\***************************************************************************/
  119.  
  120. GLOBAL  LANG vuMeter : far
  121.  
  122.  
  123.  
  124. ;/***************************************************************************\
  125. ;*       enum vuFunctIDs
  126. ;*       ---------------
  127. ;* Description:  ID numbers for real VU-meter functions
  128. ;\***************************************************************************/
  129.  
  130. ENUM    vuFunctIDs \
  131.         ID_vuInit = ID_vu, \
  132.         ID_vuClose, \
  133.         ID_vuPrepare, \
  134.         ID_vuRemove, \
  135.         ID_vuMeter
  136.