home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / mabry / wave10 / sample / wsample2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-01-01  |  3.8 KB  |  141 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Wave VBX Loop Sample"
  6.    ClientHeight    =   2985
  7.    ClientLeft      =   1650
  8.    ClientTop       =   1920
  9.    ClientWidth     =   4095
  10.    Height          =   3390
  11.    Left            =   1590
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   2985
  14.    ScaleWidth      =   4095
  15.    Top             =   1575
  16.    Width           =   4215
  17.    Begin CheckBox chkLoop 
  18.       BackColor       =   &H00C0C0C0&
  19.       Caption         =   "Repeated Playing (loop)"
  20.       Height          =   255
  21.       Left            =   240
  22.       TabIndex        =   6
  23.       Top             =   1200
  24.       Width           =   3615
  25.    End
  26.    Begin CheckBox chkExclusive 
  27.       BackColor       =   &H00C0C0C0&
  28.       Caption         =   "Exclusive Playing"
  29.       Height          =   255
  30.       Left            =   240
  31.       TabIndex        =   5
  32.       Top             =   840
  33.       Width           =   3615
  34.    End
  35.    Begin MabryWave Wave1 
  36.       Exclusive       =   0   'False
  37.       FileLength      =   -1
  38.       Filename        =   ""
  39.       Left            =   3480
  40.       Loop            =   0   'False
  41.       LoopCount       =   0   'False
  42.       PlayEnd         =   -1
  43.       PlayStart       =   -1
  44.       Top             =   0
  45.    End
  46.    Begin TextBox txtFilename 
  47.       Height          =   285
  48.       Left            =   240
  49.       TabIndex        =   2
  50.       Text            =   "C:\WINDOWS\RINGIN.WAV"
  51.       Top             =   480
  52.       Width           =   3615
  53.    End
  54.    Begin CommandButton btnStop 
  55.       Caption         =   "Stop"
  56.       Height          =   615
  57.       Left            =   2040
  58.       TabIndex        =   1
  59.       Top             =   2160
  60.       Width           =   1815
  61.    End
  62.    Begin CommandButton btnPlay 
  63.       Caption         =   "Play"
  64.       Height          =   615
  65.       Left            =   240
  66.       TabIndex        =   0
  67.       Top             =   2160
  68.       Width           =   1815
  69.    End
  70.    Begin Label Label2 
  71.       Alignment       =   2  'Center
  72.       BackColor       =   &H00C0C0C0&
  73.       Height          =   255
  74.       Left            =   240
  75.       TabIndex        =   4
  76.       Top             =   1680
  77.       Width           =   3615
  78.    End
  79.    Begin Label Label1 
  80.       BackColor       =   &H00C0C0C0&
  81.       Caption         =   "Filename:"
  82.       Height          =   255
  83.       Left            =   240
  84.       TabIndex        =   3
  85.       Top             =   240
  86.       Width           =   1935
  87.    End
  88. Option Explicit
  89. Dim fChanged As Integer ' flag: has filename changed?
  90. Sub btnPlay_Click ()
  91.     ' make sure the filename is up to date
  92.     SetFilename
  93.     ' play the file
  94.     Wave1.Action = 1
  95.     EnableButtons
  96.     Label2 = "Playing"
  97. End Sub
  98. Sub btnStop_Click ()
  99.     ' stop playing
  100.     Wave1.Action = 4
  101.     ' update buttons
  102.     EnableButtons
  103. End Sub
  104. Sub chkExclusive_Click ()
  105.     Wave1.Exclusive = (chkExclusive.Value <> 0)
  106. End Sub
  107. Sub chkLoop_Click ()
  108.     Wave1.Loop = (chkLoop.Value <> 0)
  109. End Sub
  110. Sub EnableButtons ()
  111.     ' set button status
  112.     Select Case Wave1.Status
  113.         Case 1: ' playing
  114.             btnStop.Enabled = True
  115.         Case 4: ' stopped
  116.             btnStop.Enabled = False
  117.     End Select
  118. End Sub
  119. Sub Form_Load ()
  120.     fChanged = True
  121.     EnableButtons
  122. End Sub
  123. Sub SetFilename ()
  124.     ' if the filename has changed, tell Wave VBX
  125.     If fChanged Then
  126.         ' changed no more
  127.         fChanged = False
  128.         Wave1.Filename = txtFilename
  129.     End If
  130. End Sub
  131. Sub txtFilename_Change ()
  132.     fChanged = True
  133. End Sub
  134. Sub Wave1_PlayDone ()
  135.     EnableButtons
  136.     Label2 = "Stopped"
  137. End Sub
  138. Sub Wave1_PlayLoop (LoopCount As Integer)
  139.     Label2 = "Playing (" & LoopCount & " times)"
  140. End Sub
  141.