aboutsummaryrefslogtreecommitdiff
path: root/Src/resources/skins/Winamp Modern/scripts/pltime.m
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/resources/skins/Winamp Modern/scripts/pltime.m
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/resources/skins/Winamp Modern/scripts/pltime.m')
-rw-r--r--Src/resources/skins/Winamp Modern/scripts/pltime.m62
1 files changed, 62 insertions, 0 deletions
diff --git a/Src/resources/skins/Winamp Modern/scripts/pltime.m b/Src/resources/skins/Winamp Modern/scripts/pltime.m
new file mode 100644
index 00000000..0f1ad50d
--- /dev/null
+++ b/Src/resources/skins/Winamp Modern/scripts/pltime.m
@@ -0,0 +1,62 @@
+#include <lib/std.mi>
+#include "attribs.m"
+
+Global Layer TimeBG,TimeDisplay;
+Global Text PLTime;
+Global Group frameGroup;
+Global GuiObject SongTicker;
+Global Timer callback;
+
+function setSongtickerScrolling();
+
+System.onScriptLoaded() {
+ initAttribs();
+ frameGroup = getScriptGroup();
+ TimeBG = frameGroup.findobject("player.pl.time.left");
+ TimeDisplay = frameGroup.findobject("player.pl.time.display.left");
+ PLTime = frameGroup.findobject("PLTime");
+ callback = new Timer; callback.setDelay(1); callback.start();
+}
+
+callback.onTimer() {
+ Container c = getContainer("pledit");
+ if (c) {
+ Layout l = c.getLayout("shade");
+ if (l) {
+ SongTicker = l.findObject("PESongticker");
+ }
+ }
+ if (SongTicker) callback.stop();
+ setSongtickerScrolling();
+}
+
+frameGroup.onResize(int x, int y, int w, int h) {
+ if (w>394) {
+ TimeBG.show();
+ TimeDisplay.show();
+ PLTime.setXMLParam("x","-215");
+ PLTime.setXMLParam("w","90");
+ } else {
+ TimeBG.hide();
+ TimeDisplay.hide();
+ PLTime.setXMLParam("x","-180");
+ PLTime.setXMLParam("w","55");
+ }
+}
+
+songticker_scrolling_attrib.onDataChanged() {
+ setSongtickerScrolling();
+}
+
+setSongtickerScrolling() {
+ if (!Songticker)
+ return;
+
+ if (songticker_scrolling_modern_attrib.getData()=="1") {
+ SongTicker.setXMLParam("ticker","bounce");
+ } else if (songticker_scrolling_classic_attrib.getData()=="1") {
+ SongTicker.setXMLParam("ticker","scroll");
+ } else {
+ SongTicker.setXMLParam("ticker","off");
+ }
+}