Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var DT_SINGLELINE = 0x00000020;
- var DT_NOPREFIX = 0x00000800;
- var DT_END_ELLIPSIS = 0x00008000;
- var DT_TOP = 0x00000000;
- var DT_LEFT = 0x00000000;
- var DT_BOTTOM = 0x00000008;
- var DT_RIGHT = 0x00000002;
- var DT_CENTER = 0x00000001;
- var DT_VCENTER = 0x00000004;
- var DT_WORDBREAK = 0x00000010;
- var DT_CALCRECT = 0x00000400;
- var DT_NOPREFIX = 0x00000800;
- var DT_END_ELLIPSIS = 0x00008000;
- var DT_WORD_ELLIPSIS = 0x00040000;
- var title_font = gdi.Font("Open Sans SemiBold", 24);
- var artist_font = gdi.Font("Open Sans", 14);
- var back = window.GetColorCUI(3)
- var title_colour = 0xFFA44F55
- var artist_colour = 0xFFC68F91
- var album_colour = 0xFFA44F55
- var separator_colour = 0xFFA8797B
- var title_height = false;
- var artist_height = false;
- function RGB(r, g, b) {
- return (0xff000000 | (r << 16) | (g << 8) | (b))
- }
- function on_size() {
- ww = window.Width;
- wh = window.Height;
- }
- function on_paint(gr) {
- if (!title_height) {
- var title_height = gr.CalcTextHeight("The quick brown fox jumps over the lazy dog.", title_font)
- var artist_height = gr.CalcTextHeight("The quick brown fox jumps over the lazy dog.", artist_font)
- }
- gr.FillSolidRect(0, 0, ww, wh, back);
- gr.GdiDrawText(fb.TitleFormat("%title%").Eval(), title_font, title_colour, 5, 0, ww, wh-artist_height-artist_height, DT_CALCRECT | DT_NOPREFIX | DT_WORDBREAK | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS);
- gr.GdiDrawText(fb.TitleFormat("[%artist%]").Eval(), artist_font, artist_colour, 5, wh-artist_height-artist_height, ww, artist_height, DT_CALCRECT | DT_NOPREFIX | DT_END_ELLIPSIS);
- gr.GdiDrawText(fb.TitleFormat("[%album%]").Eval(), artist_font, album_colour, 5, wh-artist_height, ww, artist_height, DT_CALCRECT | DT_NOPREFIX | DT_END_ELLIPSIS);
- }
- function on_mouse_lbtn_down(x, y) {
- }
- function on_mouse_lbtn_up(x, y) {
- }
- function on_mouse_lbtn_dblclk(x, y) {
- if(fb.IsPlaying && (x>0 && x<ww)) {
- fb.RunMainMenuCommand("View/Columns playlist/Activate now playing");
- fb.RunMainMenuCommand("View/ELPlaylist/Show now playing");
- }
- }
- //=================================================// Callbacks
- function on_playback_new_track(info) {
- fb.RunMainMenuCommand("View/Columns playlist/Activate now playing");
- fb.RunMainMenuCommand("View/ELPlaylist/Show now playing");
- window.Repaint();
- }
- function on_playback_stop(reason) {
- if(reason==0) {
- // on user Stop
- window.Repaint();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement