Страница 2 из 5 ПерваяПервая 123 ... ПоследняяПоследняя
Показано с 11 по 20 из 41

Тема: Скрипты для WSH Panel Mod и JScript Panel

  1. #11
    Модератор Аватар для MC Web
    Регистрация
    25.04.2012
    Сообщений
    1 642

    Скрипты WSH Modoki Rus

    Кодировка должна быть UTF-8.

    • Скрипт, аналогично компоненту foo_default_videoplayer.dll, для воспроизведения во внешнем проигрывателе, видео файлов AVI, MP4, и т.д.

      WSH External Player Modoki.js
      Код:
      // ==PREPROCESSOR==
      // @name "External Player Modoki"
      // @version "1.0.0"
      // @author "tomato111"
      // ==/PREPROCESSOR==
      //========
      // properties
      //========
      var prop = new function () {
      var extArr;
      this.Panel = {
      Enable: window.GetProperty('Panel.Enable', true),
      Extension: window.GetProperty('Panel.Extension', 'avi,flv,mkv,mpg,mp4,wmv')
      };
      if (!this.Panel.Extension)
      window.SetProperty('Panel.Extension', this.Panel.Extension = 'avi,flv,mkv,mpg,mp4,wmv');
      this.Player = {
      };
      extArr = this.Panel.Extension.split(/[  ]*,[  ]*/);
      for (var i = 0; i < extArr.length; i++) {
      this.Player[extArr[i].toUpperCase()] = window.GetProperty('Player.' + extArr[i].toUpperCase(), '');
      }
      };
      //========
      var sa = new ActiveXObject('Shell.Application');
      var extensionRE = new RegExp(
      '\\.(?:'
      + prop.Panel.Extension.split(/[  ]*,[  ]*/).join('|').toLowerCase()
      + ')$'
      , 'i'); /* \.(?:avi|flv|mp4|wmv)$ */
      function LaunchPlayer(ext, arg) {
      var ar = arg.charAt(0);
      if (ar !== '"') // 引数を括る
      arg = '"' + arg + '"';
      var player = prop.Player[ext];
      if (!player) {
      player = arg;
      arg = null;
      }
      sa.ShellExecute(player, arg, '', '', 1);
      }
      function RGB(r, g, b) { return (0xff000000 | (r << 16) | (g << 8) | (b)); }
      //========================================
      //== Callback function =========================
      //========================================
      function on_paint(gr) {
      var text = prop.Panel.Enable ? 'Включено' : 'Отключено';
      var font = gdi.Font('Segoe UI', 13, 0);
      var color = prop.Panel.Enable ? RGB(0, 128, 0) : RGB(0, 0, 0);
      gr.GdiDrawText(text, font, color, 4, 2, window.Width, window.Height, 0x00000000);
      }
      function on_playback_new_track(metadb) {
      if (prop.Panel.Enable) {
      var current_ext = utils.FileTest(metadb.Path, 'split').toArray()[2].toUpperCase();
      if (extensionRE.test(current_ext)) {
      !fb.IsPaused && fb.Pause(); // 自動で次の曲に遷移する場合は on_playback_starting() が呼ばれない(一瞬再生されてしまう)
      LaunchPlayer(current_ext.slice(1), metadb.Path);
      }
      else
      fb.IsPaused && fb.Pause();
      }
      }
      function on_playback_starting(cmd, is_paused) {
      prop.Panel.Enable && !is_paused && fb.Pause();
      }
      function on_mouse_lbtn_down(x, y, mask) {
      window.SetProperty('Panel.Enable', prop.Panel.Enable = !prop.Panel.Enable);
      window.Repaint();
      }
      function on_mouse_lbtn_dblclk(x, y, mask) {
      on_mouse_lbtn_down(x, y, mask);
      }
      //EOF
    • Скрипт для отображения, в соответствии с форматом, текущего времени и даты.

      WSH Date Modoki.js
      Код:
      // ==PREPROCESSOR==
      // @name "Date Modoki"
      // @version "1.0.0"
      // @author "tomato111"
      // ==/PREPROCESSOR==
      //Год %YYYY 4 цифры
      //Год %YY 2 цифры
      //Год %Y 2 цифры (без выравнивания цифр)
      //Месяц %MM
      //Месяц %M  (без выравнивания цифр)
      //Месяц %ME полное слово
      //Месяц %Me аббревиатура
      //День %DD
      //День %D  (без выравнивания цифр)
      //Часы %hh
      //Часы %h  (без выравнивания цифр)
      //Минуты %mm
      //Минуты %m  (без выравнивания цифр)
      //Секунды %ss
      //Секунды %s  (без выравнивания цифр)
      //День недели %WJ полное слово на японском
      //День недели %Wj аббревиатура на японском
      //День недели %WE полное слово на русском
      //День недели %We аббревиатура на русском
      //========
      // properties
      //========
      var prop = new function () {
      this.Style = {
      _format: window.GetProperty('Style._format', '%hh:%mm:%ss (%We) %DD.%MM.%YYYY'),
      Color:
      {
      _0_Default: window.GetProperty('Style.Color._0_Default', 'RGBA(0,0,0,255)'),
      _1_Year: window.GetProperty('Style.Color._1_Year', 'RGBA(0,0,0,255)'),
      _2_Month: window.GetProperty('Style.Color._2_Month', 'RGBA(0,0,0,255)'),
      _3_Day: window.GetProperty('Style.Color._3_Day', 'RGBA(0,0,0,255)'),
      _4_Hour: window.GetProperty('Style.Color._4_Hour', 'RGBA(0,0,0,255)'),
      _5_Minute: window.GetProperty('Style.Color._5_Minute', 'RGBA(0,0,0,255)'),
      _6_Second: window.GetProperty('Style.Color._6_Second', 'RGBA(0,0,0,255)'),
      _7_DayOfWeek: window.GetProperty('Style.Color._7_DayOfWeek', 'RGBA(0,0,0,255)'),
      _8_DayOfWeek_sat: window.GetProperty('Style.Color._8_DayOfWeek_sat', 'RGBA(0,0,200,255)'),
      _9_DayOfWeek_sun: window.GetProperty('Style.Color._9_DayOfWeek_sun', 'RGBA(200,0,0,255)'),
      Background: window.GetProperty('Style.Color.Background', 'RGBA(255,255,255,255)')
      },
      Font_Family: window.GetProperty('Style.Font_Family', 'Arial'),
      Font_Size: window.GetProperty('Style.Font_Size', 14),
      Font_Bold: window.GetProperty('Style.Font_Bold', false)
      };
      };
      //========
      //============================================
      //== Prototype ==================================
      //============================================
      Function.prototype.interval = function (time, callback) {
      var __method = this;
      var __callback = callback || function () { };
      this.$$timerid$$ = window.setInterval(function () {
      __method.apply(this, arguments);
      __callback.apply(this, arguments);
      }, time);
      };
      Function.prototype.clearInterval = function () {
      window.clearInterval(this.$$timerid$$);
      };
      //============================================
      //== function ==================================
      //============================================
      function RGBA(r, g, b, a) {
      var res = 0xff000000 | (r << 16) | (g << 8) | (b);
      if (a != undefined) res = (res & 0x00ffffff) | (a << 24);
      return res;
      }
      //============================================
      //== DateModoki Object ==========================
      //============================================
      var DateModoki = new function () {
      this.on_paint = function (gr, x, y) {
      gr.FillSolidRect(-1, -1, window.Width + 2, window.Height + 2, color['Background']);
      for (var i = 0; i < applied_text_arr.length; i++) {
      var text = applied_text_arr[i].toString();
      if (format.type_arr[i] === '_6_Second') {
      switch (format.text_arr[i]) {
      case '%ss': text = ('0' + (Number(text) + timer_count)).slice(-2); break;
      case '%s': text = (Number(text) + timer_count).toString(); break;
      }
      }
      gr.DrawString(text, font, color[format.type_arr[i]], x, y, window.Width, window.Height, 0x00000000);
      x += gr.MeasureString(text.replace(/ /g, ''), font, 0, 0, window.Width, window.Height, 0).Width
      + (text.split(' ').length - 1) * spaceWidth; // MeasureStringメソッドは空白の幅を0と返すので、あらかじめ求めておいたspaceWidthを使って補完する
      }
      };
      this.start = function () {
      setFontAndColor();
      setDate();
      window.Repaint();
      timer.interval(1000);
      };
      var timer = function () {
      timer_count++;
      if (date_now.getSeconds() + timer_count === 60) {
      setDate();
      window.Repaint()
      }
      else
      format.isContain_Second && window.Repaint();
      };
      var setDate = function () {
      timer_count = 0;
      date_now = new Date();
      applied_text_arr = format.applyDate(date_now);
      };
      var setFontAndColor = function () {
      var fontfamily = ['Arial', 'Tahoma', 'Meiryo', 'Segoe UI', 'MS Gothic'];
      fontfamily.unshift(prop.Style.Font_Family);
      for (i = 0; i < fontfamily.length; i++) {
      if (utils.CheckFont(fontfamily[i])) {
      window.SetProperty('Style.Font_Family', prop.Style.Font_Family = fontfamily[i]);
      break;
      }
      }
      font = gdi.Font(prop.Style.Font_Family, prop.Style.Font_Size, Number(prop.Style.Font_Bold));
      color = [];
      for (var name in prop.Style.Color) {
      color[name] = eval(prop.Style.Color[name]);
      }
      var temp_bmp = gdi.CreateImage(1, 1);
      var temp_gr = temp_bmp.GetGraphics();
      spaceWidth = temp_gr.MeasureString(' ,', font, 0, 0, window.Width, window.Height, 0).Width
      - temp_gr.MeasureString(',', font, 0, 0, window.Width, window.Height, 0).Width;
      temp_bmp.ReleaseGraphics(temp_gr);
      temp_bmp.Dispose();
      temp_gr = null;
      temp_bmp = null;
      };
      var timer_count, date_now, applied_text_arr = [],
      spaceWidth, font, color;
      var format = new ParseFormat(prop.Style._format);
      // Constructor
      function ParseFormat(formatText) {
      this.text_arr = [];
      this.type_arr = [];
      this.isContain_Second = false;
      var i = 0;
      var type = { YYYY: '_1_Year', YY: '_1_Year', Y: '_1_Year', MM: '_2_Month', ME: '_2_Month', Me: '_2_Month', M: '_2_Month', DD: '_3_Day', D: '_3_Day', hh: '_4_Hour', h: '_4_Hour', mm: '_5_Minute', m: '_5_Minute', ss: '_6_Second', s: '_6_Second', WJ: '_7_DayOfWeek', Wj: '_7_DayOfWeek', WE: '_7_DayOfWeek', We: '_7_DayOfWeek' };
      var dateRE = /%(?:YYYY|YY|Y|MM|ME|Me|M|DD|D|hh|h|mm|m|ss|s|WJ|Wj|WE|We)/g;
      while (dateRE.exec(formatText) !== null) {
      if (i !== RegExp.index) {
      this.text_arr.push(formatText.substring(i, RegExp.index).replace(/ /g, ' '));
      this.type_arr.push('_0_Default');
      }
      this.text_arr.push(RegExp.lastMatch);
      this.type_arr.push(type[RegExp.lastMatch.slice(1)]);
      type[RegExp.lastMatch.slice(1)] === '_6_Second' && (this.isContain_Second = true);
      i = RegExp.lastIndex;
      }
      if (i !== formatText.length) {
      this.text_arr.push(formatText.substring(i, formatText.length));
      this.type_arr.push('_0_Default');
      }
      }
      ParseFormat.prototype.applyDate = function (dateObj) {
      var arr = [], _this = this;
      for (var i = 0; i < this.text_arr.length; i++) {
      switch (this.text_arr[i]) {
      case '%YYYY': arr.push(dateObj.getFullYear()); break;
      case '%YY': arr.push(dateObj.getFullYear().toString().slice(2)); break;
      case '%Y': arr.push(Number(dateObj.getFullYear().toString().slice(2))); break;
      case '%MM': arr.push(('0' + (dateObj.getMonth() + 1)).slice(-2)); break;
      case '%ME': arr.push(monthToString(dateObj.getMonth(), false)); break;
      case '%Me': arr.push(monthToString(dateObj.getMonth(), true)); break;
      case '%M': arr.push(dateObj.getMonth() + 1); break;
      case '%DD': arr.push(('0' + dateObj.getDate()).slice(-2)); break;
      case '%D': arr.push(dateObj.getDate()); break;
      case '%hh': arr.push(('0' + dateObj.getHours()).slice(-2)); break;
      case '%h': arr.push(dateObj.getHours()); break;
      case '%mm': arr.push(('0' + dateObj.getMinutes()).slice(-2)); break;
      case '%m': arr.push(dateObj.getMinutes()); break;
      case '%ss': arr.push(('0' + dateObj.getSeconds()).slice(-2)); break;
      case '%s': arr.push(dateObj.getSeconds()); break;
      case '%WJ': arr.push(dayToString(dateObj.getDay(), false, 'ja')); setDayColor(dateObj.getDay(), i); break;
      case '%Wj': arr.push(dayToString(dateObj.getDay(), true, 'ja')); setDayColor(dateObj.getDay(), i); break;
      case '%WE': arr.push(dayToString(dateObj.getDay(), false, 'en')); setDayColor(dateObj.getDay(), i); break;
      case '%We': arr.push(dayToString(dateObj.getDay(), true, 'en')); setDayColor(dateObj.getDay(), i); break;
      default: arr.push(this.text_arr[i]); break;
      }
      }
      function monthToString(num, shorter) {
      if (shorter)
      return ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'][num];
      else
      return ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'][num];
      }
      function dayToString(num, shorter, lang) {
      if (shorter)
      switch (lang) {
      case 'en': return ['Вос', 'Пон', 'Втр', 'Срд', 'Чет', 'Пят', 'Суб'][num];
      case 'ja': return ['日', '月', '火', '水', '木', '金', '土'][num];
      }
      else
      switch (lang) {
      case 'en': return ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'][num];
      case 'ja': return ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'][num];
      }
      }
      function setDayColor(num, i) {
      if (num === 0)
      _this.type_arr[i] = '_9_DayOfWeek_sun';
      else if (num === 6)
      _this.type_arr[i] = '_8_DayOfWeek_sat';
      }
      return arr;
      };
      // End Constructor
      };
      DateModoki.start();
      //========================================
      //== Callback function =========================
      //========================================
      function on_paint(gr) {
      DateModoki.on_paint(gr, 4, 4);
      }
      //EOF
    • Скрипт для отображения всплывающей истории воспроизведения.

      WSH Popup History Modoki.js
      Код:
      // ==PREPROCESSOR==
      // @name "Popup History Modoki"
      // @version "1.0.0"
      // @author "tomato111"
      // ==/PREPROCESSOR==
      //========
      // properties
      //========
      var prop = new function () {
      this.Menu = {
      ItemName: window.GetProperty('Menu.ItemName', '%title%'),
      MaxSize: window.GetProperty('Menu.MaxSize', 10),
      PlayingMark: window.GetProperty('Menu.PlayingMark', '<воспроизводится>')
      };
      this.Style = {
      Color:
      {
      Background: eval(window.GetProperty('Style.Color.Background', 'RGBA(255,255,255,50)'))
      }
      };
      };
      //========
      //============================================
      //== function ==================================
      //============================================
      function RGBA(r, g, b, a) {
      var res = 0xff000000 | (r << 16) | (g << 8) | (b);
      if (a != undefined) res = (res & 0x00ffffff) | (a << 24);
      return res;
      }
      //============================================
      //== Popup History Modoki Object ==========================
      //============================================
      var PHM = new function () {
      this.on_paint = function (gr) {
      gr.FillSolidRect(-1, -1, window.Width + 2, window.Height + 2, prop.Style.Color.Background);
      };
      this.init = function () {
      history_items = [];
      buildHistoryMenu();
      };
      this.add = function (metadb) {
      for (var i = 0; i < history_items.length; i++) {
      if (metadb.Compare(history_items[i].metadb)) {
      buildHistoryMenu(metadb);
      return;
      }
      }
      history_items.unshift(new Info(metadb));
      if (history_items.length > prop.Menu.MaxSize)
      history_items.pop();
      buildHistoryMenu(metadb);
      };
      this.popup = function (x, y) {
      var ret = _menu.TrackPopupMenu(x, y);
      if (ret !== 0)
      history_items[ret - 1].doCommand();
      };
      var history_items, _menu;
      var MF_SEPARATOR = 0x00000800;
      var MF_GRAYED = 0x00000001;
      var MF_STRING = 0x00000000;
      var buildHistoryMenu = function (metadb) {
      var menu_items = [];
      if (history_items.length) {
      for (var i = 0; i < history_items.length; i++) {
      menu_items.push(
      {
      Flag: MF_STRING,
      Caption: history_items[i].name + (metadb.Compare(history_items[i].metadb) ? '\t' + prop.Menu.PlayingMark : '')
      }
      );
      }
      }
      else {
      menu_items.push(
      {
      Flag: MF_GRAYED,
      Caption: '(Пусто)'
      }
      );
      }
      _menu = buildMenu(menu_items);
      };
      function buildMenu(items) {
      var idx = 1;
      var _menu = window.CreatePopupMenu();
      for (var i = 0; i < items.length; i++) {
      _menu.AppendMenuItem(items[i].Flag, idx++, items[i].Caption);
      }
      return _menu;
      }
      // Constructor
      function Info(metadb) {
      this.metadb = metadb;
      this.name = fb.TitleFormat(prop.Menu.ItemName).EvalWithMetadb(metadb);
      this.itemLocation = plman.GetPlayingItemLocation();
      }
      Info.prototype.doCommand = function () {
      var metadb = this.metadb;
      var playlistIndex = this.itemLocation.PlaylistIndex;
      plman.SetPlaylistFocusItemByHandle(playlistIndex, metadb);
      var itemIndex = plman.GetPlaylistFocusItemIndex(playlistIndex);
      if (itemIndex !== -1) {
      PHM.isMenuCommand = true;
      plman.ActivePlaylist = playlistIndex;
      plman.ClearPlaylistSelection(playlistIndex);
      plman.SetPlaylistSelectionSingle(playlistIndex, itemIndex, true);
      plman.ExecutePlaylistDefaultAction(playlistIndex, itemIndex);
      }
      else
      fb.ShowPopupMessage('Элемент не найден в плейлисте.', "Popup History Modoki", 0);
      };
      // End Constructor
      this.init();
      }();
      //========================================
      //== Callback function =========================
      //========================================
      function on_paint(gr) {
      PHM.on_paint(gr);
      }
      function on_playback_new_track(metadb) {
      PHM.add(metadb);
      }
      function on_mouse_lbtn_down(x, y, mask) {
      PHM.popup(x + 1, y);
      }
      function on_mouse_lbtn_dblclk(x, y, mask) {
      on_mouse_lbtn_down(x, y, mask);
      }
      //EOF
    Последний раз редактировалось MC Web; 05.03.2018 в 15:37.

  2. #12
    Модератор Аватар для MC Web
    Регистрация
    25.04.2012
    Сообщений
    1 642

    Скрипт WSH Cover Animation Rus

    Кодировка должна быть UTF-8.

    Панель для последовательного отображения обложек (лицевая, задняя и диск). Смена обложек происходит с различными эффектами анимации, которые можно выбирать.

    WSH Cover Animation Rus.txt
    Код:
    ode:
    //coveranimation1 by grimes
    //fb2k 1.0+, WSH Panel Mod 1.3.0+ required
    //DUI/CUI ready
    
    
    var z = 0;
    var g_img = get_album_art(fb.GetNowPlaying());
    var ww = 0, wh = 0;
    var show = true;
    var dui = window.InstanceType;
    var bool = false;
    var g_timer1;
    var move = 0;
    var right = window.GetProperty("Right", false);
    var down = window.GetProperty("Down", false);
    var left = window.GetProperty("Left", false);
    var up = window.GetProperty("Up", false);
    var diagrd = window.GetProperty("Diagonale Right Down", false);
    var diagld = window.GetProperty("Diagonale Left Down", false);
    var diagru = window.GetProperty("Diagonale Right Up", false);
    var diaglu = window.GetProperty("Diagonale Left Up", false);
    var effect1 = window.GetProperty("Effect1", false);
    var effect2 = window.GetProperty("Effect2", false);
    var effect3 = window.GetProperty("Effect3", false);
    var effect4 = window.GetProperty("Effect4", false);
    var effect5 = window.GetProperty("Effect5", false);
    var effect6 = window.GetProperty("Effect6", true);
    var effect7 = window.GetProperty("Effect7", false);
    var noeffect = window.GetProperty("No Effect", false);
    var effectstartstop = window.GetProperty("Effekt on Play/Stop", true);
    var start = false;
    var stop = false;
    
    function on_paint(gr) {
        gr.FillSolidRect(0, 0, ww, wh, dui === 1 ? window.GetColorDUI(1) : window.GetColorCUI(3));
        if (g_img) {
            var scale = 0;
            var x = 0,
                y = 0;
            var scale_w = ww / g_img.Width;
            var scale_h = wh / g_img.Height;
    
            if (scale_w <= scale_h) {
                scale = scale_w;
                y = (wh - g_img.Height * scale) / 2;
            } else {
                scale = scale_h;
                x = (ww - g_img.Width * scale) / 2;
            }
            if (show){
                if (right) {
                    gr.DrawImage(g_img, x + move, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
                }
                if (down) {
                    gr.DrawImage(g_img, x, y + move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
                }
                if (left) {
                    gr.DrawImage(g_img, x - move, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
                }
                if (up) {
                    gr.DrawImage(g_img, x, y - move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
                }
                if (diagrd) {
                    gr.DrawImage(g_img, x + move, y + move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
                }
                if (diaglu) {
                    gr.DrawImage(g_img, x - move, y - move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
                }
                if (diagru) {
                    gr.DrawImage(g_img, x + move, y - move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
                }
                if (diagld) {
                    gr.DrawImage(g_img, x - move, y + move, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
                }
                if (effect1) {
                    gr.DrawImage(g_img, x + move, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height, move / 4);
                }
                if (effect2) {
                    gr.DrawImage(g_img, x + move, y, g_img.Width * scale - Math.abs(move), g_img.Height * scale - Math.abs(move), 0, 0, g_img.Width, g_img.Height);
                }
                if (effect3) {
                    gr.DrawImage(g_img, x, y - move, g_img.Width * scale + move, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
                }
                if (effect4) {
                    gr.DrawImage(g_img, x, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height, 0, 255 - Math.abs(move * 255 / ww));
                }
                if (effect5) {
                    gr.DrawImage(g_img, x + move, y + move, g_img.Width * scale - move, g_img.Height * scale - move, 0, 0, g_img.Width, g_img.Height, move / 4);
                }
                if (effect6) {
                    gr.DrawImage(g_img, ww / 2 - (g_img.Width * scale  - Math.abs(move)) / 2, wh / 2 - (g_img.Height * scale  - Math.abs(move)) / 2, ((g_img.Width * scale) - Math.abs(move)), ((g_img.Height * scale) - Math.abs(move)), 0, 0, g_img.Width, g_img.Height);
                }
                if (effect7) {
                    gr.DrawImage(g_img, ww / 2 - (g_img.Width * scale  - Math.abs(move)) / 2, wh / 2 - (g_img.Height * scale  - Math.abs(move)) / 2, ((g_img.Width * scale) - Math.abs(move)), ((g_img.Height * scale) - Math.abs(move)), 0, 0, g_img.Width, g_img.Height, move / 3);
                }
                if (noeffect) {
                    gr.DrawImage(g_img, x, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);            
                }
            }
        }
    }
    
    function on_size() {
        ww = window.Width;
        wh = window.Height;
    }
    
    function get_album_art(metadb) {
        if (metadb)
        return utils.GetAlbumArtV2(metadb, z);
    }
    
    function on_playback_new_track(metadb) {
        if (g_img) g_img.Dispose();
        g_img = get_album_art(metadb);
        show = true;
        if (effectstartstop) {
            move = -ww;
            start = true;
            stop = false;
            g_timer1 = window.CreateTimerInterval(40);
        }
        window.Repaint();
    }
    
    function on_playback_stop(reason) {
        stop = true;
        start = false;
        if (reason !== 2 && effectstartstop) {
            move = 0;
            g_timer1 = window.CreateTimerInterval(40);
        }
        if (!effectstartstop) {
            show = false;
        }
        window.Repaint();
    }
    
    function on_mouse_lbtn_down(){
        show = true;
        execute = false;
        start = false;
        stop = false;
        if (noeffect) {
            if (z < 2) {
                z++;
            }
            else {
                z = 0;
            }
            g_img = get_album_art(fb.GetNowPlaying());
            window.Repaint();
        }
        else {
            bool = false;
            g_timer1 = window.CreateTimerInterval(40);
        }
    }
    
    function on_timer(id) {
        if (g_timer1 && id === g_timer1.ID) {
            move += 40;
            if (start) {
                if (move >= 0) {
                    move = 0;
                    window.KillTimer(g_timer1);
                    g_timer1.Dispose();
                }
            }
            if (stop) {
                if (move >= ww) {
                    move = ww;
                    show = false;
                    window.KillTimer(g_timer1);
                    g_timer1.Dispose();
                }
            }
            else {
                if (move >= ww) {
                    if (z < 2) {
                        z++;
                    }
                    else {
                        z = 0;
                    }
                    bool = true;
                    move = -ww;
                    g_img = get_album_art(fb.GetNowPlaying());
                }
                if (move >= 0 && bool) {
                    window.KillTimer(g_timer1);
                    g_timer1.Dispose();
                    move = 0;
                }
            }
            window.Repaint();
        }
    }
    
    function on_mouse_rbtn_up(x, y) {
        var MF_SEPARATOR = 0x00000800;
        var MF_STRING = 0x00000000;
        var _menu = window.CreatePopupMenu();
        var idx;
        _menu.AppendMenuItem(MF_STRING, 1, "Вправо");
        _menu.AppendMenuItem(MF_STRING, 2, "Влево");
        _menu.AppendMenuItem(MF_STRING, 3, "Вниз");
        _menu.AppendMenuItem(MF_STRING, 4, "Вверх");
        _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
        _menu.AppendMenuItem(MF_STRING, 5, "По диагонали в нижний правый");
        _menu.AppendMenuItem(MF_STRING, 6, "По диагонали в верхний правый");
        _menu.AppendMenuItem(MF_STRING, 7, "По диагонали в нижний левый");
        _menu.AppendMenuItem(MF_STRING, 8, "По диагонали в верхний левый");
        _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
        _menu.AppendMenuItem(MF_STRING, 9, "Эффект 1");
        _menu.AppendMenuItem(MF_STRING, 10, "Эффект 2");
        _menu.AppendMenuItem(MF_STRING, 11, "Эффект 3");
        _menu.AppendMenuItem(MF_STRING, 12, "Эффект 4");
        _menu.AppendMenuItem(MF_STRING, 13, "Эффект 5");
        _menu.AppendMenuItem(MF_STRING, 14, "Эффект 6");
        _menu.AppendMenuItem(MF_STRING, 15, "Эффект 7");
        _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
        _menu.AppendMenuItem(MF_STRING, 16, "Без эффектов");
        _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
        _menu.AppendMenuItem(MF_STRING, 17, "Эффект при Воспроизведении/Остановке");
        _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
        _menu.AppendMenuItem(MF_STRING, 20, "Свойства WSH");
        _menu.AppendMenuItem(MF_STRING, 21, "Настройки WSH...");
        if (right) {
            _menu.CheckMenuRadioItem(1, 16, 1); 
        }
        else if (left) {
            _menu.CheckMenuRadioItem(1, 16, 2);
        }
        else if (down) {
            _menu.CheckMenuRadioItem(1, 16, 3);
        }
        else if (up) {
            _menu.CheckMenuRadioItem(1, 16, 4);
        }
        else if (diagrd) {
            _menu.CheckMenuRadioItem(1, 16, 5);
        }
        else if (diagru) {
            _menu.CheckMenuRadioItem(1, 16, 6);
        }
        else if (diagld) {
            _menu.CheckMenuRadioItem(1, 16, 7);
        }
        else if (diaglu) {
            _menu.CheckMenuRadioItem(1, 16, 8);
        }
        else if (effect1) {
            _menu.CheckMenuRadioItem(1, 16, 9);
        }
        else if (effect2) {
            _menu.CheckMenuRadioItem(1, 16, 10);
        }
        else if (effect3) {
            _menu.CheckMenuRadioItem(1, 16, 11);
        }
        else if (effect4) {
            _menu.CheckMenuRadioItem(1, 16, 12);
        }
        else if (effect5) {
            _menu.CheckMenuRadioItem(1, 16, 13);
        }
        else if (effect6) {
            _menu.CheckMenuRadioItem(1, 16, 14);
        }
        else if (effect7) {
            _menu.CheckMenuRadioItem(1, 16, 15);
        }
        else if (noeffect) {
            _menu.CheckMenuRadioItem(1, 16, 16);
        }
        if (effectstartstop) {
            _menu.CheckMenuItem(17, true);
        }
        else {
                _menu.CheckMenuItem(17, false);
        }
        
        idx = _menu.TrackPopupMenu(x, y);
        switch (idx) {
        case 1:
            if (!right) {
                right = true;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 2:
            if (!left) {
                right = false;
                left = true;
                down = false
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 3:
            if (!down) {
                right = false;
                left = false;
                down = true;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 4:
            if (!up) {
                right = false;
                left = false;
                down = false;
                up = true;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 5:
            if (!diagrd) {
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = true;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 6:
            if (!diagru) {
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = true;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 7:
            if (!diagld) {
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = true;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 8:
            if (!diaglu) {
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = true;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 9:
            if (!effect1) {
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = true;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 10:
            if (!effect2) {
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = true;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 11:
            if (!effect3) {
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = true;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 12:
            if (!effect4) {
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = true;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 13:
            if (!effect5) {
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = true;
                effect6 = false;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 14:
            if (!effect6) {
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = true;
                effect7 = false;
                noeffect = false;
            } 
            break;
        case 15:
            if (!effect7) { 
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = true;
                noeffect = false;
            } 
            break;
        case 16:
            if (!noeffect) { 
                right = false;
                left = false;
                down = false;
                up = false;
                diagrd = false;
                diagru = false;
                diagld = false;
                diaglu = false;
                effect1 = false;
                effect2 = false;
                effect3 = false;
                effect4 = false;
                effect5 = false;
                effect6 = false;
                effect7 = false;
                noeffect = true;
            } 
            break;
        case 17:
            if (!effectstartstop) {
                effectstartstop = true;
            }
            else {
                effectstartstop = false;
            }
            window.Repaint();
            break;
        case 20:
            window.ShowProperties();
            break;
        case 21:
            window.ShowConfigure();
        }
        _menu.Dispose();
        window.Repaint();
        return true;
    }
    
    function on_mouse_move() {
    	fb.IsPlaying && window.SetCursor(32649);
    }
    
    function on_colors_changed() {
        window.Repaint();
    }
    
    function on_font_changed() {
        window.Repaint();
    }

  3. #13
    Модератор Аватар для MC Web
    Регистрация
    25.04.2012
    Сообщений
    1 642

    Скрипт WSH fooClock Rus

    Кодировка должна быть UTF-8.

    Скрипт для отображения аналоговых часов (размер циферблата регулируется колесиком мыши) и календаря (включение/отключение ЛКМ).



    WSH fooClock Rus.txt
    Код:
    // fooClock 1.0 // Coded by Hunter (modifed)
    // ==PREPROCESSOR==
    // @import "%fb2k_path%\user-components\foo_uie_wsh_panel_mod\docs\Flags.txt"
    // @import "%fb2k_path%\user-components\foo_uie_wsh_panel_mod\docs\Helpers.txt"     
    // ==/PREPROCESSOR==
    
    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)); }    
    
    var hour_font = gdi.Font("Arial", 11, 0);
    var datefont = gdi.Font("Arial", 11, 0);
    
    window.GetProperty("DC",true)
    var clock_timer = window.CreateTimerInterval(1000);
    
    var d = new Date();
    
    var days = new Array("Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота");
    var months = new Array("Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь");
    
    var color = RGB(0,157,255);
    var color = RGB(140,164,179);
    
    //color = RGB(gRed,gGreen,gBlue);
    
    var radius_h = 65;
    var radius_h_dot = 5;
    var radius_h_numbers = radius_h - 12;
    var radius_h_hand = radius_h - 22;
    var h_hand_w = 4;
    
    var radius_m = radius_h;
    var radius_m_dot = 3;
    var radius_m_hand = radius_m - 5;
    var m_hand_w = 2;
    
    var radius_s_hand = radius_m - 5;
    var s_hand_w = 1;
    
    var center_r = 10;
    var center_r2 = 4;
    
    var x, y, ww, wh, w_h;
    
    function on_paint(gr) {
       
        getColorSchemeFromImage(pic);
        color2 = RGBA(gRed,gGreen,gBlue,200);
    //    gr.FillSolidRect(0, 0, ww, wh, RGB(0,40,80));   
    
        gr.SetTextRenderingHint(5);
        gr.SetSmoothingMode(4);
       
        var radius = radius_h;
        gr.FillEllipse(x - radius/2, y - radius/2 , radius, radius, color2); //Center dot
       
        // ************* Hour Dots
       
        var steps = 12;
        var radius = radius_h;
        var hour_r = radius_h_dot;
    
        for (var i = 0; i < steps; i++) {
            xV = (radius * Math.cos(Math.PI * i / steps * 2 - Math.PI / 2));
            yV = (radius * Math.sin(Math.PI * i / steps * 2 - Math.PI / 2));
    
            gr.FillEllipse(x + xV - hour_r / 2, y + yV - hour_r / 2, hour_r, hour_r, color);
        }
        // ************* Hour Numbers
       
        for (var i = 0; i < steps; i++) {
            var radius =  radius_h_numbers;       
            i == 0 ? hours = 12 : hours = i;
    
            xV = (radius * Math.cos(Math.PI * i / steps * 2 - Math.PI / 2));
            yV = (radius * Math.sin(Math.PI * i / steps * 2 - Math.PI / 2));
    
            gr.DrawString(hours, hour_font, color, x + xV - hour_r / 2, y + yV - hour_r / 2, hour_r, hour_r, 0x11005000); //
        }
       
        // ************* Minute Dots
       
        var steps = 60;
        var radius =  radius_m;
        var minute_r = radius_m_dot;
    
        for (var i = 0; i < steps; i++) {
            xV = (radius * Math.cos(Math.PI * i / steps * 2));
            yV = (radius * Math.sin(Math.PI * i / steps * 2));
    
            gr.FillEllipse(x + xV - minute_r / 2, y + yV - minute_r / 2, minute_r, minute_r, color);
        }
       
        // ************* Hour Hand
       
        var steps = 12;
        var radius = radius_h_hand;
        var m_angle = d.getHours() % 12 + d.getMinutes() / 60;
    
        xV = (radius * Math.cos(Math.PI * m_angle / steps * 2 - Math.PI / 2));
        yV = (radius * Math.sin(Math.PI * m_angle / steps * 2 - Math.PI / 2));
    
        gr.DrawLine(x + 1, y + 1, x + xV + 1, y + yV + 1, h_hand_w, RGB(0,0,0));
        gr.DrawLine(x, y, x + xV, y + yV, h_hand_w, color);   
       
        // ************* Minute Hand
    
        var steps = 60;
        var radius = radius_m_hand;
        var m_angle = d.getMinutes() + d.getSeconds() / 60;
    
        xV = (radius * Math.cos(Math.PI * m_angle / steps * 2 - Math.PI / 2));
        yV = (radius * Math.sin(Math.PI * m_angle / steps * 2 - Math.PI / 2));
    
        gr.DrawLine(x + 1, y + 1, x + xV + 1, y + yV + 1, m_hand_w, RGB(0,0,0));
        gr.DrawLine(x, y, x + xV, y + yV, m_hand_w, color);
    
        // ************* center dot (shadow)
    
        gr.FillEllipse(x - center_r / 2 + 1, y - center_r / 2 + 1, center_r + 1, center_r + 1, RGBA(0,0,0,50)); //Center dot
    
        // ************* Second Hand
    
        var steps = 60;
        var radius = radius_s_hand;
        var s_angle = d.getSeconds();
    
        xV = (radius * Math.cos(Math.PI * s_angle / steps * 2 - Math.PI / 2));
        yV = (radius * Math.sin(Math.PI * s_angle / steps * 2 - Math.PI / 2));
    
        gr.DrawLine(x+1, y+1 , x + xV+1, y + yV+1, s_hand_w, RGB(0,0,0));
        gr.DrawLine(x, y , x + xV, y + yV, s_hand_w, color);
    
        // ************* Second Hand  (oposite side)
       
        var radius = radius_s_hand / 3;
        var s_angle = 90 + d.getSeconds();
    
        xV = (radius * Math.cos(Math.PI * s_angle / steps * 2 - Math.PI / 2));
        yV = (radius * Math.sin(Math.PI * s_angle / steps * 2 - Math.PI / 2));
    
        gr.DrawLine(x + 1, y + 1, x + xV + 1, y + yV + 1, s_hand_w, RGB(0,0,0));
        gr.DrawLine(x, y, x + xV, y + yV, s_hand_w, color);
    
        // ************* center dot
    
        gr.FillEllipse(x - center_r / 2, y - center_r / 2, center_r, center_r, color); //Center dot
        gr.FillEllipse(x - center_r2 / 2, y - center_r2 / 2, center_r2, center_r2, RGB(0,0,0)); //Center dot2
    
        // ************* Date, Digital Clock
    
        if(window.GetProperty("DC",true)) {
            gr.DrawString(days[d.getDay()], datefont, color, 0, y + radius_h - 7, ww, 40, 0x11005000);
            gr.DrawString(d.getDate() + " " + months[d.getMonth()] + ", " + d.getYear(), datefont, color, 0, y + radius_h + 6, ww, 40, 0x11005000);           
    //        gr.DrawString(d.toLocaleDateString(), datefont, color, 0, y + radius_h, ww, 40, 0x11005000);
        } else {
            gr.DrawString(d.toLocaleTimeString(), datefont, color, 0, y + radius_h, ww, 40, 0x11005000);
        }
    }
    
    function on_size() {
        ww = window.Width;
        wh = window.Height;
        x = ww / 2; // CENTER
    //    y = radius_h + 5; // CENTER
        y = wh / 2 - 10; // CENTER
    }
    
    function on_timer(id) {
        d = new Date();
        window.Repaint();
    }
    
    function on_colors_changed() {
        window.Repaint();
    }
    
    function on_mouse_lbtn_down(x, y) {
        ShiftDown = utils.IsKeyPressed(0x10) ? true : false;
    }
    
    function on_mouse_lbtn_up(x, y) {
        MF_STRING = 0x00000000;
        MF_SEPARATOR = 0x00000800;
        
        var _menu = window.CreatePopupMenu();
        var idx;
    
        _menu.AppendMenuItem(MF_STRING, 1, "Календарь");
        _menu.CheckMenuItem(1, window.GetProperty("DC"));
       
        if (ShiftDown) {
            _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
            _menu.AppendMenuItem(MF_STRING, 20, "Свойства WSH");
            _menu.AppendMenuItem(MF_STRING, 21, "Настройки WSH...");
        }
       
        idx = _menu.TrackPopupMenu(x, y);
       
        switch(idx) {
            case 1:
                window.GetProperty("DC") == false ? window.SetProperty("DC", true) : window.SetProperty("DC", false);
                break;
            case 20:
                window.ShowProperties();
                break;
            case 21:
                window.ShowConfigure();
                break;
        }
        _menu.Dispose();
        return true;
    }
    
    function on_mouse_wheel(step) {
        var step = step > 0 ? 1 : (radius_h > 35 ? -1 : 0);
        size(step);
    }
    
    function on_mouse_mbtn_up(x,y) {
        var delta = 65 - radius_h;
        step = delta;
        size(step);
    }
    
    function size(step) {
        radius_h = radius_h + step;
        radius_h_numbers = radius_h_numbers + step;
        radius_h_hand = radius_h_hand + step;
        radius_m = radius_m + step;
        radius_m_hand = radius_m_hand + step;
        radius_s_hand = radius_s_hand + step;
       
        if (radius_h <= 80 && radius_h >= 50) {hour_font = gdi.Font("Arial", 11, 0)};
        if (radius_h < 50) { hour_font = gdi.Font("Arial", 9, 0)};
        if (radius_h > 80) { hour_font = gdi.Font("Arial", 13, 0)};
        if (radius_h >= 50) {
            radius_h_dot = 5;
            radius_m_dot = 3;
            center_r = 10;
        } else {
            radius_h_dot = 4;
            radius_m_dot = 2;
            center_r = 9;
        };
        window.Repaint();
    }
    
    
    // ************* ColorSchemeFromImage
    
    var g_metadb;
    on_item_focus_change();
    
    var album;
    
    
    /*        var Y = 70;
            YR = gRed + (255 - gRed) * Y / 100;   
            YG = gGreen + (255 - gGreen) * Y / 100;
            YB = gBlue + (255 - gBlue) * Y / 100;
    */
    
    function on_item_focus_change() {   
       metadb = fb.GetNowPlaying();   
        get_album_art(metadb);
    }
    
    function on_playback_new_track(metadb) {      
        on_item_focus_change();
    }
    
    function get_album_art(metadb) {
        if (metadb) {
            pic = utils.GetAlbumArtV2(metadb);
            album = fb.TitleFormat("%album%").EvalWithMetadb(metadb);
        }
    }
    
    function getAlpha(color) {
       return ((color >> 24) & 0xff);
    }
    
    function getRed(color) {
       return ((color >> 16) & 0xff);
    }
    
    function getGreen(color) {
       return ((color >> 8) & 0xff);
    }
    
    function getBlue(color) {
       return (color & 0xff);
    }
    
    function negative(colour) {
       var R = getRed(colour);
       var G = getGreen(colour);   
       var B = getBlue(colour);
       return RGB(Math.abs(R-255), Math.abs(G-255), Math.abs(B-255));
    }
    
    var gRed = 0, gGreen = 0, gBlue = 0;
    var oldgRed = 0, oldgGreen = 0, oldgBlue = 0;
    
    getColorSchemeFromImage = function(image) {   // @author "Br3tt aka Falstaff
          
        if(!image) {
            gRed = getRed(color);               
            gGreen = getGreen(color);               
            gBlue = getBlue(color);                  
        return;};                  
                   
        var left_img = gdi.CreateImage(30, 50);               
        var gb = left_img.GetGraphics();               
        var colorScheme_array = Array();               
                   
        gb.DrawImage(image, 0, 0, image.Width, image.Height, 7, 7, image.Width-14, image.Height-14, 0, 255);               
        left_img.ReleaseGraphics(gb);               
                           
    //    var myVBArray = image.Resize(50,50,5).GetColorScheme(1);               
        var myVBArray = left_img.GetColorScheme(1);               
                           
        colorScheme_array.splice(0, colorScheme_array.length);               
        colorScheme_array = myVBArray.toArray();               
                   
        gRed = getRed(colorScheme_array[0]);               
        gGreen = getGreen(colorScheme_array[0]);               
        gBlue = getBlue(colorScheme_array[0]);               
        gAlpha = getAlpha(colorScheme_array[0]);               
    }


    WSH fooClock Rus.txt
    Код:
    // fooClock 1.0 // Coded by Hunter (modifed)
    // ==PREPROCESSOR==
    // @import "%fb2k_path%\user-components\foo_uie_wsh_panel_mod\docs\Flags.txt"
    // @import "%fb2k_path%\user-components\foo_uie_wsh_panel_mod\docs\Helpers.txt"     
    // ==/PREPROCESSOR==
    
    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)); }    
    
    var hour_font = gdi.Font("Arial", 11, 0);
    var datefont = gdi.Font("Arial", 11, 0);
    
    window.GetProperty("DC",true)
    var clock_timer = window.CreateTimerInterval(1000);
    
    var d = new Date();
    
    var days = new Array("Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота");
    var months = new Array("января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря");
    
    var color = RGB(0,157,255);
    
    var radius_h = 65;
    var radius_h_dot = 5;
    var radius_h_numbers = radius_h - 12;
    var radius_h_hand = radius_h - 22;
    var h_hand_w = 4;
    
    var radius_m = radius_h;
    var radius_m_dot = 3;
    var radius_m_hand = radius_m - 5;
    var m_hand_w = 2;
    
    var radius_s_hand = radius_m - 5;
    var s_hand_w = 1;
    
    var center_r = 10;
    var center_r2 = 4;
    
    var x, y, ww, wh, w_h;
    
    function on_paint(gr) {
       
        gr.FillSolidRect(0, 0, ww, wh, RGB(0,40,80));   
    
        gr.SetTextRenderingHint(5);
        gr.SetSmoothingMode(4);
    
        // ************* Hour Dots
       
        var steps = 12;
        var radius = radius_h;
        var hour_r = radius_h_dot;
    
        for (var i = 0; i < steps; i++) {
            xV = (radius * Math.cos(Math.PI * i / steps * 2 - Math.PI / 2));
            yV = (radius * Math.sin(Math.PI * i / steps * 2 - Math.PI / 2));
    
            gr.FillEllipse(x + xV - hour_r / 2, y + yV - hour_r / 2, hour_r, hour_r, color);
        }
        // ************* Hour Numbers
       
        for (var i = 0; i < steps; i++) {
            var radius =  radius_h_numbers;       
            i == 0 ? hours = 12 : hours = i;
    
            xV = (radius * Math.cos(Math.PI * i / steps * 2 - Math.PI / 2));
            yV = (radius * Math.sin(Math.PI * i / steps * 2 - Math.PI / 2));
    
            gr.DrawString(hours, hour_font, color, x + xV - hour_r / 2, y + yV - hour_r / 2, hour_r, hour_r, 0x11005000); //
        }
       
        // ************* Minute Dots
       
        var steps = 60;
        var radius =  radius_m;
        var minute_r = radius_m_dot;
    
        for (var i = 0; i < steps; i++) {
            xV = (radius * Math.cos(Math.PI * i / steps * 2));
            yV = (radius * Math.sin(Math.PI * i / steps * 2));
    
            gr.FillEllipse(x + xV - minute_r / 2, y + yV - minute_r / 2, minute_r, minute_r, color);
        }
       
        // ************* Hour Hand
       
        var steps = 12;
        var radius = radius_h_hand;
        var m_angle = d.getHours() % 12 + d.getMinutes() / 60;
    
        xV = (radius * Math.cos(Math.PI * m_angle / steps * 2 - Math.PI / 2));
        yV = (radius * Math.sin(Math.PI * m_angle / steps * 2 - Math.PI / 2));
    
        gr.DrawLine(x + 1, y + 1, x + xV + 1, y + yV + 1, h_hand_w, RGB(0,0,0));
        gr.DrawLine(x, y, x + xV, y + yV, h_hand_w, color);   
       
        // ************* Minute Hand
    
        var steps = 60;
        var radius = radius_m_hand;
        var m_angle = d.getMinutes() + d.getSeconds() / 60;
    
        xV = (radius * Math.cos(Math.PI * m_angle / steps * 2 - Math.PI / 2));
        yV = (radius * Math.sin(Math.PI * m_angle / steps * 2 - Math.PI / 2));
    
        gr.DrawLine(x + 1, y + 1, x + xV + 1, y + yV + 1, m_hand_w, RGB(0,0,0));
        gr.DrawLine(x, y, x + xV, y + yV, m_hand_w, color);
    
        // ************* center dot (shadow)
    
        gr.FillEllipse(x - center_r / 2 + 1, y - center_r / 2 + 1, center_r + 1, center_r + 1, RGBA(0,0,0,50)); //Center dot
    
        // ************* Second Hand
    
        var steps = 60;
        var radius = radius_s_hand;
        var s_angle = d.getSeconds();
    
        xV = (radius * Math.cos(Math.PI * s_angle / steps * 2 - Math.PI / 2));
        yV = (radius * Math.sin(Math.PI * s_angle / steps * 2 - Math.PI / 2));
    
        gr.DrawLine(x+1, y+1 , x + xV+1, y + yV+1, s_hand_w, RGB(0,0,0));
        gr.DrawLine(x, y , x + xV, y + yV, s_hand_w, color);
    
        // ************* Second Hand  (oposite side)
       
        var radius = radius_s_hand / 3;
        var s_angle = 90 + d.getSeconds();
    
        xV = (radius * Math.cos(Math.PI * s_angle / steps * 2 - Math.PI / 2));
        yV = (radius * Math.sin(Math.PI * s_angle / steps * 2 - Math.PI / 2));
    
        gr.DrawLine(x + 1, y + 1, x + xV + 1, y + yV + 1, s_hand_w, RGB(0,0,0));
        gr.DrawLine(x, y, x + xV, y + yV, s_hand_w, color);
    
        // ************* center dot
    
        gr.FillEllipse(x - center_r / 2, y - center_r / 2, center_r, center_r, color); //Center dot
        gr.FillEllipse(x - center_r2 / 2, y - center_r2 / 2, center_r2, center_r2, RGB(0,0,0)); //Center dot2
    
        // ************* Date, Digital Clock
    
        if(window.GetProperty("DC",true)) {
            gr.DrawString(days[d.getDay()], datefont, color, 0, y + radius_h - 7, ww, 40, 0x11005000);
            gr.DrawString(d.getDate() + " " + months[d.getMonth()] + ", " + d.getYear(), datefont, color, 0, y + radius_h + 6, ww, 40, 0x11005000);           
    //        gr.DrawString(d.toLocaleDateString(), datefont, color, 0, y + radius_h, ww, 40, 0x11005000);
        } else {
            gr.DrawString(d.toLocaleTimeString(), datefont, color, 0, y + radius_h, ww, 40, 0x11005000);
        }
    }
    
    function on_size() {
        ww = window.Width;
        wh = window.Height;
        x = ww / 2; // CENTER
    //    y = radius_h + 5; // CENTER
        y = wh / 2 - 10; // CENTER
    }
    
    function on_timer(id) {
        d = new Date();
        window.Repaint();
    }
    
    function on_colors_changed() {
        window.Repaint();
    }
    
    function on_mouse_lbtn_down(x, y) {
        ShiftDown = utils.IsKeyPressed(0x10) ? true : false;
    }
    
    function on_mouse_lbtn_up(x, y) {
     
        var _menu = window.CreatePopupMenu();
        var idx;
        MF_STRING = 0x00000000;
        MF_SEPARATOR = 0x00000800;
        
        _menu.AppendMenuItem(MF_STRING, 1, "Календарь");
        _menu.CheckMenuItem(1, window.GetProperty("DC"));
       
        if (ShiftDown) {
            _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
            _menu.AppendMenuItem(MF_STRING, 20, "Свойства WSH");
            _menu.AppendMenuItem(MF_STRING, 21, "Настройки WSH...");
        }
       
        idx = _menu.TrackPopupMenu(x, y);
       
        switch(idx) {
            case 1:
                window.GetProperty("DC") == false ? window.SetProperty("DC", true) : window.SetProperty("DC", false);
                break;
            case 20:
                window.ShowProperties();
                break;
            case 21:
                window.ShowConfigure();
                break;
        }
        _menu.Dispose();
        return true;
    }
    
    function on_mouse_wheel(step) {
        var step = step > 0 ? 1 : (radius_h > 35 ? -1 : 0);
        size(step);
    }
    
    function on_mouse_mbtn_up(x,y) {
        var delta = 65 - radius_h;
        step = delta;
        size(step);
    }
    
    function size(step) {
        radius_h = radius_h + step;
        radius_h_numbers = radius_h_numbers + step;
        radius_h_hand = radius_h_hand + step;
        radius_m = radius_m + step;
        radius_m_hand = radius_m_hand + step;
        radius_s_hand = radius_s_hand + step;
       
        if (radius_h <= 80 && radius_h >= 50) {hour_font = gdi.Font("Arial", 11, 0)};
        if (radius_h < 50) { hour_font = gdi.Font("Arial", 9, 0)};
        if (radius_h > 80) { hour_font = gdi.Font("Arial", 13, 0)};
        if (radius_h >= 50) {
            radius_h_dot = 5;
            radius_m_dot = 3;
            center_r = 10;
        } else {
            radius_h_dot = 4;
            radius_m_dot = 2;
            center_r = 9;
        };
        window.Repaint();
    }

  4. #14
    Модератор Аватар для MC Web
    Регистрация
    25.04.2012
    Сообщений
    1 642

    Скрипт WSH Volume + Digital Clock Rus

    Кодировка должна быть UTF-8.

    Панель для отображения цифровых часов и регулирования громкости с возможностью выбора цветовой гаммы.



    WSH Volume + Digital Clock Rus.txt
    Код:
    // ==PREPROCESSOR==
    // @name "Volume"
    // @author "T.P Wang"
    // "change color" script by kgena_ua
    // "Digital Clock" script by Hunter
    //  modifed AHAPXICT
    // ==/PREPROCESSOR==
    
    DT_CENTER = 0x00000001;
    DT_VCENTER = 0x00000004;                     
    DT_SINGLELINE = 0x00000020;
    MF_SEPARATOR = 0x00000800;
    MF_STRING = 0x00000000;
    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));}
    var g_font = gdi.Font("Tahoma", 14, 1); //===FONT===//
    var g_drag = 0;
    var currentTime = new Date();
    var clock_time = window.SetInterval(on_timer, 1000);
    var v_change = false;
    var v_timer = null;
    get_color();
    window.MinWidth = 72;
    
    // ========DRAW======== //
    function on_paint(gr){
       
        var ww = window.Width;
       var wh = window.Height;
       var volume = fb.Volume;
       var pos = window.Width * ((100+volume*1)/100);
        var txt = volume.toFixed(2) + " дб";
        var currentHours = currentTime.getHours ( );
        var currentMinutes = currentTime.getMinutes ( );
        var currentSeconds = currentTime.getSeconds ( );
        currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
        currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
        gr.FillSolidRect(0, 0, ww, wh, back_rgb);
        gr.FillGradRect(0, 0, pos, wh, 90, font_rgb, back_rgb,1.0);
        gr.FillGradRect(pos, 0, ww - pos, wh, 90, RGBA(255,255,255,150), back_rgb,1.0);
       if (v_change) gr.GdiDrawText(fb.Volume.toFixed(2) + " дб", g_font, font_rgb, 0, 0, ww, wh,  DT_SINGLELINE | DT_CENTER | DT_VCENTER); 
        else {
          gr.GdiDrawText( currentHours + ":" + currentMinutes + ":" + currentSeconds, g_font, font_rgb, 0, 0, ww, wh,  DT_SINGLELINE | DT_CENTER | DT_VCENTER);
    }
    
    }
    
    // ========MENU======== //
    function on_mouse_rbtn_up(x, y) {
    
        var _menu = window.CreatePopupMenu();
       
        _menu.AppendMenuItem(MF_STRING, 1, "По умолчанию");
        _menu.AppendMenuItem(MF_STRING, 2, "Синий");
        _menu.AppendMenuItem(MF_STRING, 3, "Зеленый");
        _menu.AppendMenuItem(MF_STRING, 4, "Красный");
        _menu.AppendMenuItem(MF_STRING, 5, "Белый");
        _menu.AppendMenuItem(MF_STRING, 6, "Желтый")
        _menu.AppendMenuItem(MF_STRING, 7, "Серый")
        _menu.CheckMenuRadioItem(1, 7, window.GetProperty("Color", 1));   
        _menu.AppendMenuItem(MF_SEPARATOR, 0, 0)
        _menu.AppendMenuItem(MF_STRING, 8, "Свойства WSH...");
        _menu.AppendMenuItem(MF_STRING, 9, "Настройки WSH...");
    
        idx = _menu.TrackPopupMenu(x, y);
        switch (idx) {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
           
            ch_color(idx);
       
            break;   
        case 8:
            window.ShowProperties();
            break;
        case 9:
            window.ShowConfigure();
            break;
    }
        _menu.Dispose();
        return true
    }
    
    //=======================//
    var back_rgb, font_rgb;
    
    function get_color() {
        if (window.GetProperty("Color") == 1)  font_rgb = RGB(191,228,255), back_rgb = RGB(24, 37, 46);   //Default   
        if (window.GetProperty("Color") == 2)  font_rgb = RGB(128,192,255), back_rgb = RGB(22, 36, 46);   //Blue   
        if (window.GetProperty("Color") == 3)  font_rgb = RGB(0,255,0), back_rgb = RGB(18, 38, 38);       //Green   
        if (window.GetProperty("Color") == 4)  font_rgb = RGB(255,0,0), back_rgb = RGB(38, 26, 34);       //Red   
        if (window.GetProperty("Color") == 5)  font_rgb = RGB(255,255,255), back_rgb = RGB(26, 38, 46);   //White   
        if (window.GetProperty("Color") == 6)  font_rgb = RGB(255,255,0), back_rgb = RGB(26, 38, 38);     //Yellow
        if (window.GetProperty("Color") == 7)  font_rgb = RGB(76,121,153), back_rgb = RGB(22, 36, 45);    //Grey
    }
    
    function getRed(color) {
       return ((color >> 16) & 0xff);
    }
    
    function getGreen(color) {
       return ((color >> 8) & 0xff);
    }
    
    function getBlue(color) {
       return (color & 0xff);
    }
    
    var g_timer;
    
    function ch_color(idx) {
        get_color();
    
        old_R = getRed(font_rgb);   
        old_G = getGreen(font_rgb);   
        old_B = getBlue(font_rgb);
    
        window.SetProperty("Color", idx);   
    
       
        get_color();
    
        new_R = getRed(font_rgb);   
        new_G = getGreen(font_rgb);   
        new_B = getBlue(font_rgb);
    
        step_R = (new_R - old_R)/255; step_G = (new_G - old_G)/255; step_B = (new_B - old_B)/255;
    
        g_timer = window.SetInterval(function() {
            old_R = old_R + step_R; old_G = old_G + step_G; old_B = old_B + step_B;
            R = old_R; G = old_G; B = old_B;
            font_rgb = RGB(R,G,B)
            window.Repaint();
           
            if (
                step_R < 0 && R <= new_R || step_G < 0 && G <= new_G || step_B < 0 && B <= new_B ||
                step_R > 0 && R >= new_R || step_G > 0 && G >= new_G || step_B > 0 && B >= new_B
            ) {window.ClearInterval(g_timer); R = new_R; G = new_G; B = new_B; font_rgb = RGB(R,G,B)};
        }, 5);
    }
    //==========MOUSE===========//
    function on_mouse_lbtn_down(x,y){
       g_drag = 1;
    }
    
    function on_mouse_lbtn_up(x,y){
       on_mouse_move(x,y);
       g_drag = 0;
    }
    
    function on_mouse_move(x,y){
       if(g_drag){
          var v = x / window.Width;
          v = (v<0) ? 0 : (v<1) ? v : 1;
          v = -100/1 * (1-v);
          if(fb.Volume != v)
             fb.Volume = v;
       }
    }
    
    function on_mouse_wheel(delta){
       if(delta>0)
          fb.VolumeUp();
       else
          fb.VolumeDown();
    }
    
    function on_volume_change(val) {
       var ww = window.Width;
       var wh = window.Height;
        if (v_timer) {
          window.ClearTimeout(v_timer);
          v_timer = null;
       }
    
       v_timer = window.SetTimeout(
          function () {
             window.RepaintRect(0, 0, ww, wh, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
             window.ClearTimeout(v_timer);
             v_timer = null;
             v_change = false;
          }, 3000);
    
       v_change = true;
       window.RepaintRect(0, 0, ww, wh, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
    }
    function on_timer(id){
      currentTime = new Date();
    window.Repaint();
    }
    
    //EOF

  5. #15
    Модератор Аватар для MC Web
    Регистрация
    25.04.2012
    Сообщений
    1 642

    Скрипт WSH Artwork Rus (Maxim Terpilovsky)

    Кодировка должна быть UTF-8.

    Панель для отображения обложек альбомов с широким выбором настроек.



    WSH Artwork Rus (Maxim Terpilovsky).txt
    Код:
    // Maxim Terpilovsky's script
    // http://terpilovsky.ru
    // Artwork / Updated 27-01-2014
    
    DT_END_ELLIPSIS = 0x00008000;
    DT_EDITCONTROL = 0x00002000;
    DT_TOP = 0x00000000;
    DT_LEFT = 0x00000000;
    DT_CENTER = 0x00000001;
    DT_RIGHT = 0x00000002;
    DT_VCENTER = 0x00000004;
    DT_BOTTOM = 0x00000008;
    DT_WORDBREAK = 0x00000010;
    MF_STRING = 0x00000000;
    MK_CONTROL = 0x0008; 
    DT_CALCRECT = 0x00000400;
    MF_POPUP = 0x00000010;
    MK_SHIFT = 0x0004; 
    DT_NOPREFIX = 0x00000800;
    
    function StrFmt(alignH,alignV,trim,flag){ return ((alignH<<28)|(alignV<<24)|(trim<<20)|flag); }
    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)); }
    
    var FSO = new ActiveXObject("Scripting.FileSystemObject");
    var WshShell = new ActiveXObject("WScript.Shell");
    var ww, wh;
    var g_hover = 0;
    
    if ( utils.CheckFont( "Segoe UI" ) ) {
        var g_font       = gdi.Font("Segoe UI", 13);
        var g_font2      = gdi.Font("Segoe UI", 12, 0);
        var g_font_small = gdi.Font("Segoe UI", 11, 0);
    } else {
       var g_font       = gdi.Font("Tahoma", 13);
        var g_font2      = gdi.Font("Tahoma", 11, 1);
        var g_font_small = gdi.Font("Tahoma", 10, 1);
    }
    
    
    
    /*var arrow_left, arrow_right, info_hover = 0;
    try {
        var arrow_left  = gdi.Image( fb.FoobarPath + "\\s7e_files\\images\\arrow_left.png" );
        var arrow_right = gdi.Image( fb.FoobarPath + "\\s7e_files\\images\\arrow_right.png" );
        var picture = gdi.Image( fb.FoobarPath + "\\s7e_files\\images\\picture.png" );
        var user_image     = gdi.Image( fb.FoobarPath + "\\s7e_files\\images\\user.png" );
    } catch(e) {
        // fb.trace(e.message);
    }
    */
    
    
    
    function CoverShow( metadb ) {
    
       this.CachedPath = 0;
        this.CachedCoversNumber = 0;
    
    
        // Current Mode
        this.CurrentMode        = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'displayed_cover', 1) );
    
        // Current Mode
        this.DisplayMode        = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'disp_mode', 1) );
    
       // Priority
       this.Priority           = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'cover_priority', 2) );
    
       // Exclude
       this.Exclude            = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'exclude_covers', 0) );
    
       // Pattern
        // 1 - *keywords*.*
        // 2 - keywords.*
       this.MatchPattern       = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'match_pattern', 1) );
    
       // Aspect ratio
       this.Aspect             = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'covers_aspect', 1) );
    
       // Gesture
       this.GestureInverted    = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'gesture_inverted', 0) );
    
       // Covers from Root folder
       this.RootCovers         = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'root_covers', 1) );
    
       // Covers from subfolders
       this.SubCovers          = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'sub_covers', 1) );
    
    
       // Interval
       this.Interval           = parseInt( utils.ReadINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'interval', 1) );
        this.Intervals          = new Array(5000, 15000, 30000, 60000, 120000);
    
        cache_path              = utils.ReadINI(fb.FoobarPath + 's7e.ini', 'bio', 'cache_path');
        this.CachePath          = cache_path ? cache_path : false;
    
    
       // No Cover and Case
       //try {
          //this.NoCover = gdi.Image( fb.ProfilePath + "s7e_files\\images\\nocover.png" );
          //this.Case = gdi.Image( fb.ProfilePath + "s7e_files\\images\\case.png" );
       //}
       //catch(e) { }
    
       // Metadb
       this.OutputMetadb = function() {
    
            return ( this.CurrentMode == 3 || !fb.IsPlaying ? fb.GetFocusItem(true) : fb.GetNowPlaying() );
    
       }
    
    
        this.FormatMeta = function( meta, db ) {
    
            if ( db )  {
              s     = fb.TitleFormat("%" + meta + "%").EvalWithMetadb( db );
              s     = s.replace(/[\/\\\:\*\?\"\<\>\|]/g,'-');
                s     = s.replace(/(^\s+)|(\s+$)/g, "");
                return s;
            } else return '';
    
        }
    
       // Search for files
       this.Search = function( array, dir) {
    
          var e = new Enumerator( dir.Files );
    
          while( !e.atEnd() ) {
             var name = e.item().Name;
             if( name.match(/\.(jpg|jpeg|png|gif|bmp|tiff)$/i) ) {
                array.push( e.item().Path );
             }
             e.moveNext();
          }
    
       }
    
       // Find all covers in the folder
       this.GetExternalCovers = function( path ) {
    
          var files = [];
          var files_this = [];
          var files_subs = [];
          var covers = [];
    
          try {
             var dir  = FSO.GetFolder( path );
                var root = dir.ParentFolder;
    
             this.Search(files_this, dir);
                this.Search(files_this, root);
    
                if ( this.SubCovers ) {
    
                 var e = new Enumerator( dir.SubFolders );
    
                 for(; !e.atEnd(); e.moveNext() ) {
                    this.Search(files_subs, e.item() );
                 }
    
                }
    
          } catch(e) {
                // fb.trace( 'this.GetExternalCovers / path: ' + e.message );
            }
    
    
          if ( files_this.length > 0 || files_subs.length > 0 ) {
    
                files_this.sort();
                files_subs.sort();
                files = files.concat(files_this, files_subs);
    
                var k = files.length;
                files.reverse();
                while (k--){
    
                var name = files[k];
    
                    if ( this.MatchPattern == 1 ) {
                        if ( name.match(/.*(cover|front|folder)([^\\]*)\.(jpg|jpeg|gif|png|bmp|tiff)$/i) ) {
                            covers.push( name );
                            files[k] = null;
                        }
                    }
                    else {
                        if ( name.match(/\\(cover|front|folder)\.(jpg|jpeg|gif|png|bmp|tiff)$/i) ) {
                            covers.push( name );
                            files[k] = null;
                        }
                    }
             }
    
             overall = covers;
    
    
             k = files.length;
                while (k--){
                    var cur = files[k];
                if ( typeof( cur ) == 'string' ) overall.push( cur );
             }
    
             return overall;
    
          }
          else return new Array();
    
       }
    
    
       this.GetCovers = function( path ) {
    
          switch ( this.Exclude ) {
    
             case 0:
                   var embedded  = this.DisplayMode == 2 && this.CachePath ? [] : this.GetEmbeddedCovers( this.Metadb );
                   var external  = this.GetExternalCovers( path );
    
                   var allcovers = [];
    
                   if ( this.Priority == 1 ) allcovers = allcovers.concat(embedded, external);
                   else                      allcovers = allcovers.concat(external, embedded);
    
                   this.Covers = allcovers;
                break;
    
    
             case 1:
                   var external = this.GetExternalCovers( path );
                   this.Covers = external;
                break;
    
    
             case 2:
                   var embedded = this.DisplayMode == 2 && this.CachePath ? [] : this.GetEmbeddedCovers( this.Metadb );
                   this.Covers = embedded;
                break;
    
          }
    
    
          if ( this.Covers.length > 0 ) {
    
             try {
    
                    var temp = this.Covers[0];
                    return ( typeof temp == 'object' ? temp.Clone( 0, 0, temp.Width, temp.Height ) : gdi.LoadImageAsync( window.ID, temp ) );
    
             }
             catch(e) { return undefined; }
    
          }
          else {
             this.Covers = false;
             return 0;
          }
    
       }
    
    
       this.GetEmbeddedCovers = function( metadb ) {
    
            if ( metadb ) {
                var embedded = [];
                var c = 5;
                while ( c-- ) {
    
                    if ( c == 3 ) continue;
    
                    var temp = utils.GetAlbumArtEmbedded( metadb.RawPath, c );
                    if ( temp ) embedded.push( temp );
    
                }
                return embedded;
            } else return [];
    
       }
    
    
       this.CompareDirs = function() {
    
            metadb = this.OutputMetadb();
            try {
                artist = this.Eval( this.Metadb, 'artist'  );
                metapath = metadb.Path;
                metapath = this.DisplayMode == 2 && this.CachePath && FSO.FolderExists( this.CachePath + '\\' + artist ) ? this.CachePath + '\\' + artist : metapath.replace(/\\([^\\]*)$/g, '');
            }
            catch (e) { metapath = 0; }
    
            if ( metapath ) {
    
                switch ( this.Exclude ) {
    
                    case 0:
                            var embedded  = this.DisplayMode == 2 && this.CachePath ? [] : this.GetEmbeddedCovers( this.Metadb );
                            var external  = this.GetExternalCovers( metapath );
    
                            var allcovers = [];
    
                            if ( this.Priority == 1 ) allcovers = allcovers.concat(embedded, external);
                            else                      allcovers = allcovers.concat(external, embedded);
    
                            //this.Covers = allcovers;
                        break;
    
    
                    case 1:
                            var allcovers = this.GetExternalCovers( metapath );
                            //this.Covers = external;
                        break;
    
    
                    case 2:
                            var allcovers = this.DisplayMode == 2 && this.CachePath ? [] : this.GetEmbeddedCovers();
                           
                            //this.Covers = embedded;
                        break;
    
                }
    
             var allcovers = new Array();
                allcovers = allcovers.concat(embedded, external);
    
                return this.CachedCoversNumber == allcovers.length;
            }
        }
    
    
       this.ChangeImage = function( val ) {
          this.CurrentCover = val;
       }
    
    
       this.NextCover = function() {
    
          if ( this.Covers && this.Covers.length > 1 ) {
    
             this.CurrentCoverNumber = this.CurrentCoverNumber + 1 == this.Covers.length ? 0 : this.CurrentCoverNumber + 1;
    
             try {
    
                    var temp = this.Covers[ this.CurrentCoverNumber ];
                    var img = ( typeof temp == 'object' ) ? temp.Clone(0,0,temp.Width,temp.Height) : gdi.LoadImageAsync(window.ID, temp);
    
             } catch (e) { var img = undefined; }
    
    
                this.ChangeImage( img );
                window.Repaint();
    
          }
            else if ( !this.Covers ) { this.Update();  }
    
       }
    
        this.MultipleCovers = function() {
    
            return ( this.Covers && this.Covers.length > 1 );
    
        }
    
       this.PrevCover = function() {
    
          if ( this.Covers && this.Covers.length > 1 ) {
    
             this.CurrentCoverNumber = ( this.CurrentCoverNumber == 0 ) ? this.Covers.length - 1 : this.CurrentCoverNumber - 1;
    
             try {
    
                    var temp = this.Covers[ this.CurrentCoverNumber ];
                    var img = ( typeof temp == 'object' ) ? temp.Clone(0,0,temp.Width,temp.Height) : gdi.LoadImageAsync(window.ID, temp);
    
             } catch (e) { var img = undefined; }
    
                this.ChangeImage( img );
                window.Repaint();
    
          }
            else if ( !this.Covers ) { this.Update(); }
    
       }
    
    
       this.StopTimer = function() {
          this.CycleTimer ? window.ClearInterval(this.CycleTimer) : '';
       }
    
       this.StartTimer = function() {
    
            if ( this.CycleTimer ) window.ClearInterval( this.CycleTimer );
          if ( this.CurrentMode == 2 ) this.CycleTimer = window.SetInterval( function() { Cover.NextCover() }, this.Intervals[ this.Interval ] );
    
       }
    
        this.Reset  = function() {
    
            this.Covers = false;
            this.CoverX = null;
            this.CoverY = null;
            this.CurrentCoverNumber = 0;
            this.CurrentCover = 0;
            this.CachedPath = '';
            this.CachedCoversNumber = 0;
            this.CachedArtist = '';
        }
    
    
       this.Eval = function( meta, field ) {
    
            path = meta ? meta.Path : '';
          if ( path ) return path.indexOf('://') > 0 ?  fb.TitleFormat("[%" + field + "%]").Eval( true ) : fb.TitleFormat("[%" + field + "%]").EvalWithMetadb( meta );
    
       }
    
    
       this.Update = function( metadb ) {
    
          this.Metadb = metadb ? metadb : this.OutputMetadb();
           
            artist = this.Eval( this.Metadb, 'artist'  );
    
          try {
                dir = this.Metadb.Path;
                dir = dir.replace(/\\([^\\]*)$/g, '');
                this.MetaPath = this.DisplayMode == 2 && this.CachePath && FSO.FolderExists( this.CachePath + '\\' + artist ) ? this.CachePath + '\\' + artist : dir;
            }
          catch (e) { this.MetaPath = 0; }
    
          if ( this.MetaPath && artist ) {
    
                var artist_temp = this.Eval( this.Metadb, 'artist'  );
                var a = this.CachedPath ? this.CachedPath : ' ';
                var b = this.MetaPath;
    
                if ( a != b || ( this.CachedArtist != artist_temp ) ) {
    
                    this.Covers             = false;
                this.CurrentCoverNumber = 0;
                    this.CurrentCover       = this.GetCovers( this.MetaPath );
                    this.CachedPath         = this.MetaPath;
                    this.CachedCoversNumber = this.Covers != undefined ? this.Covers.length : 0;
                    this.CachedArtist       = artist_temp;
                    window.Repaint();
    
             }
    
          }
          else {
    
                this.Reset();
                window.Repaint();
    
            }
    
       }
    
       //this.Update( metadb);
        this.CachedArtist = '';
        this.CachedCoversNumber = this.Covers != undefined ? this.Covers.length : 0;
       this.CycleTimer = 0;
       this.TimerStarted = false;
        this.LbtnPressed = 0;
        this.X1 = 0;
        this.X2 = 0;
        this.X  = 0;
        this.MouseGesture = 0;
        this.CoverX = null;
        this.CoverY = null;
        this.Covers = undefined;
    }
    
    
    var Cover = new CoverShow();
    
    
    function on_size() {
    
        ww = window.Width;
        wh = window.Height;
    ///    if ( ww && wh ) { Cover.Reset(); Cover.Update(); }
    
    }
    
    
    function on_paint( gr ) {
    
        //d = new Date();
        //t = d.getTime();
    
            gr.SetSmoothingMode( 4 );
            gr.SetInterpolationMode( 1 );
    ///        gr.FillSolidRect(0, 0, ww, wh, RGB(255,255,255));
    
    
            if ( Cover.Covers ) {
    
                // Bottom box
    ///            gr.FillSolidRect( 0, wh - 27, ww, 27, RGBA(255,255,255,150));
    
    
                // Check if it's corrupted or not loaded
                if ( !Cover.CurrentCover ) {
    
                    Cover.CoverX = null;
                    Cover.CoverY = null;
    
                    var cov = Cover.Covers[ Cover.CurrentCoverNumber ];
    
                    if ( typeof cov == 'object' ) {
    
                        Cover.CurrentCover = cov == null ? false : cov.Clone(0,0,cov.Width,cov.Height);
                        var image_name = 'Встроенное изображение';
    
                    }
                    else {
    
                        Cover.CurrentCover = gdi.Image( cov );
                        if ( Cover.CurrentCover == null ) Cover.CurrentCover = false;
                        var image_name = 'Изображение';
    
                    }
    
                    if ( !Cover.CurrentCover ) gr.GdiDrawText( image_name + ' вероятно повреждено и не может быть отображено.', g_font, RGB(0,0,0), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_WORDBREAK | DT_CALCRECT);               
                    if ( !Cover.CurrentCover ) gr.GdiDrawText( image_name + ' вероятно повреждено и не может быть отображено.', g_font, RGB(140,164,179), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_WORDBREAK | DT_CALCRECT);               
    
                }
    
    
                if ( typeof Cover.CurrentCover == 'object' ) {
    
                    var img = Cover.CurrentCover;
    
                    // Width, height, coords
    ///                var resulting_height = wh - 53;
    
                    if ( Cover.Aspect ) {
    
                        if ( img.Width > ww || img.Height > wh ) {
    //                    if ( img.Width > ww || img.Height > resulting_height ) {
                            var iw1 = ww;
                            var iw2 = img.Width / ( img.Height / wh );
    ///                        var iw2 = img.Width / ( img.Height / resulting_height );
                            var ih1 = wh;
    ///                        var ih1 = resulting_height;
                            var ih2 = img.Height / ( img.Width / ww );
                            var iw = Math.min(iw1, iw2);
                            var ih = Math.min(ih1, ih2);
    
                        }
                        else {
                            var iw = img.Width;
                            var ih = img.Height;
                        }
    
                    }
                    else {
    
                        var iw = ( img.Width > ww ) ? ww : img.Width;
                        var ih = ( img.Height > wh ) ? wh : img.Height;
    ///                    var ih = ( img.Height > resulting_height ) ? resulting_height : img.Height;
    
                    }
    
                    img = img.CreateRawBitmap();
    
                    var x = (iw < ih) ? ((iw < ww) ? ((ww - iw)/2) : 0 ) : ((iw >= ww) ? 0 : ((ww - iw)/2));
                    var y = (iw > ih) ? ((ih < wh) ? ((wh - ih)/2) : 0 ) : ((ih >= wh) ? 0 : ((wh - ih)/2));
    ///                var y = (iw > ih) ? ((ih < resulting_height) ? ((wh - ih)/2) : 0 ) : ((ih >= resulting_height) ? 0 : ((wh - ih)/2));
    
                    Cover.CoverX = x;
                    Cover.CoverY = y;
    
                    // Draw cover
                    gr.GdiDrawBitmap( img, x, y, iw, ih, 0, 0, img.Width, img.Height );
    
                    if((wh - ih)/2 < 15 && g_hover == 1){
                        gr.FillSolidRect (0, 0, ww, 18, RGBA(0,20,30,150));                 
                        gr.FillSolidRect (0, wh - 18, ww, wh, RGBA(0,20,30,150)); 
                    }
    
                    // Resolution
    ///                gr.GdiDrawText( Cover.CurrentCover.Width + " × " + Cover.CurrentCover.Height, g_font_small, RGB(0,0,0), 0, wh - 25, ww, 25, DT_CENTER | DT_VCENTER | DT_CALCRECT);
                    if (g_hover == 1) {
                        gr.GdiDrawText( Cover.CurrentCover.Width + " X " + Cover.CurrentCover.Height, g_font_small, RGB(0,0,0), 7, 1, ww, 18, DT_LEFT| DT_VCENTER | DT_END_ELLIPSIS | DT_CALCRECT);
                        gr.GdiDrawText( Cover.CurrentCover.Width + " X " + Cover.CurrentCover.Height, g_font_small, RGB(140,164,179), 6, 0, ww, 18, DT_LEFT| DT_VCENTER | DT_END_ELLIPSIS | DT_CALCRECT);
                    }
    
                    // Filesize
    ///                try { var size = Math.round( FSO.GetFile( Cover.Covers[ Cover.CurrentCoverNumber ] ).size / 1024 ) + " KB"; }
    ///                catch(e) { var size = ''; }
    ///                gr.GdiDrawText( size, g_font_small, RGB(0,0,0), 6, wh - 25, ww, 25, DT_LEFT| DT_VCENTER | DT_CALCRECT);
    
    
                    // Release graphics
                    var graphics = Cover.CurrentCover.GetGraphics();
                    Cover.CurrentCover.ReleaseGraphics( graphics );
                    Cover.CurrentCover.Dispose();
                    Cover.CurrentCover = 0;
    
                }
                else if ( typeof Cover.CurrentCover == 'number' ) {
    
                    gr.GdiDrawText( 'Загрузка...', g_font2, RGB(0,0,0), 1, 1, ww, wh, DT_CENTER | DT_VCENTER | DT_CALCRECT);
                    gr.GdiDrawText( 'Загрузка...', g_font2, RGB(140,164,179), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_CALCRECT);
    
                }
    
                // Cover Number
    
                if (g_hover == 1) {
                    gr.GdiDrawText( (Cover.CurrentCoverNumber+1) + "/" + Cover.Covers.length, g_font_small, RGB(0,0,0), -5, wh - 20, ww, 25, DT_RIGHT | DT_VCENTER | DT_CALCRECT);
                    gr.GdiDrawText( (Cover.CurrentCoverNumber+1) + "/" + Cover.Covers.length, g_font_small, RGB(140,164,179), -6, wh - 21, ww, 25, DT_RIGHT | DT_VCENTER | DT_CALCRECT);
                }
    ///            gr.DrawLine( 0, wh - 25, ww, wh - 25, 1, RGB(218,219,220));
    
                // Filename
                if ( typeof Cover.Covers[ Cover.CurrentCoverNumber ] == 'object' ) var filename = 'Embedded';
                else if ( Cover.Covers[ Cover.CurrentCoverNumber ] ) var filename = Cover.Covers[ Cover.CurrentCoverNumber ].replace(/(.*)\\(.*)$/i,"$2");
    
    ///            estimate = gr.EstimateLineWrap(filename, g_font_small, ww - 10);
    ///            estimate = estimate.toArray();
    
    ///            if ( picture && user_image ) gr.DrawImage( Cover.DisplayMode == 2 ? user_image : picture, 5, 5, picture.Width, picture.Height, 0, 0, picture.Width, picture.Height, angle = 0, alpha = 255);
                if (g_hover == 1) {
                    gr.GdiDrawText( filename, g_font_small, RGB(0,0,0), 6, wh - 17, ww - 39, 18, DT_LEFT| DT_VCENTER | DT_END_ELLIPSIS | DT_CALCRECT);
                    gr.GdiDrawText( filename, g_font_small, RGB(140,164,179), 5, wh - 18, ww - 40, 18, DT_LEFT| DT_VCENTER | DT_END_ELLIPSIS | DT_CALCRECT);
                }
    ///            gr.DrawLine( 0, 25, ww, 25, 1, RGB(218,219,220));
    
    
            }
            else {
    
                metadb = Cover.OutputMetadb();
                if ( metadb ) info = fb.TitleFormat(Cover.DisplayMode == 2 ? "[%artist%]" : "[%artist%][ — %album%]").EvalWithMetadb( metadb );
                else          info = false;
    
                Cover.CoverX = null;
                Cover.CoverY = null;
                gr.GdiDrawText( 'Нет изображений', g_font2, RGB(0,0,0), 1, 1, ww, wh, DT_CENTER | DT_VCENTER | DT_CALCRECT);
                gr.GdiDrawText( 'Нет изображений', g_font2, RGB(140,164,179), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_CALCRECT);
    
                // ARTIST BAR
    ///            if ( info ) {
    ///                gr.FillSolidRect(0, 0, ww, 25, RGB(255,255,255));
    ///                gr.GdiDrawText( info, g_font2, RGB(0, 0, 0), 24, 0, ww - 50, 25, DT_LEFT | DT_VCENTER | DT_EDITCONTROL | DT_END_ELLIPSIS | DT_CALCRECT | DT_NOPREFIX);
    ///                gr.DrawLine( 0, 25, ww, 25, 1, RGB(218,219,220));
    ///                if ( picture && user_image ) gr.DrawImage( Cover.DisplayMode == 2 ? user_image : picture, 5, 4, user_image.Width, user_image.Height, 0, 0, user_image.Width, user_image.Height, angle = 0, alpha = 255);
    ///            }
    
    
            }
    
        //d = new Date();
        //t2 = d.getTime();
        //fb.trace( 'Repaint: ' + (t2 - t) + ' ms' );
    
    }
    
    
    function on_load_image_done(cookie, image) {
    
        Cover.CurrentCover = image == null ? false : image;
        window.Repaint();
    
    }
    
    
    
    function on_mouse_move(x, y) {
    
        if ( !g_hover ) {
    
            g_hover = 1;
                window.Repaint(); 
    
            if ( !Cover.CompareDirs() ) {
    
              Cover.Reset();
                Cover.Update();
    
            }
    
        }
    
       if ( Cover.MultipleCovers() && Cover.X1 ) {
            Cover.X2 = x;
        }
    
    }
    
    
    function on_mouse_leave() {
    
       g_hover    = 0;
        info_hover = 0;
    
        Cover.X1   = 0;
        Cover.X2   = 0;
        Cover.X    = 0;
        Cover.MouseGesture = 0;
        window.Repaint(); 
    }
    
    function on_mouse_wheel( step ) {
    
        (step < 0) ? Cover.NextCover() : Cover.PrevCover();
    
    }
    
    
    function on_mouse_lbtn_down(x, y, mask) {
    
        if ( mask == 1 ) {
            Cover.LbtnPressed = 1;
            Cover.X1 = x;
        }
    
    }
    
    
    function on_mouse_lbtn_up(x, y, mask) {
    
       if ( !mask && Cover.MultipleCovers() && Cover.X1 ) {
    
            Cover.X2 = x;
    
            if ( Cover.X1 < Cover.X2 && Math.abs( Cover.X1 - Cover.X2 ) > 8 ) Cover.GestureInverted == 1 ? Cover.NextCover() : Cover.PrevCover();
            else if ( Cover.X1 > Cover.X2 && Math.abs( Cover.X1 - Cover.X2 ) > 8 ) Cover.GestureInverted == 1 ? Cover.PrevCover() : Cover.NextCover();
            else if ( Cover.X1 > ww / 2 ) Cover.NextCover();
            else if ( Cover.X1 < ww / 2 ) Cover.PrevCover();
    
            Cover.LbtnPressed = 0;
            Cover.X1 = 0;
            Cover.X2 = 0;
            Cover.X = 0;
            Cover.MouseGesture = 0;
    
       }
       else if ( mask == MK_CONTROL ) {
          if ( typeof Cover.Covers[ Cover.CurrentCoverNumber ] == 'object' ) WshShell.run( '"' + Cover.MetaPath.replace(/\\([^\\]*)$/g, '') + '"' );
            else if ( Cover.Covers[ Cover.CurrentCoverNumber ] ) WshShell.run( '"' + Cover.Covers[ Cover.CurrentCoverNumber ] + '"' );
        }
        else if ( mask == MK_SHIFT ) {
    
            WshShell.run( '"' + Cover.MetaPath.replace(/\\([^\\]*)$/g, '') + '"' );
    
        }
    
    }
    
    function on_mouse_rbtn_up(x, y) {
       var _menu = window.CreatePopupMenu();
       var _firstgroup = window.CreatePopupMenu();
       var _secondgroup = window.CreatePopupMenu();
       var _thirdgroup = window.CreatePopupMenu();
       var _fourthgroup = window.CreatePopupMenu();
       var _fivthgroup = window.CreatePopupMenu();
       var _sixthgroup = window.CreatePopupMenu();
       var _seventhgroup = window.CreatePopupMenu();
       var _eighthgroup = window.CreatePopupMenu();
       var _ninthgroup = window.CreatePopupMenu();
        var _tenthgroup = window.CreatePopupMenu();
       var i = 1;
       var ret;
    
        artist = Cover.FormatMeta('artist', Cover.OutputMetadb() );
    
       _firstgroup.AppendMenuItem(MF_STRING, i++, "Воспроизводимый элемент (не зацикленно)");
       _firstgroup.AppendMenuItem(MF_STRING, i++, "Воспроизводимый элемент (зацикленно)");
       _firstgroup.AppendMenuItem(MF_STRING, i++, "Текущее выделение");
    
       _firstgroup.EnableMenuItem( Cover.CurrentMode, 1 );
       _firstgroup.CheckMenuRadioItem( 1, i-1, Cover.CurrentMode );
    
        _firstgroup.AppendMenuSeparator();
    
       _firstgroup.AppendMenuItem(MF_STRING, i++, "Обложка: лицевая, задняя, диск и т.д.");
       _firstgroup.AppendMenuItem(MF_STRING, i++, "Фото исполнителя");
        _firstgroup.EnableMenuItem( i-1 , !Cover.CachePath ? 1 : 0 );
       _firstgroup.EnableMenuItem( Cover.DisplayMode + 3, 1 );
       _firstgroup.CheckMenuRadioItem( i-2, i-1, Cover.DisplayMode + 3 );
    
       _secondgroup.AppendMenuItem(MF_STRING, i++, "Встроенные обложки");
       _secondgroup.AppendMenuItem(MF_STRING, i++, "Внешние обложки");
    
       _secondgroup.EnableMenuItem( Cover.Priority + 5, 1 );
       _secondgroup.CheckMenuRadioItem( i-2, i-1, Cover.Priority + 5 );
    
       _thirdgroup.AppendMenuItem(MF_STRING, i++, "Встроенные обложки");
       _thirdgroup.AppendMenuItem(MF_STRING, i++, "Внешние обложки");
    
       if ( Cover.Exclude ) {
    //      _thirdgroup.EnableMenuItem( Cover.Exclude + 5, 1 );
          _thirdgroup.CheckMenuRadioItem( i-2, i-1, Cover.Exclude + 7 );
       }
    
       _fourthgroup.AppendMenuItem(MF_STRING, i++, "*ключевые слова*.*");
       _fourthgroup.AppendMenuItem(MF_STRING, i++, " ключевые слова.*");
    
        _fourthgroup.EnableMenuItem( Cover.MatchPattern + 9, 1 );
        _fourthgroup.CheckMenuRadioItem( i-2, i-1, Cover.MatchPattern + 9 );
    
    
       _fivthgroup.AppendMenuItem(MF_STRING, i++, "5 сек.");
       _fivthgroup.AppendMenuItem(MF_STRING, i++, "15 сек.");
       _fivthgroup.AppendMenuItem(MF_STRING, i++, "30 сек.");
       _fivthgroup.AppendMenuItem(MF_STRING, i++, "1 мин.");
       _fivthgroup.AppendMenuItem(MF_STRING, i++, "2 мин.");
    
       _fivthgroup.EnableMenuItem( Cover.Interval + 12, 1 );
       _fivthgroup.CheckMenuRadioItem( i-5, i-1, Cover.Interval + 12 );
    
       _sixthgroup.AppendMenuItem(MF_STRING, i++, "Не сохранять пропорции");
       _sixthgroup.AppendMenuItem(MF_STRING, i++, "Сохранять пропорции");
    
       _sixthgroup.EnableMenuItem( Cover.Aspect + 17, 1 );
       _sixthgroup.CheckMenuRadioItem( i-2, i-1, Cover.Aspect + 17 );
    
       _seventhgroup.AppendMenuItem(MF_STRING, i++, "Инвертировать жест влево/вправо");
       _seventhgroup.CheckMenuItem( i-1, Cover.GestureInverted );
    
       _eighthgroup.AppendMenuItem(MF_STRING, i++, "Показывать обложки из корневой папки");
       _eighthgroup.CheckMenuItem( i-1, Cover.RootCovers );
        _eighthgroup.AppendMenuItem(MF_STRING, i++, "Показывать обложки из вложенных папок");
       _eighthgroup.CheckMenuItem( i-1, Cover.SubCovers );
    
       _ninthgroup.AppendMenuItem(MF_STRING, i++, "cover.*");
       _ninthgroup.AppendMenuItem(MF_STRING, i++, "folder.*");
       _ninthgroup.AppendMenuItem(MF_STRING, i++, "front.*");
       _ninthgroup.AppendMenuItem(MF_STRING, i++, "back.*");
       _ninthgroup.AppendMenuItem(MF_STRING, i++, "disc.*");
       _ninthgroup.AppendMenuItem(MF_STRING, i++, "%album%.*");
    
        _tenthgroup.AppendMenuItem(MF_STRING, i, "Текущее изображение");
    
        if ( Cover.Covers && typeof Cover.Covers[ Cover.CurrentCoverNumber ] != 'object' ) {
                fb.trace( Cover.Covers );
                var imagepath = Cover.Covers[ Cover.CurrentCoverNumber ];
                var dir       = imagepath.replace(/\\([^\\]*)$/g, '');
                var imagename = imagepath.replace(/\\([^\\]*)$/g, "$1");
                var ext       = imagename.replace(/(.*)\.([^\.]*)$/,'$2');
    
                if ( imagename == ('cover.'  + ext )  || FSO.FileExists( dir + '\\cover.'  + ext  ) ) _ninthgroup.EnableMenuItem(   22, 1 );
                if ( imagename == ('folder.' + ext )  || FSO.FileExists( dir + '\\folder.' + ext  ) ) _ninthgroup.EnableMenuItem(   23, 1 );
                if ( imagename == ('front.'  + ext )  || FSO.FileExists( dir + '\\front.'  + ext  ) ) _ninthgroup.EnableMenuItem(   24, 1 );
                if ( imagename == ('back.'   + ext )  || FSO.FileExists( dir + '\\back.'   + ext  ) ) _ninthgroup.EnableMenuItem(   25, 1 );
                if ( imagename == ('disc.'   + ext )  || FSO.FileExists( dir + '\\disc.'   + ext  ) ) _ninthgroup.EnableMenuItem(   26, 1 );
    
                var album = fb.Titleformat("$replace(%album%,/,-,\,-,:,-,*,-,?,-,\",-,<,-,>,-,|,-)").EvalWithMetadb( Cover.OutputMetadb() );
                if ( imagename == (album + '.' + ext ) || FSO.FileExists( dir + '\\' + album + '.' + ext  ) ) _ninthgroup.EnableMenuItem( 27, 1 );
        }
        else {
                _ninthgroup.EnableMenuItem( 22, 1 );
                _ninthgroup.EnableMenuItem( 23, 1 );
                _ninthgroup.EnableMenuItem( 24, 1 );
                _ninthgroup.EnableMenuItem( 25, 1 );
                _ninthgroup.EnableMenuItem( 26, 1 );
                _ninthgroup.EnableMenuItem( 27, 1 );
                _tenthgroup.EnableMenuItem( 28, 1 );
        }
    
    
       _firstgroup.AppendTo(   _menu, MF_STRING, "Отображение");
       _secondgroup.AppendTo(  _menu, MF_STRING, "Приоритет");
       _thirdgroup.AppendTo(   _menu, MF_STRING, "Исключить из поиска");
       _fourthgroup.AppendTo(  _menu, MF_STRING, "Совпадение");
       _fivthgroup.AppendTo(   _menu, MF_STRING, "Интервал");
       _sixthgroup.AppendTo(   _menu, MF_STRING, "Пропорции");
        _seventhgroup.AppendTo( _menu, MF_STRING, "Мышь");
        _eighthgroup.AppendTo(  _menu, MF_STRING, "Дополнительно");
    
        _menu.AppendMenuSeparator(); 
    
       _ninthgroup.AppendTo( _menu, MF_STRING, "Переименовать текущее изображение в...");
       _tenthgroup.AppendTo( _menu, MF_STRING, "Удалить...");
    
        _menu.AppendMenuSeparator();
       _menu.AppendMenuItem(MF_STRING, ++i, "Обновить обложки");
        _menu.AppendMenuSeparator();
        _menu.AppendMenuItem(MF_STRING, ++i, "Открыть папку");
        _menu.AppendMenuItem(MF_STRING, ++i, "Открыть обложку");
    
        // Open cover option handle
        if ( !Cover.Covers || typeof Cover.Covers[ Cover.CurrentCoverNumber ] == 'object' ) {
            _menu.EnableMenuItem( 31, 1 );
        }
    
        if ( !Cover.CachePath && !FSO.FolderExists( Cover.CachePath + '\\' + artist ) ) {
            _menu.EnableMenuItem( 29, 1 );
        }
    
        _menu.AppendMenuSeparator(); 
        _menu.AppendMenuItem(MF_STRING, ++i, "Настройки WSH...");
    
       ret = _menu.TrackPopupMenu(x, y);
       if (ret >= 1 && ret <= 3) {
          utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'displayed_cover', Cover.CurrentMode = ret );
            Cover.StopTimer();
          Cover = new CoverShow();
            Cover.Update();
            Cover.StartTimer();
       }
       else if (ret >= 4 && ret <= 5) {
          utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'disp_mode',       Cover.DisplayMode = ret - 3);
            Cover.Reset();
            Cover.Update();
       }
       else if (ret >= 6 && ret <= 7) {
          utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'cover_priority',  Cover.Priority = ret - 5);
            Cover = new CoverShow();
            Cover.Update();
       }
       else if (ret >= 8 && ret <= 9) {
          utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'exclude_covers', ( ret - 7 == Cover.Exclude ) ? Cover.Exclude = 0 : Cover.Exclude = ret - 7 );
            Cover.Reset();
            Cover.Update();
       }
       else if (ret >= 10 && ret <= 11) {
          utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'match_pattern', Cover.MatchPattern = ret - 9 );
            Cover.Reset();
            Cover.Update();
       }
       else if (ret >= 12 && ret <= 16) {
          utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'interval', Cover.Interval = ret - 12);
          Cover.StopTimer();
            Cover.StartTimer();
       }
       else if (ret >= 17 && ret <= 18) {
          utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'covers_aspect', Cover.Aspect = ret - 17 );
            Cover.Reset();
            Cover.Update();
       }
       else if (ret == 19) {
            utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'gesture_inverted', Cover.GestureInverted = Cover.GestureInverted == 1 ? 0 : 1);
        }
       else if (ret == 20) {
            utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'root_covers', Cover.RootCovers = Cover.RootCovers == 1 ? 0 : 1);
            Cover.Reset();
            Cover.Update();
        }
       else if (ret == 21) {
            utils.WriteINI( fb.FoobarPath + 's7e.ini', 'artwork-settings', 'sub_covers', Cover.SubCovers = Cover.SubCovers == 1 ? 0 : 1);
            Cover.Reset();
            Cover.Update();
        }
       else if (ret == 22) {
            try {
                FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\cover.' + ext );
              Cover.Reset();
                Cover.Update();
            } catch(e) { }
       }
       else if (ret == 23) {
            try {
                FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\folder.' + ext );
              Cover.Reset();
                Cover.Update();
            } catch(e) { }
       }
       else if (ret == 24) {
            try {
                FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\front.' + ext );
              Cover.Reset();
                Cover.Update();
            } catch(e) { }
       }
        else if (ret == 25) {
            try {
                FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\back.' + ext );
              Cover.Reset();
                Cover.Update();
            } catch(e) { }
       }
        else if (ret == 26) {
            try {
                FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\disc.' + ext );
              Cover.Reset();
                Cover.Update();
            } catch(e) { }
       }
        else if (ret == 27) {
            try {
                FSO.MoveFile( Cover.Covers[ Cover.CurrentCoverNumber ], Cover.Covers[ Cover.CurrentCoverNumber ] = dir + '\\' + album  + '.' + ext );
              Cover.Reset();
                Cover.Update();
            } catch(e) { }
       }
        else if (ret == 28 ) {
          try {
                FSO.DeleteFile( Cover.Covers[ Cover.CurrentCoverNumber ] );
              Cover.Reset();
                Cover.Update();
            } catch(e) { }
       }
       else if (ret == 29 ) {
          Cover.Reset();
            Cover.Update();
       }
       else if (ret == 30 ) {
          WshShell.run( '"' + Cover.MetaPath + '"' );
       }
       else if (ret == 31 ) {
          if ( Cover.Covers[ Cover.CurrentCoverNumber ] ) WshShell.run( '"' + Cover.Covers[ Cover.CurrentCoverNumber ] + '"' );
       }
        else if (ret == 32 ) {
            window.ShowConfigure();
        }
       return true;
    }
    
    function on_playback_dynamic_info_track() {
    
        Cover.Reset();
        Cover.Update();
    
    }
    
    function on_playback_starting() {
        // some
    }
    
    function on_playback_stop( Reason ) {
       Cover.StopTimer();
       if ( Reason == 0 ) on_item_focus_change();
    }
    
    
    function on_item_focus_change() {
       
        if ( !fb.IsPlaying || Cover.CurrentMode == 3) { Cover.Update(); }
    }
    
    function on_playlist_items_added(playlist) { Cover.Update(); }
    
    function on_playlist_items_removed(playlist, new_count) { Cover.Update(); }
    
    function on_playlist_switch() { Cover.Update(); }
    
    function on_playback_new_track( metadb ){
    
        Cover.Update( metadb );
        Cover.StartTimer();
    
    }
    
    function on_mouse_mbtn_up(x,y) {
    
        artist = Cover.FormatMeta('artist', Cover.OutputMetadb() );
        if ( (Cover.CachePath && FSO.FolderExists( Cover.CachePath + '\\' + artist )) || Cover.DisplayMode == 2 ) {
            utils.WriteINI(fb.FoobarPath + 's7e.ini', 'artwork-settings', 'disp_mode', Cover.DisplayMode = Cover.DisplayMode == 1 ? 2 : 1);
            Cover.Reset();
            Cover.Update();
        }
    
    }
    
    function on_notify_data( name, info) {
    
        if ( info == 'refresh' && name == '314FBCC4-9383-48CD-B2DA-45593D3BE1FF' ) {
            Cover.Reset();
            Cover.Update();
        }
        else if ( info == true && name == '314FBCC4-9383-48CD-B2DA-45593D3BE1FF' ) {
            on_mouse_mbtn_up();
        }
        else if ( name == '314FBCC4-9383-48CD-B2DA-45593D3BE1FF' ) {
            Cover.CachePath = info;
            Cover.Reset();
            Cover.Update();
        }
    
    }
    
    function on_key_down(vkey) {
    
        if ( vkey == 0x00000021 || vkey == 0x00000026 ) {
    
            Cover.PrevCover();
    
        }
        else if ( vkey == 0x00000022 || vkey == 0x00000028 ) {
    
            Cover.NextCover();
    
        }
        else if ( vkey == 0x00000023  ) {
    
            if ( Cover.Covers != undefined ) {
    
                Cover.CurrentCoverNumber = Cover.Covers.length - 1;
    
                var tmp = Cover.Covers[ Cover.CurrentCoverNumber ];
                var img;
    
             try       { img = ( typeof tmp == 'object' ) ? tmp.Clone(0,0,tmp.Width,tmp.Height) : gdi.LoadImageAsync( window.ID, Cover.Covers[ Cover.CurrentCoverNumber ] ); }
                catch (e) { img = undefined; }
    
                Cover.ChangeImage( img );
                window.Repaint();
    
            }
    
        }
        else if ( vkey == 0x00000024  ) {
    
            if ( Cover.Covers != undefined ) {
    
                Cover.CurrentCoverNumber = 0;
    
                var tmp = Cover.Covers[ Cover.CurrentCoverNumber ];
                var img;
    
             try       { img = ( typeof tmp == 'object' ) ? tmp.Clone(0,0,tmp.Width,tmp.Height) : gdi.LoadImageAsync( window.ID, Cover.Covers[ Cover.CurrentCoverNumber ] ); }
                catch (e) { img = undefined; }
    
                Cover.ChangeImage( img );
                window.Repaint();
    
            }
    
        }
    
    }
    
    
    
    function on_timer(id) {
       //if ( Cover.CurrentMode == 2 && Cover.CycleTimer.ID == id ) Cover.NextCover();
    }

  6. #16
    Модератор Аватар для MC Web
    Регистрация
    25.04.2012
    Сообщений
    1 642

    Скрипт WSH YouTube Track Manager Rus

    Русифицированный скрипт WSH YouTube Track Manager Rus, воспроизводит треки исполнителя, жанра или исполнителей и похожих исполнителей в режиме радио с YouTube.
    Поиск по альбомам: двойной щелчок - для загрузки и воспроизведения треков.
    Треки надлежащим образом сгруппированы: в соответствии с динамическими именами по параметрам поиска для исполнителя, названия, альбома и дате.

    Подробнее смотрим в файле Readme.txt.

    Дополнительно для работы требуются компоненты foo_playcount и foo_youtube.



    Скачать WSH YouTube Track Manager Rus 1.9 (28.10.2015) с Яндекс.Диск (66 КБ)

  7. #17
    Модератор Аватар для MC Web
    Регистрация
    25.04.2012
    Сообщений
    1 642

    Скрипт WSH Cover Panel Mod Rus

    Панель для отображения обложек альбомов с широким выбором настроек:

    • клавиши управления
    • выбор языка меню при первой загрузке (русский / английский)
    • и др.



    Скачать WSH Cover Panel Mod Rus 1.15 (07.11.2015) с Яндекс.Диск (82 КБ)

  8. #18
    Участник форума
    Регистрация
    22.04.2012
    Сообщений
    19
    Не мешает написать, что надо папку import скопировать в корень фубара....
    Я еще и расширение скрипта поменял на .txt

  9. #19
    Модератор Аватар для MC Web
    Регистрация
    25.04.2012
    Сообщений
    1 642
    suhov, я уж думаю, кто занимается созданием панелей с помощью скриптов WSH в таких пояснениях не нуждаются.
    Хотя, некоторые не знают, что с файлом *.fpl делать.

  10. #20
    Модератор Аватар для MC Web
    Регистрация
    25.04.2012
    Сообщений
    1 642

    Скрипты JS Smooth от Br3tt для JScript Panel



    Примечание: Подробное описание читаем в ссылках данных на оригинальные скрипты.
    Последний раз редактировалось MC Web; 12.11.2015 в 19:43.

Метки этой темы

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •