home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmWaveMixTest
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "Wave Mix Tester"
- ClientHeight = 5415
- ClientLeft = 2415
- ClientTop = 1905
- ClientWidth = 6120
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 5820
- Left = 2355
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 5415
- ScaleWidth = 6120
- Top = 1560
- Width = 6240
- Begin Threed.SSPanel panWaveFrame
- Height = 435
- Index = 7
- Left = 90
- TabIndex = 25
- Top = 4800
- Width = 5895
- _Version = 65536
- _ExtentX = 10398
- _ExtentY = 767
- _StockProps = 15
- BackColor = -2147483633
- BevelOuter = 1
- Begin VB.CommandButton btnPlay
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Play"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 315
- Index = 7
- Left = 600
- TabIndex = 26
- Top = 60
- Width = 795
- End
- Begin VB.Label lblWaveFile
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "[none]"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Index = 7
- Left = 1470
- TabIndex = 27
- Top = 90
- Width = 4275
- End
- Begin VB.Image imgHand
- Appearance = 0 'Flat
- Height = 480
- Index = 7
- Left = 60
- Picture = "WAVMIX1.frx":0000
- Top = 0
- Visible = 0 'False
- Width = 480
- End
- End
- Begin Threed.SSPanel panWaveFrame
- Height = 435
- Index = 6
- Left = 90
- TabIndex = 22
- Top = 4290
- Width = 5895
- _Version = 65536
- _ExtentX = 10398
- _ExtentY = 767
- _StockProps = 15
- BackColor = -2147483633
- BevelOuter = 1
- Begin VB.CommandButton btnPlay
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Play"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 315
- Index = 6
- Left = 600
- TabIndex = 23
- Top = 60
- Width = 795
- End
- Begin VB.Label lblWaveFile
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "[none]"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Index = 6
- Left = 1470
- TabIndex = 24
- Top = 90
- Width = 4275
- End
- Begin VB.Image imgHand
- Appearance = 0 'Flat
- Height = 480
- Index = 6
- Left = 60
- Picture = "WAVMIX1.frx":030A
- Top = -30
- Visible = 0 'False
- Width = 480
- End
- End
- Begin Threed.SSPanel panWaveFrame
- Height = 435
- Index = 5
- Left = 60
- TabIndex = 19
- Top = 3810
- Width = 5895
- _Version = 65536
- _ExtentX = 10398
- _ExtentY = 767
- _StockProps = 15
- BackColor = -2147483633
- BevelOuter = 1
- Begin VB.CommandButton btnPlay
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Play"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 315
- Index = 5
- Left = 600
- TabIndex = 20
- Top = 60
- Width = 795
- End
- Begin VB.Label lblWaveFile
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "[none]"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Index = 5
- Left = 1470
- TabIndex = 21
- Top = 90
- Width = 4275
- End
- Begin VB.Image imgHand
- Appearance = 0 'Flat
- Height = 480
- Index = 5
- Left = 60
- Picture = "WAVMIX1.frx":0614
- Top = 0
- Visible = 0 'False
- Width = 480
- End
- End
- Begin Threed.SSPanel panWaveFrame
- Height = 435
- Index = 4
- Left = 90
- TabIndex = 16
- Top = 3330
- Width = 5895
- _Version = 65536
- _ExtentX = 10398
- _ExtentY = 767
- _StockProps = 15
- BackColor = -2147483633
- BevelOuter = 1
- Begin VB.CommandButton btnPlay
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Play"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 315
- Index = 4
- Left = 600
- TabIndex = 17
- Top = 60
- Width = 795
- End
- Begin VB.Label lblWaveFile
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "[none]"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Index = 4
- Left = 1470
- TabIndex = 18
- Top = 90
- Width = 4275
- End
- Begin VB.Image imgHand
- Appearance = 0 'Flat
- Height = 480
- Index = 4
- Left = 60
- Picture = "WAVMIX1.frx":091E
- Top = -30
- Visible = 0 'False
- Width = 480
- End
- End
- Begin Threed.SSPanel panWaveFrame
- Height = 435
- Index = 3
- Left = 90
- TabIndex = 13
- Top = 2850
- Width = 5895
- _Version = 65536
- _ExtentX = 10398
- _ExtentY = 767
- _StockProps = 15
- BackColor = -2147483633
- BevelOuter = 1
- Begin VB.CommandButton btnPlay
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Play"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 315
- Index = 3
- Left = 600
- TabIndex = 14
- Top = 60
- Width = 795
- End
- Begin VB.Label lblWaveFile
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "[none]"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Index = 3
- Left = 1470
- TabIndex = 15
- Top = 90
- Width = 4275
- End
- Begin VB.Image imgHand
- Appearance = 0 'Flat
- Height = 480
- Index = 3
- Left = 60
- Picture = "WAVMIX1.frx":0C28
- Top = -30
- Visible = 0 'False
- Width = 480
- End
- End
- Begin Threed.SSPanel panWaveFrame
- Height = 435
- Index = 2
- Left = 90
- TabIndex = 10
- Top = 2370
- Width = 5895
- _Version = 65536
- _ExtentX = 10398
- _ExtentY = 767
- _StockProps = 15
- BackColor = -2147483633
- BevelOuter = 1
- Begin VB.CommandButton btnPlay
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Play"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 315
- Index = 2
- Left = 600
- TabIndex = 11
- Top = 60
- Width = 795
- End
- Begin VB.Label lblWaveFile
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "[none]"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Index = 2
- Left = 1470
- TabIndex = 12
- Top = 90
- Width = 4275
- End
- Begin VB.Image imgHand
- Appearance = 0 'Flat
- Height = 480
- Index = 2
- Left = 60
- Picture = "WAVMIX1.frx":0F32
- Top = 0
- Visible = 0 'False
- Width = 480
- End
- End
- Begin Threed.SSPanel panWaveFrame
- Height = 435
- Index = 1
- Left = 120
- TabIndex = 7
- Top = 1890
- Width = 5895
- _Version = 65536
- _ExtentX = 10398
- _ExtentY = 767
- _StockProps = 15
- BackColor = -2147483633
- BevelOuter = 1
- Begin VB.CommandButton btnPlay
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Play"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 315
- Index = 1
- Left = 600
- TabIndex = 8
- Top = 60
- Width = 795
- End
- Begin VB.Label lblWaveFile
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "[none]"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Index = 1
- Left = 1470
- TabIndex = 9
- Top = 90
- Width = 4275
- End
- Begin VB.Image imgHand
- Appearance = 0 'Flat
- Height = 480
- Index = 1
- Left = 60
- Picture = "WAVMIX1.frx":123C
- Top = -30
- Visible = 0 'False
- Width = 480
- End
- End
- Begin Threed.SSPanel panWaveFrame
- Height = 435
- Index = 0
- Left = 120
- TabIndex = 1
- Top = 1260
- Width = 5895
- _Version = 65536
- _ExtentX = 10398
- _ExtentY = 767
- _StockProps = 15
- BackColor = -2147483633
- BevelOuter = 1
- Begin VB.CommandButton btnPlay
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Play"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 315
- Index = 0
- Left = 600
- TabIndex = 3
- Top = 60
- Width = 795
- End
- Begin VB.Image imgHand
- Appearance = 0 'Flat
- Height = 480
- Index = 0
- Left = 60
- Picture = "WAVMIX1.frx":1546
- Top = -30
- Width = 480
- End
- Begin VB.Label lblWaveFile
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "[none]"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Index = 0
- Left = 1470
- TabIndex = 4
- Top = 90
- Width = 4275
- End
- End
- Begin Threed.SSPanel panMain
- Height = 1095
- Left = 120
- TabIndex = 0
- Top = 90
- Width = 5895
- _Version = 65536
- _ExtentX = 10398
- _ExtentY = 1931
- _StockProps = 15
- BackColor = -2147483633
- RoundedCorners = 0 'False
- Begin VB.CheckBox chkLoop
- Caption = "Loop Sound"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 225
- Left = 3210
- TabIndex = 5
- Top = 180
- Width = 1455
- End
- Begin VB.CommandButton btnOpen
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "&Wave File..."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 345
- Left = 1620
- TabIndex = 2
- Top = 120
- Width = 1395
- End
- Begin VB.Label Label1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "Click to the left of a channel's Play button, then change its File and Loop parameters using the controls above."
- ForeColor = &H000000C0&
- Height = 435
- Left = 150
- TabIndex = 28
- Top = 540
- Width = 5625
- End
- Begin VB.Label lblSoundNbr
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BackStyle = 0 'Transparent
- Caption = "Wave Channel 0"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 225
- Left = 120
- TabIndex = 6
- Top = 180
- Width = 1425
- End
- End
- Begin MSComDlg.CommonDialog CMDialog1
- Left = 0
- Top = 0
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 0
- DefaultExt = "WAV"
- DialogTitle = "Open Wave File"
- Filter = "Wave Files (*.wav)|*.wav"
- End
- Attribute VB_Name = "frmWaveMixTest"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- '------------------------------------------------------------
- ' WAVMIX1.FRM
- ' This example program let's the user set multiple wave audio
- ' channels for simultaneous playback using the WAVEMIX DLL.
- '------------------------------------------------------------
- ' MsgBox parameters
- Const MB_OK = 0 ' OK button only
- Const MB_OKCANCEL = 1 ' OK and Cancel buttons
- Const MB_ABORTRETRYIGNORE = 2 ' Abort, Retry, and Ignore buttons
- Const MB_YESNOCANCEL = 3 ' Yes, No, and Cancel buttons
- Const MB_YESNO = 4 ' Yes and No buttons
- Const MB_RETRYCANCEL = 5 ' Retry and Cancel buttons
- Const MB_ICONSTOP = 16 ' Critical message
- Const MB_ICONQUESTION = 32 ' Warning query
- Const MB_ICONEXCLAMATION = 48 ' Warning message
- Const MB_ICONINFORMATION = 64 ' Information message
- Dim CurrentChannel As Long
- Const MAX_CHANNELS = 8
- Dim Channel(0 To 7) As tChannelInfo
- Private Sub btnOpen_Click()
- '------------------------------------------------------------
- ' Let the user assign a wave file to the cuurent channel.
- '------------------------------------------------------------
- Const ShowOpen = 1
- On Error Resume Next
- ' Let the user select another wave file via the
- ' Open File common dialog.
- CMDialog1.CancelError = True
- CMDialog1.InitDir = App.Path
- CMDialog1.Action = ShowOpen
- If Err <> 0 Then Exit Sub
- ' If we're currently looping a sound on this
- ' channel, then stop the sound and reset the
- ' text on the button.
- If btnPlay(CurrentChannel).Caption = "Stop" Then
- WAVMIX_StopChannel CurrentChannel
- btnPlay(CurrentChannel).Caption = "Play"
- End If
- ' Set the current channel to use the new wave file.
- lblWaveFile(CurrentChannel) = "Channel " & Format$(CurrentChannel) & ": " & LCase$(CMDialog1.FileName)
- Channel(CurrentChannel).WaveFile = LCase$(CMDialog1.FileName)
- Channel(CurrentChannel).Loops = (chkLoop.Value = 1)
- WAVMIX_SetFile Channel(CurrentChannel).WaveFile, CurrentChannel
- End Sub
- Private Sub btnPlay_Click(Index As Integer)
- '------------------------------------------------------------
- ' Play the wave assigned to the specified channel.
- '------------------------------------------------------------
- Dim AChannel As Long
- AChannel = Index
- If btnPlay(Index).Caption = "Play" Then
- If Channel(Index).Loops Then btnPlay(Index).Caption = "Stop"
- WAVMIX_PlayChannel AChannel, Channel(Index).Loops
- Else
- btnPlay(Index).Caption = "Play"
- WAVMIX_StopChannel AChannel
- End If
- End Sub
- Private Sub chkLoop_Click()
- '------------------------------------------------------------
- ' Set the boolean that determines if the current channel
- ' will loop the wave file when played.
- '------------------------------------------------------------
- Channel(CurrentChannel).Loops = (chkLoop.Value = 1)
- End Sub
- Private Sub Form_Load()
- '------------------------------------------------------------
- ' Initialize the WaveMix DLL and adjust the position of
- ' controls on the form.
- '------------------------------------------------------------
- Dim LeftMargin As Integer, TopMargin As Integer
- Dim i As Integer, j As Integer
- CurrentChannel = 0
- ChDir App.Path
- ' Initialize the WaveMix DLL.
- If Not WAVMIX_InitMixer() Then
- MsgBox "Unable to Initialize WaveMix DLL", MB_OK Or MB_ICONEXCLAMATION, "WaveMix Error"
- End
- End If
- ' Adjust the channel frames on the screen.
- LeftMargin = panWaveFrame(0).Left
- TopMargin = panWaveFrame(0).Top - (panMain.Top + panMain.Height)
- lblWaveFile(0) = "Channel 0: [none]"
- For i = 1 To 7
- lblWaveFile(i) = "Channel " & Format$(i) & ": [none]"
- panWaveFrame(i).Left = LeftMargin
- panWaveFrame(i).Width = panWaveFrame(1).Width
- panWaveFrame(i).Height = panWaveFrame(1).Height
- panWaveFrame(i).Top = panWaveFrame(i - 1).Top + panWaveFrame(i - 1).Height + TopMargin
- Next
- Me.Height = (Me.Height - Me.ScaleHeight) + panWaveFrame(7).Top + panWaveFrame(7).Height + (TopMargin * 2)
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- '------------------------------------------------------------
- ' Before the program ends, shut down the WaveMix DLL.
- '------------------------------------------------------------
- WAVMIX_Close
- End Sub
- Private Sub panWaveFrame_Click(Index As Integer)
- '------------------------------------------------------------
- ' Change the current channel.
- '------------------------------------------------------------
- If Index = CurrentChannel Then Exit Sub
- imgHand(Index).Visible = True
- imgHand(CurrentChannel).Visible = False
- CurrentChannel = Index
- lblSoundNbr = "Wave Channel " & Format$(CurrentChannel)
- chkLoop.Value = Abs(Channel(CurrentChannel).Loops)
- End Sub
-