Attribute VB_Name = "ID3v11"
'This module is used to read and write to ID3v1.1 tags.

Public Type ID3info
    TAG As String * 3
    Songname As String * 30
    Artist As String * 30
    Album As String * 30
    Year As String * 4
    Comment As String * 28
    Track As Byte
    Genre As String * 1
End Type

Public Function GetID3info()
    Open Filename For Binary Access Read As #1
    Get #1, FileLen(Filename) - 127, TAG
    If Not TAG = "TAG" Then
    Close #1
    HasTag = False
        Exit Sub
        End If
        HasTag = True
    Filename = Filename
    Get #1, , Songname
    Get #1, , Artist
    Get #1, , Album
    Get #1, , Year
    Get #1, , Comment
    Get #1, , Track
    Get #1, , Genre
    Close #1
End Function

Public Function WriteID3info()
    Open Filename For Binary Access Write As #1
        Seek #1, FileLen(Filename) - 127
        Put #1, , TAG
        Put #1, , Songname
        Put #1, , Artist
        Put #1, , Album
        Put #1, , Year
        Put #1, , Comment
        Put #1, , Track
        Put #1, , Genre
    Close #1
End Function
    
    With ID3info
        Songname = .Songname
        Artist = .Artist
        Album = .Album
        Year = .Year
        Comment = .Comment
        Track = .Track
        Genre = .Genre
    End With
    
