Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==PREPROCESSOR==
- // @name "WSH Advanced Playback Order Button"
- // @version "1.0.0"
- // @author "Br3tt aka Falstaff >> http://br3tt.deviantart.com"
- // ==/PREPROCESSOR==
- // Use with MenuManager()
- MF_STRING = 0x00000000;
- MF_SEPARATOR = 0x00000800;
- MF_GRAYED = 0x00000001;
- MF_DISABLED = 0x00000002;
- MF_POPUP = 0x00000010;
- // Used in window.SetCursor()
- IDC_ARROW = 32512;
- IDC_HAND = 32649;
- // Used in window.GetColorCUI()
- ColorTypeCUI = {
- text: 0,
- selection_text: 1,
- inactive_selection_text: 2,
- background: 3,
- selection_background: 4,
- inactive_selection_background: 5,
- active_item_frame: 6
- };
- // Used in window.GetColorDUI()
- ColorTypeDUI = {
- text: 0,
- background: 1,
- highlight: 2,
- selection: 3
- };
- function StringFormat() {
- var h_align = 0,
- v_align = 0,
- trimming = 0,
- flags = 0;
- switch (arguments.length) {
- case 3:
- trimming = arguments[2];
- case 2:
- v_align = arguments[1];
- case 1:
- h_align = arguments[0];
- break;
- default:
- return 0;
- };
- return ((h_align << 28) | (v_align << 24) | (trimming << 20) | flags);
- };
- StringAlignment = {
- Near: 0,
- Centre: 1,
- Far: 2
- };
- var lt_stringformat = StringFormat(StringAlignment.Near, StringAlignment.Near);
- var ct_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Near);
- var rt_stringformat = StringFormat(StringAlignment.Far, StringAlignment.Near);
- var lc_stringformat = StringFormat(StringAlignment.Near, StringAlignment.Centre);
- var cc_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Centre);
- var rc_stringformat = StringFormat(StringAlignment.Far, StringAlignment.Centre);
- var lb_stringformat = StringFormat(StringAlignment.Near, StringAlignment.Far);
- var cb_stringformat = StringFormat(StringAlignment.Centre, StringAlignment.Far);
- var rb_stringformat = StringFormat(StringAlignment.Far, StringAlignment.Far);
- function RGB(r, g, b) {
- return (0xff000000 | (r << 16) | (g << 8) | (b));
- };
- function RGBA(r, g, b, a) {
- return ((a << 24) | (r << 16) | (g << 8) | (b));
- };
- //=================================================// Button object
- ButtonStates = {normal: 0, hover: 1, down: 2};
- button = function (normal, hover, down) {
- this.img = Array(normal, hover, down);
- this.w = this.img[0].Width;
- this.h = this.img[0].Height;
- this.state = ButtonStates.normal;
- this.update = function (normal, hover, down) {
- this.img = Array(normal, hover, down);
- };
- this.draw = function (gr, x, y, alpha) {
- this.x = x;
- this.y = y;
- this.img[this.state] && gr.DrawImage(this.img[this.state], this.x, this.y, this.w, this.h, 0, 0, this.w, this.h, 0, alpha);
- };
- this.display_context_menu = function (x, y, id) {};
- this.repaint = function () {
- window.RepaintRect(this.x, this.y, this.w, this.h);
- };
- this.checkstate = function (event, x, y) {
- this.ishover = (x > this.x && x < this.x + this.w - 1 && y > this.y && y < this.y + this.h - 1);
- this.old = this.state;
- switch (event) {
- case "down":
- switch(this.state) {
- case ButtonStates.normal:
- case ButtonStates.hover:
- this.state = this.ishover ? ButtonStates.down : ButtonStates.normal;
- break;
- };
- break;
- case "up":
- this.state = this.ishover ? ButtonStates.hover : ButtonStates.normal;
- break;
- case "right":
- if(this.ishover) this.display_context_menu(x, y, id);
- break;
- case "move":
- switch(this.state) {
- case ButtonStates.normal:
- case ButtonStates.hover:
- this.state = this.ishover ? ButtonStates.hover : ButtonStates.normal;
- break;
- };
- break;
- case "leave":
- this.state = this.isdown ? ButtonStates.down : ButtonStates.normal;
- break;
- };
- if(this.state!=this.old) this.repaint();
- return this.state;
- };
- };
- // images
- var bt_pbo_off;
- var bt_pbo_hov;
- var bt_pbo_on;
- var pbo_sac;
- var pbo_sac_ov;
- var pbo_sac_on;
- var pbo_normal;
- var pbo_normal_ov;
- var pbo_normal_on;
- var pbo_repeat_playlist;
- var pbo_repeat_playlist_ov;
- var pbo_repeat_playlist_on;
- var pbo_repeat;
- var pbo_repeat_ov;
- var pbo_repeat_on;
- var pbo_random;
- var pbo_random_ov;
- var pbo_random_on;
- var pbo_shuffle;
- var pbo_shuffle_ov;
- var pbo_shuffle_on;
- var pbo_shuffle_album;
- var pbo_shuffle_album_ov;
- var pbo_shuffle_album_on;
- var pbo_shuffle_folder;
- var pbo_shuffle_folder_ov;
- var pbo_shuffle_folder_on;
- // Globals
- var g_instancetype = window.InstanceType;
- var ww = 0, wh = 0;
- var g_textcolor = 0, g_textcolor_hl = 0;
- var g_backcolor = 0;
- var g_syscolor = 0;
- var COLOR_BTNFACE = 15;
- var hand = false;
- var bt_pad_x = window.GetProperty("PBO button left padding", 2);
- var bt_pad_y = window.GetProperty("PBO button top padding", 2);
- var buttons = Array();
- function get_colors() {
- if (g_instancetype == 0) { // CUI
- g_textcolor = window.GetColorCUI(ColorTypeCUI.text);
- g_textcolor_hl = window.GetColorCUI(ColorTypeCUI.text);
- g_textcolor_sel = window.GetColorCUI(ColorTypeCUI.selection_text);
- g_backcolor = window.GetColorCUI(ColorTypeCUI.background);
- } else if (g_instancetype == 1) { // DUI
- g_textcolor = window.GetColorDUI(ColorTypeDUI.text);
- g_textcolor_hl = window.GetColorDUI(ColorTypeDUI.highlight);
- g_textcolor_sel = window.GetColorDUI(ColorTypeDUI.selection);
- g_backcolor = window.GetColorDUI(ColorTypeDUI.background);
- } else {
- // None
- };
- g_syscolor = utils.GetSysColor(COLOR_BTNFACE);
- }
- get_colors();
- // START
- function on_size() {
- ww = window.Width;
- wh = window.Height;
- if(!ww || !wh) return true;
- init_icons();
- check_buttons();
- }
- function on_paint(gr) {
- // Fill default system bg color
- gr.FillSolidRect(0, 0, ww, wh, g_syscolor);
- // Draw PBO button
- // ===============
- for(var i=0; i<buttons.length; i++) {
- switch(i) {
- case 0: // PBO
- buttons[i].draw(gr, bt_pad_x, bt_pad_y, 255);
- break;
- case 1: // PBO list
- buttons[i].draw(gr, bt_pad_x+26, bt_pad_y, 255);
- break;
- }
- }
- }
- function on_mouse_lbtn_down(x, y, mask) {
- // buttons
- for(var i=0; i<buttons.length; i++) {
- buttons[i].checkstate("down", x, y);
- };
- window.Repaint();
- };
- function on_mouse_lbtn_up(x, y, mask) {
- // buttons
- for(var i=0; i<buttons.length; i++) {
- switch(i) {
- case 0:
- if(buttons[i].checkstate("up", x, y)==ButtonStates.hover) {
- if(!fb.StopAfterCurrent) {
- fb.PlaybackOrder = (fb.PlaybackOrder>5)?0:fb.PlaybackOrder+1;
- if(fb.PlaybackOrder==0) {
- fb.RunMainMenuCommand("Playback/Stop After Current");
- }
- } else {
- // removing Stop After Current
- fb.RunMainMenuCommand("Playback/Stop After Current");
- }
- buttons[i].state = ButtonStates.hover;
- };
- break;
- case 1:
- if(buttons[i].checkstate("up", x, y)==ButtonStates.hover) {
- show_pbo_context_menu(bt_pad_x+30, bt_pad_y+15);
- buttons[i].state = ButtonStates.hover;
- };
- break;
- };
- };
- window.Repaint();
- };
- function on_mouse_move(x, y) {
- hand = false;
- // buttons
- for(var i=0; i<buttons.length; i++) {
- if(buttons[i].checkstate("move", x, y)==ButtonStates.hover) hand = true;
- };
- // Mouse Cursor
- window.SetCursor(hand? IDC_HAND : IDC_ARROW);
- }
- function on_mouse_leave() {
- // buttons
- for(var i=0; i<buttons.length; i++) {
- buttons[i].checkstate("leave", 0, 0);
- };
- window.Repaint();
- }
- function on_colors_changed() {
- get_colors();
- window.Repaint();
- }
- //=================================================// Events
- function on_playlist_stop_after_current_changed(state) {
- check_buttons();
- window.Repaint();
- }
- function on_playback_order_changed(new_order_index) {
- check_buttons();
- window.Repaint();
- }
- //=================================================// Init Icons and Images (no_cover ...)
- function init_icons() {
- var gb;
- var gui_font;
- var off_color = g_textcolor;
- var hov_color = g_textcolor_sel;
- var on_colour = g_textcolor_hl;
- // --- pbo list bt ---
- bt_pbolist_off = gdi.CreateImage(12, 21);
- gb = bt_pbolist_off.GetGraphics();
- gb.SetSmoothingMode(2);
- gb.FillGradRect(-4, 0, 15, 18, 90, 0, g_textcolor&0x25ffffff, 1.0);
- gb.DrawRoundRect(-4, 0, 15, 18, 3, 3, 1.0, g_textcolor&0x35ffffff);
- gb.SetSmoothingMode(0);
- gb.FillSolidRect(-1, 0, 1, 19, g_textcolor&0x20ffffff);
- //
- gb.FillSolidRect(3, 09, 5, 1, off_color);
- gb.FillSolidRect(4, 10, 3, 1, off_color);
- gb.FillSolidRect(5, 11, 1, 1, off_color);
- bt_pbolist_off.ReleaseGraphics(gb);
- bt_pbolist_hov = gdi.CreateImage(12, 21);
- gb = bt_pbolist_hov.GetGraphics();
- gb.SetSmoothingMode(2);
- gb.FillGradRect(-4, 0, 15, 18, 90, 0, g_textcolor&0x25ffffff, 1.0);
- gb.DrawRoundRect(-4, 0, 15, 18, 3, 3, 1.0, g_textcolor&0x35ffffff);
- gb.SetSmoothingMode(0);
- gb.FillSolidRect(-1, 0, 1, 19, g_textcolor&0x20ffffff);
- //
- gb.FillSolidRect(3, 09, 5, 1, hov_color);
- gb.FillSolidRect(4, 10, 3, 1, hov_color);
- gb.FillSolidRect(5, 11, 1, 1, hov_color);
- bt_pbolist_hov.ReleaseGraphics(gb);
- bt_pbolist_on = gdi.CreateImage(12, 21);
- gb = bt_pbolist_on.GetGraphics();
- gb.SetSmoothingMode(2);
- gb.FillGradRect(-4, 0, 15, 18, 90, 0, g_textcolor&0x25ffffff, 0.0);
- gb.DrawRoundRect(-4, 0, 15, 18, 3, 3, 1.0, g_textcolor&0x35ffffff);
- gb.SetSmoothingMode(0);
- gb.FillSolidRect(-1, 0, 1, 19, g_textcolor&0x20ffffff);
- //
- gb.FillSolidRect(3, 10, 5, 1, on_colour);
- gb.FillSolidRect(4, 11, 3, 1, on_colour);
- gb.FillSolidRect(5, 12, 1, 1, on_colour);
- bt_pbolist_on.ReleaseGraphics(gb);
- // --- pbo bg ---
- bt_pbo_off = gdi.CreateImage(26, 21);
- gb = bt_pbo_off.GetGraphics();
- gb.SetSmoothingMode(2);
- gb.FillGradRect(1, 0, 28, 18, 90, 0, g_textcolor&0x25ffffff, 1.0);
- gb.DrawRoundRect(1, 0, 28, 18, 3, 3, 1.0, g_textcolor&0x35ffffff);
- gb.SetSmoothingMode(0);
- gb.FillSolidRect(25, 1, 1, 17, g_textcolor&0x20ffffff);
- bt_pbo_off.ReleaseGraphics(gb);
- bt_pbo_hov = gdi.CreateImage(26, 21);
- gb = bt_pbo_hov.GetGraphics();
- gb.SetSmoothingMode(2);
- gb.FillGradRect(1, 0, 28, 18, 90, 0, g_textcolor&0x25ffffff, 1.0);
- gb.DrawRoundRect(1, 0, 28, 18, 3, 3, 1.0, g_textcolor&0x35ffffff);
- gb.SetSmoothingMode(0);
- gb.FillSolidRect(25, 1, 1, 17, g_textcolor&0x20ffffff);
- bt_pbo_hov.ReleaseGraphics(gb);
- bt_pbo_on = gdi.CreateImage(26, 21);
- gb = bt_pbo_on.GetGraphics();
- gb.SetSmoothingMode(2);
- gb.FillGradRect(1, 0, 28, 18, 90, 0, g_textcolor&0x25ffffff, 0.0);
- gb.DrawRoundRect(1, 0, 28, 18, 3, 3, 1.0, g_textcolor&0x35ffffff);
- gb.SetSmoothingMode(0);
- gb.FillSolidRect(25, 1, 1, 17, g_textcolor&0x20ffffff);
- bt_pbo_on.ReleaseGraphics(gb);
- // --- pbo img ---
- pbo_sac = gdi.CreateImage(26, 21);
- gb = pbo_sac.GetGraphics();
- gb.DrawImage(bt_pbo_off, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 9, 9, 1, off_color);
- gb.FillSolidRect(12, 7, 1, 5, off_color);
- gb.FillSolidRect(13, 8, 1, 3, off_color);
- gb.FillSolidRect(16, 7, 5, 5, off_color);
- pbo_sac.ReleaseGraphics(gb);
- pbo_sac_ov = gdi.CreateImage(26, 21);
- gb = pbo_sac_ov.GetGraphics();
- gb.DrawImage(bt_pbo_hov, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 9, 9, 1, hov_color);
- gb.FillSolidRect(12, 7, 1, 5, hov_color);
- gb.FillSolidRect(13, 8, 1, 3, hov_color);
- gb.FillSolidRect(16, 7, 5, 5, hov_color);
- pbo_sac_ov.ReleaseGraphics(gb);
- pbo_sac_on = gdi.CreateImage(26, 21);
- gb = pbo_sac_on.GetGraphics();
- gb.DrawImage(bt_pbo_on, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 10, 9, 1, on_colour);
- gb.FillSolidRect(12, 8, 1, 5, on_colour);
- gb.FillSolidRect(13, 9, 1, 3, on_colour);
- gb.FillSolidRect(16, 8, 5, 5, on_colour);
- pbo_sac_on.ReleaseGraphics(gb);
- pbo_normal = gdi.CreateImage(26, 21);
- gb = pbo_normal.GetGraphics();
- gb.DrawImage(bt_pbo_off, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 9, 15, 1, off_color);
- gb.FillSolidRect(18, 7, 1, 5, off_color);
- gb.FillSolidRect(19, 8, 1, 3, off_color);
- pbo_normal.ReleaseGraphics(gb);
- pbo_normal_ov = gdi.CreateImage(26, 21);
- gb = pbo_normal_ov.GetGraphics();
- gb.DrawImage(bt_pbo_hov, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 9, 15, 1, hov_color);
- gb.FillSolidRect(18, 7, 1, 5, hov_color);
- gb.FillSolidRect(19, 8, 1, 3, hov_color);
- pbo_normal_ov.ReleaseGraphics(gb);
- pbo_normal_on = gdi.CreateImage(26, 21);
- gb = pbo_normal_on.GetGraphics();
- gb.DrawImage(bt_pbo_on, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 10, 15, 1, on_colour);
- gb.FillSolidRect(18, 8, 1, 5, on_colour);
- gb.FillSolidRect(19, 9, 1, 3, on_colour);
- pbo_normal_on.ReleaseGraphics(gb);
- pbo_repeat_playlist = gdi.CreateImage(26, 21);
- gb = pbo_repeat_playlist.GetGraphics();
- gb.DrawImage(bt_pbo_off, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 10, 3, 1, off_color);
- gb.FillSolidRect(15, 6, 6, 1, off_color);
- gb.FillSolidRect(6, 13, 15, 1, off_color);
- gb.FillSolidRect(5, 11, 1, 2, off_color);
- gb.FillSolidRect(21, 7, 1, 6, off_color);
- gb.FillSolidRect(17, 4, 1, 5, off_color);
- gb.FillSolidRect(16, 5, 1, 3, off_color);
- gb.FillSolidRect(10, 6, 4, 1, off_color);
- gb.FillSolidRect(10, 8, 4, 1, off_color);
- gb.FillSolidRect(10, 10, 4, 1, off_color);
- pbo_repeat_playlist.ReleaseGraphics(gb);
- pbo_repeat_playlist_ov = gdi.CreateImage(26, 21);
- gb = pbo_repeat_playlist_ov.GetGraphics();
- gb.DrawImage(bt_pbo_hov, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 10, 3, 1, hov_color);
- gb.FillSolidRect(15, 6, 6, 1, hov_color);
- gb.FillSolidRect(6, 13, 15, 1, hov_color);
- gb.FillSolidRect(5, 11, 1, 2, hov_color);
- gb.FillSolidRect(21, 7, 1, 6, hov_color);
- gb.FillSolidRect(17, 4, 1, 5, hov_color);
- gb.FillSolidRect(16, 5, 1, 3, hov_color);
- gb.FillSolidRect(10, 6, 4, 1, hov_color);
- gb.FillSolidRect(10, 8, 4, 1, hov_color);
- gb.FillSolidRect(10, 10, 4, 1, hov_color);
- pbo_repeat_playlist_ov.ReleaseGraphics(gb);
- pbo_repeat_playlist_on = gdi.CreateImage(26, 21);
- gb = pbo_repeat_playlist_on.GetGraphics();
- gb.DrawImage(bt_pbo_on, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 11, 3, 1, on_colour);
- gb.FillSolidRect(15, 7, 6, 1, on_colour);
- gb.FillSolidRect(6, 14, 15, 1, on_colour);
- gb.FillSolidRect(5, 12, 1, 2, on_colour);
- gb.FillSolidRect(21, 8, 1, 6, on_colour);
- gb.FillSolidRect(17, 5, 1, 5, on_colour);
- gb.FillSolidRect(16, 6, 1, 3, on_colour);
- gb.FillSolidRect(10, 7, 4, 1, on_colour);
- gb.FillSolidRect(10, 9, 4, 1, on_colour);
- gb.FillSolidRect(10, 11, 4, 1, on_colour);
- pbo_repeat_playlist_on.ReleaseGraphics(gb);
- pbo_repeat = gdi.CreateImage(26, 21);
- gb = pbo_repeat.GetGraphics();
- gb.DrawImage(bt_pbo_off, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 6, 6, 1, off_color);
- gb.FillSolidRect(13, 6, 8, 1, off_color);
- gb.FillSolidRect(6, 13, 15, 1, off_color);
- gb.FillSolidRect(5, 7, 1, 6, off_color);
- gb.FillSolidRect(21, 7, 1, 6, off_color);
- gb.FillSolidRect(15, 4, 1, 5, off_color);
- gb.FillSolidRect(14, 5, 1, 3, off_color);
- gb.FillSolidRect(11, 5, 1, 3, off_color);
- pbo_repeat.ReleaseGraphics(gb);
- pbo_repeat_ov = gdi.CreateImage(26, 21);
- gb = pbo_repeat_ov.GetGraphics();
- gb.DrawImage(bt_pbo_hov, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 6, 6, 1, hov_color);
- gb.FillSolidRect(13, 6, 8, 1, hov_color);
- gb.FillSolidRect(6, 13, 15, 1, hov_color);
- gb.FillSolidRect(5, 7, 1, 6, hov_color);
- gb.FillSolidRect(21, 7, 1, 6, hov_color);
- gb.FillSolidRect(15, 4, 1, 5, hov_color);
- gb.FillSolidRect(14, 5, 1, 3, hov_color);
- gb.FillSolidRect(11, 5, 1, 3, hov_color);
- pbo_repeat_ov.ReleaseGraphics(gb);
- pbo_repeat_on = gdi.CreateImage(26, 21);
- gb = pbo_repeat_on.GetGraphics();
- gb.DrawImage(bt_pbo_on, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 7, 6, 1, on_colour);
- gb.FillSolidRect(13, 7, 8, 1, on_colour);
- gb.FillSolidRect(6, 14, 15, 1, on_colour);
- gb.FillSolidRect(5, 8, 1, 6, on_colour);
- gb.FillSolidRect(21, 8, 1, 6, on_colour);
- gb.FillSolidRect(15, 5, 1, 5, on_colour);
- gb.FillSolidRect(14, 6, 1, 3, on_colour);
- gb.FillSolidRect(11, 6, 1, 3, on_colour);
- pbo_repeat_on.ReleaseGraphics(gb);
- pbo_random = gdi.CreateImage(26, 21);
- gb = pbo_random.GetGraphics();
- gb.DrawImage(bt_pbo_off, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gui_font = gdi.Font("tahoma", 8, 0);
- gb.SetTextRenderingHint(3);
- gb.DrawString("RND", gui_font, off_color, 0, 3, 27, 13, cc_stringformat);
- pbo_random.ReleaseGraphics(gb);
- pbo_random_ov = gdi.CreateImage(26, 21);
- gb = pbo_random_ov.GetGraphics();
- gb.DrawImage(bt_pbo_hov, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gui_font = gdi.Font("tahoma", 8, 0);
- gb.SetTextRenderingHint(3);
- gb.DrawString("RND", gui_font, hov_color, 0, 3, 27, 13, cc_stringformat);
- pbo_random_ov.ReleaseGraphics(gb);
- pbo_random_on = gdi.CreateImage(26, 21);
- gb = pbo_random_on.GetGraphics();
- gb.DrawImage(bt_pbo_on, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gui_font = gdi.Font("tahoma", 8, 0);
- gb.SetTextRenderingHint(3);
- gb.DrawString("RND", gui_font, on_colour, 0, 4, 27, 13, cc_stringformat);
- pbo_random_on.ReleaseGraphics(gb);
- pbo_shuffle = gdi.CreateImage(26, 21);
- gb = pbo_shuffle.GetGraphics();
- gb.DrawImage(bt_pbo_off, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 6, 6, 1, off_color);
- gb.FillSolidRect(15, 6, 7, 1, off_color);
- gb.FillSolidRect(6, 12, 6, 1, off_color);
- gb.FillSolidRect(15, 12, 7, 1, off_color);
- gb.FillSolidRect(19, 4, 1, 5, off_color);
- gb.FillSolidRect(19, 10, 1, 5, off_color);
- gb.FillSolidRect(20, 5, 1, 3, off_color);
- gb.FillSolidRect(20, 11, 1, 3, off_color);
- gb.FillSolidRect(12, 7, 1, 1, off_color);
- gb.FillSolidRect(12, 11, 1, 1, off_color);
- gb.FillSolidRect(14, 7, 1, 1, off_color);
- gb.FillSolidRect(14, 11, 1, 1, off_color);
- gb.FillSolidRect(13, 8, 1, 3, off_color);
- pbo_shuffle.ReleaseGraphics(gb);
- pbo_shuffle_ov = gdi.CreateImage(26, 21);
- gb = pbo_shuffle_ov.GetGraphics();
- gb.DrawImage(bt_pbo_hov, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 6, 6, 1, hov_color);
- gb.FillSolidRect(15, 6, 7, 1, hov_color);
- gb.FillSolidRect(6, 12, 6, 1, hov_color);
- gb.FillSolidRect(15, 12, 7, 1, hov_color);
- gb.FillSolidRect(19, 4, 1, 5, hov_color);
- gb.FillSolidRect(19, 10, 1, 5, hov_color);
- gb.FillSolidRect(20, 5, 1, 3, hov_color);
- gb.FillSolidRect(20, 11, 1, 3, hov_color);
- gb.FillSolidRect(12, 7, 1, 1, hov_color);
- gb.FillSolidRect(12, 11, 1, 1, hov_color);
- gb.FillSolidRect(14, 7, 1, 1, hov_color);
- gb.FillSolidRect(14, 11, 1, 1, hov_color);
- gb.FillSolidRect(13, 8, 1, 3, hov_color);
- pbo_shuffle_ov.ReleaseGraphics(gb);
- pbo_shuffle_on = gdi.CreateImage(26, 21);
- gb = pbo_shuffle_on.GetGraphics();
- gb.DrawImage(bt_pbo_on, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(6, 7, 6, 1, on_colour);
- gb.FillSolidRect(15, 7, 7, 1, on_colour);
- gb.FillSolidRect(6, 13, 6, 1, on_colour);
- gb.FillSolidRect(15, 13, 7, 1, on_colour);
- gb.FillSolidRect(19, 5, 1, 5, on_colour);
- gb.FillSolidRect(19, 11, 1, 5, on_colour);
- gb.FillSolidRect(20, 6, 1, 3, on_colour);
- gb.FillSolidRect(20, 12, 1, 3, on_colour);
- gb.FillSolidRect(12, 8, 1, 1, on_colour);
- gb.FillSolidRect(12, 12, 1, 1, on_colour);
- gb.FillSolidRect(14, 8, 1, 1, on_colour);
- gb.FillSolidRect(14, 12, 1, 1, on_colour);
- gb.FillSolidRect(13, 9, 1, 3, on_colour);
- pbo_shuffle_on.ReleaseGraphics(gb);
- pbo_shuffle_album = gdi.CreateImage(26, 21);
- gb = pbo_shuffle_album.GetGraphics();
- gb.DrawImage(bt_pbo_off, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(12, 6, 2, 1, off_color);
- gb.FillSolidRect(17, 6, 5, 1, off_color);
- gb.FillSolidRect(12, 12, 2, 1, off_color);
- gb.FillSolidRect(17, 12, 5, 1, off_color);
- gb.FillSolidRect(19, 4, 1, 5, off_color);
- gb.FillSolidRect(19, 10, 1, 5, off_color);
- gb.FillSolidRect(20, 5, 1, 3, off_color);
- gb.FillSolidRect(20, 11, 1, 3, off_color);
- gb.FillSolidRect(14, 7, 1, 1, off_color);
- gb.FillSolidRect(14, 11, 1, 1, off_color);
- gb.FillSolidRect(16, 7, 1, 1, off_color);
- gb.FillSolidRect(16, 11, 1, 1, off_color);
- gb.FillSolidRect(15, 8, 1, 3, off_color);
- gb.FillSolidRect(5, 6, 1, 1, off_color);
- gb.FillSolidRect(5, 8, 1, 1, off_color);
- gb.FillSolidRect(5, 10, 1, 1, off_color);
- gb.FillSolidRect(5, 12, 1, 1, off_color);
- gb.FillSolidRect(7, 6, 4, 1, off_color);
- gb.FillSolidRect(7, 8, 4, 1, off_color);
- gb.FillSolidRect(7, 10, 4, 1, off_color);
- gb.FillSolidRect(7, 12, 4, 1, off_color);
- pbo_shuffle_album.ReleaseGraphics(gb);
- pbo_shuffle_album_ov = gdi.CreateImage(26, 21);
- gb = pbo_shuffle_album_ov.GetGraphics();
- gb.DrawImage(bt_pbo_hov, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(12, 6, 2, 1, hov_color);
- gb.FillSolidRect(17, 6, 5, 1, hov_color);
- gb.FillSolidRect(12, 12, 2, 1, hov_color);
- gb.FillSolidRect(17, 12, 5, 1, hov_color);
- gb.FillSolidRect(19, 4, 1, 5, hov_color);
- gb.FillSolidRect(19, 10, 1, 5, hov_color);
- gb.FillSolidRect(20, 5, 1, 3, hov_color);
- gb.FillSolidRect(20, 11, 1, 3, hov_color);
- gb.FillSolidRect(14, 7, 1, 1, hov_color);
- gb.FillSolidRect(14, 11, 1, 1, hov_color);
- gb.FillSolidRect(16, 7, 1, 1, hov_color);
- gb.FillSolidRect(16, 11, 1, 1, hov_color);
- gb.FillSolidRect(15, 8, 1, 3, hov_color);
- gb.FillSolidRect(5, 6, 1, 1, hov_color);
- gb.FillSolidRect(5, 8, 1, 1, hov_color);
- gb.FillSolidRect(5, 10, 1, 1, hov_color);
- gb.FillSolidRect(5, 12, 1, 1, hov_color);
- gb.FillSolidRect(7, 6, 4, 1, hov_color);
- gb.FillSolidRect(7, 8, 4, 1, hov_color);
- gb.FillSolidRect(7, 10, 4, 1, hov_color);
- gb.FillSolidRect(7, 12, 4, 1, hov_color);
- pbo_shuffle_album_ov.ReleaseGraphics(gb);
- pbo_shuffle_album_on = gdi.CreateImage(26, 21);
- gb = pbo_shuffle_album_on.GetGraphics();
- gb.DrawImage(bt_pbo_on, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(12, 7, 2, 1, on_colour);
- gb.FillSolidRect(17, 7, 5, 1, on_colour);
- gb.FillSolidRect(12, 13, 2, 1, on_colour);
- gb.FillSolidRect(17, 13, 5, 1, on_colour);
- gb.FillSolidRect(19, 5, 1, 5, on_colour);
- gb.FillSolidRect(19, 11, 1, 5, on_colour);
- gb.FillSolidRect(20, 6, 1, 3, on_colour);
- gb.FillSolidRect(20, 12, 1, 3, on_colour);
- gb.FillSolidRect(14, 8, 1, 1, on_colour);
- gb.FillSolidRect(14, 12, 1, 1, on_colour);
- gb.FillSolidRect(16, 8, 1, 1, on_colour);
- gb.FillSolidRect(16, 12, 1, 1, on_colour);
- gb.FillSolidRect(15, 9, 1, 3, on_colour);
- gb.FillSolidRect(5, 7, 1, 1, on_colour);
- gb.FillSolidRect(5, 9, 1, 1, on_colour);
- gb.FillSolidRect(5, 11, 1, 1, on_colour);
- gb.FillSolidRect(5, 13, 1, 1, on_colour);
- gb.FillSolidRect(7, 7, 4, 1, on_colour);
- gb.FillSolidRect(7, 9, 4, 1, on_colour);
- gb.FillSolidRect(7, 11, 4, 1, on_colour);
- gb.FillSolidRect(7, 13, 4, 1, on_colour);
- pbo_shuffle_album_on.ReleaseGraphics(gb);
- pbo_shuffle_folder = gdi.CreateImage(26, 21);
- gb = pbo_shuffle_folder.GetGraphics();
- gb.DrawImage(bt_pbo_off, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(12, 6, 2, 1, off_color);
- gb.FillSolidRect(17, 6, 5, 1, off_color);
- gb.FillSolidRect(12, 12, 2, 1, off_color);
- gb.FillSolidRect(17, 12, 5, 1, off_color);
- gb.FillSolidRect(19, 4, 1, 5, off_color);
- gb.FillSolidRect(19, 10, 1, 5, off_color);
- gb.FillSolidRect(20, 5, 1, 3, off_color);
- gb.FillSolidRect(20, 11, 1, 3, off_color);
- gb.FillSolidRect(14, 7, 1, 1, off_color);
- gb.FillSolidRect(14, 11, 1, 1, off_color);
- gb.FillSolidRect(16, 7, 1, 1, off_color);
- gb.FillSolidRect(16, 11, 1, 1, off_color);
- gb.FillSolidRect(15, 8, 1, 3, off_color);
- gb.FillSolidRect(6, 5, 2, 1, off_color);
- gb.FillSolidRect(6, 10, 2, 1, off_color);
- gb.FillSolidRect(6, 6, 5, 3, off_color);
- gb.FillSolidRect(6, 11, 5, 3, off_color);
- pbo_shuffle_folder.ReleaseGraphics(gb);
- pbo_shuffle_folder_ov = gdi.CreateImage(26, 21);
- gb = pbo_shuffle_folder_ov.GetGraphics();
- gb.DrawImage(bt_pbo_hov, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(12, 6, 2, 1, hov_color);
- gb.FillSolidRect(17, 6, 5, 1, hov_color);
- gb.FillSolidRect(12, 12, 2, 1, hov_color);
- gb.FillSolidRect(17, 12, 5, 1, hov_color);
- gb.FillSolidRect(19, 4, 1, 5, hov_color);
- gb.FillSolidRect(19, 10, 1, 5, hov_color);
- gb.FillSolidRect(20, 5, 1, 3, hov_color);
- gb.FillSolidRect(20, 11, 1, 3, hov_color);
- gb.FillSolidRect(14, 7, 1, 1, hov_color);
- gb.FillSolidRect(14, 11, 1, 1, hov_color);
- gb.FillSolidRect(16, 7, 1, 1, hov_color);
- gb.FillSolidRect(16, 11, 1, 1, hov_color);
- gb.FillSolidRect(15, 8, 1, 3, hov_color);
- gb.FillSolidRect(6, 5, 2, 1, hov_color);
- gb.FillSolidRect(6, 10, 2, 1, hov_color);
- gb.FillSolidRect(6, 6, 5, 3, hov_color);
- gb.FillSolidRect(6, 11, 5, 3, hov_color);
- pbo_shuffle_folder_ov.ReleaseGraphics(gb);
- pbo_shuffle_folder_on = gdi.CreateImage(26, 21);
- gb = pbo_shuffle_folder_on.GetGraphics();
- gb.DrawImage(bt_pbo_on, 0, 0, 27, 21, 0, 0, 27, 21, 0, 255);
- gb.FillSolidRect(12, 7, 2, 1, on_colour);
- gb.FillSolidRect(17, 7, 5, 1, on_colour);
- gb.FillSolidRect(12, 13, 2, 1, on_colour);
- gb.FillSolidRect(17, 13, 5, 1, on_colour);
- gb.FillSolidRect(19, 5, 1, 5, on_colour);
- gb.FillSolidRect(19, 11, 1, 5, on_colour);
- gb.FillSolidRect(20, 6, 1, 3, on_colour);
- gb.FillSolidRect(20, 12, 1, 3, on_colour);
- gb.FillSolidRect(14, 8, 1, 1, on_colour);
- gb.FillSolidRect(14, 12, 1, 1, on_colour);
- gb.FillSolidRect(16, 8, 1, 1, on_colour);
- gb.FillSolidRect(16, 12, 1, 1, on_colour);
- gb.FillSolidRect(15, 9, 1, 3, on_colour);
- gb.FillSolidRect(6, 6, 2, 1, on_colour);
- gb.FillSolidRect(6, 11, 2, 1, on_colour);
- gb.FillSolidRect(6, 7, 5, 3, on_colour);
- gb.FillSolidRect(6, 12, 5, 3, on_colour);
- pbo_shuffle_folder_on.ReleaseGraphics(gb);
- buttons.splice(0, buttons.length);
- for(i=0;i<2;i++) {
- switch(i) {
- case 0:
- buttons.push(new button(bt_pbo_off, bt_pbo_hov, bt_pbo_on));
- break;
- case 1:
- buttons.push(new button(bt_pbolist_off, bt_pbolist_hov, bt_pbolist_on));
- break;
- };
- };
- };
- function check_buttons() {
- // Update Playback Order Button
- if(fb.StopAfterCurrent) {
- buttons[0].update(pbo_sac, pbo_sac_ov, pbo_sac_on);
- } else {
- switch(fb.PlaybackOrder) {
- case 0:
- buttons[0].update(pbo_normal, pbo_normal_ov, pbo_normal_on);
- break;
- case 1:
- buttons[0].update(pbo_repeat_playlist, pbo_repeat_playlist_ov, pbo_repeat_playlist_on);
- break;
- case 2:
- buttons[0].update(pbo_repeat, pbo_repeat_ov, pbo_repeat_on);
- break;
- case 3:
- buttons[0].update(pbo_random, pbo_random_ov, pbo_random_on);
- break;
- case 4:
- buttons[0].update(pbo_shuffle, pbo_shuffle_ov, pbo_shuffle_on);
- break;
- case 5:
- buttons[0].update(pbo_shuffle_album, pbo_shuffle_album_ov, pbo_shuffle_album_on);
- break;
- case 6:
- buttons[0].update(pbo_shuffle_folder, pbo_shuffle_folder_ov, pbo_shuffle_folder_on);
- break;
- };
- };
- };
- //=======================================================================/ Menu(s)
- function show_pbo_context_menu(x, y) {
- var MF_SEPARATOR = 0x00000800;
- var MF_STRING = 0x00000000;
- var idx;
- var _menu = window.CreatePopupMenu();
- var pbo = fb.PlaybackOrder;
- _menu.AppendMenuItem(MF_STRING, 1, "Default");
- _menu.AppendMenuItem(MF_STRING, 2, "Repeat Playlist");
- _menu.AppendMenuItem(MF_STRING, 3, "Repeat Track");
- _menu.AppendMenuItem(MF_STRING, 4, "Random");
- _menu.AppendMenuItem(MF_STRING, 5, "Shuffle Tracks");
- _menu.AppendMenuItem(MF_STRING, 6, "Shuffle Albums");
- _menu.AppendMenuItem(MF_STRING, 7, "Shuffle Folders");
- _menu.AppendMenuItem(MF_SEPARATOR, 0, "");
- _menu.AppendMenuItem(MF_STRING, 8, "Stop After Current");
- _menu.CheckMenuRadioItem(1, 7, pbo+1);
- _menu.CheckMenuItem(8, fb.StopAfterCurrent?1:0);
- idx = _menu.TrackPopupMenu(x, y);
- switch(idx) {
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- pbo = idx-1;
- fb.PlaybackOrder=pbo;
- break;
- case 8:
- fb.RunMainMenuCommand("Playback/Stop After Current");
- check_buttons();
- break;
- }
- _menu.Dispose();
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement