home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wavemix / wavmix1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-09  |  26.8 KB  |  762 lines

  1. VERSION 4.00
  2. Begin VB.Form frmWaveMixTest 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00C0C0C0&
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "Wave Mix Tester"
  7.    ClientHeight    =   5415
  8.    ClientLeft      =   2415
  9.    ClientTop       =   1905
  10.    ClientWidth     =   6120
  11.    BeginProperty Font 
  12.       name            =   "MS Sans Serif"
  13.       charset         =   0
  14.       weight          =   700
  15.       size            =   8.25
  16.       underline       =   0   'False
  17.       italic          =   0   'False
  18.       strikethrough   =   0   'False
  19.    EndProperty
  20.    ForeColor       =   &H80000008&
  21.    Height          =   5820
  22.    Left            =   2355
  23.    LinkTopic       =   "Form1"
  24.    MaxButton       =   0   'False
  25.    ScaleHeight     =   5415
  26.    ScaleWidth      =   6120
  27.    Top             =   1560
  28.    Width           =   6240
  29.    Begin Threed.SSPanel panWaveFrame 
  30.       Height          =   435
  31.       Index           =   7
  32.       Left            =   90
  33.       TabIndex        =   25
  34.       Top             =   4800
  35.       Width           =   5895
  36.       _Version        =   65536
  37.       _ExtentX        =   10398
  38.       _ExtentY        =   767
  39.       _StockProps     =   15
  40.       BackColor       =   -2147483633
  41.       BevelOuter      =   1
  42.       Begin VB.CommandButton btnPlay 
  43.          Appearance      =   0  'Flat
  44.          BackColor       =   &H00C0C0C0&
  45.          Caption         =   "Play"
  46.          BeginProperty Font 
  47.             name            =   "MS Sans Serif"
  48.             charset         =   0
  49.             weight          =   400
  50.             size            =   8.25
  51.             underline       =   0   'False
  52.             italic          =   0   'False
  53.             strikethrough   =   0   'False
  54.          EndProperty
  55.          Height          =   315
  56.          Index           =   7
  57.          Left            =   600
  58.          TabIndex        =   26
  59.          Top             =   60
  60.          Width           =   795
  61.       End
  62.       Begin VB.Label lblWaveFile 
  63.          Appearance      =   0  'Flat
  64.          BackColor       =   &H80000005&
  65.          BackStyle       =   0  'Transparent
  66.          Caption         =   "[none]"
  67.          BeginProperty Font 
  68.             name            =   "MS Sans Serif"
  69.             charset         =   0
  70.             weight          =   400
  71.             size            =   8.25
  72.             underline       =   0   'False
  73.             italic          =   0   'False
  74.             strikethrough   =   0   'False
  75.          EndProperty
  76.          ForeColor       =   &H80000008&
  77.          Height          =   255
  78.          Index           =   7
  79.          Left            =   1470
  80.          TabIndex        =   27
  81.          Top             =   90
  82.          Width           =   4275
  83.       End
  84.       Begin VB.Image imgHand 
  85.          Appearance      =   0  'Flat
  86.          Height          =   480
  87.          Index           =   7
  88.          Left            =   60
  89.          Picture         =   "WAVMIX1.frx":0000
  90.          Top             =   0
  91.          Visible         =   0   'False
  92.          Width           =   480
  93.       End
  94.    End
  95.    Begin Threed.SSPanel panWaveFrame 
  96.       Height          =   435
  97.       Index           =   6
  98.       Left            =   90
  99.       TabIndex        =   22
  100.       Top             =   4290
  101.       Width           =   5895
  102.       _Version        =   65536
  103.       _ExtentX        =   10398
  104.       _ExtentY        =   767
  105.       _StockProps     =   15
  106.       BackColor       =   -2147483633
  107.       BevelOuter      =   1
  108.       Begin VB.CommandButton btnPlay 
  109.          Appearance      =   0  'Flat
  110.          BackColor       =   &H00C0C0C0&
  111.          Caption         =   "Play"
  112.          BeginProperty Font 
  113.             name            =   "MS Sans Serif"
  114.             charset         =   0
  115.             weight          =   400
  116.             size            =   8.25
  117.             underline       =   0   'False
  118.             italic          =   0   'False
  119.             strikethrough   =   0   'False
  120.          EndProperty
  121.          Height          =   315
  122.          Index           =   6
  123.          Left            =   600
  124.          TabIndex        =   23
  125.          Top             =   60
  126.          Width           =   795
  127.       End
  128.       Begin VB.Label lblWaveFile 
  129.          Appearance      =   0  'Flat
  130.          BackColor       =   &H80000005&
  131.          BackStyle       =   0  'Transparent
  132.          Caption         =   "[none]"
  133.          BeginProperty Font 
  134.             name            =   "MS Sans Serif"
  135.             charset         =   0
  136.             weight          =   400
  137.             size            =   8.25
  138.             underline       =   0   'False
  139.             italic          =   0   'False
  140.             strikethrough   =   0   'False
  141.          EndProperty
  142.          ForeColor       =   &H80000008&
  143.          Height          =   255
  144.          Index           =   6
  145.          Left            =   1470
  146.          TabIndex        =   24
  147.          Top             =   90
  148.          Width           =   4275
  149.       End
  150.       Begin VB.Image imgHand 
  151.          Appearance      =   0  'Flat
  152.          Height          =   480
  153.          Index           =   6
  154.          Left            =   60
  155.          Picture         =   "WAVMIX1.frx":030A
  156.          Top             =   -30
  157.          Visible         =   0   'False
  158.          Width           =   480
  159.       End
  160.    End
  161.    Begin Threed.SSPanel panWaveFrame 
  162.       Height          =   435
  163.       Index           =   5
  164.       Left            =   60
  165.       TabIndex        =   19
  166.       Top             =   3810
  167.       Width           =   5895
  168.       _Version        =   65536
  169.       _ExtentX        =   10398
  170.       _ExtentY        =   767
  171.       _StockProps     =   15
  172.       BackColor       =   -2147483633
  173.       BevelOuter      =   1
  174.       Begin VB.CommandButton btnPlay 
  175.          Appearance      =   0  'Flat
  176.          BackColor       =   &H00C0C0C0&
  177.          Caption         =   "Play"
  178.          BeginProperty Font 
  179.             name            =   "MS Sans Serif"
  180.             charset         =   0
  181.             weight          =   400
  182.             size            =   8.25
  183.             underline       =   0   'False
  184.             italic          =   0   'False
  185.             strikethrough   =   0   'False
  186.          EndProperty
  187.          Height          =   315
  188.          Index           =   5
  189.          Left            =   600
  190.          TabIndex        =   20
  191.          Top             =   60
  192.          Width           =   795
  193.       End
  194.       Begin VB.Label lblWaveFile 
  195.          Appearance      =   0  'Flat
  196.          BackColor       =   &H80000005&
  197.          BackStyle       =   0  'Transparent
  198.          Caption         =   "[none]"
  199.          BeginProperty Font 
  200.             name            =   "MS Sans Serif"
  201.             charset         =   0
  202.             weight          =   400
  203.             size            =   8.25
  204.             underline       =   0   'False
  205.             italic          =   0   'False
  206.             strikethrough   =   0   'False
  207.          EndProperty
  208.          ForeColor       =   &H80000008&
  209.          Height          =   255
  210.          Index           =   5
  211.          Left            =   1470
  212.          TabIndex        =   21
  213.          Top             =   90
  214.          Width           =   4275
  215.       End
  216.       Begin VB.Image imgHand 
  217.          Appearance      =   0  'Flat
  218.          Height          =   480
  219.          Index           =   5
  220.          Left            =   60
  221.          Picture         =   "WAVMIX1.frx":0614
  222.          Top             =   0
  223.          Visible         =   0   'False
  224.          Width           =   480
  225.       End
  226.    End
  227.    Begin Threed.SSPanel panWaveFrame 
  228.       Height          =   435
  229.       Index           =   4
  230.       Left            =   90
  231.       TabIndex        =   16
  232.       Top             =   3330
  233.       Width           =   5895
  234.       _Version        =   65536
  235.       _ExtentX        =   10398
  236.       _ExtentY        =   767
  237.       _StockProps     =   15
  238.       BackColor       =   -2147483633
  239.       BevelOuter      =   1
  240.       Begin VB.CommandButton btnPlay 
  241.          Appearance      =   0  'Flat
  242.          BackColor       =   &H00C0C0C0&
  243.          Caption         =   "Play"
  244.          BeginProperty Font 
  245.             name            =   "MS Sans Serif"
  246.             charset         =   0
  247.             weight          =   400
  248.             size            =   8.25
  249.             underline       =   0   'False
  250.             italic          =   0   'False
  251.             strikethrough   =   0   'False
  252.          EndProperty
  253.          Height          =   315
  254.          Index           =   4
  255.          Left            =   600
  256.          TabIndex        =   17
  257.          Top             =   60
  258.          Width           =   795
  259.       End
  260.       Begin VB.Label lblWaveFile 
  261.          Appearance      =   0  'Flat
  262.          BackColor       =   &H80000005&
  263.          BackStyle       =   0  'Transparent
  264.          Caption         =   "[none]"
  265.          BeginProperty Font 
  266.             name            =   "MS Sans Serif"
  267.             charset         =   0
  268.             weight          =   400
  269.             size            =   8.25
  270.             underline       =   0   'False
  271.             italic          =   0   'False
  272.             strikethrough   =   0   'False
  273.          EndProperty
  274.          ForeColor       =   &H80000008&
  275.          Height          =   255
  276.          Index           =   4
  277.          Left            =   1470
  278.          TabIndex        =   18
  279.          Top             =   90
  280.          Width           =   4275
  281.       End
  282.       Begin VB.Image imgHand 
  283.          Appearance      =   0  'Flat
  284.          Height          =   480
  285.          Index           =   4
  286.          Left            =   60
  287.          Picture         =   "WAVMIX1.frx":091E
  288.          Top             =   -30
  289.          Visible         =   0   'False
  290.          Width           =   480
  291.       End
  292.    End
  293.    Begin Threed.SSPanel panWaveFrame 
  294.       Height          =   435
  295.       Index           =   3
  296.       Left            =   90
  297.       TabIndex        =   13
  298.       Top             =   2850
  299.       Width           =   5895
  300.       _Version        =   65536
  301.       _ExtentX        =   10398
  302.       _ExtentY        =   767
  303.       _StockProps     =   15
  304.       BackColor       =   -2147483633
  305.       BevelOuter      =   1
  306.       Begin VB.CommandButton btnPlay 
  307.          Appearance      =   0  'Flat
  308.          BackColor       =   &H00C0C0C0&
  309.          Caption         =   "Play"
  310.          BeginProperty Font 
  311.             name            =   "MS Sans Serif"
  312.             charset         =   0
  313.             weight          =   400
  314.             size            =   8.25
  315.             underline       =   0   'False
  316.             italic          =   0   'False
  317.             strikethrough   =   0   'False
  318.          EndProperty
  319.          Height          =   315
  320.          Index           =   3
  321.          Left            =   600
  322.          TabIndex        =   14
  323.          Top             =   60
  324.          Width           =   795
  325.       End
  326.       Begin VB.Label lblWaveFile 
  327.          Appearance      =   0  'Flat
  328.          BackColor       =   &H80000005&
  329.          BackStyle       =   0  'Transparent
  330.          Caption         =   "[none]"
  331.          BeginProperty Font 
  332.             name            =   "MS Sans Serif"
  333.             charset         =   0
  334.             weight          =   400
  335.             size            =   8.25
  336.             underline       =   0   'False
  337.             italic          =   0   'False
  338.             strikethrough   =   0   'False
  339.          EndProperty
  340.          ForeColor       =   &H80000008&
  341.          Height          =   255
  342.          Index           =   3
  343.          Left            =   1470
  344.          TabIndex        =   15
  345.          Top             =   90
  346.          Width           =   4275
  347.       End
  348.       Begin VB.Image imgHand 
  349.          Appearance      =   0  'Flat
  350.          Height          =   480
  351.          Index           =   3
  352.          Left            =   60
  353.          Picture         =   "WAVMIX1.frx":0C28
  354.          Top             =   -30
  355.          Visible         =   0   'False
  356.          Width           =   480
  357.       End
  358.    End
  359.    Begin Threed.SSPanel panWaveFrame 
  360.       Height          =   435
  361.       Index           =   2
  362.       Left            =   90
  363.       TabIndex        =   10
  364.       Top             =   2370
  365.       Width           =   5895
  366.       _Version        =   65536
  367.       _ExtentX        =   10398
  368.       _ExtentY        =   767
  369.       _StockProps     =   15
  370.       BackColor       =   -2147483633
  371.       BevelOuter      =   1
  372.       Begin VB.CommandButton btnPlay 
  373.          Appearance      =   0  'Flat
  374.          BackColor       =   &H00C0C0C0&
  375.          Caption         =   "Play"
  376.          BeginProperty Font 
  377.             name            =   "MS Sans Serif"
  378.             charset         =   0
  379.             weight          =   400
  380.             size            =   8.25
  381.             underline       =   0   'False
  382.             italic          =   0   'False
  383.             strikethrough   =   0   'False
  384.          EndProperty
  385.          Height          =   315
  386.          Index           =   2
  387.          Left            =   600
  388.          TabIndex        =   11
  389.          Top             =   60
  390.          Width           =   795
  391.       End
  392.       Begin VB.Label lblWaveFile 
  393.          Appearance      =   0  'Flat
  394.          BackColor       =   &H80000005&
  395.          BackStyle       =   0  'Transparent
  396.          Caption         =   "[none]"
  397.          BeginProperty Font 
  398.             name            =   "MS Sans Serif"
  399.             charset         =   0
  400.             weight          =   400
  401.             size            =   8.25
  402.             underline       =   0   'False
  403.             italic          =   0   'False
  404.             strikethrough   =   0   'False
  405.          EndProperty
  406.          ForeColor       =   &H80000008&
  407.          Height          =   255
  408.          Index           =   2
  409.          Left            =   1470
  410.          TabIndex        =   12
  411.          Top             =   90
  412.          Width           =   4275
  413.       End
  414.       Begin VB.Image imgHand 
  415.          Appearance      =   0  'Flat
  416.          Height          =   480
  417.          Index           =   2
  418.          Left            =   60
  419.          Picture         =   "WAVMIX1.frx":0F32
  420.          Top             =   0
  421.          Visible         =   0   'False
  422.          Width           =   480
  423.       End
  424.    End
  425.    Begin Threed.SSPanel panWaveFrame 
  426.       Height          =   435
  427.       Index           =   1
  428.       Left            =   120
  429.       TabIndex        =   7
  430.       Top             =   1890
  431.       Width           =   5895
  432.       _Version        =   65536
  433.       _ExtentX        =   10398
  434.       _ExtentY        =   767
  435.       _StockProps     =   15
  436.       BackColor       =   -2147483633
  437.       BevelOuter      =   1
  438.       Begin VB.CommandButton btnPlay 
  439.          Appearance      =   0  'Flat
  440.          BackColor       =   &H00C0C0C0&
  441.          Caption         =   "Play"
  442.          BeginProperty Font 
  443.             name            =   "MS Sans Serif"
  444.             charset         =   0
  445.             weight          =   400
  446.             size            =   8.25
  447.             underline       =   0   'False
  448.             italic          =   0   'False
  449.             strikethrough   =   0   'False
  450.          EndProperty
  451.          Height          =   315
  452.          Index           =   1
  453.          Left            =   600
  454.          TabIndex        =   8
  455.          Top             =   60
  456.          Width           =   795
  457.       End
  458.       Begin VB.Label lblWaveFile 
  459.          Appearance      =   0  'Flat
  460.          BackColor       =   &H80000005&
  461.          BackStyle       =   0  'Transparent
  462.          Caption         =   "[none]"
  463.          BeginProperty Font 
  464.             name            =   "MS Sans Serif"
  465.             charset         =   0
  466.             weight          =   400
  467.             size            =   8.25
  468.             underline       =   0   'False
  469.             italic          =   0   'False
  470.             strikethrough   =   0   'False
  471.          EndProperty
  472.          ForeColor       =   &H80000008&
  473.          Height          =   255
  474.          Index           =   1
  475.          Left            =   1470
  476.          TabIndex        =   9
  477.          Top             =   90
  478.          Width           =   4275
  479.       End
  480.       Begin VB.Image imgHand 
  481.          Appearance      =   0  'Flat
  482.          Height          =   480
  483.          Index           =   1
  484.          Left            =   60
  485.          Picture         =   "WAVMIX1.frx":123C
  486.          Top             =   -30
  487.          Visible         =   0   'False
  488.          Width           =   480
  489.       End
  490.    End
  491.    Begin Threed.SSPanel panWaveFrame 
  492.       Height          =   435
  493.       Index           =   0
  494.       Left            =   120
  495.       TabIndex        =   1
  496.       Top             =   1260
  497.       Width           =   5895
  498.       _Version        =   65536
  499.       _ExtentX        =   10398
  500.       _ExtentY        =   767
  501.       _StockProps     =   15
  502.       BackColor       =   -2147483633
  503.       BevelOuter      =   1
  504.       Begin VB.CommandButton btnPlay 
  505.          Appearance      =   0  'Flat
  506.          BackColor       =   &H00C0C0C0&
  507.          Caption         =   "Play"
  508.          BeginProperty Font 
  509.             name            =   "MS Sans Serif"
  510.             charset         =   0
  511.             weight          =   400
  512.             size            =   8.25
  513.             underline       =   0   'False
  514.             italic          =   0   'False
  515.             strikethrough   =   0   'False
  516.          EndProperty
  517.          Height          =   315
  518.          Index           =   0
  519.          Left            =   600
  520.          TabIndex        =   3
  521.          Top             =   60
  522.          Width           =   795
  523.       End
  524.       Begin VB.Image imgHand 
  525.          Appearance      =   0  'Flat
  526.          Height          =   480
  527.          Index           =   0
  528.          Left            =   60
  529.          Picture         =   "WAVMIX1.frx":1546
  530.          Top             =   -30
  531.          Width           =   480
  532.       End
  533.       Begin VB.Label lblWaveFile 
  534.          Appearance      =   0  'Flat
  535.          BackColor       =   &H80000005&
  536.          BackStyle       =   0  'Transparent
  537.          Caption         =   "[none]"
  538.          BeginProperty Font 
  539.             name            =   "MS Sans Serif"
  540.             charset         =   0
  541.             weight          =   400
  542.             size            =   8.25
  543.             underline       =   0   'False
  544.             italic          =   0   'False
  545.             strikethrough   =   0   'False
  546.          EndProperty
  547.          ForeColor       =   &H80000008&
  548.          Height          =   255
  549.          Index           =   0
  550.          Left            =   1470
  551.          TabIndex        =   4
  552.          Top             =   90
  553.          Width           =   4275
  554.       End
  555.    End
  556.    Begin Threed.SSPanel panMain 
  557.       Height          =   1095
  558.       Left            =   120
  559.       TabIndex        =   0
  560.       Top             =   90
  561.       Width           =   5895
  562.       _Version        =   65536
  563.       _ExtentX        =   10398
  564.       _ExtentY        =   1931
  565.       _StockProps     =   15
  566.       BackColor       =   -2147483633
  567.       RoundedCorners  =   0   'False
  568.       Begin VB.CheckBox chkLoop 
  569.          Caption         =   "Loop Sound"
  570.          BeginProperty Font 
  571.             name            =   "MS Sans Serif"
  572.             charset         =   0
  573.             weight          =   400
  574.             size            =   8.25
  575.             underline       =   0   'False
  576.             italic          =   0   'False
  577.             strikethrough   =   0   'False
  578.          EndProperty
  579.          Height          =   225
  580.          Left            =   3210
  581.          TabIndex        =   5
  582.          Top             =   180
  583.          Width           =   1455
  584.       End
  585.       Begin VB.CommandButton btnOpen 
  586.          Appearance      =   0  'Flat
  587.          BackColor       =   &H00C0C0C0&
  588.          Caption         =   "&Wave File..."
  589.          BeginProperty Font 
  590.             name            =   "MS Sans Serif"
  591.             charset         =   0
  592.             weight          =   400
  593.             size            =   8.25
  594.             underline       =   0   'False
  595.             italic          =   0   'False
  596.             strikethrough   =   0   'False
  597.          EndProperty
  598.          Height          =   345
  599.          Left            =   1620
  600.          TabIndex        =   2
  601.          Top             =   120
  602.          Width           =   1395
  603.       End
  604.       Begin VB.Label Label1 
  605.          Appearance      =   0  'Flat
  606.          BackColor       =   &H80000005&
  607.          BackStyle       =   0  'Transparent
  608.          Caption         =   "Click to the left of a channel's Play button, then change its File and Loop parameters using the controls above."
  609.          ForeColor       =   &H000000C0&
  610.          Height          =   435
  611.          Left            =   150
  612.          TabIndex        =   28
  613.          Top             =   540
  614.          Width           =   5625
  615.       End
  616.       Begin VB.Label lblSoundNbr 
  617.          Appearance      =   0  'Flat
  618.          BackColor       =   &H80000005&
  619.          BackStyle       =   0  'Transparent
  620.          Caption         =   "Wave Channel 0"
  621.          BeginProperty Font 
  622.             name            =   "MS Sans Serif"
  623.             charset         =   0
  624.             weight          =   400
  625.             size            =   8.25
  626.             underline       =   0   'False
  627.             italic          =   0   'False
  628.             strikethrough   =   0   'False
  629.          EndProperty
  630.          ForeColor       =   &H80000008&
  631.          Height          =   225
  632.          Left            =   120
  633.          TabIndex        =   6
  634.          Top             =   180
  635.          Width           =   1425
  636.       End
  637.    End
  638.    Begin MSComDlg.CommonDialog CMDialog1 
  639.       Left            =   0
  640.       Top             =   0
  641.       _Version        =   65536
  642.       _ExtentX        =   847
  643.       _ExtentY        =   847
  644.       _StockProps     =   0
  645.       DefaultExt      =   "WAV"
  646.       DialogTitle     =   "Open Wave File"
  647.       Filter          =   "Wave Files (*.wav)|*.wav"
  648.    End
  649. Attribute VB_Name = "frmWaveMixTest"
  650. Attribute VB_Creatable = False
  651. Attribute VB_Exposed = False
  652. Option Explicit
  653. '------------------------------------------------------------
  654. ' WAVMIX1.FRM
  655. ' This example program let's the user set multiple wave audio
  656. ' channels for simultaneous playback using the WAVEMIX DLL.
  657. '------------------------------------------------------------
  658. ' MsgBox parameters
  659. Const MB_OK = 0                 ' OK button only
  660. Const MB_OKCANCEL = 1           ' OK and Cancel buttons
  661. Const MB_ABORTRETRYIGNORE = 2   ' Abort, Retry, and Ignore buttons
  662. Const MB_YESNOCANCEL = 3        ' Yes, No, and Cancel buttons
  663. Const MB_YESNO = 4              ' Yes and No buttons
  664. Const MB_RETRYCANCEL = 5        ' Retry and Cancel buttons
  665. Const MB_ICONSTOP = 16          ' Critical message
  666. Const MB_ICONQUESTION = 32      ' Warning query
  667. Const MB_ICONEXCLAMATION = 48   ' Warning message
  668. Const MB_ICONINFORMATION = 64   ' Information message
  669. Dim CurrentChannel As Long
  670. Const MAX_CHANNELS = 8
  671. Dim Channel(0 To 7) As tChannelInfo
  672. Private Sub btnOpen_Click()
  673. '------------------------------------------------------------
  674. ' Let the user assign a wave file to the cuurent channel.
  675. '------------------------------------------------------------
  676. Const ShowOpen = 1
  677.     On Error Resume Next
  678.     ' Let the user select another wave file via the
  679.     ' Open File common dialog.
  680.     CMDialog1.CancelError = True
  681.     CMDialog1.InitDir = App.Path
  682.     CMDialog1.Action = ShowOpen
  683.     If Err <> 0 Then Exit Sub
  684.     ' If we're currently looping a sound on this
  685.     ' channel, then stop the sound and reset the
  686.     ' text on the button.
  687.     If btnPlay(CurrentChannel).Caption = "Stop" Then
  688.         WAVMIX_StopChannel CurrentChannel
  689.         btnPlay(CurrentChannel).Caption = "Play"
  690.     End If
  691.     ' Set the current channel to use the new wave file.
  692.     lblWaveFile(CurrentChannel) = "Channel " & Format$(CurrentChannel) & ": " & LCase$(CMDialog1.FileName)
  693.     Channel(CurrentChannel).WaveFile = LCase$(CMDialog1.FileName)
  694.     Channel(CurrentChannel).Loops = (chkLoop.Value = 1)
  695.     WAVMIX_SetFile Channel(CurrentChannel).WaveFile, CurrentChannel
  696. End Sub
  697. Private Sub btnPlay_Click(Index As Integer)
  698. '------------------------------------------------------------
  699. ' Play the wave assigned to the specified channel.
  700. '------------------------------------------------------------
  701. Dim AChannel As Long
  702.     AChannel = Index
  703.     If btnPlay(Index).Caption = "Play" Then
  704.         If Channel(Index).Loops Then btnPlay(Index).Caption = "Stop"
  705.         WAVMIX_PlayChannel AChannel, Channel(Index).Loops
  706.     Else
  707.         btnPlay(Index).Caption = "Play"
  708.         WAVMIX_StopChannel AChannel
  709.     End If
  710. End Sub
  711. Private Sub chkLoop_Click()
  712. '------------------------------------------------------------
  713. ' Set the boolean that determines if the current channel
  714. ' will loop the wave file when played.
  715. '------------------------------------------------------------
  716.     Channel(CurrentChannel).Loops = (chkLoop.Value = 1)
  717. End Sub
  718. Private Sub Form_Load()
  719. '------------------------------------------------------------
  720. ' Initialize the WaveMix DLL and adjust the position of
  721. ' controls on the form.
  722. '------------------------------------------------------------
  723. Dim LeftMargin As Integer, TopMargin As Integer
  724. Dim i As Integer, j As Integer
  725.     CurrentChannel = 0
  726.     ChDir App.Path
  727.     ' Initialize the WaveMix DLL.
  728.     If Not WAVMIX_InitMixer() Then
  729.         MsgBox "Unable to Initialize WaveMix DLL", MB_OK Or MB_ICONEXCLAMATION, "WaveMix Error"
  730.         End
  731.     End If
  732.     ' Adjust the channel frames on the screen.
  733.     LeftMargin = panWaveFrame(0).Left
  734.     TopMargin = panWaveFrame(0).Top - (panMain.Top + panMain.Height)
  735.     lblWaveFile(0) = "Channel 0: [none]"
  736.     For i = 1 To 7
  737.         lblWaveFile(i) = "Channel " & Format$(i) & ": [none]"
  738.         panWaveFrame(i).Left = LeftMargin
  739.         panWaveFrame(i).Width = panWaveFrame(1).Width
  740.         panWaveFrame(i).Height = panWaveFrame(1).Height
  741.         panWaveFrame(i).Top = panWaveFrame(i - 1).Top + panWaveFrame(i - 1).Height + TopMargin
  742.     Next
  743.     Me.Height = (Me.Height - Me.ScaleHeight) + panWaveFrame(7).Top + panWaveFrame(7).Height + (TopMargin * 2)
  744. End Sub
  745. Private Sub Form_Unload(Cancel As Integer)
  746. '------------------------------------------------------------
  747. ' Before the program ends, shut down the WaveMix DLL.
  748. '------------------------------------------------------------
  749.     WAVMIX_Close
  750. End Sub
  751. Private Sub panWaveFrame_Click(Index As Integer)
  752. '------------------------------------------------------------
  753. ' Change the current channel.
  754. '------------------------------------------------------------
  755.     If Index = CurrentChannel Then Exit Sub
  756.     imgHand(Index).Visible = True
  757.     imgHand(CurrentChannel).Visible = False
  758.     CurrentChannel = Index
  759.     lblSoundNbr = "Wave Channel " & Format$(CurrentChannel)
  760.     chkLoop.Value = Abs(Channel(CurrentChannel).Loops)
  761. End Sub
  762.