PDA

View Full Version : player status button script request


drwho9437
30th November 2001, 14:59
does anybody want to write a script for the player status button so the it causes the following actions:

State, Mouseaction, Winamp Action
stop, single click, play
stop, double click, eject
play, single click, pause
play, double click, stop
pause, single click, play (unpause)
pause, double click, stop

I would write it myself but I don't know the scripting language at the moment. I will probably try to learn it over break but I just had this idea so I though I'd ask if anyone wants to take a stab at it. The layout it is written for doesn't matter to me I can change that ;).

Naamloos
30th November 2001, 15:22
Make 3 buttons and give them a name I'm using myplaybutton as example

MyStop.onLeftClick()
Play();
MyStop.doubleClick()
Eject();

and so on...
check Rhinotrips site for the real names of the functions, I can't remember them so clear, but I know they are there...

drwho9437
30th November 2001, 17:36
I would like all the funtions on the play status button (the one that shows if winamp is playing paused or stoped) depending on it's state so I think it is much or complicated.

drwho9437
10th December 2001, 23:39
anyone want to help me with this one

sirchess
11th December 2001, 01:40
This is a rather tricky one. The problem is that WinAmp won't recognize a click on the status area. The script listed below will work, but only on a LAYER or BUTTON labelled "statusarea".

Also the script is FAR from perfect. The single-click actions will work, and the double-click for the play and pause states works, but the double-click for the stop state won't work. I'll look more into this later...


#include "../../../lib/std.mi"

Global GuiObject statusarea;
Global Slider SongPos;
Global Boolean DblClickDone;

Function Boolean checkStatus(int x, int y);

System.onScriptLoaded()
{
statusarea = getContainer("main").getLayout("normal").getObject("statusarea");
SongPos = getContainer("main").getLayout("normal").getObject("SeekerGhost");

DblClickDone = 0;
}


mainlayout.onLeftButtonUp(int x, int y)
{
if (DblClickDone == 0)
{
int IsPlayingInt;
IsPlayingInt = System.getLeftVuMeter();

if (IsPlayingInt != NULL)
{
System.Pause();
}
else
{
System.Play();
}
}
else DblClickDone = 0;
}

mainlayout.onLeftButtonDblClk(int x, int y)
{
if (SongPos.getPosition() != NULL)
{
System.Stop();
}
else
{
System.Eject();
}

DblClickDone = 1;
}

drwho9437
11th December 2001, 02:52
thanks... After the 20th I think I will have a chance to get my hands dirty with scripting. The idea of the script is to make an extreemly small winshade mode with the status being the only real button.

sirchess
11th December 2001, 20:32
Well like I said above, the status region itself won't register a click for some reason...but you could probably easily copy the status button images to layers and just have the script change layers when it changed modes.