Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
65
Src/resources/skins/Winamp Modern/scripts/seek.m
Normal file
65
Src/resources/skins/Winamp Modern/scripts/seek.m
Normal file
|
@ -0,0 +1,65 @@
|
|||
#include <lib/std.mi>
|
||||
|
||||
Global Group frameGroup;
|
||||
Global Slider Seeker;
|
||||
Global Int Seeking;
|
||||
Global Timer SongTickerTimer;
|
||||
Global Text InfoTicker;
|
||||
Global GuiObject SongTicker;
|
||||
Global layer SeekPos;
|
||||
|
||||
System.onScriptLoaded() {
|
||||
|
||||
frameGroup = getScriptGroup();
|
||||
Seeker = frameGroup.findObject("SeekerGhost");
|
||||
SongTicker = frameGroup.findObject("songticker");
|
||||
SeekPos = frameGroup.findObject("player.seekbar.pos");
|
||||
InfoTicker = frameGroup.findObject("infoticker");
|
||||
|
||||
SongTickerTimer = new Timer;
|
||||
SongTickerTimer.setDelay(1000);
|
||||
}
|
||||
|
||||
SongTickerTimer.onTimer() {
|
||||
SongTicker.show();
|
||||
InfoTicker.hide();
|
||||
SongTickerTimer.stop();
|
||||
}
|
||||
|
||||
System.onScriptUnloading() {
|
||||
delete SongTickerTimer;
|
||||
}
|
||||
|
||||
|
||||
Seeker.onSetPosition(int p) {
|
||||
if (seeking) {
|
||||
Float f;
|
||||
f = p;
|
||||
f = f / 255 * 100;
|
||||
Float len = getPlayItemLength();
|
||||
if (len != 0) {
|
||||
int np = len * f / 100;
|
||||
SongTickerTimer.start();
|
||||
SongTicker.hide();
|
||||
InfoTicker.show();
|
||||
InfoTicker.setText(translate("Seek") + ":" + integerToTime(np) + "/" + integerToTime(len) + " (" + integerToString(f) + "%) ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Seeker.onLeftButtonDown(int x, int y) {
|
||||
seeking = 1;
|
||||
}
|
||||
|
||||
Seeker.onLeftButtonUp(int x, int y) {
|
||||
seeking = 0;
|
||||
SongTickerTimer.start();
|
||||
SongTicker.show();
|
||||
InfoTicker.hide();
|
||||
}
|
||||
|
||||
Seeker.onSetFinalPosition(int p) {
|
||||
SongTickerTimer.start();
|
||||
SongTicker.show();
|
||||
InfoTicker.hide();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue