• Viernes 29 de Marzo de 2024, 15:40

Autor Tema:  Os Interesaria Una Clase Para Acceder A Cddb  (Leído 1687 veces)

Taursoft

  • Miembro activo
  • **
  • Mensajes: 27
    • Ver Perfil
Os Interesaria Una Clase Para Acceder A Cddb
« en: Miércoles 28 de Enero de 2004, 16:23 »
0
HOLA A TODOS SI QUEREIS UNA CLASE CDDB PARA ACCEDER AL SERVIDOR FREEDB PODEMOS ACERLA JUNTOS YA QUE YO DISPONGO DEL CODIGO PARA VISUAL BASIC 6.0
PERO YO LO NECESITO PARA VISUAL BASIC .NET
Y QUIERO QUE JUNTOS LO PASEMOS A VISUAL BASIC .NET PARA ELLO YO IRE PONIENDO PARTES DEL CODIGO

AQUI VA LA PRIMERA:

:comp:


Código: Text
  1.  
  2.  
  3. Option Explicit
  4.  
  5. 'Form handles
  6. Dim frmFuzzy As frmFuzzyMatch
  7. Dim frmSites As frmServerSites
  8. Dim frmSubmit As frmSubmitInfo
  9.  
  10. 'Default Freedb Server to use
  11. Const CDDB_SERVER As String = "freedb.freedb.org"
  12.  
  13. 'Events
  14. Public Event ProtocolError(ByVal Number As Long, ByVal Message As String)
  15.  
  16. 'Enums
  17. Public Enum uCDDBIfc
  18.     AUTO
  19.     SPTI
  20.     ASPI
  21.     MCI
  22. End Enum
  23.  
  24. Public Enum uCDDBMode
  25.     TEST
  26.     SUBMIT
  27. End Enum
  28.  
  29. Public Enum uCDDBLang
  30.     ENGLISH
  31.     GERMAN
  32.     FRENCH
  33. End Enum
  34.  
  35. Public Enum uCDDBMatchCode
  36.     MATCH_NONE
  37.     MATCH_MULTIPLE
  38.     MATCH_EXACT
  39. End Enum
  40.  
  41. 'collections
  42. Private colServers      As Collection
  43. Private colTrackNames   As Collection
  44. Private colTrackTimes   As Collection
  45. Private colTrackNotes   As Collection
  46.  
  47. 'properties management
  48. Private strAppName      As String
  49. Private strAppVer       As String
  50. Private enumCDDBMode    As uCDDBMode
  51. Private strCDDBServer   As String
  52. Private strUserEmail    As String
  53. 'lrcuscp 13.5.2002
  54. Private strCDDBFilePath As String
  55.  
  56. Private m_QueryString   As String
  57. Private m_UseFirstMatch As Boolean
  58. Private m_AllowSubmit   As Boolean
  59. Private m_QueryLocal    As Boolean
  60.  
  61. Private m_MatchCode     As uCDDBMatchCode
  62.  
  63. Private m_MediaTOC      As String
  64. Private m_MediaId       As String
  65. Private m_ArtistName    As String
  66. Private m_AlbumName     As String
  67. Private m_Category      As String
  68. Private m_Genre         As String
  69. Private m_AlbumSeconds  As Integer
  70. Private m_Tracks        As Integer
  71. Private m_Notes         As String
  72. Private m_Year          As String
  73. Private m_Revision      As Integer
  74. Private m_CdTextInfo    As String
  75.  
  76.  
  77.  
  78. Public Property Get GetMediaID() As String
  79.     GetMediaID = m_MediaId
  80. End Property
  81.  
  82. Public Property Get GetArtistName() As String
  83.     GetArtistName = m_ArtistName
  84. End Property
  85.  
  86. Public Property Get GetAlbumName() As String
  87.     GetAlbumName = m_AlbumName
  88. End Property
  89.  
  90. Public Property Get GetAlbumCategory() As String
  91.     GetAlbumCategory = m_Category
  92. End Property
  93.  
  94. Public Property Get GetAlbumGenre() As String
  95.     GetAlbumGenre = m_Category
  96.     If (m_Genre <> "") Then GetAlbumGenre = m_Genre
  97. End Property
  98.  
  99. Public Property Get GetAlbumLength() As Long
  100.     GetAlbumLength = m_AlbumSeconds
  101. End Property
  102.  
  103. Public Property Get GetAlbumTracks() As Long
  104.     GetAlbumTracks = m_Tracks
  105. End Property
  106.  
  107. Public Property Get GetAlbumNotes() As String
  108.     GetAlbumNotes = m_Notes
  109. End Property
  110.  
  111. Public Property Get GetAlbumYear() As String
  112.     GetAlbumYear = m_Year
  113. End Property
  114.  
  115. Public Property Get GetAlbumRevision() As String
  116.     GetAlbumRevision = m_Revision
  117. End Property
  118.  
  119. Public Property Get GetTrackName(idx As Integer) As String
  120.     GetTrackName = ""
  121.     If (idx > 0 And idx <= colTrackNames.Count) Then
  122.         GetTrackName = colTrackNames(idx)
  123.     End If
  124. End Property
  125.  
  126. Public Property Get GetTrackTime(idx As Integer) As Integer
  127.     GetTrackTime = 0
  128.     If (idx > 0 And idx <= colTrackTimes.Count) Then
  129.         GetTrackTime = colTrackTimes(idx)
  130.     End If
  131. End Property
  132.  
  133. Public Property Get GetTrackNotes(idx As Integer) As String
  134.     GetTrackNotes = ""
  135.     If (idx > 0 And idx <= colTrackNotes.Count) Then
  136.         GetTrackNotes = colTrackNotes(idx)
  137.     End If
  138. End Property
  139.  
  140. Public Property Get GetCdText() As String
  141.     GetCdText = m_CdTextInfo
  142. End Property
  143.  
  144.  
  145. Public Property Get GetServer(idx As Integer) As String
  146.     Dim i As Integer
  147.     Dim j As Integer
  148.     Dim site As String
  149.     Dim tmpsite() As String
  150.  
  151.     'process errors here
  152.     On Error Resume Next
  153.  
  154.     'pass back a specific server
  155.     If (idx > 0 And idx <= colServers.Count) Then
  156.         'get site info string, no parsing option
  157.         GetServer = colServers(idx)
  158.     Else
  159.         'populate the servers into the selection box
  160.         For i = 1 To colServers.Count
  161.             'break down sserver site string to give more clear selection display
  162.             tmpsite = Split(colServers(i), " ", 15, vbTextCompare)
  163.            
  164.             site = tmpsite(0)                       'server name
  165.             site = site & vbTab & tmpsite(4) & _
  166.                    vbTab & tmpsite(5) & vbTab       'lat and lon
  167.            
  168.             'get the location...
  169.             For j = 6 To UBound(tmpsite())
  170.                 site = site & " " & tmpsite(j)
  171.             Next j
  172.            
  173.             'plug it in...
  174.             frmSites.lstList.AddItem site
  175.         Next i
  176.  
  177.         'get user selection...
  178.         i = frmSites.GetSelection()
  179.  
  180.         'server name _only_ returned, we are selecting for them...
  181.         tmpsite = Split(colServers(i), " ", 15, vbTextCompare)
  182.         GetServer = tmpsite(0)
  183.     End If
  184. End Property
  185.  
  186.  


TAMBIEN DEBEREIS DECLARAR LAS APIS NECESARIAS.

BUENO AQUI VA LA PRIMERA AHORA OS TOCA A VOSOTROS USTEDES TRADUCIS ESTO A .NET Y YO OS PONGO LA SEGUNDA PARTE ASI PODREIS AÑADIRLE A VUESTRAS APLICACIONES LA POSIBILIDAD DE ACCEDER A FREEDB CON ESTA CLASE QUE ES TOTALMENTE GRATUITA.

SALUDOS OS ESPERO AMIGOS  :comp: