vbAccelerator - Contents of code file: frmWavPlayer.frm
VERSION 5.00
Begin VB.Form frmWavViewer
Caption = "vbAccelerator WaveForm Display"
ClientHeight = 6600
ClientLeft = 3735
ClientTop = 2730
ClientWidth = 7890
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmWavPlayer.frx":0000
LinkTopic = "Form1"
ScaleHeight = 6600
ScaleWidth = 7890
Begin WavViewer6.vbalWaveRender vbalWaveRender1
Height = 5595
Left = 120
TabIndex = 4
Top = 480
Width = 7635
_ExtentX = 13467
_ExtentY = 9869
End
Begin VB.HScrollBar hscZoom
Height = 255
Left = 1680
Max = 22
TabIndex = 2
Top = 6180
Value = 14
Width = 1695
End
Begin VB.CommandButton cmdPick
Caption = "..."
Height = 315
Left = 7500
TabIndex = 1
Top = 60
Width = 315
End
Begin VB.TextBox txtFile
Height = 315
Left = 960
TabIndex = 0
Top = 60
Width = 6495
End
Begin VB.Label lblWaveFile
Caption = "Wave File:"
Height = 255
Left = 120
TabIndex = 5
Top = 120
Width = 1275
End
Begin VB.Label lblZoom
Caption = "&Zoom:"
Height = 195
Left = 120
TabIndex = 3
Top = 6180
Width = 1515
End
End
Attribute VB_Name = "frmWavViewer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdPick_Click()
Dim sFile As String
Dim cD As New cCommonDialog
On Error GoTo ErrorHandler
If (cD.VBGetOpenFileName(sFile, Filter:="Wave Files (*.WAV)|*.WAV|All Files
(*.*)|*.*", _
DefaultExt:="WAV", Owner:=Me.hwnd)) Then
vbalWaveRender1.WaveFile = sFile
txtFile.Text = sFile
End If
Exit Sub
ErrorHandler:
MsgBox "Error: " & Err.Description, vbExclamation
Exit Sub
End Sub
Private Sub Form_Load()
hscZoom_Change
End Sub
Private Sub Form_Resize()
On Error Resume Next
vbalWaveRender1.Move vbalWaveRender1.Left, vbalWaveRender1.TOp,
Me.ScaleWidth - vbalWaveRender1.Left - 4 * Screen.TwipsPerPixelX
End Sub
Private Sub hscZoom_Change()
Dim lValue As Long
Dim lZoom As Long
lValue = hscZoom.value
Select Case lValue
Case 0
lZoom = -24
Case 1
lZoom = -16
Case 2
lZoom = -12
Case 3
lZoom = -8
Case 4
lZoom = -6
Case 5 To 7
lZoom = 9 - lValue
Case Else
lZoom = 2 ^ (lValue - 8)
End Select
If (lZoom < 0) Then
lblZoom.Caption = "Zoom: " & Abs(lZoom) & ":1"
Else
lblZoom.Caption = "Zoom: 1:" & lZoom
End If
vbalWaveRender1.Zoom = lZoom
End Sub
Private Sub hscZoom_Scroll()
hscZoom_Change
End Sub
|
|