Jump to content

VB Array issue ,looking for some help


Recommended Posts

Working on a media player for my website that users can download and listen to without needing to install 3rd party media player.  I am having a problem pulling and showing the information from the array.

Dim tags As String() = Bass.BASS_ChannelGetTagsMETA(stream)
        If tags Is Nothing Then
            ' try http...
            tags = Bass.BASS_ChannelGetTagsHTTP(stream)
        End If
        If Not (tags Is Nothing) Then
            Dim tag As String
            For Each tag In tags
                Console.WriteLine(tag)
            Next tag
        End If

This is an example of what is being pulled and shown in console:

Quote

StreamTitle='Judy Garland - Have Yourself A Merry Little Christmas';StreamUrl='&artist=Judy%20Garland&title=Have%20Yourself%20A%20Merry%20Little%20Christmas& album=100%20Classic%20Christmas%20Songs&duration=164754&songtype=S&overlay=NO&buycd=&website=&pictur e=az_99_100%20Classic%20Christmas%20Songs_Judy%20Garland.jpg';

Information I am trying to pull is StreamTitle, Artist and Title.

Link to post
Share on other sites

I'm thinking a regular expression that matches letters + '=' + single quote + stuff up until the next single quote + single quote.

Link to post
Share on other sites

By the way, you should probably find yourself a stream that has an apostrophe in the title and see what the corresponding StreamTitle looks like.

Link to post
Share on other sites

Something like this:

StreamTitle='Franke Carle - Little Jack Frost Get Lost';StreamUrl='&artist=Franke%20Carle&title=Little%20Jack%20Frost%20Get%20Lost&album=100%20Classic%20Christmas%20Songs&duration=164937&songtype=S&overlay=NO&buycd=&website=&picture=az_80_100%20Classic%20Christmas%20Songs_Franke%20Carle.jpg';


 

Link to post
Share on other sites

What about that? If you're responding to my thing about apostrophes, I don't see any in there. Besides the ones used around the StreamTitle and StreamUrl values.

I meant a title with an apostrophe in the value, like... maybe "Frankie Carle - Ridin' High, Vocalion".

On that note, the guy's name is apparently Frankie Carle.

Link to post
Share on other sites

Sorry wrong one...lol.  Been playing with a few.

StreamTitle='Nat 'King' Cole - The Christmas Song';StreamUrl='&artist=Nat%20'King'%20Cole&title=The%20Christmas%20Song&album=100%20Classic%20Christmas%20Songs&duration=192601&songtype=S&overlay=NO&buycd=&website=&picture=az_2_100%20Classic%20Christmas%20Songs_Nat%20'King'%20Cole.jpg';

 

Link to post
Share on other sites

Ugh. That's really not that great.

So the "stuff up until the next single quote" I said won't work because it'll stop just before "King". Only other option is to match anything, but be "ungreedy" about it: meaning to match as little as possible so that the regular expression can keep going. Immediately after that comes the closing apostrophe, then letters and an equals sign. That last part won't match when it hits "King", so the engine will go back and match Nat + King. Then it won't match again with Cole, so it'll finally go all the way through "Song" at which point everything will work.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.