FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Bug in ActiveWinamp script

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
LostDreamer
Newbie


Joined: 21 Feb 2006
Posts: 2

PostPosted: Tue Feb 21, 2006 1:18 am    Post subject: Bug in ActiveWinamp script Reply with quote

Hey all,

Long time reader, first time poster...
I'm shocked by the fact that I seem to be the first one to notice this...

I got Winamp 5.11 running here with Active Winamp... and everything works ok, but the screen of my Nokia 7650 kept saying : Lost contact with winamp...

After looking at the script I found an error around line 118
there are a few faulty error checks over there.

Changing :
[code:1]catch( e ) {
if( playlistRow != null ) playlistRow.textualContent = "";
if( songRow != null ) songRow.textualContent = "Lost contact with Winamp";
if( artistRow != null ) artistRow.textualContent = "";
if( albumRow != null ) albumRow.textualContent = "";
theScreen.mediaPosition = -1;
theScreen.mediaLength = -1;
theScreen.playerState = scIndeterminate;
[/code:1]

to

[code:1]catch( e ) {
if( playlistRow == null ) playlistRow.textualContent = "";
if( songRow == null ) songRow.textualContent = "Lost contact with Winamp";
if( artistRow == null ) artistRow.textualContent = "";
if( albumRow == null ) albumRow.textualContent = "";
if( theScreen.mediaPosition == null ) theScreen.mediaPosition = -1;
if( theScreen.mediaLength == null ) theScreen.mediaLength = -1;
if( theScreen.playerState == null ) theScreen.playerState = scIndeterminate;
[/code:1]

Did the trick for me....


LostDreamer

ps. Salling Clicker must be the best program I ever used (and ever will probably) for having a remote for my PC.
My greatest thanks go out to Jonas and everyone who contributed to the scripts.
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Tue Feb 21, 2006 1:35 am    Post subject: Reply with quote

Thanks for the kudos. Much appreciated! :-)

Your find is intriguing. I don't quite see how it'd fix anyting, except prevent some of the mediaplayer widget state variables from being set. You just added the three null-checks, right? :?

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LostDreamer
Newbie


Joined: 21 Feb 2006
Posts: 2

PostPosted: Tue Feb 21, 2006 1:48 am    Post subject: Reply with quote

Yep, I guess somehow I got into that error catching event even though it wasnt necessary....
Double checking it for empty values seemed to help out.

LostDreamer
Back to top
View user's profile Send private message
BadAngel
Newbie


Joined: 12 Jan 2007
Posts: 1

PostPosted: Fri Jan 12, 2007 2:40 pm    Post subject: Reply with quote

The changes suggested by LostDreamer fix the bug when an error occurs..

In my case the error occures because i dont have any ratings for my mp3 so when the script tries to access the mediaitem.rating it goes to the error handler..

To fix that, at the block starting at line 119 in ActiveWinamp\Winamp.js

Change:
[code:1]
theScreen.listeningVolume = wo.Volume*100/255;
theScreen.mediaPosition = wo.Position/1000;
theScreen.mediaLength = mediaItem.Length;
theScreen.mediaRating = mediaItem.Rating * 20;
theScreen.mediaRepeat = wo.Repeat ? scRepeatAll : scRepeatOff;
theScreen.shuffle = wo.Shuffle;
[/code:1]
To:
[code:1]
theScreen.listeningVolume = wo.Volume*100/255;
theScreen.mediaPosition = wo.Position/1000;
theScreen.mediaLength = mediaItem.Length;
// theScreen.mediaRating = mediaItem.Rating * 20;
theScreen.mediaRepeat = wo.Repeat ? scRepeatAll : scRepeatOff;
theScreen.shuffle = wo.Shuffle;
[/code:1]

This fixes the problem and makes the script more usable.. it now displays a volume bar when changing volume and also displays Shuffle indicator on the screen.

Antonis
Back to top
View user's profile Send private message
dzid_
Newbie


Joined: 09 May 2007
Posts: 13
Location: Poland

PostPosted: Fri May 11, 2007 8:36 pm    Post subject: Reply with quote

Why mediaItem.Rating doesn't get any information of rating. It can setup rating, but cannot read it. I suppose it's the problem of ActiveWinamp.


/Winamp 5.34 /Vista
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group