home *** CD-ROM | disk | FTP | other *** search
/ Audio 4.94 - Over 11,000 Files / audio-11000.iso / msdos / sndbords / proaudio / pas_sdk1 / pas / pcm / recfila.asm < prev    next >
Assembly Source File  |  1992-07-17  |  4KB  |  163 lines

  1. ;$Author:   DCODY  $
  2. ;$Date:   17 Jul 1992 14:25:40  $
  3. ;$Header:   W:/sccs/pcmapps/recfila.asv   1.2   17 Jul 1992 14:25:40   DCODY  $
  4. ;$Log:   W:/sccs/pcmapps/recfila.asv  $
  5. ;  
  6. ;     Rev 1.2   17 Jul 1992 14:25:40   DCODY
  7. ;  TurnItOn will only execute if TurnItOff was first called.
  8. ;  
  9. ;     Rev 1.1   23 Jun 1992 16:09:22   DCODY
  10. ;  No change.
  11. ;  
  12. ;     Rev 1.0   15 Jun 1992 09:26:46   BCRANE
  13. ;  Initial revision.
  14. ;$Logfile:   W:/sccs/pcmapps/recfila.asv  $
  15. ;$Modtimes$
  16. ;$Revision:   1.2  $
  17. ;$Workfile:   recfila.asm  $ 
  18.  
  19.     Title    recfila.asm  --  Miscellaneous assembler code for recfile.c
  20.         page    64,131
  21.  
  22. ;   /*\
  23. ;---|*|------------====< RECFILA.ASM >====------------
  24. ;---|*|
  25. ;---|*| Copyright (c) 1991, Media Vision, Inc. All rights reserved
  26. ;---|*|
  27. ;   \*/
  28.  
  29.     .xlist
  30.     include model.inc
  31.     include masm.inc
  32.         include common.inc
  33.     include binary.inc
  34.     .list
  35.  
  36. PCMCODEVERSION    equ    0003h        ; version 00.03
  37.  
  38. ;
  39. ;---------------------------========================---------------------------
  40. ;---------------------------====< DATA SECTION >====---------------------------
  41. ;---------------------------========================---------------------------
  42. ;
  43.         .data
  44. ;
  45. ; Global Data Declarations
  46. ;
  47.     public    RightInputChannel
  48. RightInputChannel    dw    -1    ; PCm right channel
  49.     public    LeftInputChannel
  50. LeftInputChannel    dw    -1    ; PCM left channel
  51.  
  52.     extrn    MVSetMixerFunction:dword    ; set mixer function call
  53.     extrn    MVGetMixerFunction:dword    ; get mixer function call
  54.  
  55. ;
  56. ;---------------------------========================---------------------------
  57. ;---------------------------====< CODE SECTION >====---------------------------
  58. ;---------------------------========================---------------------------
  59. ;
  60.         .code
  61.     assume ds:@data
  62.  
  63. ;   /*\
  64. ;---|*|
  65. ;---|*|------------====< TurnItOff >====----------------
  66. ;---|*|
  67. ;---|*| Turn off the PCM Input Mixer channels. This avoids feedback.
  68. ;---|*|
  69. ;---|*| Entry Conditions:
  70. ;---|*|     None
  71. ;---|*|
  72. ;---|*| Exit Conditions:
  73. ;---|*|     None
  74. ;---|*|
  75. ;   \*/
  76.  
  77.     externADDR    MVInitMixerCode,FFAR    ; set mixer function call
  78.  
  79.     public    TurnItOff
  80. TurnItOff    proc
  81.     push    bp
  82.     mov    bp,sp
  83. ;
  84. ; initialize the mixer code.
  85. ;
  86.     sub    ax,ax            ; send a zero path
  87.     push    ax
  88.   if @datasize
  89.         push    ax
  90.   endif
  91.     call    MVInitMixercode
  92.     mov    sp,bp
  93. ;
  94. ; Save each setting, then turn off the PCM channels to kill feed back
  95. ;
  96.     mov    cx,BI_INPUTMIXER
  97.     mov    dx,BI_L_PCM
  98.     call    dword ptr [MVGetMixerFunction]
  99.     mov    LeftInputChannel,bx
  100.  
  101.     mov    dx,BI_R_PCM
  102.     call    dword ptr [MVGetMixerFunction]
  103.     mov    RightInputChannel,bx
  104.  
  105.     sub    bx,bx
  106.     call    dword ptr [MVSetMixerFunction]
  107.  
  108.     mov    dx,BI_L_PCM
  109.     call    dword ptr [MVSetMixerFunction]
  110.  
  111.     pop    bp
  112.     ret
  113.  
  114. TurnItOff    endp
  115.  
  116. ;
  117. ;   /*\
  118. ;---|*|------------====< TurnItOn() >====------------
  119. ;---|*|
  120. ;---|*| Restore the mixer settings for the PCM left/right channels
  121. ;---|*|
  122. ;---|*| Entry Conditions:
  123. ;---|*|     None
  124. ;---|*|
  125. ;---|*| Exit Conditions:
  126. ;---|*|     None
  127. ;---|*|
  128. ;   \*/
  129.  
  130.         public  TurnItOn
  131. TurnItOn        proc
  132. ;
  133. ; if we didn't set the channels, then don't restore them!
  134. ;
  135.     cmp    [RightInputChannel],-1    ; did we touch these?
  136.     jz    tuion05         ; no, just exit...
  137. ;
  138. ; restore each mixer setting                                           */
  139. ;
  140.     mov    cx,BI_INPUTMIXER
  141.     mov    dx,BI_L_PCM
  142.     mov    bx,LeftInputChannel
  143.     inc    bx
  144.     call    dword ptr [MVSetMixerFunction]
  145.  
  146.     mov    dx,BI_R_PCM
  147.     mov    bx,RightInputChannel
  148.     inc    bx
  149.     call    dword ptr [MVSetMixerFunction]
  150. ;
  151. tuion05:
  152.     ret
  153.  
  154. TurnItOn    endp
  155.  
  156.  
  157. ;   /*\
  158. ;---|*| end of RECFILA.ASM
  159. ;   \*/
  160.  
  161.         end
  162.  
  163.