Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==PREPROCESSOR==
- // @import "%fb2k_profile_path%marc2003\common8.js"
- // @name "Thumbs"
- // @feature "v1.4"
- // @feature "watch-metadb"
- // ==/PREPROCESSOR==
- //the track info section displays 3 lines of title formatted text. you can customise that here/////////////////////////////////////////////
- var line1 = {
- text: "", //leave this blank
- tf: "%artist%", //enter any title formatting
- font: gdi.Font("Segoe UI", 36, 1), //font name, size, style. 1 means bold and 0 is normal.
- colour: RGB(240, 240, 240), //colour
- y: 0 //change this value to move text up or down.
- }
- var line2 = {
- text: "",
- tf: "%title%",
- font: gdi.Font("Segoe UI", 28, 1),
- colour: RGB(210, 210, 210),
- y: 38
- }
- var line3 = {
- text: "",
- tf: "[%album%]",
- font: gdi.Font("Segoe UI", 20, 1),
- colour: RGB(180, 180, 180),
- y: 70
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- var p = new panel("Thumbs", ["remap", "custom_background"]);
- window.SetProperty("2k3.musicbrainz_releases", false);
- var li = new list("musicbrainz", 0, 0, 0, 0);
- var th = new thumbs();
- th.mode = th.modes.off;
- var r = new rating(0, 4, 24);
- var b = new buttons("playback");
- var bs = 32; //button size
- var c = new cd(0, 0, p.w, p.h);
- var l = new lastfm();
- //function takes 3 values: x, y, size. see on_size function if you want to update these relative to panel width/height
- var ps = new playcount_sync(3, 0, 32);
- b.update = function() {
- b.buttons.stop = new button((p.w - bs*6) , p.h-bs*3, bs, bs, {normal: this.images.stop}, function() { fb.Stop(); }, "Stop");
- b.buttons.play = new button((p.w - bs*6)+bs, p.h-bs*3, bs, bs, {normal: !fb.IsPlaying || fb.IsPaused ? this.images.play : this.images.pause}, function() { fb.PlayOrPause(); }, !fb.IsPlaying || fb.IsPaused ? "Play" : "Pause");
- b.buttons.previous = new button((p.w - bs*6)+bs * 2, p.h-bs*3, bs, bs, {normal: this.images.previous}, function() { fb.Prev(); }, "Previous");
- b.buttons.next = new button((p.w - bs*6)+bs * 3, p.h-bs*3, bs, bs, {normal: this.images.next}, function() { fb.Next(); }, "Next");
- window.Repaint();
- }
- b.update();
- function on_playback_time(time) {
- ps.playback_time(time);
- th.playback_time(time);
- }
- function on_size() {
- p.size();
- pos_x = 0;
- pos_y = p.h-15;
- th.size();
- r.x = p.w - 125;
- r.y = p.h - 25;
- c.w = 200;
- c.h = 200;
- c.x=0;
- c.y=p.h-200;
- ps.x = p.w - 220;
- ps.y = p.h - 95;
- b.update();
- ps.update_button();
- }
- function on_paint(gr) {
- th.mode = th.modes.off;
- p.draw_background(gr);
- th.draw(gr);
- r.draw(gr);
- for (var i = 0; i < li.items; i++) {
- p.draw_image(gr, li.musicbrainz_images[li.images[i]], pos_x + (i * 20), pos_y, 16, 16);
- }
- gr.FillSolidRect(0, p.h-150, p.w, 110, RGBA(0, 0, 0, 196));
- p.left_text(gr, line1.text, line1.font, line1.colour, 210, p.h-150, 500, line1.font.Height);
- p.left_text(gr, line2.text, line2.font, line2.colour, 210, p.h-150+ line2.y, 500, line2.font.Height);
- p.left_text(gr, line3.text, line3.font, line3.colour, 210, p.h-150 + line3.y, 500, line3.font.Height);
- c.draw(gr);
- b.draw(gr);
- }
- function on_playback_stop() {
- b.update();
- }
- function on_playback_pause() {
- b.update();
- }
- function on_playback_starting() {
- b.update();
- }
- function on_metadb_changed() {
- th.metadb_changed();
- r.metadb_changed();
- li.metadb_changed();
- c.metadb_changed();
- line1.text = p.eval(line1.tf);
- line2.text = p.eval(line2.tf);
- line3.text = p.eval(line3.tf);
- ps.metadb_changed();
- }
- function on_playback_new_track() {
- ps.playback_new_track();
- }
- function on_playback_edited() {
- ps.playback_edited();
- }
- function on_get_album_art_done(metadb, art_id, im, ip) {
- c.get_album_art_done(ip);
- }
- function on_mouse_wheel(step) {
- th.wheel(step);
- }
- function on_mouse_move(x, y) {
- p.move(x, y);
- if (x > pos_x && x < pos_x + (li.items * 20) && y > pos_y && y < pos_y + 20) return p.tt(li.urls[Math.floor((x - pos_x) / 20)]);
- if (b.move(x, y)) return;
- if (r.move(x,y)) return;
- if (c.move(x, y)) return;
- if (b.move(x, y)) return;
- }
- function on_mouse_lbtn_up(x, y) {
- if (x > pos_x && x < pos_x + (li.items * 20) && y > pos_y && y < pos_y + 20) return p.browser(li.urls[Math.floor((x - pos_x) / 20)]);
- if (b.lbtn_up(x, y)) return;
- if (r.lbtn_up(x,y)) return;
- th.lbtn_up(x, y);
- }
- function on_mouse_lbtn_dblclk(x, y) {
- if (c.lbtn_dblclk(x, y)) return;
- th.lbtn_dblclk(x, y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement