home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l407 / 4.ddi / WAVE.FR_ / WAVE.bin (.txt)
Encoding:
Visual Basic Form  |  1993-04-28  |  5.1 KB  |  167 lines

  1. VERSION 2.00
  2. Begin Form Wave 
  3.    BorderStyle     =   1  'Fixed Single
  4.    ClientHeight    =   1380
  5.    ClientLeft      =   1305
  6.    ClientTop       =   2445
  7.    ClientWidth     =   5715
  8.    Height          =   2070
  9.    Left            =   1245
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form4"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   1380
  15.    ScaleWidth      =   5715
  16.    Top             =   1815
  17.    Width           =   5835
  18.    Begin MMControl MMControl1 
  19.       BackVisible     =   0   'False
  20.       EjectVisible    =   0   'False
  21.       Height          =   375
  22.       Left            =   240
  23.       RecordVisible   =   0   'False
  24.       StepVisible     =   0   'False
  25.       TabIndex        =   0
  26.       Top             =   840
  27.       UpdateInterval  =   0
  28.       Width           =   2205
  29.    End
  30.    Begin HScrollBar HScroll1 
  31.       Height          =   255
  32.       Left            =   240
  33.       Max             =   100
  34.       TabIndex        =   1
  35.       Top             =   360
  36.       Width           =   5295
  37.    End
  38.    Begin Label Label2 
  39.       FontBold        =   -1  'True
  40.       FontItalic      =   0   'False
  41.       FontName        =   "Courier"
  42.       FontSize        =   12
  43.       FontStrikethru  =   0   'False
  44.       FontUnderline   =   0   'False
  45.       Height          =   255
  46.       Left            =   4800
  47.       TabIndex        =   3
  48.       Top             =   0
  49.       Width           =   735
  50.    End
  51.    Begin Label Label1 
  52.       FontBold        =   -1  'True
  53.       FontItalic      =   0   'False
  54.       FontName        =   "Courier"
  55.       FontSize        =   12
  56.       FontStrikethru  =   0   'False
  57.       FontUnderline   =   0   'False
  58.       Height          =   255
  59.       Left            =   360
  60.       TabIndex        =   2
  61.       Top             =   0
  62.       Width           =   615
  63.    End
  64.    Begin Menu AL_FILE 
  65.       Caption         =   "&File"
  66.       Begin Menu AI_OPEN 
  67.          Caption         =   "&Open..."
  68.       End
  69.       Begin Menu AI_SEPARATOR 
  70.          Caption         =   "-"
  71.       End
  72.       Begin Menu AI_EXIT 
  73.          Caption         =   "&Exit"
  74.       End
  75.    End
  76. Const INTERVAL = 50
  77. Const INTERVAL_PLUS = 55
  78. Dim CurrentValue As Double
  79. Sub AI_EXIT_Click ()
  80.     Unload Wave
  81. End Sub
  82. Sub AI_OPEN_Click ()
  83.     Dim msec As Double
  84.     ' Set the number of milliseconds between successive
  85.     ' StatusUpdate events.
  86.     MMControl1.UpdateInterval = 0
  87.     ' Display the File Open... dialog.
  88.     OpenDlg.CMDialog1.FilterIndex = 1
  89.     OpenDlg.CMDialog1.Flags = OFN_READONLY Or OFN_FILEMUSTEXIST
  90.     OpenDlg.CMDialog1.CancelError = True
  91.     OpenDlg.CMDialog1.Filename = ""
  92.     On Error Resume Next
  93.     OpenDlg.CMDialog1.Action = 1
  94.     If Err <> 0 Then
  95.         ' No file selected from the "Open File..." dialog.
  96.         Exit Sub
  97.     End If
  98.     ' If the device is open, close it.
  99.     If Not MMControl1.Mode = MCI_MODE_NOT_OPEN Then
  100.         MMControl1.Command = "Close"
  101.     End If
  102.     ' Open the device with the new filename.
  103.     MMControl1.Filename = OpenDlg.CMDialog1.Filename
  104.     On Error GoTo MCI_ERROR
  105.     MMControl1.Command = "Open"
  106.     On Error GoTo 0
  107.     Caption = DialogCaption + MMControl1.Filename
  108.     ' Set the timing labels on the form.
  109.     MMControl1.TimeFormat = MCI_FORMAT_MILLISECONDS
  110.     Label1.Caption = "0.0"
  111.     msec = (CDbl(MMControl1.Length) / 1000)
  112.     Label2.Caption = Format$(msec, "0.00")
  113.     ' Set the scrollbar values.
  114.     Hscroll1.value = 0
  115.     CurrentValue = 0#
  116.     Exit Sub
  117. MCI_ERROR:
  118.     DisplayErrorMessageBox
  119.     Resume MCI_EXIT
  120. MCI_EXIT:
  121.     Unload Wave
  122. End Sub
  123. Sub Form_Load ()
  124.     ' Force the MCI control to complete before returning
  125.     ' to the application.
  126.     Wave.MMControl1.Wait = True
  127. End Sub
  128. Sub Form_Unload (Cancel As Integer)
  129.     MCITest.Show
  130. End Sub
  131. Sub MMControl1_PauseClick (Cancel As Integer)
  132.     ' Set the number of milliseconds between successive
  133.     ' StatusUpdate events.
  134.     MMControl1.UpdateInterval = 0
  135. End Sub
  136. Sub MMControl1_PlayClick (Cancel As Integer)
  137.     ' Set the number of milliseconds between successive
  138.     ' StatusUpdate events.
  139.     MMControl1.UpdateInterval = INTERVAL
  140. End Sub
  141. Sub MMControl1_PrevClick (Cancel As Integer)
  142.     ' Set the number of milliseconds between successive
  143.     ' StatusUpdate events.
  144.     MMControl1.UpdateInterval = 0
  145.     ' Reset the scrollbar values.
  146.     Hscroll1.value = 0
  147.     CurrentValue = 0#
  148.     MMControl1.Command = "Prev"
  149. End Sub
  150. Sub MMControl1_StatusUpdate ()
  151.     Dim value As Integer
  152.     ' If the device is not playing, reset to beginning.
  153.     If Not MMControl1.Mode = MCI_MODE_PLAY Then
  154.         Hscroll1.value = Hscroll1.max
  155.         MMControl1.UpdateInterval = 0
  156.         Exit Sub
  157.     End If
  158.     ' Determine how much of the file has played.  Set a
  159.     ' value of the scrollbar between 0 and 100.
  160.     CurrentValue = CurrentValue + INTERVAL_PLUS
  161.     value = CInt((CurrentValue / MMControl1.Length) * 100)
  162.     If value > Hscroll1.max Then
  163.         value = 100
  164.     End If
  165.     Hscroll1.value = value
  166. End Sub
  167.