Advertisement
wwww

fb2k WSH Panel: Playback Order

Dec 23rd, 2012
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
  2.  
  3. var ww     = 0;
  4. var wh     = 0;
  5. var images = [
  6.     gdi.Image("D:\\Users\\\\AppData\\Roaming\\foobar2000\\images\\0.png"),
  7.     gdi.Image("D:\\Users\\\\AppData\\Roaming\\foobar2000\\images\\1.png"),
  8.     gdi.Image("D:\\Users\\\\AppData\\Roaming\\foobar2000\\images\\2.png"),
  9.     gdi.Image("D:\\Users\\\\AppData\\Roaming\\foobar2000\\images\\3.png"),
  10.     gdi.Image("D:\\Users\\\\AppData\\Roaming\\foobar2000\\images\\4.png"),
  11.     gdi.Image("D:\\Users\\\\AppData\\Roaming\\foobar2000\\images\\5.png"),
  12.     gdi.Image("D:\\Users\\\\AppData\\Roaming\\foobar2000\\images\\6.png")
  13. ];
  14. var hover = false;
  15.  
  16. function on_size()
  17. {
  18.     ww = window.width;
  19.     wh = window.height;
  20.     on_playback_order_changed(fb.PlaybackOrder);
  21. }
  22.  
  23. function on_paint(e)
  24. {
  25.     e.DrawImage(images[fb.PlaybackOrder],0,0,ww,wh,0,0,ww,wh,0,hover?128:255);
  26. }
  27.  
  28. function on_mouse_lbtn_up(x, y)
  29. {
  30.     if (x > 0 && x < ww && y > 0 && y< wh) {
  31.         fb.PlaybackOrder = (fb.PlaybackOrder+1) % 7;
  32.         window.Repaint();
  33.     }
  34.     return true;
  35. }
  36.  
  37. function on_mouse_rbtn_up(x, y) {
  38.     if (x > 0 && x < ww && y > 0 && y< wh) {
  39.         fb.PlaybackOrder = ((fb.PlaybackOrder-1) % 7 + 7) % 7;
  40.         window.Repaint();
  41.     }
  42.     return true;
  43. }
  44.  
  45. function on_mouse_move(x, y) {
  46.     if (x > 0 && x < ww && y > 0 && y< wh) {
  47.         hover = true;
  48.     } else {
  49.         hover = false;
  50.     }
  51.     window.Repaint();
  52. }
  53. function on_mouse_leave() { hover = false; window.Repaint(); }
  54.  
  55. function on_playback_order_changed(new_order) { window.Repaint(); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement