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 / frmParamEQ.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-08  |  5.0 KB  |  166 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmParamEQ 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "ParamEQ Effects Update"
  6.    ClientHeight    =   2220
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   2775
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   2220
  14.    ScaleWidth      =   2775
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.CommandButton cmdOK 
  18.       Caption         =   "OK"
  19.       Height          =   315
  20.       Left            =   1800
  21.       TabIndex        =   6
  22.       Top             =   1800
  23.       Width           =   915
  24.    End
  25.    Begin MSComctlLib.Slider sldCenter 
  26.       Height          =   195
  27.       Left            =   60
  28.       TabIndex        =   0
  29.       Top             =   360
  30.       Width           =   2655
  31.       _ExtentX        =   4683
  32.       _ExtentY        =   344
  33.       _Version        =   393216
  34.       LargeChange     =   500
  35.       SmallChange     =   100
  36.       Min             =   80
  37.       Max             =   16000
  38.       SelStart        =   80
  39.       TickFrequency   =   1000
  40.       Value           =   80
  41.    End
  42.    Begin MSComctlLib.Slider sldBand 
  43.       Height          =   195
  44.       Left            =   60
  45.       TabIndex        =   1
  46.       Top             =   900
  47.       Width           =   2655
  48.       _ExtentX        =   4683
  49.       _ExtentY        =   344
  50.       _Version        =   393216
  51.       LargeChange     =   4
  52.       Min             =   1
  53.       Max             =   36
  54.       SelStart        =   1
  55.       TickFrequency   =   4
  56.       Value           =   1
  57.    End
  58.    Begin MSComctlLib.Slider sldGain 
  59.       Height          =   195
  60.       Left            =   60
  61.       TabIndex        =   2
  62.       Top             =   1440
  63.       Width           =   2655
  64.       _ExtentX        =   4683
  65.       _ExtentY        =   344
  66.       _Version        =   393216
  67.       Min             =   -15
  68.       Max             =   15
  69.       TickFrequency   =   2
  70.    End
  71.    Begin VB.Label lbl 
  72.       BackStyle       =   0  'Transparent
  73.       Caption         =   "Center"
  74.       Height          =   255
  75.       Index           =   1
  76.       Left            =   60
  77.       TabIndex        =   5
  78.       Top             =   120
  79.       Width           =   735
  80.    End
  81.    Begin VB.Label lbl 
  82.       BackStyle       =   0  'Transparent
  83.       Caption         =   "Bandwith"
  84.       Height          =   255
  85.       Index           =   0
  86.       Left            =   60
  87.       TabIndex        =   4
  88.       Top             =   660
  89.       Width           =   735
  90.    End
  91.    Begin VB.Label lbl 
  92.       BackStyle       =   0  'Transparent
  93.       Caption         =   "Gain"
  94.       Height          =   255
  95.       Index           =   3
  96.       Left            =   60
  97.       TabIndex        =   3
  98.       Top             =   1200
  99.       Width           =   1035
  100.    End
  101. Attribute VB_Name = "frmParamEQ"
  102. Attribute VB_GlobalNameSpace = False
  103. Attribute VB_Creatable = False
  104. Attribute VB_PredeclaredId = True
  105. Attribute VB_Exposed = False
  106. Option Explicit
  107. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  108. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  109. '  File:       frmParamEQ.frm
  110. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  111. Private oBuffer As DirectSoundSecondaryBuffer8
  112. Private mlIndex As Long
  113. Private oFX As DirectSoundFXParamEq8
  114. Private Sub SaveAllSettings()
  115.     Dim fxNew As DSFXPARAMEQ
  116.     'Ok, save these new settings
  117.     'Set the new information up
  118.     With fxNew
  119.         .fBandwidth = CSng(sldBand.Value)
  120.         .fCenter = CSng(sldCenter.Value)
  121.         .fGain = CSng(sldGain.Value)
  122.     End With
  123.     'Now update the effect
  124.     oFX.SetAllParameters fxNew
  125. End Sub
  126. Private Sub cmdOK_Click()
  127.     SaveAllSettings
  128.     Unload Me
  129. End Sub
  130. Private Sub Form_Load()
  131.     Dim fxCurrent As DSFXPARAMEQ
  132.     'Get the echo interface
  133.     Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_PARAMEQ, mlIndex, IID_DirectSoundFXParamEq)
  134.     'Get the current settings from it
  135.     fxCurrent = oFX.GetAllParameters
  136.     'Now put them out there
  137.     With fxCurrent
  138.         sldBand.Value = CLng(.fBandwidth)
  139.         sldCenter.Value = CLng(.fCenter)
  140.         sldGain.Value = CLng(.fGain)
  141.     End With
  142. End Sub
  143. Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
  144.     'Store the buffer and index
  145.     Set oBuffer = oBuf
  146.     mlIndex = Index
  147. End Sub
  148. Private Sub sldBand_Change()
  149.     SaveAllSettings
  150. End Sub
  151. Private Sub sldBand_Scroll()
  152.     SaveAllSettings
  153. End Sub
  154. Private Sub sldCenter_Change()
  155.     SaveAllSettings
  156. End Sub
  157. Private Sub sldCenter_Scroll()
  158.     SaveAllSettings
  159. End Sub
  160. Private Sub sldGain_Change()
  161.     SaveAllSettings
  162. End Sub
  163. Private Sub sldGain_Scroll()
  164.     SaveAllSettings
  165. End Sub
  166.