📄 biquadconfig.frm
字号:
On Error Resume Next
tempedit1.Visible = False
eqconfig.TextMatrix(eqconfig.RowSel, eqconfig.ColSel) = filertype.Text
filertype.Visible = False
For j = 2 To 5
eqconfig.Col = j
eqconfig.Row = eqconfig.RowSel
eqconfig.CellBackColor = &HFFFFFF
eqconfig.ForeColor = &H0
Next
Select Case filertype.Text
Case "BANDPASS"
eqconfig.Col = 4
eqconfig.Row = eqconfig.RowSel
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
eqconfig.Col = 5
eqconfig.Row = eqconfig.RowSel
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
Case "SO_ALLPASS"
eqconfig.Col = 3
eqconfig.Row = eqconfig.RowSel
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
eqconfig.Col = 5
eqconfig.Row = eqconfig.RowSel
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
Case "SO_EQ"
eqconfig.Col = 3
eqconfig.Row = eqconfig.RowSel
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
Case "SO_BUTT_LOWPASS", "SO_BUTT_HIGPASS", "NOTCH"
For j = 3 To 5
eqconfig.Col = j
eqconfig.Row = eqconfig.RowSel
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
Next
Case "SO_SHELF_BASS", "SO_SHELF_TREB", "LOW_VARIQ", "HIGH_VARIQ"
For j = 3 To 4
eqconfig.Col = j
eqconfig.Row = eqconfig.RowSel
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
Next
Case "LOW_PLATEAU", "HIGH_PLATEAU"
eqconfig.Col = 4
eqconfig.Row = eqconfig.RowSel
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
Case "BYPASS"
For j = 2 To 5
eqconfig.Col = j
eqconfig.Row = eqconfig.RowSel
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
eqconfig.TextMatrix(i, j) = 1
Next
' Case "BANDPASS"
'
' For j = 4 To 5
' eqconfig.Col = j
' eqconfig.Row = eqconfig.RowSel
' eqconfig.CellBackColor = &HE44500
' eqconfig.ForeColor = &HE44500
' Next
End Select
End Sub
Private Sub Flash_Click()
On Error Resume Next
Unload form3
Command1_Click
form3.Visible = True
End Sub
Private Sub Form_Click()
On Error Resume Next
volumeSlider.Visible = False
step.Visible = False
tempedit1.Visible = False
filertype.Visible = False
tempedit3.Visible = False
tempedit2.Visible = False
End Sub
Private Sub Form_Load()
On Error Resume Next
compressionform_2ohm.Show
compressionform_2ohm.Visible = False
Form1.Show
Open App.Path + "\default.flash" For Binary As #1 ' Open file.
Call loadparameter
Open App.Path + "\default.flash" For Binary As #1 ' Open file.
pointer = compression_pointer * 2 + 1
For j = compression_pointer To compression_pointer + 12 + 3
Get #1, pointer, intworkingbuf(j)
pointer = pointer + 2
Next j
Close #1
Open App.Path + "\portconfig.ini" For Binary As #1
Dim data As Byte
Get #1, 1, data
Form2.COMt.Text = data
Close #1
End Sub
Private Sub loadparameter()
On Error Resume Next
Dim i As Integer
Dim j As Integer
Dim s As String
Dim data As Integer
pointer = 1
Dim filtertype
filtertype = Array("FO_ALLPASS", "SO_ALLPASS", "SO_EQ", "FO_BUTT_LOWPASS", "FO_BUTT_HIGPASS", "SO_BUTT_LOWPASS", "SO_BUTT_HIGPASS", "SO_LR_LOWPASS", "SO_LR_HIGPASS", "FO_SHELF_BASS", "FO_SHELF_TREB", "SO_SHELF_BASS", "SO_SHELF_TREB", "LOW_PLATEAU", "HIGH_PLATEAU", "LOW_VARIQ", "HIGH_VARIQ", "NOTCH", "BANDPASS", "SHELF", "BYPASS")
For i = 1 To 7
'If ((i Mod 7) <> 0) Then
For j = 1 To 5
Get #1, pointer, data
pointer = pointer + 2
eqconfig.TextMatrix(i, j) = data
eqconfig.Col = j
eqconfig.Row = i
eqconfig.CellBackColor = &H80000000
' eqconfig.ForeColor = &H80000008
Select Case filtertype(eqconfig.TextMatrix(i, 1))
Case "SO_ALLPASS"
If ((j = 3) Or (j = 5)) Then
eqconfig.Col = j
eqconfig.Row = i
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
eqconfig.TextMatrix(i, j) = 1
End If
Case "SO_EQ"
If (j = 3) Then
eqconfig.Col = j
eqconfig.Row = i
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
eqconfig.TextMatrix(i, j) = 1
End If
Case "SO_BUTT_LOWPASS", "SO_BUTT_HIGPASS", "NOTCH"
If j > 2 Then
eqconfig.Col = j
eqconfig.Row = i
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
eqconfig.TextMatrix(i, j) = 1
End If
Case "SO_SHELF_BASS", "SO_SHELF_TREB", "LOW_VARIQ", "HIGH_VARIQ"
If ((j = 3) Or (j = 4)) Then
eqconfig.Col = j
eqconfig.Row = i
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
eqconfig.TextMatrix(i, j) = 1
End If
Case "BANDPASS"
If (j > 3) Then
eqconfig.Col = j
eqconfig.Row = i
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
eqconfig.TextMatrix(i, j) = 1
End If
Case "LOW_PLATEAU", "HIGH_PLATEAU"
If (j = 4) Then
eqconfig.Col = j
eqconfig.Row = i
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
eqconfig.TextMatrix(i, j) = 1
End If
Case "BYPASS"
If (j > 1) Then
eqconfig.Col = j
eqconfig.Row = i
eqconfig.CellBackColor = &HE44500
eqconfig.ForeColor = &HE44500
eqconfig.TextMatrix(i, j) = 1
End If
End Select
Next j
eqconfig.TextMatrix(i, 1) = filtertype(eqconfig.TextMatrix(i, 1))
'End If
'If i < 26 Then
' eqconfig.TextMatrix(i, 0) = "step" + Str(i)
'Else
' eqconfig.TextMatrix(i, 0) = "step" + Str((i - 25))
'End If
Next i
pointer = ucMaxVulumeAndStep * 2 + 1
Get #1, pointer, data
maxvolume.Text = data
pointer = inputgain_pointer * 2 + 1
Get #1, pointer, data
inputgain.Text = data
pointer = ucMaxVulumeAndStep * 2 + 3
Get #1, pointer, data
volumestep.Text = data
pointer = system_mode * 2 + 1
Get #1, pointer, data
Sys_User.Value = data
pointer = autothreshold_pointer * 2 + 1
Get #1, pointer, data
autothreshold.Text = data
pointer = compression_pointer * 2 + 1
For j = compression_pointer To compression_pointer + 12 + 3
Get #1, pointer, intworkingbuf(j)
pointer = pointer + 2
Next j
Close #1
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub GetSampleWave_Click()
Dim bytrec() As Byte
Dim i As Long
MousePointer = vbHourglass
Form_Load1
For i = 0 To 131072
workingbuf(i) = 0
Next i
MSComm1.InBufferCount = 0 'clear buffer
For i = 0 To 7
bb(0) = &H8D 'write to flash
MSComm1.Output = bb
Next i
wbptr = 0 'receive pointer
'readfromflashbtn = True
readsamplewavebtn = True
Timer1.Interval = 8500
Timer1.Enabled = True
End Sub
Private Sub help1_Click()
HelpFunction Me.hwnd, HELP_INDEX, ""
End Sub
Private Sub Image1_Click()
On Error Resume Next
Form4.Show
With Form4.WebBrowser1
.Navigate "http://www.bashaudio.com"
End With
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
Image1.MousePointer = 14
End Sub
Private Sub Load_Click()
On Error Resume Next
Dim s As String
With dlgopen: .FileName = ""
.DialogTitle = "Select a file to load"
.CancelError = False
.Filter = "biquad(*.flash)|*.flash"
.ShowOpen
If Len(.FileName) = 0 Then
Exit Sub
End If
s = .FileName
End With
Open s For Binary As #1 ' Open file.
Call loadparameter
Open s For Binary As #1 ' Open file.
pointer = 1
'For i = 1 To 700
'Get #1, pointer, intworkingbuf(i)
'pointer = pointer + 2
''Debug.Print i, intworkingbuf(i)
'Next i
pointer = compression_pointer * 2 + 1
For j = compression_pointer To compression_pointer + 12 + 3
Get #1, pointer, intworkingbuf(j)
pointer = pointer + 2
Next j
Close #1
compressionform_2ohm.Show
compressionform_2ohm.Visible = False
End Sub
Private Sub MSComm1_OnComm()
On Error Resume Next
Select Case MSComm1.CommEvent
Case comEvReceive
Dim bytrec() As Byte
Dim i As Integer
bytrec() = MSComm1.Input
checksum = (checksum Mod 65536)
If (((checksum And &HFF) = bytrec(1)) And ((((checksum And &HFF00) / 256) And &HFF) = bytrec(0))) Then
Timer1.Enabled = False
writetoflash.Enabled = True
readflash.Enabled = True
MousePointer = 1
Form_Unload1 (0)
MsgBox ("The data is sent successfully.")
End If
End Select
End Sub
'Private Sub MSComm1_OnComm()
'
''on error Resume Next
''Select Case MSComm1.CommEvent
'' Case comEvReceive
'' Dim bytrec() As Byte
'' Dim i As Integer
'' Dim temp As String
' ' MySecond = Second(Time)
''t:
''MySecond1 = Second(Time)
''If Abs(MySecond1 - MySecond) < 4 Then GoTo t
' If MSComm1.InBufferCount = 953 Then
' MsgBox ("Transmit finished")
' End If
'' Else
'' MsgBox ("Transmit failed! Turn the power off. Try again!")
'' End If
'' Timer1.Enabled = False
' writetoflash.Enabled = True
' readflash.Enabled = True
' FlashCopy.Enabled = True
' MousePointer = 1
'' Form_Unload1 (0)
'
'' temp = Hex(wbptr) + "----"
'' bytrec() = MSComm1.Input
''
'' If MSComm1.InBufferCount > 0 Then
'' For i = 0 To 7 'MSComm1.InBufferCount - 1
'' temp = temp + Hex(bytrec(i)) + " "
'' 'List1.AddItem Hex(bytrec(i))
'' 'List1.ListIndex = List1.ListCount - 1
'' workingbuf(wbptr) = bytrec(i)
'' wbptr = wbptr + 1
'' 'Debug.Print wbptr, Hex(bytrec(i))
'' If readsamplewavebtn = True Then
'' If wbptr > 4096 Then
'' 'wbptr = 0
'' Exit Sub
'' End If
'' Else
''
'' If wbptr > flashsize - 1 Then wbptr = 0 '4095
'' End If
'' Next i
''' List1.AddItem temp
''' List1.ListIndex = List1.ListCount - 1
'' End If
'' End Select
'
'End Sub
Private Sub Portsetting_Click()
Dim s As String
s = form3.MSComm1.Settings
Dim i As Byte
' Form2.COMt.Text = Hex$(form3.MSComm1.CommPort) + " - COM" + Hex$(form3.MSComm1.CommPort)
For i = 1 To 10
If Mid$(s, i, 1) = "," Then
i = i - 1
Exit For
End If
Next i
Form2.baud.Text = Mid$(s, 1, i) 'baud
Form2.DataBit.Text = Mid$(s, i + 4, 1)
Form2.Parity.Text = Mid$(s, i + 2, 1)
Form2.StopBit.Text = Mid$(s, i + 6, 1)
Select Case Form2.Parity.Text
Case "e"
Form2.Parity.Text = "Even"
Case "m"
Form2.Parity.Text = "Mark"
Case "n"
Form2.Parity.Text = "None"
Case "o"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -