home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Wave
- BorderStyle = 1 'Fixed Single
- ClientHeight = 1380
- ClientLeft = 1305
- ClientTop = 2445
- ClientWidth = 5715
- Height = 2070
- Left = 1245
- LinkMode = 1 'Source
- LinkTopic = "Form4"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1380
- ScaleWidth = 5715
- Top = 1815
- Width = 5835
- Begin MMControl MMControl1
- BackVisible = 0 'False
- EjectVisible = 0 'False
- Height = 375
- Left = 240
- RecordVisible = 0 'False
- StepVisible = 0 'False
- TabIndex = 0
- Top = 840
- UpdateInterval = 0
- Width = 2205
- End
- Begin HScrollBar HScroll1
- Height = 255
- Left = 240
- Max = 100
- TabIndex = 1
- Top = 360
- Width = 5295
- End
- Begin Label Label2
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Courier"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 4800
- TabIndex = 3
- Top = 0
- Width = 735
- End
- Begin Label Label1
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Courier"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 360
- TabIndex = 2
- Top = 0
- Width = 615
- End
- Begin Menu AL_FILE
- Caption = "&File"
- Begin Menu AI_OPEN
- Caption = "&Open..."
- End
- Begin Menu AI_SEPARATOR
- Caption = "-"
- End
- Begin Menu AI_EXIT
- Caption = "&Exit"
- End
- End
- Const INTERVAL = 50
- Const INTERVAL_PLUS = 55
- Dim CurrentValue As Double
- Sub AI_EXIT_Click ()
- Unload Wave
- End Sub
- 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.
- OpenDlg.CMDialog1.FilterIndex = 1
- OpenDlg.CMDialog1.Flags = OFN_READONLY Or OFN_FILEMUSTEXIST
- OpenDlg.CMDialog1.CancelError = True
- OpenDlg.CMDialog1.Filename = ""
- On Error Resume Next
- OpenDlg.CMDialog1.Action = 1
- If Err <> 0 Then
- ' No file selected from the "Open File..." dialog.
- Exit Sub
- End If
- ' If the device is open, close it.
- If Not MMControl1.Mode = MCI_MODE_NOT_OPEN 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 = MCI_FORMAT_MILLISECONDS
- 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
- Sub Form_Load ()
- ' Force the MCI control to complete before returning
- ' to the application.
- Wave.MMControl1.Wait = True
- End Sub
- Sub Form_Unload (Cancel As Integer)
- MCITest.Show
- End Sub
- Sub MMControl1_PauseClick (Cancel As Integer)
- ' Set the number of milliseconds between successive
- ' StatusUpdate events.
- MMControl1.UpdateInterval = 0
- End Sub
- Sub MMControl1_PlayClick (Cancel As Integer)
- ' Set the number of milliseconds between successive
- ' StatusUpdate events.
- MMControl1.UpdateInterval = INTERVAL
- End Sub
- 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
- Sub MMControl1_StatusUpdate ()
- Dim value As Integer
- ' If the device is not playing, reset to beginning.
- If Not MMControl1.Mode = MCI_MODE_PLAY 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 + INTERVAL_PLUS
- value = CInt((CurrentValue / MMControl1.Length) * 100)
- If value > Hscroll1.max Then
- value = 100
- End If
- Hscroll1.value = value
- End Sub
-