Private Sub Command2_Click()
Dim f1 As Integer, xmlpath As String, songpath As String, mp3path As String, f2 As Integer, i As Integer, pos As Integer
Dim Artist As String, SongName As String, artname As String, fname As String, MyPath As String
Dim mytag As Boolean
mp3path = "C:\Program Files\mgamerz\XML PLAYER\my_mp3s\"
xmlpath = "C:\Program Files\mgamerz\XML PLAYER\"
SongName = Dir(mp3path & "\*.mp3")
fname = mp3path & SongName
With Form4
While Not Len(SongName) = 0
' Artist = GetMP3Tag(fname)
If Not i = 0 Then
Load .Label1(i): Load .Text1(i)
.Label1(i).Top = .Label1(i - 1).Top + 350
.Text1(i).Top = .Text1(i - 1).Top + 350
.Label1(i).Visible = True: .Text1(i).Visible = True
End If
.Label1(i) = SongName
mytag = GetMP3Tag(fname)
.Text1(i) = RTrim(MP3Info.sArtist)
SongName = Dir
fname = mp3path & SongName
i = i + 1
Wend
.Height = .Text1(.Text1.Count - 1).Top + 1600
.TAG = mp3path
MDIForm1.Caption = "Close This Form to Update XML Playlist"
.Show
' .WindowState = 2
End With
TAG = "wait"
While TAG = "wait"
DoEvents
Wend
i = 1
f2 = FreeFile
Open mp3path & "mp3.txt" For Output As #f2
f1 = FreeFile
Open xmlpath & "audiolist.xml" For Output As #f1
Print #f1, "<?xml version=""1.0""?>"
Print #f1, "<songs>"
SongName = Dir(mp3path & "\*.mp3")
i = 1
While Not Len(SongName) = 0
' if you can return the name of the artist you put the code in here
mytag = GetMP3Tag(mp3path & SongName)
'pos = InStr(mytag, "\")
mytag = Replace(mytag, "\", "/")
Do While InStr(mytag, " ")
mytag = Replace(mytag, " ", "")
Loop
Artist = RTrim(MP3Info.sArtist)
If Len(Artist) = 0 Then Artist = "UNKOWN"
MyPath = Right(mp3path, (Len(mp3path) - Len(xmlpath))) & " " & SongName
MyPath = Replace(MyPath, "\", "/")
MyPath = Replace(MyPath, " ", "", 1, 1)
songpath = "<song path=""" & MyPath & """ artist=""" & Artist & """ title=""" & SongName & """/> "
Print #f1, songpath
Print #f2, SongName
Sleep 100
SongName = Dir
Wend
Print #f1, "</songs>"
Close
End Sub
Private Sub Command3_Click()
Dim Q As String
Q = "" & vbCrLf
Q = Q + "Developed By" & vbCrLf
Q = Q + "Rob Gibson, Tony Dockery 2005© " & vbCrLf
MsgBox Q, vbInformation, "XML Updater V2.0"
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Command5_Click()
Dim strFile() As String, strPath As String
Dim n As Long, nCount As Long
On Error Resume Next
With CommonDialog1
.Flags = cdlOFNAllowMultiselect + cdlOFNExplorer
.CancelError = True
.InitDir = "C:\Program Files\mgamerz\XML PLAYER\my_mp3s"
.DialogTitle = "Select File To Delete"
.ShowOpen
If Err.Number <> cdlCancel Then
strFile = Split(.FileName, vbNullChar)
nCount = UBound(strFile)
If nCount = 0 Then
'Only one file is selected so split up the path and the filename
ReDim strFile(1)
strFile(0) = Left$(.FileName, InStrRev(.FileName, "\"))
strFile(1) = Mid$(.FileName, InStrRev(.FileName, "\") + 1)
nCount = 1
End If
strPath = strFile(0)
If Right$(strPath, 1) <> "\" Then
strPath = strPath & "\"
End If
For n = 1 To nCount
Kill strPath & strFile(n)
Next
End If
End With
End Sub