⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 samples.frm

📁 不错的一个VB菜单设计 界面和功能都不错
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSamples 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Draw waves"
   ClientHeight    =   3045
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7575
   Icon            =   "samples.frx":0000
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3045
   ScaleWidth      =   7575
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.Label lblChannels 
      AutoSize        =   -1  'True
      Caption         =   "x"
      Height          =   195
      Left            =   90
      TabIndex        =   0
      Top             =   60
      Width           =   75
   End
End
Attribute VB_Name = "frmSamples"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public objSamples As flwmmedia.FWSamples

Private Sub Form_Activate()
  objSamples.CurrentSample = 0
  Call DrawWaves
End Sub


Public Sub DrawWaves()
  Dim lngInd        As Long
  Dim dblLeftY      As Long
  Dim dblRightY     As Long
  Dim dblLastX      As Long
  Dim dblLastLeftY  As Long
  Dim dblLastRightY As Long
  Dim lngAmplitude  As Long
  Dim dblLeft       As Double
  Dim dblRight      As Double
  Dim dblFactor     As Double
  Dim dblStep       As Double
   
  dblFactor = (objSamples.NumSamples - objSamples.CurrentSample) / Me.Width
  dblStep = IIf(dblFactor < 1, 1 / dblFactor, 1)
   
  If objSamples.Stereo Then
    lblChannels.Caption = "Stereo"
    
    lngAmplitude = Me.Height * 0.25
       
    For lngInd = 0 To Me.Width Step dblStep
      objSamples.CurrentSample = dblFactor * lngInd
      Call objSamples.GetSample(dblLeft, dblRight)
      
      dblRightY = CLng(dblRight * lngAmplitude)
      dblLeftY = CLng(dblLeft * lngAmplitude)
      Line (dblLastX, lngAmplitude + dblLastLeftY)-(lngInd, dblLeftY + lngAmplitude)
      Line (dblLastX, lngAmplitude * 3 + dblLastRightY)-(lngInd, dblRightY + lngAmplitude * 3)
      dblLastLeftY = dblLeftY
      dblLastRightY = dblRightY
      dblLastX = lngInd
    Next
  Else
    lblChannels.Caption = "Mono"
    
    lngAmplitude = Me.Height * 0.5
      
    For lngInd = 0 To Me.Width Step dblStep
      objSamples.CurrentSample = dblFactor * lngInd
      Call objSamples.GetSample(dblLeft, dblRight)
      
      dblLeftY = CLng(dblLeft * lngAmplitude)
      Line (dblLastX, lngAmplitude + dblLastLeftY)-(lngInd, dblLeftY + lngAmplitude)
      dblLastLeftY = dblLeftY
      dblLastX = lngInd
    Next
  End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -