diff options
| author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
| commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
| tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/resources/skins/Winamp Modern/scripts/albumart.m | |
| parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
| parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
| download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz | |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/resources/skins/Winamp Modern/scripts/albumart.m')
| -rw-r--r-- | Src/resources/skins/Winamp Modern/scripts/albumart.m | 113 |
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 |
