Results 1 to 28 of 28

Thread: little help again (RESOLVED)

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Resolved little help again (RESOLVED)

    Hi all
    I have received excellent help here and am back for a little more. I have an app that will write an xml file however it is currently writing it like this
    <?xml version="1.0"?>
    <songs>
    <song path="my_mp3s\ 05 - Swamp.mp3" artist="Michael Kamen" title="05 - Swamp.mp3"/>
    </songs>

    But I need it to be displayed like this

    <?xml version="1.0"?>
    <songs>
    <song path="my_mp3s/song.mp3"artist="" title=""/>

    </songs>

    I just need to remove the spacing nand change the slash here is the code that performs this but I'm not sure what needs changing I have played about with it but having no luck. Hop someone can help. Thanks

    VB Code:
    1. Private Sub Command2_Click()
    2. Dim f1 As Integer, xmlpath As String, songpath As String, mp3path As String, f2 As Integer, i As Integer
    3.     Dim Artist As String, SongName As String, artname As String, fname As String, MyPath As String
    4.  
    5.     Dim mytag As Boolean
    6.    mp3path = "C:\mgamerz\my_mp3s\"
    7.    xmlpath = "C:\mgamerz\ "
    8.  
    9.  
    10.      
    11.      SongName = Dir(mp3path & "\*.mp3")
    12.      fname = mp3path & SongName
    13.      
    14.             With Form4
    15.    
    16.     While Not Len(SongName) = 0
    17.        
    18. '        Artist = GetMP3Tag(fname)
    19.                 If Not i = 0 Then
    20.                     Load .Label1(i): Load .Text1(i)
    21.                     .Label1(i).Top = .Label1(i - 1).Top + 350
    22.                     .Text1(i).Top = .Text1(i - 1).Top + 350
    23.                     .Label1(i).Visible = True: .Text1(i).Visible = True
    24.                    
    25.                 End If
    26.                
    27.                 .Label1(i) = SongName
    28.                 mytag = GetMP3Tag(fname)
    29.                 .Text1(i) = RTrim(MP3Info.sArtist)
    30.                      
    31.  
    32.         SongName = Dir
    33.              fname = mp3path & SongName
    34.  
    35.         i = i + 1
    36.    
    37.     Wend
    38.                 .Height = .Text1(.Text1.Count - 1).Top + 1600
    39.                 .TAG = mp3path
    40.                 MDIForm1.Caption = "You must close this form before continuing"
    41.                 .Show
    42. '                .WindowState = 2
    43.             End With
    44.     TAG = "wait"
    45.     While TAG = "wait"
    46.     DoEvents
    47.     Wend
    48.    
    49.      
    50.    i = 1
    51.      f2 = FreeFile
    52.     Open mp3path & "mp3.txt" For Output As #f2
    53.      f1 = FreeFile
    54.      
    55.     Open xmlpath & "audiolist.xml" For Output As #f1
    56.    
    57.    
    58.     Print #f1, "<?xml version=""1.0""?>"
    59.     Print #f1, "<songs>"
    60.     SongName = Dir(mp3path & "\*.mp3")
    61.     i = 1
    62.     While Not Len(SongName) = 0
    63.        
    64.         ' if you can return the name of the artist you put the code in here
    65.  
    66.                 mytag = GetMP3Tag(mp3path & SongName)
    67.                 Artist = RTrim(MP3Info.sArtist)
    68.                  If Len(Artist) = 0 Then Artist = "UNKOWN"
    69.                  
    70.                  
    71.                   MyPath = Right(mp3path, (Len(mp3path) - Len(xmlpath) + 1)) & " " & SongName
    72.        
    73.        songpath = "<song path=""" & MyPath & """ artist=""" & Artist & """ title=""" & SongName & """/> "
    74.  
    75.        
    76.         Print #f1, songpath
    77.         Print #f2, SongName
    78.         Sleep 100
    79.         SongName = Dir
    80.    
    81.     Wend
    82.  
    83.     Print #f1, "</songs>"
    84. Close
    85.  
    86. End Sub
    Last edited by robvr6; Feb 6th, 2005 at 12:42 AM. Reason: resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width