Winamp Title/Artist name formatting for Shoutcast radio.

All your questions about LcdStudio 2.0 Plugins

Moderator: LcdStudio2 Experts

Winamp Title/Artist name formatting for Shoutcast radio.

Postby septakon » Thu Jul 20, 2006 2:18 am

Hello! I am just starting to play around with LCDstudio and I love it!!!

Could anybody help me with this issue? My design will display the artist/title correctly for files on my computer. however, when listening to an online radio such as shoutcast, the artist is unknown and the title will be:

Artist Name - Song Title (station description)

for example:

Genuine - Deep Draw (Groove Salad: a nicely chilled plate of ambient beats and grooves. [SomaFM])

Is there a code that will allow to put "Genuine" as the artist, "Deep Draw" as the song name and take off the station description?

Thanks!
septakon
 
Posts: 3
Joined: Thu Jul 20, 2006 2:08 am

Postby Aeryck » Thu Jul 20, 2006 4:00 am

Well, you -could- make a couple custom variables for the Artist and Title fields... Differentiating between an mp3 file and a shoutcast stream would be a different story altogether, however you could look at the "Filename" parameter (I would assume this would be the URL of your SC stream) for some conditional formatting.

I'm not an expert on C# formatting routines; someone else could probably point you to the actual code bits you'd need.. But, yes, it IS possible to accomplish what you want.

If nobody else offers code bits, I'll see if I can whip something up.

BTW, Welcome to the Forums!
"Yes, that's right. We're having a difficult time finding the enemy."
"Well, what do you use to look for them?"
"We ask people, 'are you the enemy?'. And whoever says yes, we shoot them!"
Aeryck
Homo Moderatus
 
Posts: 578
Joined: Wed Mar 08, 2006 10:17 pm
Location: 30 Miles from Hell.... (MI)

Custom

Postby spock » Fri Jul 21, 2006 11:49 pm

Yes, you could make two custom variables, as Aeryck pointed out. Just take a look at C#'s formatting functions. You can truncate the same input variable at specific points to get the song title and the artist separately. It's not hard to make it work for you.
Live long and prosper...
User avatar
spock
Site Admin
 
Posts: 4541
Joined: Mon Feb 17, 2003 6:01 pm
Location: Athens, Greece

Postby septakon » Sat Jul 22, 2006 12:35 am

Thanks! Following your advice, I researched a little bit about C#.

I came up with that code with some copy/pasting:

if ((String)GetData("Winamp.Artist") == "Unknown")
return ((String)GetData("Winamp.Title")).Substring(((String)GetData("Winamp.Title")).LastIndexOf("\\") +1).Replace(" (Groove Salad: a nicely chilled plate of ambient beats and grooves. [SomaFM])", "");
else
return ((String)GetData("Winamp.Artist"))

So using the example above:

Genuine - Deep Draw (Groove Salad: a nicely chilled plate of ambient beats and grooves. [SomaFM])

will give the output: Genuine - Deep Draw

now, can I only keep everything before the - (hyphen) for the artist name? and everything after for the Title?

Also, for the station description, I will have to make a code for all the stations I listen to. how can I do this? For example, let's say the three stations i listen too have the following descriptions:

(SomaFM)
(Chilloutpsy)
(Ambient Space)

How can I make a code that does: Replace the (SomaFM) by "" (empty string), or replace (Chilloutpsy) by "", or replace (Ambient Space) by "".

wow, ive never done any programming at all in my life, but when I see how you can make cool things like that, i llike it!

thanks!
septakon
 
Posts: 3
Joined: Thu Jul 20, 2006 2:08 am

Postby septakon » Tue Jul 25, 2006 1:33 am

programming is hard and should be left to people with greater logical thinking capabilities.
septakon
 
Posts: 3
Joined: Thu Jul 20, 2006 2:08 am

Re: Winamp Title/Artist name formatting for Shoutcast radio.

Postby arje06 » Mon May 17, 2010 8:06 am

Well, that's good for you, and we are glad to know the result of your works if you don't mind. I know that this thread is quite old that's why I'm looking forward to know the result of your work. How about posting it here?
Last edited by arje06 on Wed Jun 09, 2010 12:30 pm, edited 2 times in total.
arje06
 
Posts: 1
Joined: Mon May 17, 2010 7:06 am

Four

Postby spock » Mon May 17, 2010 10:06 pm

Oh, really? Just like you, resurrecting a four-year-old thread, only to write this?
Marvellous!
Live long and prosper...
User avatar
spock
Site Admin
 
Posts: 4541
Joined: Mon Feb 17, 2003 6:01 pm
Location: Athens, Greece


Return to Plugins

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests