Old 12th November 2018, 19:56   #1
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 372
Circular seeker crashes listening to streams

This skin has a nice circular seeker that works fine when listening to music on disk but it crashes Winamp when you try to listen to online music. How shall I edit CircSlider.m to disable the circular seeker while listening to streams?
ariszlo is offline   Reply With Quote
Old 12th November 2018, 20:44   #2
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550
I think the extended behaviour is to disable the seeker if playing a stream. Try to apply something from seek.m (from Big Bento scripts).
And songinfo.m (library file usually find on lib/com) has some useful commands like songinfo_isStream.

· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 12th November 2018, 21:01   #3
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 372
Thanks, Victhor. I have found this in seek.m:

code:
/** Hehe, this is the best trick i figured out to indicate if we have a stream */

Seeker.onSetVisible (Boolean onoff)
{
if (onoff)
{
progressBar.show();
}
else
{
progressBar.hide();
}
}



But I do not know how to use something like this in CircSlider.m. I do not really know the logic and syntax of maki, all I can relatively easily do is change some variables.
ariszlo is offline   Reply With Quote
Old 13th November 2018, 03:41   #4
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550
Mhmm... it's a sneaky script, I've tried a couple of things with no luck (though I'm not getting a crash when streaming), maybe later I'll give it another shot.

· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 13th November 2018, 07:20   #5
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 494
You might try adding this line ...

PHP Code:
if (strsearch(getPlayItemString(),"http")==|| strsearch(getPlayItemString(),"https")==0) return;
else 
func79(); 
to the System.onScriptLoaded() section and System.onPlay(). It basically looks for the http/https string within the item being played.

P.S. And I would change the line <WasabiXML version="1.2"> to 1.36.
PeterK. is offline   Reply With Quote
Old 13th November 2018, 09:32   #6
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 372
Thanks, PeterK. Getting there. This is how I added your code to System.onScriptLoaded():

PHP Code:
System.onScriptLoaded()
{
AnimatedLayer2 System.getScriptGroup().getObject(( "Progress"));
Button3 System.getScriptGroup().getObject(( "click"));
/*func79();*/
if (strsearch(getPlayItemString(),"http")==|| strsearch(getPlayItemString(),"https")==0) return;
else 
func79();
return 
Null;

This fixes the issue if I start listening to a stream using another skin and switch to Alfa Romeo History. But ARH is still crashes Winamp if I start listening to some music on disk already using the ARH skin and switch to a stream.

Adding your code to System.onPlay(), too, would probably fix the latter, too, but there is no System.onPlay() section in CircSlider.m. How do I add a System.onPlay() section?

As for changing WasabiXML version to 1.36, it causes a null object called error in cars.maki. So either cars.m should be updated for WasabiXML v1.36, which I do not know how to do, or WasabiXML version should be kept at 1.2.
ariszlo is offline   Reply With Quote
Old 13th November 2018, 16:48   #7
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 494
Quote:
Originally Posted by ariszlo View Post
... How do I add a System.onPlay() section?
PHP Code:
System.onPlay()
{
if (
strsearch(getPlayItemString(),"http")==|| strsearch(getPlayItemString(),"https")==0) return;
else 
func79();

Quote:
Originally Posted by ariszlo View Post
As for changing WasabiXML version to 1.36, it causes a null object called error in cars.maki. So either cars.m should be updated for WasabiXML v1.36, which I do not know how to do, or WasabiXML version should be kept at 1.2.
I just compiled cars.m and had no problems (after setting the version to 1.36)
P.S. Null Object Called appears when the script cannot find an id, which was declared in the script but is (apparently) missing in the corresponding xml file.
PeterK. is offline   Reply With Quote
Old 13th November 2018, 17:15   #8
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 372
Thanks again. Two more questions:

1. Where do I put the System.onPlay() section in CircSlider.m?
2. Did I add your code correctly to the System.onScriptLoaded() section or should it be cleaned up?

Quote:
Originally Posted by PeterK. View Post
I just compiled cars.m and had no problems (after setting the version to 1.36)
P.S. Null Object Called appears when the script cannot find an id, which was declared in the script but is (apparently) missing in the corresponding xml file.
OK, I will recompile it as you suggest. Perhaps, it went wrong on my machine because I had compiled it before setting the version to 1.36.
ariszlo is offline   Reply With Quote
Old 13th November 2018, 17:29   #9
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 494
Quote:
Originally Posted by ariszlo View Post
Thanks again. Two more questions:

1. Where do I put the System.onPlay() section in CircSlider.m?.
Does not matter. Below System.onScriptLoaded()?
Quote:
Originally Posted by ariszlo View Post
2. Did I add your code correctly to the System.onScriptLoaded() section or should it be cleaned up?
I see no problems.

P.S. You might also set the default_visible of the Main Window to 1.
PHP Code:
<!-- Main WindowContainer and Layout -->
<
container id="main" name="Main Window" default_x="0" default_y="0" default_visible="0"
PeterK. is offline   Reply With Quote
Old 13th November 2018, 19:34   #10
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 372
No more guru meditations, thanks. But crashes still occur.

Switching from music on disk to a stream does not unload seeker animation and still crashes Winamp.

On the other hand, switching to Alfa Romeo History from another skin while listening to a stream no longer crashes Winamp but then switching to music on disk does not start seeker animation, either.

What should be added to CircSlider.m (and where) to stop seeker animation when switching from music on disk to a stream?

And what should be added to start seeker animation when switching from a stream to music on disk?
ariszlo is offline   Reply With Quote
Old 13th November 2018, 23:49   #11
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 372
Crashes fixed

Peter, you pointed me in the right direction, thank you!

Adding a System.onPlay() section did not help so I removed it. Instead, I added your code to the Timer4.onTimer() section (in addition to the System.onScriptLoaded() section) like this:

PHP Code:
Timer4.onTimer()
{
if (
strsearch(getPlayItemString(),"http")==|| strsearch(getPlayItemString(),"https")==0) return;
else 
Int5 System.getPlayItemLength();
Int6 System.getPosition();
Int7 = ( ( Int6 124) / Int5);
AnimatedLayer2.gotoFrame(Int7);
return 
Null;

There is still something to figure out but at last it no longer crashes. The issue to solve is that if I switch to a stream from music on disk then the seeker is not reset but stays where it was when I switched. But that is a minor issue.

I wonder why this workaround is not needed for Adil's Boom, which also has a circular seeker.
ariszlo is offline   Reply With Quote
Old 14th November 2018, 06:41   #12
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 494
This is great news. In order to make the amimatedLayer disappear during streaming you need to add the line AnimatedLayer2.gotoFrame(0); and put all the rest within the else section:

PHP Code:
Timer4.onTimer()
{
    if (
strsearch(getPlayItemString(),"http")==|| strsearch(getPlayItemString(),"https")==0)
    {
        
AnimatedLayer2.gotoFrame(0);
        return;
    }
    else 
    {
        
Int5 System.getPlayItemLength();
        
Int6 System.getPosition();
        
Int7 = ( ( Int6 124) / Int5);
        
AnimatedLayer2.gotoFrame(Int7);
        return 
Null;
    }

PeterK. is offline   Reply With Quote
Old 14th November 2018, 21:26   #13
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 372
Peter, you are my hero! Thank you very much.
ariszlo is offline   Reply With Quote
Old 15th November 2018, 17:38   #14
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 494
Quote:
Originally Posted by ariszlo View Post
... I wonder why this workaround is not needed for Adil's Boom, which also has a circular seeker.
If you start my skin and play an Online Radio you will notice that neither the progress bar nor the Seeker thumb are visible. This is managed by Winamp and its Skinning Engine which provides the <ProgressGrid> guiObject and help Winamp decide whether it should show or hide the progress bar and its thumb. In the Alfa Romeo Skin the circular progress bar was declared as an animated layer, which needs to be shown/hidden depending on the source we listen to. In the Boom skin the circular progress bar is just a layer covered by a map. In order to compute how much of the progress bar should be shown the command getPlayItemLength() is used in many functions in the script. And if you listen to a stream the value of getPlayItemLength() is -1. This could be the reason why the progress bar does not "move" while streaming because the newpos value is negative. So it works here properly without an <if> query and, as I assume, was achieved by accident.
Quote:
Originally Posted by ariszlo View Post
Peter, you are my hero! Thank you very much.
Always a pleasure.
PeterK. is offline   Reply With Quote
Old 18th November 2018, 15:20   #15
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 372
Thanks Peter, again. Something is still missing. If Winamp starts up with a playlist of music on disk and I start playing it then the seeker properly progresses. Then, when I switch to a playlist of online music, the seeker properly becomes inactive. And you can switch back and forth with proper seeker behavior.

However, if Winamp starts up with a playlist of online music and I start playing it, the seeker is properly idle. But when I switch to a playlist with music on disk, it will still remain idle.

This is the content of my playlist of online music (loungebarradio.m3u):

code:
#EXTM3U
#EXTINF:-1,http://streaming.radionomy.com/LOUNGEBARRADIO
http://streaming.radionomy.com/LOUNGEBARRADIO

Attached Files
File Type: m CircSlider.m (2.4 KB, 19 views)
ariszlo is offline   Reply With Quote
Old 18th November 2018, 16:50   #16
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 372
Figured it out. The if statements should only be added to Timer4.onTimer(), not to System.onScriptLoaded(). Restoring System.onScriptLoaded() to this fixes it:

PHP Code:
System.onScriptLoaded()
{
AnimatedLayer2 System.getScriptGroup().getObject(( "Progress"));
Button3 System.getScriptGroup().getObject(( "click"));
func79();
return 
Null;

ariszlo is offline   Reply With Quote
Old 18th November 2018, 17:52   #17
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 372
Published the fixed skin at DeviantArt.
ariszlo is offline   Reply With Quote
Old 18th November 2018, 19:04   #18
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 494
Quote:
Originally Posted by ariszlo View Post
Figured it out. The if statements should only be added to Timer4.onTimer(), not to System.onScriptLoaded()...
The content of .onScriptLoaded is called only once - while launching Winamp (or switching to another skin). After that all declared object "wait" until user start using them.

I am glad you got it done, Ariszló. And thanks for the credits.
PeterK. is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump