home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD90348172000.psc / Form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  2000-08-17  |  25.7 KB  |  757 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  3. Begin VB.Form Form1 
  4.    BackColor       =   &H00000000&
  5.    Caption         =   "c"
  6.    ClientHeight    =   5280
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   6210
  10.    Icon            =   "Form1.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5280
  13.    ScaleWidth      =   6210
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.PictureBox picPeakVol 
  16.       Appearance      =   0  'Flat
  17.       BackColor       =   &H00000000&
  18.       BorderStyle     =   0  'None
  19.       FillColor       =   &H0000FF00&
  20.       FillStyle       =   0  'Solid
  21.       ForeColor       =   &H0000FF00&
  22.       Height          =   3000
  23.       Left            =   90
  24.       Picture         =   "Form1.frx":1CCA
  25.       ScaleHeight     =   3000
  26.       ScaleWidth      =   4995
  27.       TabIndex        =   32
  28.       Top             =   1020
  29.       Width           =   5000
  30.    End
  31.    Begin VB.Timer Timer2 
  32.       Interval        =   100
  33.       Left            =   720
  34.       Top             =   4350
  35.    End
  36.    Begin VB.CommandButton cmdPlay 
  37.       Caption         =   "Play wave"
  38.       Height          =   400
  39.       Left            =   4995
  40.       TabIndex        =   28
  41.       Top             =   4380
  42.       Width           =   1000
  43.    End
  44.    Begin VB.PictureBox Picture2 
  45.       AutoRedraw      =   -1  'True
  46.       BackColor       =   &H00000000&
  47.       BorderStyle     =   0  'None
  48.       Height          =   3000
  49.       Left            =   5220
  50.       ScaleHeight     =   3000
  51.       ScaleWidth      =   840
  52.       TabIndex        =   5
  53.       Top             =   1230
  54.       Width           =   840
  55.       Begin VB.Label lblVolume 
  56.          BackStyle       =   0  'Transparent
  57.          Caption         =   "0"
  58.          ForeColor       =   &H00FFFFFF&
  59.          Height          =   270
  60.          Left            =   45
  61.          TabIndex        =   29
  62.          Top             =   420
  63.          Width           =   720
  64.       End
  65.       Begin VB.Label peak 
  66.          Appearance      =   0  'Flat
  67.          BackColor       =   &H80000005&
  68.          BorderStyle     =   1  'Fixed Single
  69.          ForeColor       =   &H80000008&
  70.          Height          =   105
  71.          Index           =   5
  72.          Left            =   15
  73.          TabIndex        =   27
  74.          Top             =   2220
  75.          Width           =   345
  76.       End
  77.       Begin VB.Label peak 
  78.          Appearance      =   0  'Flat
  79.          BackColor       =   &H80000005&
  80.          BorderStyle     =   1  'Fixed Single
  81.          ForeColor       =   &H80000008&
  82.          Height          =   105
  83.          Index           =   4
  84.          Left            =   15
  85.          TabIndex        =   26
  86.          Top             =   2340
  87.          Width           =   345
  88.       End
  89.       Begin VB.Label peak 
  90.          Appearance      =   0  'Flat
  91.          BackColor       =   &H80000005&
  92.          BorderStyle     =   1  'Fixed Single
  93.          ForeColor       =   &H80000008&
  94.          Height          =   105
  95.          Index           =   3
  96.          Left            =   15
  97.          TabIndex        =   25
  98.          Top             =   2460
  99.          Width           =   345
  100.       End
  101.       Begin VB.Label peak 
  102.          Appearance      =   0  'Flat
  103.          BackColor       =   &H80000005&
  104.          BorderStyle     =   1  'Fixed Single
  105.          ForeColor       =   &H80000008&
  106.          Height          =   105
  107.          Index           =   2
  108.          Left            =   15
  109.          TabIndex        =   24
  110.          Top             =   2580
  111.          Width           =   345
  112.       End
  113.       Begin VB.Label peak 
  114.          Appearance      =   0  'Flat
  115.          BackColor       =   &H80000005&
  116.          BorderStyle     =   1  'Fixed Single
  117.          ForeColor       =   &H80000008&
  118.          Height          =   105
  119.          Index           =   1
  120.          Left            =   15
  121.          TabIndex        =   23
  122.          Top             =   2700
  123.          Width           =   345
  124.       End
  125.       Begin VB.Label peak 
  126.          Appearance      =   0  'Flat
  127.          BackColor       =   &H80000005&
  128.          BorderStyle     =   1  'Fixed Single
  129.          ForeColor       =   &H80000008&
  130.          Height          =   105
  131.          Index           =   0
  132.          Left            =   15
  133.          TabIndex        =   22
  134.          Top             =   2820
  135.          Width           =   345
  136.       End
  137.       Begin VB.Label peak 
  138.          Appearance      =   0  'Flat
  139.          BackColor       =   &H80000005&
  140.          BorderStyle     =   1  'Fixed Single
  141.          ForeColor       =   &H80000008&
  142.          Height          =   105
  143.          Index           =   6
  144.          Left            =   15
  145.          TabIndex        =   21
  146.          Top             =   2100
  147.          Width           =   345
  148.       End
  149.       Begin VB.Label peak 
  150.          Appearance      =   0  'Flat
  151.          BackColor       =   &H80000005&
  152.          BorderStyle     =   1  'Fixed Single
  153.          ForeColor       =   &H80000008&
  154.          Height          =   105
  155.          Index           =   7
  156.          Left            =   15
  157.          TabIndex        =   20
  158.          Top             =   1980
  159.          Width           =   345
  160.       End
  161.       Begin VB.Label peak 
  162.          Appearance      =   0  'Flat
  163.          BackColor       =   &H80000005&
  164.          BorderStyle     =   1  'Fixed Single
  165.          ForeColor       =   &H80000008&
  166.          Height          =   105
  167.          Index           =   8
  168.          Left            =   15
  169.          TabIndex        =   19
  170.          Top             =   1860
  171.          Width           =   345
  172.       End
  173.       Begin VB.Label peak 
  174.          Appearance      =   0  'Flat
  175.          BackColor       =   &H80000005&
  176.          BorderStyle     =   1  'Fixed Single
  177.          ForeColor       =   &H80000008&
  178.          Height          =   105
  179.          Index           =   9
  180.          Left            =   15
  181.          TabIndex        =   18
  182.          Top             =   1740
  183.          Width           =   345
  184.       End
  185.       Begin VB.Label peak 
  186.          Appearance      =   0  'Flat
  187.          BackColor       =   &H80000005&
  188.          BorderStyle     =   1  'Fixed Single
  189.          ForeColor       =   &H80000008&
  190.          Height          =   105
  191.          Index           =   10
  192.          Left            =   15
  193.          TabIndex        =   17
  194.          Top             =   1620
  195.          Width           =   345
  196.       End
  197.       Begin VB.Label peak 
  198.          Appearance      =   0  'Flat
  199.          BackColor       =   &H80000005&
  200.          BorderStyle     =   1  'Fixed Single
  201.          ForeColor       =   &H80000008&
  202.          Height          =   105
  203.          Index           =   11
  204.          Left            =   375
  205.          TabIndex        =   16
  206.          Top             =   1620
  207.          Width           =   345
  208.       End
  209.       Begin VB.Label peak 
  210.          Appearance      =   0  'Flat
  211.          BackColor       =   &H80000005&
  212.          BorderStyle     =   1  'Fixed Single
  213.          ForeColor       =   &H80000008&
  214.          Height          =   105
  215.          Index           =   12
  216.          Left            =   375
  217.          TabIndex        =   15
  218.          Top             =   1740
  219.          Width           =   345
  220.       End
  221.       Begin VB.Label peak 
  222.          Appearance      =   0  'Flat
  223.          BackColor       =   &H80000005&
  224.          BorderStyle     =   1  'Fixed Single
  225.          ForeColor       =   &H80000008&
  226.          Height          =   105
  227.          Index           =   13
  228.          Left            =   375
  229.          TabIndex        =   14
  230.          Top             =   1860
  231.          Width           =   345
  232.       End
  233.       Begin VB.Label peak 
  234.          Appearance      =   0  'Flat
  235.          BackColor       =   &H80000005&
  236.          BorderStyle     =   1  'Fixed Single
  237.          ForeColor       =   &H80000008&
  238.          Height          =   105
  239.          Index           =   14
  240.          Left            =   375
  241.          TabIndex        =   13
  242.          Top             =   1980
  243.          Width           =   345
  244.       End
  245.       Begin VB.Label peak 
  246.          Appearance      =   0  'Flat
  247.          BackColor       =   &H80000005&
  248.          BorderStyle     =   1  'Fixed Single
  249.          ForeColor       =   &H80000008&
  250.          Height          =   105
  251.          Index           =   15
  252.          Left            =   375
  253.          TabIndex        =   12
  254.          Top             =   2100
  255.          Width           =   345
  256.       End
  257.       Begin VB.Label peak 
  258.          Appearance      =   0  'Flat
  259.          BackColor       =   &H80000005&
  260.          BorderStyle     =   1  'Fixed Single
  261.          ForeColor       =   &H80000008&
  262.          Height          =   105
  263.          Index           =   21
  264.          Left            =   375
  265.          TabIndex        =   11
  266.          Top             =   2820
  267.          Width           =   345
  268.       End
  269.       Begin VB.Label peak 
  270.          Appearance      =   0  'Flat
  271.          BackColor       =   &H80000005&
  272.          BorderStyle     =   1  'Fixed Single
  273.          ForeColor       =   &H80000008&
  274.          Height          =   105
  275.          Index           =   20
  276.          Left            =   375
  277.          TabIndex        =   10
  278.          Top             =   2700
  279.          Width           =   345
  280.       End
  281.       Begin VB.Label peak 
  282.          Appearance      =   0  'Flat
  283.          BackColor       =   &H80000005&
  284.          BorderStyle     =   1  'Fixed Single
  285.          ForeColor       =   &H80000008&
  286.          Height          =   105
  287.          Index           =   19
  288.          Left            =   375
  289.          TabIndex        =   9
  290.          Top             =   2580
  291.          Width           =   345
  292.       End
  293.       Begin VB.Label peak 
  294.          Appearance      =   0  'Flat
  295.          BackColor       =   &H80000005&
  296.          BorderStyle     =   1  'Fixed Single
  297.          ForeColor       =   &H80000008&
  298.          Height          =   105
  299.          Index           =   18
  300.          Left            =   375
  301.          TabIndex        =   8
  302.          Top             =   2460
  303.          Width           =   345
  304.       End
  305.       Begin VB.Label peak 
  306.          Appearance      =   0  'Flat
  307.          BackColor       =   &H80000005&
  308.          BorderStyle     =   1  'Fixed Single
  309.          ForeColor       =   &H80000008&
  310.          Height          =   105
  311.          Index           =   17
  312.          Left            =   375
  313.          TabIndex        =   7
  314.          Top             =   2340
  315.          Width           =   345
  316.       End
  317.       Begin VB.Label peak 
  318.          Appearance      =   0  'Flat
  319.          BackColor       =   &H80000005&
  320.          BorderStyle     =   1  'Fixed Single
  321.          ForeColor       =   &H80000008&
  322.          Height          =   105
  323.          Index           =   16
  324.          Left            =   375
  325.          TabIndex        =   6
  326.          Top             =   2220
  327.          Width           =   345
  328.       End
  329.    End
  330.    Begin ComctlLib.ProgressBar ProgressBar2 
  331.       Height          =   300
  332.       Left            =   1155
  333.       TabIndex        =   4
  334.       Top             =   120
  335.       Width           =   4845
  336.       _ExtentX        =   8546
  337.       _ExtentY        =   529
  338.       _Version        =   327682
  339.       Appearance      =   1
  340.    End
  341.    Begin ComctlLib.ProgressBar ProgressBar1 
  342.       Height          =   300
  343.       Left            =   1155
  344.       TabIndex        =   3
  345.       Top             =   600
  346.       Width           =   4845
  347.       _ExtentX        =   8546
  348.       _ExtentY        =   529
  349.       _Version        =   327682
  350.       Appearance      =   1
  351.    End
  352.    Begin VB.CheckBox Check1 
  353.       Caption         =   "get input"
  354.       Height          =   400
  355.       Left            =   3885
  356.       Style           =   1  'Graphical
  357.       TabIndex        =   2
  358.       Top             =   4365
  359.       Width           =   1000
  360.    End
  361.    Begin VB.Timer Timer1 
  362.       Interval        =   1
  363.       Left            =   225
  364.       Top             =   4350
  365.    End
  366.    Begin VB.Label Label4 
  367.       Caption         =   "Label4"
  368.       Height          =   765
  369.       Left            =   2760
  370.       TabIndex        =   31
  371.       Top             =   900
  372.       Width           =   2295
  373.    End
  374.    Begin VB.Label Label3 
  375.       Alignment       =   2  'Center
  376.       Caption         =   "The VU meter will only work if your sound card features a peak control line."
  377.       Height          =   300
  378.       Left            =   90
  379.       TabIndex        =   30
  380.       Top             =   4905
  381.       Width           =   5940
  382.       WordWrap        =   -1  'True
  383.    End
  384.    Begin VB.Label Label2 
  385.       BackStyle       =   0  'Transparent
  386.       Caption         =   "output level"
  387.       ForeColor       =   &H0080FFFF&
  388.       Height          =   300
  389.       Left            =   135
  390.       TabIndex        =   1
  391.       Top             =   165
  392.       Width           =   855
  393.    End
  394.    Begin VB.Label Label1 
  395.       BackStyle       =   0  'Transparent
  396.       Caption         =   "input level"
  397.       ForeColor       =   &H0080FFFF&
  398.       Height          =   300
  399.       Left            =   135
  400.       TabIndex        =   0
  401.       Top             =   630
  402.       Width           =   855
  403.    End
  404. Attribute VB_Name = "Form1"
  405. Attribute VB_GlobalNameSpace = False
  406. Attribute VB_Creatable = False
  407. Attribute VB_PredeclaredId = True
  408. Attribute VB_Exposed = False
  409. Option Explicit
  410. '_____________________________________________________________________________________
  411. ' Volume Level Control
  412. Dim hmixer As Long                  ' mixer handle
  413. Dim inputVolCtrl As MIXERCONTROL    ' waveout volume control
  414. Dim outputVolCtrl As MIXERCONTROL   ' microphone volume control
  415. Dim rc As Long                      ' return code
  416. Dim OK As Boolean                   ' boolean return code
  417. Dim mxcd As MIXERCONTROLDETAILS         ' control info
  418. Dim vol As MIXERCONTROLDETAILS_SIGNED   ' control's signed value
  419. Dim volume As Long                      ' volume value
  420. Dim volHmem As Long ' handle to volume memory
  421. Dim pic As Integer
  422. Dim pic1 As Integer
  423. Dim lines
  424. Dim ppos1
  425. '_____________________________________________________________________________________
  426. ' picture peak
  427. Dim Y As Single
  428. Dim pPos As Long
  429. Dim lasty As Single
  430. '_____________________________________________________________________________________
  431. ' for playing a wave-file
  432. Dim SoundFileName As String
  433. Dim i As Long
  434. Private Sub cmdPlay_Click()
  435. '_____________________________________________________________________________________
  436. ' IS THERE A SOUNDCARD INSTALLED???
  437.  SoundFileName$ = App.Path & "\" & "INTRO.WAV"
  438.  i = waveOutGetNumDevs()
  439.  If i > 0 Then
  440.  MsgBox " found a soundcard in your PC"
  441.  i& = sndPlaySound(SoundFileName$, Flags&)
  442.  Else
  443.  MsgBox "no soundcard found or installed?!"
  444.  Beep
  445.  End If
  446. End Sub
  447. Private Sub Form_Load()
  448. Form2.Line10.Y1 = (Form2.Line6.Y1 - Form2.Line7.Y1) / 2
  449. Form2.Line10.Y2 = (Form2.Line6.Y1 - Form2.Line7.Y1) / 2
  450. Form2.Line11.Y1 = (Form2.Line6.Y1 - Form2.Line7.Y1) / 2
  451. Form2.Line11.Y2 = (Form2.Line6.Y1 - Form2.Line7.Y1) / 2
  452. lines = Form2.Line11.Y1
  453. pic = 1
  454. pic1 = 1
  455. Form1.Hide
  456. StartInput
  457. Form2.Line1.X2 = Form2.Shape1.Left
  458. Form2.Line2.Y1 = Form2.Shape1.Top
  459. Form2.Show
  460. '_____________________________________________________________________________________
  461.    ' Open the mixer specified by DEVICEID
  462.    rc = mixerOpen(hmixer, DEVICEID, 0, 0, 0)
  463.    If ((MMSYSERR_NOERROR <> rc)) Then
  464.        MsgBox "Couldn't open the mixer."
  465.        Exit Sub
  466.    End If
  467.        
  468.    ' Get the input volume meter
  469.    OK = GetControl(hmixer, MIXERLINE_COMPONENTTYPE_DST_WAVEIN, MIXERCONTROL_CONTROLTYPE_PEAKMETER, inputVolCtrl)
  470.    If (OK <> True) Then
  471.        OK = GetControl(hmixer, MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE, MIXERCONTROL_CONTROLTYPE_PEAKMETER, inputVolCtrl)
  472.    End If
  473.    If (OK = True) Then
  474.       ProgressBar1.Min = 0
  475.       ProgressBar1.Max = inputVolCtrl.lMaximum
  476.    Else
  477.       ProgressBar1.Enabled = False
  478.       MsgBox "Couldn't get wavein meter"
  479.    End If
  480.        
  481.    ' Get the output volume meter
  482.    OK = GetControl(hmixer, MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT, MIXERCONTROL_CONTROLTYPE_PEAKMETER, outputVolCtrl)
  483.    If (OK = True) Then
  484.       ProgressBar2.Min = 0
  485.       ProgressBar2.Max = outputVolCtrl.lMaximum
  486.    Else
  487.       ProgressBar2.Enabled = False
  488.       MsgBox "Couldn't get waveout meter"
  489.    End If
  490.    ' Initialize mixercontrol structure
  491.    mxcd.cbStruct = Len(mxcd)
  492.    volHmem = GlobalAlloc(&H0, Len(volume))  ' Allocate a buffer for the volume value
  493.    mxcd.paDetails = GlobalLock(volHmem)
  494.    mxcd.cbDetails = Len(volume)
  495.    mxcd.cChannels = 1
  496. End Sub
  497. Private Sub Check1_Click()
  498.    If (Check1.Value = 1) Then
  499.       StartInput  ' Start receiving audio input
  500.    Else
  501.       StopInput   ' Stop receiving audio input
  502.    End If
  503. End Sub
  504. Private Sub Timer1_Timer()
  505. On Error Resume Next
  506. ' Process sound buffer if recording
  507.   If (fRecording) Then
  508.   For i = 0 To (NUM_BUFFERS - 1)
  509.   If inHdr(i).dwFlags And WHDR_DONE Then
  510.   rc = waveInAddBuffer(hWaveIn, inHdr(i), Len(inHdr(i)))
  511.   End If
  512.   Next
  513.   End If
  514. ' Get the current input level
  515.   If (ProgressBar1.Enabled = True) Then
  516.   mxcd.dwControlID = inputVolCtrl.dwControlID
  517.   mxcd.item = inputVolCtrl.cMultipleItems
  518.   rc = mixerGetControlDetails(hmixer, mxcd, MIXER_GETCONTROLDETAILSF_VALUE)
  519.   CopyStructFromPtr volume, mxcd.paDetails, Len(volume)
  520. If (volume < 0) Then
  521. volume = -volume
  522. End If
  523. lblVolume.Caption = volume
  524. Y = (volume / 32768) * 2000 + 500
  525. If pic = 1 Then
  526. Form2.Picture1.Line (pPos - 50, lasty)-(pPos, Y), RGB(volume / 200, volume / 100, volume / 25)
  527. Form2.Picture2.Line (pPos - 50, lasty)-(pPos, Y), RGB(volume / 200, volume / 100, volume / 25)
  528. End If
  529. If pic1 = 1 Then
  530. Form3.Picture1.Line (ppos1 - 50, lasty)-(ppos1, Y), RGB(volume / 200, volume / 100, volume / 25)
  531. If pic1 = 2 Then
  532. Form3.Picture2.Line (ppos1 - 50, lasty)-(ppos1, Y), RGB(volume / 200, volume / 100, volume / 25)
  533. Form3.Picture3.Line (ppos1 - 50, lasty)-(ppos1, Y), RGB(volume / 200, volume / 100, volume / 25)
  534. End If
  535. End If
  536. picPeakVol.Line (pPos - 50, lasty)-(pPos, Y), vbBlue
  537. lasty = Y
  538. pPos = pPos + 50
  539. ppos1 = ppos1 + 50
  540. If ppos1 >= 11835 Then
  541. If pic1 = 1 Then
  542. pic1 = 2
  543. GoTo 70
  544. End If
  545. If pic1 = 2 Then
  546. pic1 = 3
  547. GoTo 70
  548. End If
  549. If pic1 = 3 Then
  550. Form3.Picture1.Cls
  551. Form3.Picture2.Cls
  552. Form3.Picture3.Cls
  553. pic1 = 1
  554. GoTo 70
  555. End If
  556. End If
  557. If pPos >= 7215 Then               '5000 = picpeakvol.width
  558. picPeakVol.Cls
  559. If pic = 1 Then
  560. pic = 2
  561. GoTo 67
  562. Form2.Picture1.Cls
  563. Form2.Picture2.Cls
  564. pic = 1
  565. End If
  566. GoTo 67
  567. ppos1 = 0
  568. GoTo 40
  569. pPos = 0
  570. End If
  571. ProgressBar1.Value = volume
  572. peak(0).BackColor = vbBlack
  573. peak(1).BackColor = vbBlack
  574. peak(2).BackColor = vbBlack
  575. peak(3).BackColor = vbBlack
  576. peak(4).BackColor = vbBlack
  577. peak(5).BackColor = vbBlack
  578. peak(6).BackColor = vbBlack
  579. peak(7).BackColor = vbBlack
  580. peak(8).BackColor = vbBlack
  581. peak(9).BackColor = vbBlack
  582. peak(10).BackColor = vbBlack
  583. '---------------------------
  584. peak(21).BackColor = vbBlack
  585. peak(20).BackColor = vbBlack
  586. peak(19).BackColor = vbBlack
  587. peak(18).BackColor = vbBlack
  588. peak(17).BackColor = vbBlack
  589. peak(16).BackColor = vbBlack
  590. peak(15).BackColor = vbBlack
  591. peak(14).BackColor = vbBlack
  592. peak(13).BackColor = vbBlack
  593. peak(12).BackColor = vbBlack
  594. peak(11).BackColor = vbBlack
  595. If volume > 0 Then peak(0).BackColor = RGB(0, 150, 0)
  596. If volume > 0 Then peak(21).BackColor = RGB(0, 20, 100)
  597. If volume > 3200 Then peak(1).BackColor = RGB(0, 200, 0)
  598. If volume > 3200 Then peak(20).BackColor = RGB(5, 40, 110)
  599. If volume > 6400 Then peak(2).BackColor = RGB(0, 255, 0)
  600. If volume > 6400 Then peak(19).BackColor = RGB(10, 60, 120)
  601. If volume > 9600 Then peak(3).BackColor = RGB(255, 255, 0) 'gelb
  602. If volume > 9600 Then peak(18).BackColor = RGB(15, 80, 130)
  603. If volume > 12800 Then peak(4).BackColor = RGB(255, 255, 50)
  604. If volume > 12800 Then peak(17).BackColor = RGB(20, 100, 140)
  605. If volume > 16000 Then peak(5).BackColor = RGB(255, 255, 100)
  606. If volume > 16000 Then peak(16).BackColor = RGB(25, 120, 150)
  607. If volume > 19200 Then peak(6).BackColor = RGB(255, 255, 150)
  608. If volume > 19200 Then peak(15).BackColor = RGB(30, 140, 160)
  609. If volume > 22400 Then peak(7).BackColor = RGB(255, 255, 200)
  610. If volume > 22400 Then peak(14).BackColor = RGB(40, 160, 180)
  611. If volume > 25600 Then peak(8).BackColor = RGB(255, 255, 215) 'rot
  612. If volume > 25600 Then peak(13).BackColor = RGB(50, 180, 190)
  613. If volume > 28800 Then peak(9).BackColor = RGB(255, 255, 230)
  614. If volume > 28800 Then peak(12).BackColor = RGB(60, 200, 200)
  615. If volume > 32000 Then peak(10).BackColor = RGB(255, 255, 245)
  616. If volume > 32000 Then peak(11).BackColor = RGB(70, 220, 210)
  617.   Form2.Line4.X2 = (volume / 10) / 4 * 3 + Form2.Line4.X1 + volume / 100
  618.   Form2.Line4.Y2 = (volume / 10) / 4 * 3 + Form2.Line4.Y1 + volume / 100
  619. If XSens = True Then
  620. Form2.Line4.X2 = (volume / 5) / 4 * 3 + Form2.Line4.X1 + volume / 50
  621. Form2.Line4.Y2 = (volume / 5) / 4 * 3 + Form2.Line4.Y1 + volume / 50
  622. Form2.Shape1.Height = volume / 5
  623. Form2.Shape1.Width = volume / 5
  624. 'If volume / 5 > Form2.Line7.Y1 Then Form2.Shape2.Top = Form2.Line7.Y1 - Form2.Shape2.Height
  625. Form2.Shape2.Top = (volume / 5) + 100
  626. Form2.Shape3.Width = volume / 2.5
  627. GoTo 9
  628. End If
  629. Form2.Line4.X2 = (volume / 10) / 4 * 3 + Form2.Line4.X1 + volume / 100
  630. Form2.Line4.Y2 = (volume / 10) / 4 * 3 + Form2.Line4.Y1 + volume / 100
  631. Form2.Shape1.Height = volume / 10
  632. Form2.Shape1.Width = volume / 10
  633. Form2.Shape2.Top = (volume / 10) + 100
  634. Form2.Shape3.Width = volume / 5
  635. Form2.Line11.Y1 = (volume / 20) + lines
  636. Form2.Line11.Y2 = (volume / 20) + lines
  637. Form2.Line10.Y1 = ((volume / 20) * (-0.5) * 1.5) + lines
  638. Form2.Line10.Y2 = ((volume / 20) * (-0.5) * 1.5) + lines
  639. Form2.Line20.X1 = Form2.Line10.X1
  640. Form2.Line20.Y1 = Form2.Line10.Y1
  641. Form2.Line20.X2 = Form2.Line11.X2
  642. Form2.Line20.Y2 = Form2.Line11.Y2
  643. Form2.Line12.X1 = Form2.Line11.X1
  644. Form2.Line12.Y1 = Form2.Line11.Y1
  645. Form2.Line12.X2 = Form2.Line10.X2
  646. Form2.Line12.Y2 = Form2.Line10.Y2
  647. If Form2.Shape1.Height >= Form2.Line8.Y2 Then Form2.TooSens
  648. Form2.Shape1.BorderColor = RGB(volume / 200, volume / 100, volume / 25)
  649. Form2.Line1.BorderColor = Form2.Shape1.BorderColor
  650. Form2.Line2.BorderColor = Form2.Shape1.BorderColor
  651. Form2.Line4.BorderColor = Form2.Shape1.BorderColor
  652. Form2.Shape2.BorderColor = Form2.Shape1.BorderColor
  653. Form2.Line10.BorderColor = Form2.Shape1.BorderColor
  654. Form2.Line11.BorderColor = Form2.Shape1.BorderColor
  655. Form2.Line12.BorderColor = Form2.Shape1.BorderColor
  656. Form2.Line20.BorderColor = Form2.Shape1.BorderColor
  657. Form2.Shape3.BackColor = Form2.Shape1.BorderColor
  658.   Form2.Line1.X1 = (Form2.Shape1.Width) / 2 + Form2.Line1.X2
  659.   Form2.Line2.Y2 = (Form2.Shape1.Height) / 2 + Form2.Line2.Y1
  660.   Form2.Line3.X2 = Form2.Shape1.Width / 4 + Form2.Line3.X1
  661.   Form2.Line3.Y2 = Form2.Shape1.Height / 4 + Form2.Line3.Y1
  662.   vol1 = volume
  663.   End If
  664. ' Get the current output level
  665.   If (ProgressBar2.Enabled = True) Then
  666.   mxcd.dwControlID = outputVolCtrl.dwControlID
  667.   mxcd.item = outputVolCtrl.cMultipleItems
  668.   rc = mixerGetControlDetails(hmixer, mxcd, MIXER_GETCONTROLDETAILSF_VALUE)
  669.   CopyStructFromPtr volume, mxcd.paDetails, Len(volume)
  670.   If (volume < 0) Then volume = -volume
  671.   lblVolume.Caption = volume
  672. Y = (volume / 32768) * 2000 + 500
  673. If pic1 = 1 Then
  674. Form3.Picture1.Line (ppos1 - 50, lasty)-(ppos1, Y), vbBlue
  675. If pic1 = 2 Then
  676. Form3.Picture2.Line (ppos1 - 50, lasty)-(ppos1, Y), vbBlue
  677. Form3.Picture3.Line (ppos1 - 50, lasty)-(ppos1, Y), vbBlue
  678. End If
  679. End If
  680. If pic = 1 Then
  681. Form2.Picture1.Line (pPos - 50, lasty)-(pPos, Y), vbBlue
  682. Form2.Picture2.Line (pPos - 50, lasty)-(pPos, Y), vbBlue
  683. End If
  684. picPeakVol.Line (pPos - 50, lasty)-(pPos, Y), vbBlue
  685. lasty = Y
  686. pPos = pPos + 50
  687. ppos1 = ppos1 + 50
  688. If ppos1 >= 11835 Then
  689. If pic1 = 1 Then
  690. pic1 = 2
  691. GoTo 90
  692. End If
  693. If pic1 = 2 Then
  694. pic1 = 3
  695. GoTo 90
  696. End If
  697. If pic1 = 3 Then
  698. Form3.Picture1.Cls
  699. Form3.Picture2.Cls
  700. Form3.Picture3.Cls
  701. pic1 = 1
  702. GoTo 90
  703. End If
  704. End If
  705. If pPos >= 7215 Then               '5000 = picpeakvol.width
  706. picPeakVol.Cls
  707. If pic = 1 Then
  708. pic = 2
  709. GoTo 68
  710. Form2.Picture1.Cls
  711. Form2.Picture2.Cls
  712. pic = 1
  713. End If
  714. GoTo 68
  715. ppos1 = 0
  716. GoTo 30
  717. pPos = 0
  718. End If
  719.   ProgressBar2.Value = volume
  720. If volume > 0 Then peak(0).BackColor = RGB(0, 150, 0)
  721. If volume > 0 Then peak(21).BackColor = RGB(0, 20, 100)
  722. If volume > 3200 Then peak(1).BackColor = RGB(0, 200, 0)
  723. If volume > 3200 Then peak(20).BackColor = RGB(5, 40, 110)
  724. If volume > 6400 Then peak(2).BackColor = RGB(0, 255, 0)
  725. If volume > 6400 Then peak(19).BackColor = RGB(10, 60, 120)
  726. If volume > 9600 Then peak(3).BackColor = RGB(255, 255, 0) 'gelb
  727. If volume > 9600 Then peak(18).BackColor = RGB(15, 80, 130)
  728. If volume > 12800 Then peak(4).BackColor = RGB(255, 255, 50)
  729. If volume > 12800 Then peak(17).BackColor = RGB(20, 100, 140)
  730. If volume > 16000 Then peak(5).BackColor = RGB(255, 255, 100)
  731. If volume > 16000 Then peak(16).BackColor = RGB(25, 120, 150)
  732. If volume > 19200 Then peak(6).BackColor = RGB(255, 255, 150)
  733. If volume > 19200 Then peak(15).BackColor = RGB(30, 140, 160)
  734. If volume > 22400 Then peak(7).BackColor = RGB(255, 255, 200)
  735. If volume > 22400 Then peak(14).BackColor = RGB(40, 160, 180)
  736. If volume > 25600 Then peak(8).BackColor = RGB(255, 255, 215) 'rot
  737. If volume > 25600 Then peak(13).BackColor = RGB(50, 180, 190)
  738. If volume > 28800 Then peak(9).BackColor = RGB(255, 255, 230)
  739. If volume > 28800 Then peak(12).BackColor = RGB(60, 200, 200)
  740. If volume > 32000 Then peak(10).BackColor = RGB(255, 255, 245)
  741. If volume > 32000 Then peak(11).BackColor = RGB(70, 220, 210)
  742. End If
  743. End Sub
  744. Private Sub Form_Unload(Cancel As Integer)
  745.    If (fRecording = True) Then
  746.        StopInput
  747.    End If
  748.    GlobalFree volHmem
  749. End Sub
  750. Private Sub Timer2_Timer()
  751.   If Form2.Label1.Caption = "Label 1" Then
  752.   Max = vol1 / 1000
  753.   Min = vol1 / 1000
  754.   End If
  755.   Form2.Label1.Caption = "Output Volume: " & vol1 / 1000
  756. End Sub
  757.