VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Record"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
    Public Type BASS_RECORDINFO
        Flags As Long         ' device capabilities (DSCCAPS_xxx flags)
        formats As Long       ' supported standard formats (WAVE_FORMAT_xxx flags)
        inputs As Long        ' number of inputs
        singlein As Long      ' BASSTRUE = only 1 input can be set at a time
        Freq As Long          ' current input rate (Vista/OSX only)
    End Type
    
    'Type BASS_DEVICEINFO
    '    name As Long          ' description
    '   driver As Long        ' driver
    '    flags As Long
    'End Type
    
Public Enum BassInputFlags
BASS_INPUT_OFF = &H10000
BASS_INPUT_ON = &H20000
BASS_INPUT_TYPE_MASK = &HFF000000
BASS_INPUT_TYPE_UNDEF = &H0
BASS_INPUT_TYPE_DIGITAL = &H1000000
BASS_INPUT_TYPE_LINE = &H2000000
BASS_INPUT_TYPE_MIC = &H3000000
BASS_INPUT_TYPE_SYNTH = &H4000000
BASS_INPUT_TYPE_CD = &H5000000
BASS_INPUT_TYPE_PHONE = &H6000000
BASS_INPUT_TYPE_SPEAKER = &H7000000
BASS_INPUT_TYPE_WAVE = &H8000000
BASS_INPUT_TYPE_AUX = &H9000000
BASS_INPUT_TYPE_ANALOG = &HA000000
End Enum

Private Declare Function BASS_RecordGetDeviceInfo Lib "bass.dll" (ByVal Device As Long, ByRef info As BASS_DEVICEINFO) As Long
Private Declare Function BASS_RecordInit Lib "bass.dll" (ByVal Device As Long) As Long
Private Declare Function BASS_RecordSetDevice Lib "bass.dll" (ByVal Device As Long) As Long
Private Declare Function BASS_RecordGetDevice Lib "bass.dll" () As Long
Private Declare Function BASS_RecordFree Lib "bass.dll" () As Long
Private Declare Function BASS_RecordGetInfo Lib "bass.dll" (ByRef info As BASS_RECORDINFO) As Long
Private Declare Function BASS_RecordGetInputName Lib "bass.dll" (ByVal inputn As Long) As Long
Private Declare Function BASS_RecordSetInput Lib "bass.dll" (ByVal inputn As Long, ByVal Flags As Long, ByVal Volume As Single) As Long
Private Declare Function BASS_RecordGetInput Lib "bass.dll" (ByVal inputn As Long, ByRef Volume As Single) As Long
Private Declare Function BASS_RecordStart Lib "bass.dll" (ByVal Freq As Long, ByVal Chans As Long, ByVal Flags As Long, ByVal Proc As Long, ByVal User As Long) As Long
Private Declare Function BASS_ChannelStop Lib "bass.dll" (Handle As Long) As Boolean

Private mHandles As Long

Function Free() As Boolean
Free = BASS_RecordFree
End Function

Function GetDevice() As Long
GetDevice = BASS_RecordGetDevice
End Function

Function GetDeviceInfo(Device As Long) As BASS_DEVICEINFO
Dim tmp As BASS_DEVICEINFO
Dim bl As Boolean
bl = BASS_RecordGetDeviceInfo(Device, tmp)
GetDeviceInfo = tmp
End Function

Function GetInfo() As BASS_RECORDINFO

Dim tmp As BASS_RECORDINFO
Dim bl As Boolean

bl = BASS_RecordGetInfo(tmp)
GetInfo = tmp

End Function

Function GetInput(Input_ As Integer, ByRef GetInputVolume As Single) As BassInputFlags
GetInput = BASS_RecordGetInput(Input_, GetInputVolume)
End Function

Function GetInputName(Input_ As Integer) As String
GetInputName = BASS_RecordGetInputName(Input_)
End Function

Function Initialize(Optional Input_ As Integer = -1) As Boolean
Initialize = BASS_RecordInit(Input_)
End Function

Function SetDevice(Device As Long) As Boolean
SetDevice = BASS_RecordSetDevice(Input_)
End Function

Function SetInput(Input_ As Long, Flags As Long, Volume As Single) As Boolean
SetInput = BASS_RecordSetInput(Input_, Flags, Volume)
End Function

Sub Start(Optional Freq As Long = 44000, Optional Chans As Long = 2, Optional Flags As Long = 0)
mHandles = BASS_RecordStart(Freq, Chans, Flags, AddressOf RECORDPROC, 0)
End Sub

Function Stop_() As Boolean
Stop_ = BASS_ChannelStop(mHandles)
End Function

Property Get Handle() As Long
Handle = mHandles
End Property

