[HELP] Compiling scripts.. ?

All your questions about LcdStudio 2.0 Plugins

Moderator: LcdStudio2 Experts

[HELP] Compiling scripts.. ?

Postby YBinnenweg » Sat Aug 21, 2010 11:43 am

Hi folks, first of all I'm really happy i found this program for my keyboard! It's great!

But i have 1 question, rightnow im using the build in Windows Media Player plugin, to show the status. (It's called "status")
This is not exactly what im looking for, because what im looking for will look like this:
Artistname - Songname
Now i've found this topic on the forum:
http://www.lcdstudio.com/forum/viewtopic.php?t=9811
Which shows different custom scripts, that may fit my idea, the only problem is, i have no idea how to compile/enable those scripts like those:
Code: Select all
if ((String)GetData("Winamp.FileName") == "Unknown")
    return String.Empty;
else
    return System.IO.Path.GetFileNameWithoutExtension((String)GetData("Winamp.FileName"));


Could somebody help me with it?

Thx for reading,
Yannick :D

BTW. I'm running Windows 7 X64, so i have Windows Media Player 12.
YBinnenweg
 
Posts: 1
Joined: Sat Aug 21, 2010 11:34 am

Postby Chunky1318 » Sat May 28, 2011 7:24 pm

Doesnt work for windows media player, but for itunes, this code shows "Artist - Track"

Code: Select all
string a = (string)GetData("Itunes.CurrentTrack.Artist");
string t = (string)GetData("Itunes.CurrentTrack.Name");

string d = (a)+(" - ")+(t);

return (d)


Windows media player support is totally shit :( but im working on it!
Chunky1318
 
Posts: 2
Joined: Sat May 28, 2011 7:21 pm

script

Postby spock » Sat May 28, 2011 8:44 pm

Who told you to use parentheses everywhere? And variables?
Other than that, you can just use this:

Code: Select all
return (string)GetData("Itunes.CurrentTrack.Artist") + " - " + (string)GetData("Itunes.CurrentTrack.Name")
Live long and prosper...
User avatar
spock
Site Admin
 
Posts: 4538
Joined: Mon Feb 17, 2003 6:01 pm
Location: Athens, Greece

Postby Chunky1318 » Sat May 28, 2011 11:16 pm

lol... I like clean code!
Chunky1318
 
Posts: 2
Joined: Sat May 28, 2011 7:21 pm

script

Postby spock » Sun May 29, 2011 11:29 am

Start liking efficient code more.
Live long and prosper...
User avatar
spock
Site Admin
 
Posts: 4538
Joined: Mon Feb 17, 2003 6:01 pm
Location: Athens, Greece


Return to Plugins

Who is online

Users browsing this forum: No registered users and 0 guests

cron