home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Wave
- BorderStyle = 1 'Fixed Single
- ClientHeight = 1380
- ClientLeft = 1350
- ClientTop = 4230
- ClientWidth = 5715
- Height = 2070
- Left = 1290
- LinkMode = 1 'Source
- LinkTopic = "Form4"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1380
- ScaleWidth = 5715
- Top = 3600
- Width = 5835
- Begin VB.HScrollBar HScroll1
- Height = 255
- Left = 240
- Max = 100
- TabIndex = 0
- Top = 360
- Width = 5295
- End
- Begin MCI.MMControl MMControl1
- Height = 495
- Left = 1080
- TabIndex = 3
- Top = 720
- Width = 3540
- _version = 65536
- _extentx = 6244
- _extenty = 873
- _stockprops = 32
- borderstyle = 1
- End
- Begin VB.Label Label2
- BeginProperty Font
- name = "Courier"
- charset = 1
- weight = 700
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 4800
- TabIndex = 2
- Top = 0
- Width = 735
- End
- Begin VB.Label Label1
- BeginProperty Font
- name = "Courier"
- charset = 1
- weight = 700
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 360
- TabIndex = 1
- Top = 0
- Width = 615
- End
- Begin VB.Menu AL_FILE
- Caption = "&File"
- Begin VB.Menu AI_OPEN
- Caption = "&Open..."
- End
- Begin VB.Menu AI_SEPARATOR
- Caption = "-"
- End
- Begin VB.Menu AI_EXIT
- Caption = "&Exit"
- End
- End
- Attribute VB_Name = "Wave"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Const conInterval = 50
- Const conIntervalPlus = 55
- Dim CurrentValue As Double
- Private Sub AI_EXIT_Click()
- Unload Wave
- End Sub
- Private Sub AI_OPEN_Click()
- Dim msec As Double
- ' Set the number of milliseconds between successive
- ' StatusUpdate events.
- MMControl1.UpdateInterval = 0
- ' Display the File Open dialog box.
- OpenDlg.CMDialog1.FilterIndex = 1
- OpenDlg.CMDialog1.Flags = vbOFNReadOnly Or vbOFNFileMustExist
- OpenDlg.CMDialog1.CancelError = True
- OpenDlg.CMDialog1.FileName = ""
- On Error Resume Next
- OpenDlg.CMDialog1.ShowOpen
- If Err <> 0 Then
- ' No file selected from the Open File dialog box.
- Exit Sub
- End If
- ' If the device is open, close it.
- If Not MMControl1.Mode = vbMCIModeNotOpen Then
- MMControl1.Command = "Close"
- End If
- ' Open the device with the new filename.
- MMControl1.FileName = OpenDlg.CMDialog1.FileName
- On Error GoTo MCI_ERROR
- MMControl1.Command = "Open"
- On Error GoTo 0
- Caption = DialogCaption + MMControl1.FileName
- ' Set the timing labels on the form.
- MMControl1.TimeFormat = vbMCIFormatMilliseconds
- Label1.Caption = "0.0"
- msec = (CDbl(MMControl1.Length) / 1000)
- Label2.Caption = Format$(msec, "0.00")
- ' Set the scrollbar values.
- Hscroll1.value = 0
- CurrentValue = 0#
- Exit Sub
- MCI_ERROR:
- DisplayErrorMessageBox
- Resume MCI_EXIT
- MCI_EXIT:
- Unload Wave
- End Sub
- Private Sub Form_Load()
- ' Force the multimedia MCI control to complete before returning
- ' to the application.
- Wave.MMControl1.Wait = True
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- MCITest.Show
- End Sub
- Private Sub MMControl1_PauseClick(Cancel As Integer)
- ' Set the number of milliseconds between successive
- ' StatusUpdate events.
- MMControl1.UpdateInterval = 0
- End Sub
- Private Sub MMControl1_PlayClick(Cancel As Integer)
- ' Set the number of milliseconds between successive
- ' StatusUpdate events.
- MMControl1.UpdateInterval = conInterval
- End Sub
- Private Sub MMControl1_PrevClick(Cancel As Integer)
- ' Set the number of milliseconds between successive
- ' StatusUpdate events.
- MMControl1.UpdateInterval = 0
- ' Reset the scrollbar values.
- Hscroll1.value = 0
- CurrentValue = 0#
- MMControl1.Command = "Prev"
- End Sub
- Private Sub MMControl1_StatusUpdate()
- Dim value As Integer
- ' If the device is not playing, reset to the beginning.
- If Not MMControl1.Mode = vbMCIModePlay Then
- Hscroll1.value = Hscroll1.Max
- MMControl1.UpdateInterval = 0
- Exit Sub
- End If
- ' Determine how much of the file has played. Set a
- ' value of the scrollbar between 0 and 100.
- CurrentValue = CurrentValue + conIntervalPlus
- value = CInt((CurrentValue / MMControl1.Length) * 100)
- If value > Hscroll1.Max Then
- value = 100
- End If
- Hscroll1.value = value
- End Sub
-