From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- .../skins/Winamp Modern/scripts/albumart.m | 113 +++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 Src/resources/skins/Winamp Modern/scripts/albumart.m (limited to 'Src/resources/skins/Winamp Modern/scripts/albumart.m') 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 +#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 -- cgit