| Author |
Message |
pagangeek
Joined: 04 Apr 2007 Posts: 48
|
|
Custom Variables within the Winamp Plugin. |
|
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.
 |
 |
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 |
|
 |
UNOPARATOR
Homo Moderatus

Joined: 19 Jul 2005 Posts: 865 Location: Istanbul, Turkey |
|
|
|
change "False" to this ---> false (no quotation marks, all lowercase)
|
|
| Thu Apr 26, 2007 6:30 pm |
|
 |
pagangeek
Joined: 04 Apr 2007 Posts: 48
|
|
|
|
Cheers!
Works a treat 
_________________ -- This must be Thursday.. I never could quite get the hang of thursdays... |
|
| Thu Apr 26, 2007 6:55 pm |
|
 |
pagangeek
Joined: 04 Apr 2007 Posts: 48
|
|
|
|
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 |
|
 |
spock
Site Admin

Joined: 17 Feb 2003 Posts: 4172 Location: Athens, Greece |
|
Bool |
|
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 |
 |
 |
pagangeek
Joined: 04 Apr 2007 Posts: 48
|
|
|
|
Alright.. so now i've got this:
 |
 |
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 |
|
 |
pagangeek
Joined: 04 Apr 2007 Posts: 48
|
|
|
|
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 |
|
 |
Dj_Stoux
Joined: 05 Aug 2007 Posts: 24 Location: Austria - Europe |
|
|
|
1. i have a ssimilar problem
i used this script:
 |
 |
if ((Boolean)GetData("Winamp.Shuffle") = false) return "0";
else return "1"; |
but if i click test
 |
 |
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 |
 |
 |
pagangeek
Joined: 04 Apr 2007 Posts: 48
|
|
Re: Bool |
|
You need another =.
It should read
 |
 |
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 |
|
 |
|