home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 66 / IOPROG_66.ISO / soft / c++ / mmwavex.exe / Demos / VB / Play / Form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  2001-01-16  |  4.0 KB  |  137 lines

  1. VERSION 5.00
  2. Object = "{E9D405C0-E53F-11D1-8819-C199198E9702}#2.0#0"; "MMWAVEX2.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  4. Begin VB.Form Form1 
  5.    Caption         =   "Form1"
  6.    ClientHeight    =   1995
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   2745
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1995
  12.    ScaleWidth      =   2745
  13.    StartUpPosition =   2  'Bildschirmmitte
  14.    Begin MMWAVEX2.MMWavePlayerX WavePlayer 
  15.       Height          =   420
  16.       Left            =   120
  17.       TabIndex        =   0
  18.       Top             =   120
  19.       Width           =   420
  20.       Wave.TimeFormat =   0
  21.       BufferSize      =   4096
  22.       NumBuffers      =   25
  23.       DeviceID        =   0
  24.       TimeFormat      =   0
  25.       CallBackMode    =   0
  26.       Looping         =   0
  27.       LoopCount       =   0
  28.       _Handle         =   3
  29.       Level1          =   2
  30.       Level2          =   1
  31.    End
  32.    Begin MMWAVEX2.MMWaveLevelX MMWaveLevelX2 
  33.       Height          =   255
  34.       Left            =   720
  35.       TabIndex        =   4
  36.       Top             =   360
  37.       Width           =   1815
  38.       Object.Width           =   121
  39.       Bevel.BevelInner=   1
  40.       Bevel.BevelOuter=   2
  41.       Bevel.BorderStyle=   1
  42.       Bevel.BorderSpace=   1
  43.       Channel         =   2
  44.       PeakSpeed       =   1
  45.       DecayMode       =   1
  46.       Decay           =   10
  47.       _Handle         =   1
  48.    End
  49.    Begin MMWAVEX2.MMWaveLevelX MMWaveLevelX1 
  50.       Height          =   255
  51.       Left            =   720
  52.       TabIndex        =   3
  53.       Top             =   120
  54.       Width           =   1815
  55.       Object.Width           =   121
  56.       Bevel.BevelInner=   1
  57.       Bevel.BevelOuter=   2
  58.       Bevel.BorderStyle=   1
  59.       Bevel.BorderSpace=   1
  60.       Channel         =   1
  61.       PeakSpeed       =   1
  62.       DecayMode       =   1
  63.       Decay           =   10
  64.       _Handle         =   2
  65.    End
  66.    Begin ComctlLib.Slider PosSlider 
  67.       Height          =   375
  68.       Left            =   720
  69.       TabIndex        =   5
  70.       Top             =   1440
  71.       Width           =   1815
  72.       _ExtentX        =   3201
  73.       _ExtentY        =   661
  74.       _Version        =   327682
  75.       TickFrequency   =   10
  76.    End
  77.    Begin VB.CommandButton StopBtn 
  78.       Caption         =   "Stop"
  79.       Enabled         =   0   'False
  80.       Height          =   375
  81.       Left            =   720
  82.       TabIndex        =   2
  83.       Top             =   840
  84.       Width           =   735
  85.    End
  86.    Begin VB.CommandButton PlayBtn 
  87.       Caption         =   "Play"
  88.       Height          =   375
  89.       Left            =   1680
  90.       TabIndex        =   1
  91.       Top             =   840
  92.       Width           =   735
  93.    End
  94. Attribute VB_Name = "Form1"
  95. Attribute VB_GlobalNameSpace = False
  96. Attribute VB_Creatable = False
  97. Attribute VB_PredeclaredId = True
  98. Attribute VB_Exposed = False
  99. Option Explicit
  100. Dim Seeking As Boolean
  101. Private Sub PlayBtn_Click()
  102.     If WavePlayer.SelectFile Then
  103.        Seeking = False
  104.        PosSlider.Max = WavePlayer.FileLength \ 1000
  105.        WavePlayer.Play
  106.     End If
  107. End Sub
  108. Private Sub StopBtn_Click()
  109.     WavePlayer.Stop
  110. End Sub
  111. Private Sub Form_Unload(Cancel As Integer)
  112.     WavePlayer.Stop
  113. End Sub
  114. Private Sub WavePlayer_OnData(ByVal lpWaveHdr As Long)
  115.     If Not Seeking Then
  116.        PosSlider.Value = WavePlayer.Position \ 1000
  117.     End If
  118. End Sub
  119. Private Sub WavePlayer_OnStart()
  120.     PosSlider.Enabled = True
  121.     PlayBtn.Enabled = False
  122.     StopBtn.Enabled = True
  123. End Sub
  124. Private Sub WavePlayer_OnStop()
  125.     PosSlider.Enabled = False
  126.     PosSlider.Value = 0
  127.     PlayBtn.Enabled = True
  128.     StopBtn.Enabled = False
  129. End Sub
  130. Private Sub PosSlider_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  131.     Seeking = True
  132. End Sub
  133. Private Sub PosSlider_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  134.     WavePlayer.Position = PosSlider.Value * 1000
  135.     Seeking = False
  136. End Sub
  137.