VB.Net - FreeStream Desktop (Equalizer)

Поділитися
Вставка
  • Опубліковано 31 жов 2024

КОМЕНТАРІ • 3

  • @basilis_akridas
    @basilis_akridas Рік тому

    Hi, perfect job, tell me, I can have this code?

    • @mcompsoftware
      @mcompsoftware  Рік тому

      gTrackbar: www.codeproject.com/Articles/35104/gTrackBar-A-Custom-TrackBar-UserControl-VB-NET
      Bass.Net.dll: drive.google.com/file/d/1cTbQtxDTmY1FJ8CekZfhbBvKbdJv4z21/view?usp=sharing
      pnlEq -> Panel
      eqPic -> Button
      Imports Un4seen.Bass
      Imports Un4seen.Bass.Bass
      Imports gTrackBar
      Public Class Equalizer
      Public peq As BASS_DX8_PARAMEQ
      Public fxeq As Integer()
      Public strm As Integer
      Public Function BASS_ChannelSetFXEQ(ByVal handle As Integer, ByVal fxeq As Integer(), ByVal peq As BASS_DX8_PARAMEQ, ByVal count As Integer) As Boolean
      Dim retValue As Boolean
      Try
      For i As Integer = 0 To count
      fxeq(i) = Bass.BASS_ChannelSetFX(handle, BASSFXType.BASS_FX_DX8_PARAMEQ, 0)
      peq.Preset_Default()
      retValue = Bass.BASS_FXSetParameters(fxeq(i), peq)
      Next i
      Return retValue
      Catch ex As Exception
      MessageBox.Show(ex.Message, "HIBA!", MessageBoxButtons.OK, MessageBoxIcon.Error)
      End Try
      Return False
      End Function
      Public Function BASS_ChannelSetVolumeFXEQ(ByVal fxeq As Integer(), ByVal peq As BASS_DX8_PARAMEQ, ByVal band As Integer, ByVal center As Integer, ByVal gain As Single) As Boolean
      Try
      If Bass.BASS_FXGetParameters(fxeq(band), peq) Then
      peq.fBandwidth = 18.0!
      peq.fCenter = center
      peq.fGain = gain
      Return Bass.BASS_FXSetParameters(fxeq(band), peq)
      End If
      Catch ex As Exception
      MessageBox.Show(ex.Message, "HIBA!", MessageBoxButtons.OK, MessageBoxIcon.Error)
      End Try
      Return False
      End Function
      Public Function BASS_ChannelRemoveFXEQ(ByVal handle As Integer, ByVal fxeq As Integer(), ByVal count As Integer) As Boolean
      Dim retValue As Boolean
      Try
      For i As Integer = 0 To count
      retValue = Bass.BASS_ChannelRemoveFX(handle, fxeq(i))
      Next i
      Return retValue
      Catch ex As Exception
      MessageBox.Show(ex.Message, "HIBA!", MessageBoxButtons.OK, MessageBoxIcon.Error)
      End Try
      Return False
      End Function
      Private Sub GTrackBar1_Scroll(sender As Object, e As EventArgs) Handles GTrackBar1.ValueChanged
      BASS_ChannelSetVolumeFXEQ(fxeq, peq, 0, 80, GTrackBar1.Value)
      End Sub
      Private Sub GTrackBar2_Scroll(sender As Object, e As EventArgs) Handles GTrackBar2.ValueChanged
      BASS_ChannelSetVolumeFXEQ(fxeq, peq, 1, 120, GTrackBar2.Value)
      End Sub
      Private Sub GTrackBar3_Scroll(sender As Object, e As EventArgs) Handles GTrackBar3.ValueChanged
      BASS_ChannelSetVolumeFXEQ(fxeq, peq, 2, 250, GTrackBar3.Value)
      End Sub
      Private Sub GTrackBar4_Scroll(sender As Object, e As EventArgs) Handles GTrackBar4.ValueChanged
      BASS_ChannelSetVolumeFXEQ(fxeq, peq, 3, 500, GTrackBar4.Value)
      End Sub
      Private Sub GTrackBar5_Scroll(sender As Object, e As EventArgs) Handles GTrackBar5.ValueChanged
      BASS_ChannelSetVolumeFXEQ(fxeq, peq, 4, 1000, GTrackBar5.Value)
      End Sub
      Private Sub GTrackBar6_Scroll(sender As Object, e As EventArgs) Handles GTrackBar6.ValueChanged
      BASS_ChannelSetVolumeFXEQ(fxeq, peq, 5, 1800, GTrackBar6.Value)
      End Sub
      Private Sub GTrackBar7_Scroll(sender As Object, e As EventArgs) Handles GTrackBar7.ValueChanged
      BASS_ChannelSetVolumeFXEQ(fxeq, peq, 6, 3500, GTrackBar7.Value)
      End Sub
      Private Sub GTrackBar8_Scroll(sender As Object, e As EventArgs) Handles GTrackBar8.ValueChanged
      BASS_ChannelSetVolumeFXEQ(fxeq, peq, 7, 7000, GTrackBar8.Value)
      End Sub
      Private Sub GTrackBar9_Scroll(sender As Object, e As EventArgs) Handles GTrackBar9.ValueChanged
      BASS_ChannelSetVolumeFXEQ(fxeq, peq, 8, 10000, GTrackBar9.Value)
      End Sub
      Private Sub GTrackBar10_Scroll(sender As Object, e As EventArgs) Handles GTrackBar10.ValueChanged
      BASS_ChannelSetVolumeFXEQ(fxeq, peq, 9, 14000, GTrackBar10.Value)
      End Sub
      Private Sub eqPic_Click(sender As Object, e As EventArgs) Handles eqPic.Click
      Try
      If CBool(strm) Then
      If pnlEq.Visible = True Then
      pnlEq.Visible = False
      BASS_ChannelRemoveFXEQ(strm, fxeq, 9)
      GTrackBar1.Value = 0
      GTrackBar2.Value = 0
      GTrackBar3.Value = 0
      GTrackBar4.Value = 0
      GTrackBar5.Value = 0
      GTrackBar6.Value = 0
      GTrackBar7.Value = 0
      GTrackBar8.Value = 0
      GTrackBar9.Value = 0
      GTrackBar10.Value = 0
      Else
      pnlEq.Visible = True
      BASS_ChannelSetFXEQ(strm, fxeq, peq, 9)
      GTrackBar1_Scroll(sender, e)
      GTrackBar2_Scroll(sender, e)
      GTrackBar3_Scroll(sender, e)
      GTrackBar4_Scroll(sender, e)
      GTrackBar5_Scroll(sender, e)
      GTrackBar6_Scroll(sender, e)
      GTrackBar7_Scroll(sender, e)
      GTrackBar8_Scroll(sender, e)
      GTrackBar9_Scroll(sender, e)
      GTrackBar10_Scroll(sender, e)
      End If
      Else
      MsgBox("Indítsa el a lejátszást az equalizer használatához!", MsgBoxStyle.Exclamation, "Üzenet fejléc")
      End If
      Catch ex As Exception
      MessageBox.Show(ex.Message, "HIBA!", MessageBoxButtons.OK, MessageBoxIcon.Error)
      End Try
      End Sub
      End Class

    • @basilis_akridas
      @basilis_akridas Рік тому

      @@mcompsoftware Only Respect bro. 'll try it tomorrow and see what I can do. Again, many thanks