home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectSound / EffectsBuffers / frmGargle.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-08  |  4.7 KB  |  149 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmGargle 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Gargle Effects Update"
  6.    ClientHeight    =   1635
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   2775
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1635
  14.    ScaleWidth      =   2775
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.OptionButton optTriangle 
  18.       Caption         =   "Triangle"
  19.       Height          =   255
  20.       Left            =   1680
  21.       TabIndex        =   6
  22.       Top             =   540
  23.       Width           =   915
  24.    End
  25.    Begin VB.OptionButton optSquare 
  26.       Caption         =   "Square"
  27.       Height          =   255
  28.       Left            =   120
  29.       TabIndex        =   5
  30.       Top             =   540
  31.       Width           =   915
  32.    End
  33.    Begin MSComctlLib.Slider sldRate 
  34.       Height          =   195
  35.       Left            =   780
  36.       TabIndex        =   4
  37.       Top             =   960
  38.       Width           =   1935
  39.       _ExtentX        =   3413
  40.       _ExtentY        =   344
  41.       _Version        =   393216
  42.       LargeChange     =   100
  43.       SmallChange     =   10
  44.       Min             =   1
  45.       Max             =   1000
  46.       SelStart        =   1
  47.       TickFrequency   =   100
  48.       Value           =   1
  49.    End
  50.    Begin VB.CommandButton cmdOK 
  51.       Caption         =   "OK"
  52.       Height          =   315
  53.       Left            =   1800
  54.       TabIndex        =   3
  55.       Top             =   1260
  56.       Width           =   915
  57.    End
  58.    Begin VB.Label lbl 
  59.       BackStyle       =   0  'Transparent
  60.       Caption         =   "Rate Hz"
  61.       Height          =   255
  62.       Index           =   1
  63.       Left            =   60
  64.       TabIndex        =   2
  65.       Top             =   960
  66.       Width           =   735
  67.    End
  68.    Begin VB.Label lbl 
  69.       BackStyle       =   0  'Transparent
  70.       Caption         =   "Wave Type"
  71.       Height          =   255
  72.       Index           =   0
  73.       Left            =   60
  74.       TabIndex        =   1
  75.       Top             =   300
  76.       Width           =   915
  77.    End
  78.    Begin VB.Label lbl 
  79.       BackStyle       =   0  'Transparent
  80.       Caption         =   "Here you can modify the gargle effect"
  81.       Height          =   255
  82.       Index           =   4
  83.       Left            =   60
  84.       TabIndex        =   0
  85.       Top             =   60
  86.       Width           =   2655
  87.    End
  88. Attribute VB_Name = "frmGargle"
  89. Attribute VB_GlobalNameSpace = False
  90. Attribute VB_Creatable = False
  91. Attribute VB_PredeclaredId = True
  92. Attribute VB_Exposed = False
  93. Option Explicit
  94. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  95. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  96. '  File:       frmGargle.frm
  97. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  98. Private oBuffer As DirectSoundSecondaryBuffer8
  99. Private mlIndex As Long
  100. Private oFX As DirectSoundFXGargle8
  101. Private Sub SaveAllSettings()
  102.     Dim fxNew As DSFXGARGLE
  103.     'Ok, save these new settings
  104.     'Set the new information up
  105.     fxNew.lRateHz = CLng(sldRate.Value)
  106.     If optSquare.Value Then
  107.         fxNew.lWaveShape = DSFXGARGLE_WAVE_SQUARE
  108.     ElseIf optTriangle.Value Then
  109.         fxNew.lWaveShape = DSFXGARGLE_WAVE_TRIANGLE
  110.     End If
  111.     'Now update the effect
  112.     oFX.SetAllParameters fxNew
  113. End Sub
  114. Private Sub cmdOK_Click()
  115.     SaveAllSettings
  116.     Unload Me
  117. End Sub
  118. Private Sub Form_Load()
  119.     Dim fxCurrent As DSFXGARGLE
  120.     'Get the gargle interface
  121.     Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_GARGLE, mlIndex, IID_DirectSoundFXGargle)
  122.     'Get the current settings from it
  123.     fxCurrent = oFX.GetAllParameters
  124.     'Now put them out there
  125.     sldRate.Value = fxCurrent.lRateHz
  126.     If fxCurrent.lWaveShape = DSFXGARGLE_WAVE_SQUARE Then
  127.         optSquare.Value = True
  128.     ElseIf fxCurrent.lWaveShape = DSFXGARGLE_WAVE_TRIANGLE Then
  129.         optTriangle.Value = True
  130.     End If
  131. End Sub
  132. Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
  133.     'Store the buffer and index
  134.     Set oBuffer = oBuf
  135.     mlIndex = Index
  136. End Sub
  137. Private Sub optSquare_Click()
  138.     SaveAllSettings
  139. End Sub
  140. Private Sub optTriangle_Click()
  141.     SaveAllSettings
  142. End Sub
  143. Private Sub sldRate_Change()
  144.     SaveAllSettings
  145. End Sub
  146. Private Sub sldRate_Scroll()
  147.     SaveAllSettings
  148. End Sub
  149.