home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{A7127494-0AF9-11D2-ABBA-444553540000}#2.0#0"; "OVOL.OCX"
- Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
- Begin VB.Form frmOVolSample
- BorderStyle = 3 'Fixed Dialog
- Caption = "OVol V2.0 Example Program"
- ClientHeight = 5595
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 6480
- Icon = "Sample.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5595
- ScaleWidth = 6480
- ShowInTaskbar = 0 'False
- StartUpPosition = 3 'Windows Default
- Begin VB.Timer Timer1
- Interval = 200
- Left = 2640
- Top = 2580
- End
- Begin ComctlLib.Slider Slider1
- Height = 450
- Index = 0
- Left = 2340
- TabIndex = 0
- Top = 240
- Width = 2955
- _ExtentX = 5212
- _ExtentY = 794
- _Version = 327682
- LargeChange = 20
- Max = 100
- TickFrequency = 5
- End
- Begin prjOVol.OVol OVol1
- Left = 3000
- Top = 2460
- _ExtentX = 847
- _ExtentY = 847
- Bass = 50.001
- Treble = 100
- VolumeCd = 29.804
- VolumeLineIn = 50.001
- VolumeMaster = 32.941
- VolumeMicrophone= 50.001
- VolumeMidiOut = 49.804
- VolumePcSpeaker = 50.001
- VolumeWaveOut = 49.804
- DeviceNameBass = "Master Bass Level"
- DeviceNameTreble= "Master Treble Level"
- DeviceNameCd = "CD Audio Volume Level"
- DeviceNameLineIn= "Line-In Volume Level"
- DeviceNameMaster= "Master Volume Level"
- DeviceNameMicrophone= "Microphone Volume Level"
- DeviceNameMidiOut= "MIDI Volume Level"
- DeviceNamePcSpeaker= "PC Speaker Volume Level"
- DeviceNameWaveOut= "Wave Output Volume Level"
- End
- Begin VB.CheckBox chkMuted
- Caption = "Muted"
- Height = 195
- Index = 0
- Left = 5460
- TabIndex = 1
- Top = 240
- Width = 855
- End
- Begin VB.CommandButton cmdExit
- Caption = "Close"
- Height = 315
- Left = 5580
- TabIndex = 16
- Top = 5160
- Width = 795
- End
- Begin VB.CheckBox chkMuted
- Caption = "Muted"
- Height = 195
- Index = 1
- Left = 5460
- TabIndex = 5
- Top = 1860
- Width = 855
- End
- Begin VB.CheckBox chkMuted
- Caption = "Muted"
- Height = 195
- Index = 2
- Left = 5460
- TabIndex = 7
- Top = 2400
- Width = 855
- End
- Begin VB.CheckBox chkMuted
- Caption = "Muted"
- Height = 195
- Index = 3
- Left = 5460
- TabIndex = 9
- Top = 2940
- Width = 855
- End
- Begin VB.CheckBox chkMuted
- Caption = "Muted"
- Height = 195
- Index = 4
- Left = 5460
- TabIndex = 11
- Top = 3480
- Width = 855
- End
- Begin VB.CheckBox chkMuted
- Caption = "Muted"
- Height = 195
- Index = 5
- Left = 5460
- TabIndex = 13
- Top = 4020
- Width = 855
- End
- Begin VB.CheckBox chkMuted
- Caption = "Muted"
- Height = 195
- Index = 6
- Left = 5460
- TabIndex = 15
- Top = 4560
- Width = 855
- End
- Begin ComctlLib.Slider Slider1
- Height = 450
- Index = 1
- Left = 2340
- TabIndex = 2
- Top = 780
- Width = 2955
- _ExtentX = 5212
- _ExtentY = 794
- _Version = 327682
- LargeChange = 20
- Max = 100
- TickFrequency = 5
- End
- Begin ComctlLib.Slider Slider1
- Height = 450
- Index = 2
- Left = 2340
- TabIndex = 3
- Top = 1320
- Width = 2955
- _ExtentX = 5212
- _ExtentY = 794
- _Version = 327682
- LargeChange = 20
- Max = 100
- TickFrequency = 5
- End
- Begin ComctlLib.Slider Slider1
- Height = 450
- Index = 3
- Left = 2340
- TabIndex = 4
- Top = 1860
- Width = 2955
- _ExtentX = 5212
- _ExtentY = 794
- _Version = 327682
- LargeChange = 20
- Max = 100
- TickFrequency = 5
- End
- Begin ComctlLib.Slider Slider1
- Height = 450
- Index = 4
- Left = 2340
- TabIndex = 6
- Top = 2400
- Width = 2955
- _ExtentX = 5212
- _ExtentY = 794
- _Version = 327682
- LargeChange = 20
- Max = 100
- TickFrequency = 5
- End
- Begin ComctlLib.Slider Slider1
- Height = 450
- Index = 5
- Left = 2340
- TabIndex = 8
- Top = 2940
- Width = 2955
- _ExtentX = 5212
- _ExtentY = 794
- _Version = 327682
- LargeChange = 20
- Max = 100
- TickFrequency = 5
- End
- Begin ComctlLib.Slider Slider1
- Height = 450
- Index = 6
- Left = 2340
- TabIndex = 10
- Top = 3480
- Width = 2955
- _ExtentX = 5212
- _ExtentY = 794
- _Version = 327682
- LargeChange = 20
- Max = 100
- TickFrequency = 5
- End
- Begin ComctlLib.Slider Slider1
- Height = 450
- Index = 7
- Left = 2340
- TabIndex = 12
- Top = 4020
- Width = 2955
- _ExtentX = 5212
- _ExtentY = 794
- _Version = 327682
- LargeChange = 20
- Max = 100
- TickFrequency = 5
- End
- Begin ComctlLib.Slider Slider1
- Height = 450
- Index = 8
- Left = 2340
- TabIndex = 14
- Top = 4560
- Width = 2955
- _ExtentX = 5212
- _ExtentY = 794
- _Version = 327682
- LargeChange = 20
- Max = 100
- TickFrequency = 5
- End
- Begin VB.Label Label1
- Height = 255
- Index = 0
- Left = 120
- TabIndex = 25
- Top = 240
- Width = 2145
- End
- Begin VB.Label Label1
- Height = 255
- Index = 1
- Left = 120
- TabIndex = 24
- Top = 780
- Width = 2145
- End
- Begin VB.Label Label1
- Height = 255
- Index = 2
- Left = 120
- TabIndex = 23
- Top = 1320
- Width = 2145
- End
- Begin VB.Label Label1
- Height = 255
- Index = 3
- Left = 120
- TabIndex = 22
- Top = 1860
- Width = 2145
- End
- Begin VB.Label Label1
- Height = 255
- Index = 4
- Left = 120
- TabIndex = 21
- Top = 2400
- Width = 2145
- End
- Begin VB.Label Label1
- Height = 255
- Index = 5
- Left = 120
- TabIndex = 20
- Top = 2940
- Width = 2145
- End
- Begin VB.Label Label1
- Height = 255
- Index = 6
- Left = 120
- TabIndex = 19
- Top = 3480
- Width = 2145
- End
- Begin VB.Label Label1
- Height = 255
- Index = 7
- Left = 120
- TabIndex = 18
- Top = 4020
- Width = 2145
- End
- Begin VB.Label Label1
- Height = 255
- Index = 8
- Left = 120
- TabIndex = 17
- Top = 4560
- Width = 2145
- End
- Attribute VB_Name = "frmOVolSample"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub chkMuted_Click(Index As Integer)
- 'set the mute state to the checkbox value
- Dim Temp As Boolean
- Temp = CBool(chkMuted(Index).Value)
- Select Case Index
- Case 0 'master
- OVol1.MutedMaster = Temp
- Case 1 'wave
- OVol1.MutedWaveOut = Temp
- Case 2 'midi
- OVol1.MutedMidiOut = Temp
- Case 3 'cd
- OVol1.MutedCd = Temp
- Case 4 'line in
- OVol1.MutedLineIn = Temp
- Case 5 'microphone
- OVol1.MutedMicrophone = Temp
- Case 6 'pc speaker
- OVol1.MutedPcSpeaker = Temp
- End Select
- End Sub
- Private Sub cmdExit_Click()
- 'Never use that evil END command!
- Unload Me
- End Sub
- Private Sub Form_Load()
- 'show the intial values
- ShowNames
- ShowLevels
- ShowMute
- End Sub
- Public Sub ShowNames()
- 'show the names of the devices according to Windows
- Label1(0) = OVol1.DeviceNameMaster
- Label1(1) = OVol1.DeviceNameBass
- Label1(2) = OVol1.DeviceNameTreble
- Label1(3) = OVol1.DeviceNameWaveOut
- Label1(4) = OVol1.DeviceNameMidiOut
- Label1(5) = OVol1.DeviceNameCd
- Label1(6) = OVol1.DeviceNameLineIn
- Label1(7) = OVol1.DeviceNameMicrophone
- Label1(8) = OVol1.DeviceNamePcSpeaker
- End Sub
- Public Sub ShowLevels()
- 'set the sliders to the various sound/tone levels
- Slider1(0) = OVol1.VolumeMaster
- Slider1(1) = OVol1.Bass
- Slider1(2) = OVol1.Treble
- Slider1(3) = OVol1.VolumeWaveOut
- Slider1(4) = OVol1.VolumeMidiOut
- Slider1(5) = OVol1.VolumeCd
- Slider1(6) = OVol1.VolumeLineIn
- Slider1(7) = OVol1.VolumeMicrophone
- Slider1(8) = OVol1.VolumePcSpeaker
- End Sub
- Public Sub ShowMute()
- 'show the state of the mute checkbox on the mixer
- chkMuted(0).Value = Abs(CInt(OVol1.MutedMaster))
- chkMuted(1).Value = Abs(CInt(OVol1.MutedWaveOut))
- chkMuted(2).Value = Abs(CInt(OVol1.MutedMidiOut))
- chkMuted(3).Value = Abs(CInt(OVol1.MutedCd))
- chkMuted(4).Value = Abs(CInt(OVol1.MutedLineIn))
- chkMuted(5).Value = Abs(CInt(OVol1.MutedMicrophone))
- chkMuted(6).Value = Abs(CInt(OVol1.MutedPcSpeaker))
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- 'release memory back to the system
- Set frmOVolSample = Nothing
- End Sub
- Private Sub Slider1_Click(Index As Integer)
- 'set the volume/tone to the slider's value
- Dim Temp As Single
- Temp = CSng(Slider1(Index).Value)
- Select Case Index
- Case 0
- OVol1.VolumeMaster = Temp
- Case 1
- OVol1.Bass = Temp
- Case 2
- OVol1.Treble = Temp
- Case 3
- OVol1.VolumeWaveOut = Temp
- Case 4
- OVol1.VolumeMidiOut = Temp
- Case 5
- OVol1.VolumeCd = Temp
- Case 6
- OVol1.VolumeLineIn = Temp
- Case 7
- OVol1.VolumeMicrophone = Temp
- Case 8
- OVol1.VolumePcSpeaker = Temp
- End Select
- End Sub
- Private Sub Timer1_Timer()
- 'update the display every 1/5 of a second
- 'NOTE:Making too many consecutive reads too quickly
- 'can cause the OCX to cease to work. The reason is that
- 'the OCX doesn't have the time to update itself before
- 'the next call, causing a stack overflow. This is
- 'normal behavior, not a bug.
- ShowLevels
- ShowMute
- End Sub
-