aboutsummaryrefslogtreecommitdiff
path: root/Src/resources/skins/Winamp Modern/scripts/albumart.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/albumart.m
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/resources/skins/Winamp Modern/scripts/albumart.m')
-rw-r--r--Src/resources/skins/Winamp Modern/scripts/albumart.m113
1 files changed, 113 insertions, 0 deletions
diff --git a/Src/resources/skins/Winamp Modern/scripts/albumart.m b/Src/resources/skins/Winamp Modern/scripts/albumart.m
new file mode 100644
index 00000000..2ef9ce27
--- /dev/null
+++ b/Src/resources/skins/Winamp Modern/scripts/albumart.m
@@ -0,0 +1,113 @@
+#include <lib/std.mi>
+#include "attribs.m"
+
+Global AlbumArtLayer waaa;
+Global Layout aalayout;
+
+System.onScriptLoaded()
+{
+ initAttribs();
+ Container albumart = System.getContainer("winamp.albumart");
+ aalayout = albumart.getLayout("normal");
+ waaa = getScriptGroup().findObject(getParam());
+}
+
+system.onScriptUnloading ()
+{
+ if (!aalayout) return;
+ setPrivateInt("Winamp Modern", "Album Art XPos", aalayout.getLeft());
+ setPrivateInt("Winamp Modern", "Album Art YPos", aalayout.getTop());
+}
+
+aalayout.onStartup ()
+{
+ resize(getPrivateInt("Winamp Modern", "Album Art XPos", 0), getPrivateInt("Winamp Modern", "Album Art YPos", 0), getWidth(), getHeight());
+}
+
+aalayout.onSetVisible (Boolean onoff)
+{
+ if (!onoff)
+ {
+ albumart_visible_attrib.setData("0");
+ }
+ else
+ {
+ albumart_visible_attrib.setData("1");
+ }
+}
+
+albumart_visible_attrib.onDataChanged ()
+{
+ if (getData() == "1")
+ {
+ aalayout.show();
+ }
+ else
+ {
+ aalayout.hide();
+ }
+}
+
+System.onKeyDown(String key)
+{
+ if (key == "alt+a")
+ {
+ if (albumart_visible_attrib.getData() == "0")
+ albumart_visible_attrib.setData("1");
+ else
+ albumart_visible_attrib.setData("0");
+ complete;
+ }
+}
+
+waaa.onRightButtonDown (int x, int y)
+{
+ popupmenu p = new popupmenu;
+
+ p.addCommand("Refresh Album Art", 1, 0, 0);
+ String path = getPath(getPlayItemMetaDataString("filename"));
+ if(path != "")
+ {
+ p.addCommand("Open Folder", 2, 0, 0);
+ }
+
+ int result = p.popatmouse();
+ delete p;
+
+ if (result == 1)
+ {
+ waaa.refresh();
+ }
+ else if (result == 2)
+ {
+ if(path != "")
+ {
+ System.navigateUrl(path);
+ }
+ else
+ {
+ String url = getPlayItemMetaDataString("streamurl");
+ if(url != "")
+ {
+ System.navigateUrl(url);
+ }
+ }
+ }
+}
+
+waaa.onLeftButtonDblClk (int x, int y)
+{
+ String path = getPath(getPlayItemMetaDataString("filename"));
+ if(path != "")
+ {
+ System.navigateUrl(path);
+ }
+ else
+ {
+ String url = getPlayItemMetaDataString("streamurl");
+ if(url != "")
+ {
+ System.navigateUrl(url);
+ }
+ }
+} \ No newline at end of file