LcdStudio.Com Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Custom Variables within the Winamp Plugin.

 
Reply to topic    LcdStudio.Com Forum Index » Plugins View previous topic
View next topic
Custom Variables within the Winamp Plugin.
Author Message
pagangeek



Joined: 04 Apr 2007
Posts: 48

Post Custom Variables within the Winamp Plugin. Reply with quote
Ok.. I'll admit.. it has been a damn long time since I wrote any code that wasn't pure html.

I'm trying to tie the various "state" indicators of the winamp plugin to animated gifs.
With the help of previous threads, I've managed to get the Playing/Paused/Stopped working.. yay!
However, I'm now banging my head agains the Shuffle variable.
Heres what I'm currently trying.

Code:
if ((Boolean)GetData("Winamp.Shuffle") = "False") return "0";
else return "1";


The error i'm getting is that I can't convert between the data types of string and bool..
This makes me think that i've got something fundamentally wrong, but I just can't see it.

Any chance of a helping hand?

_________________
-- This must be Thursday.. I never could quite get the hang of thursdays...
Thu Apr 26, 2007 6:18 pm View user's profile Send private message Visit poster's website
UNOPARATOR
Homo Moderatus


Joined: 19 Jul 2005
Posts: 865
Location: Istanbul, Turkey

Post Reply with quote
change "False" to this ---> false (no quotation marks, all lowercase)
Thu Apr 26, 2007 6:30 pm View user's profile Send private message
pagangeek



Joined: 04 Apr 2007
Posts: 48

Post Reply with quote
Cheers!
Works a treat Smile

_________________
-- This must be Thursday.. I never could quite get the hang of thursdays...
Thu Apr 26, 2007 6:55 pm View user's profile Send private message Visit poster's website
pagangeek



Joined: 04 Apr 2007
Posts: 48

Post Reply with quote
alright.. so heres the next question.

I've built a custom animation bar to display the percentage through the track currently playing.

However, i'm struggling with linking it to the datatype.
My animation only has 20 frames.. so I figure I have to divide the datatype.. but how do I divide it then link it to the gif?

_________________
-- This must be Thursday.. I never could quite get the hang of thursdays...
Thu Apr 26, 2007 9:19 pm View user's profile Send private message Visit poster's website
spock
Site Admin


Joined: 17 Feb 2003
Posts: 4172
Location: Athens, Greece

Post Bool Reply with quote
And if you want the output to register as boolean, you should change the returns to true and false instead of "1" and "0", accordingly.

_________________
Live long and prosper...
Thu Apr 26, 2007 9:20 pm View user's profile Send private message Send e-mail Visit poster's website ICQ Number
pagangeek



Joined: 04 Apr 2007
Posts: 48

Post Reply with quote
Alright.. so now i've got this:
Code:
Single played = ((Int32)GetData("Winamp.PlayingPct"));
played = played / 5;
return played;


This however returns with decimals, which I dont want.. could someone tell me how to strip them out?

_________________
-- This must be Thursday.. I never could quite get the hang of thursdays...
Thu Apr 26, 2007 10:19 pm View user's profile Send private message Visit poster's website
pagangeek



Joined: 04 Apr 2007
Posts: 48

Post Reply with quote
nevermind.. Just tried it and found that it actually works anyhow!
yay!!

_________________
-- This must be Thursday.. I never could quite get the hang of thursdays...
Thu Apr 26, 2007 10:21 pm View user's profile Send private message Visit poster's website
Dj_Stoux



Joined: 05 Aug 2007
Posts: 24
Location: Austria - Europe

Post Reply with quote
1. i have a ssimilar problem

i used this script:
Code:
if ((Boolean)GetData("Winamp.Shuffle") = false) return "0";
else return "1";

but if i click test

Quote:
c:\Dokumente und Einstellungen\Sephiroth\Lokale Einstellungen\Temp\1zci4rzy.0.cs(13,11) : warning CS0665: Assignment in conditional expression is always constant; did you mean to use == instead of = ?


but what do i have to change?

Thanks

_________________
Elvis lives
Mon Aug 06, 2007 11:07 am View user's profile Send private message MSN Messenger ICQ Number
pagangeek



Joined: 04 Apr 2007
Posts: 48

Post Re: Bool Reply with quote
You need another =.

It should read
Code:
if ((Boolean)GetData("Winamp.Shuffle") == false) return "0";


_________________
-- This must be Thursday.. I never could quite get the hang of thursdays...
Mon Aug 06, 2007 11:14 am View user's profile Send private message Visit poster's website
Display posts from previous:    
Reply to topic    LcdStudio.Com Forum Index » Plugins All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.