c++ source and ocx for winamp dsp/vis plugins here

Started by RevG,

lagarto

"EXCUSE" didn't translate for English. :P

Revg, don't know the reason, but the ADAPT-X worked again. I am awaiting the help in relation to execution of two audio files. When I only execute a, it works perfect, but when I execute two audio, he/she begins to appear some defects. But once, thank you very much.

lagarto

:'( Please help me. I still didn't get to play two audio files with StreamProc.  :'(


Function STREAMPROC(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long
     
     Dim decbuff(decblock * 2) As Byte
     Dim tempbuffer() As Byte
     ReDim tempbuffer(length) As Byte
     Dim a As Long
     Dim c As Long
     Dim nBufferPos As Long
     nBufferPos = 0
     
     c = length
     
     If exlen Then
        a = 0
        If (c < exlen) Then
            a = c
        Else
            a = exlen
        End If
         
        Call CopyMemory(tempbuffer(nBufferPos), excess(0), a)
        Call CopyMemory(excess(0), excess(a), exlen)
        nBufferPos = nBufferPos + a
        c = c - a
    End If
   
    Do While (c)
        a = BASS_ChannelGetData(m_hStream, decbuff(0), decblock)
        If a < 0 Then
            Exit Do
        End If
       
       If frmMain.started Then
       a = 4 * frmMain.ActiveVis1.ModifySamples(VarPtr(decbuff(0)), a / 4, 16, 2, 44100)
       End If
       
        If (a > c) Then
            Call CopyMemory(tempbuffer(nBufferPos), decbuff(0), c)
            exlen = a - c
            Call CopyMemory(excess(0), decbuff(c), exlen)
            c = 0
        Else
            Call CopyMemory(tempbuffer(nBufferPos), decbuff(0), a)
            nBufferPos = nBufferPos + a
            c = c - a
        End If
    Loop
   
    Call CopyMemory(ByVal buffer, tempbuffer(0), length - c)
   
    STREAMPROC = length - c
End Function