Option Explicit
'Form handles
Dim frmFuzzy As frmFuzzyMatch
Dim frmSites As frmServerSites
Dim frmSubmit As frmSubmitInfo
'Default Freedb Server to use
Const CDDB_SERVER As String = "freedb.freedb.org"
'Events
Public Event ProtocolError(ByVal Number As Long, ByVal Message As String)
'Enums
Public Enum uCDDBIfc
AUTO
SPTI
ASPI
MCI
End Enum
Public Enum uCDDBMode
TEST
SUBMIT
End Enum
Public Enum uCDDBLang
ENGLISH
GERMAN
FRENCH
End Enum
Public Enum uCDDBMatchCode
MATCH_NONE
MATCH_MULTIPLE
MATCH_EXACT
End Enum
'collections
Private colServers As Collection
Private colTrackNames As Collection
Private colTrackTimes As Collection
Private colTrackNotes As Collection
'properties management
Private strAppName As String
Private strAppVer As String
Private enumCDDBMode As uCDDBMode
Private strCDDBServer As String
Private strUserEmail As String
'lrcuscp 13.5.2002
Private strCDDBFilePath As String
Private m_QueryString As String
Private m_UseFirstMatch As Boolean
Private m_AllowSubmit As Boolean
Private m_QueryLocal As Boolean
Private m_MatchCode As uCDDBMatchCode
Private m_MediaTOC As String
Private m_MediaId As String
Private m_ArtistName As String
Private m_AlbumName As String
Private m_Category As String
Private m_Genre As String
Private m_AlbumSeconds As Integer
Private m_Tracks As Integer
Private m_Notes As String
Private m_Year As String
Private m_Revision As Integer
Private m_CdTextInfo As String
Public Property Get GetMediaID() As String
GetMediaID = m_MediaId
End Property
Public Property Get GetArtistName() As String
GetArtistName = m_ArtistName
End Property
Public Property Get GetAlbumName() As String
GetAlbumName = m_AlbumName
End Property
Public Property Get GetAlbumCategory() As String
GetAlbumCategory = m_Category
End Property
Public Property Get GetAlbumGenre() As String
GetAlbumGenre = m_Category
If (m_Genre <> "") Then GetAlbumGenre = m_Genre
End Property
Public Property Get GetAlbumLength() As Long
GetAlbumLength = m_AlbumSeconds
End Property
Public Property Get GetAlbumTracks() As Long
GetAlbumTracks = m_Tracks
End Property
Public Property Get GetAlbumNotes() As String
GetAlbumNotes = m_Notes
End Property
Public Property Get GetAlbumYear() As String
GetAlbumYear = m_Year
End Property
Public Property Get GetAlbumRevision() As String
GetAlbumRevision = m_Revision
End Property
Public Property Get GetTrackName(idx As Integer) As String
GetTrackName = ""
If (idx > 0 And idx <= colTrackNames.Count) Then
GetTrackName = colTrackNames(idx)
End If
End Property
Public Property Get GetTrackTime(idx As Integer) As Integer
GetTrackTime = 0
If (idx > 0 And idx <= colTrackTimes.Count) Then
GetTrackTime = colTrackTimes(idx)
End If
End Property
Public Property Get GetTrackNotes(idx As Integer) As String
GetTrackNotes = ""
If (idx > 0 And idx <= colTrackNotes.Count) Then
GetTrackNotes = colTrackNotes(idx)
End If
End Property
Public Property Get GetCdText() As String
GetCdText = m_CdTextInfo
End Property
Public Property Get GetServer(idx As Integer) As String
Dim i As Integer
Dim j As Integer
Dim site As String
Dim tmpsite() As String
'process errors here
On Error Resume Next
'pass back a specific server
If (idx > 0 And idx <= colServers.Count) Then
'get site info string, no parsing option
GetServer = colServers(idx)
Else
'populate the servers into the selection box
For i = 1 To colServers.Count
'break down sserver site string to give more clear selection display
tmpsite = Split(colServers(i), " ", 15, vbTextCompare)
site = tmpsite(0) 'server name
site = site & vbTab & tmpsite(4) & _
vbTab & tmpsite(5) & vbTab 'lat and lon
'get the location...
For j = 6 To UBound(tmpsite())
site = site & " " & tmpsite(j)
Next j
'plug it in...
frmSites.lstList.AddItem site
Next i
'get user selection...
i = frmSites.GetSelection()
'server name _only_ returned, we are selecting for them...
tmpsite = Split(colServers(i), " ", 15, vbTextCompare)
GetServer = tmpsite(0)
End If
End Property