View difference between Paste ID: qU8chyzn and 7wrCtfgD
SHOW: | | - or go back to the newest paste.
1
// ==PREPROCESSOR==
2
// @name "Youtube Radio"
3
// @author "Mire777"
4
// @feature "v1.4"
5
// @feature "watch-metadb"
6
// ==/PREPROCESSOR==
7
8-
// Paths
8+
//Properties
9-
var fbfolder = (fb.ProfilePath + "Artist_info");
9+
10-
var lfm_folder = fbfolder;
10+
11
START_ARTIST = window.GetProperty("YT  Station", "");
12-
//image download size
12+
13-
size = "high";
13+
14
gnr = window.GetProperty("YT  Tag(27-100)", "27");
15-
//Download server
15+
16
var MF_GRAYED = 0x00000001;
17-
//auto_lfm = window.GetProperty("LFM Radio", "0");
17+
18
var IDC_ARROW = 32512;
19
var IDC_HAND = 32649;
20
21
22-
//Download server
22+
23
	return (0xff000000 | (r << 16) | (g << 8) | (b));
24
}
25
26
function RGBA(r, g, b, a) {
27-
//Search terms(google,yahoo)
27+
28-
terms = "";
28+
29
30-
//Cycle
30+
31-
cycle2 = 15;
31+
32
}
33-
var VERSION = "7.2013-10-19.01";
33+
34-
var DT_LEFT = 0x00000000;
34+
35-
var DT_CENTER = 0x00000001;
35+
36-
var DT_RIGHT = 0x00000002;
36+
37-
var DT_VCENTER = 0x00000004;
37+
38-
var DT_WORDBREAK = 0x00000010;
38+
39-
var DT_CALCRECT = 0x00000400;
39+
40-
var DT_NOPREFIX = 0x00000800;
40+
41-
var DT_END_ELLIPSIS = 0x00008000;
41+
42
function on_playback_new_track() {
43
	p.item_focus_change();
44
    downloadLFM();
45
}
46
47
function on_playback_dynamic_info_track() {
48
	p.item_focus_change();
49-
var ONE_DAY = 86400000;
49+
50-
var ONE_WEEK = 604800000;
50+
51
function on_playback_stop() {
52-
String.prototype.addCommas = function() {
52+
53-
	return this.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
53+
54
55
function on_item_focus_change() {
56
	p.item_focus_change();
57
}
58
59
function on_mouse_leave() {
60-
String.prototype.ucfirst = function() {
60+
61-
	return this.charAt(0).toUpperCase() + this.substr(1);
61+
62
63
function on_mouse_rbtn_up(x, y) {
64
	p.rbtn_up(x, y);
65
	return true;
66
}
67
68
69
70
function panel(name, features) {
71
	this.item_focus_change = function() {
72
		if (!this.metadb_func) return;
73
		switch(this.selection_mode) {
74
			case 0:
75
				this.metadb = fb.GetSelection();
76-
function on_font_changed() {
76+
77-
	p.font_changed();
77+
78
				this.metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
79
				break;
80
			case 2:
81
				this.metadb = fb.GetFocusItem();
82
				break;
83
		}
84
		if (this.metadb) on_metadb_changed();
85
	}
86
87
//Metadb
88
this.metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
89
90-
    //im.download();
90+
91-
    im.downloadLFM();
91+
//Size	
92
	this.size = function() {
93
		this.w = window.Width;
94
		this.h = window.Height;
95
	}
96
97
//Move	
98
	this.move = function(x, y) {
99
		this.mx = x;
100
		this.my = y;
101
	}
102
103
//Menu	
104
	this.rbtn_up = function(x, y) {
105
		var _menu = window.CreatePopupMenu();
106
		var idx;
107-
	if (typeof b == "object") b.leave();
107+
108-
	if (typeof r == "object") r.leave();
108+
109-
	if (typeof li == "object") li.leave();
109+
110-
	if (typeof s == "object") s.leave();
110+
111
			case typeof im == "object":
112
{
113
					
114
if(auto_yt==1) _menu.AppendMenuItem(MF_STRING, 1902, "Youtube Radio");
115
if(auto_yt==0) _menu.AppendMenuItem(MF_STRING, 1903, "Youtube Radio");
116
_menu.CheckMenuItem(1902, auto_yt?1:0);
117
                  
118-
function on_notify_data(name, data) {
118+
119-
	if (name == "lastfm" && data == "update" && typeof l == "object") l.notify_data(name, data);
119+
120-
	if (name == "autoplaylists" && data == "update" && typeof li == "object" && li.mode == "autoplaylists") li.update();
120+
121-
	if (name == "images" && data == "update" && typeof im == "object") im.update();
121+
122-
	if (name == "love" && typeof ps == "object") l.post(fb.TitleFormat("%LASTFM_LOVED_DB%").EvalWithMetadb(data) == 1 ? "track.unlove" : "track.love", data);
122+
123
if (auto_yt=="0") _menu.AppendMenuItem(MF_STRING, 21, "Get Next Video");
124
125
_menu.AppendMenuItem(MF_STRING, 401, "Search Videos");
126
_menu.AppendMenuSeparator();
127
128
_menu.AppendMenuItem(MF_STRING, 1914, "Start Radio Station");
129
p.artist = p.eval("%artist%");
130
if (p.artist == "" || p.artist == "?") {_menu.AppendMenuItem(MF_STRING| MF_GRAYED, 2000, "Same Artist Station");}
131
else
132
{_menu.AppendMenuItem(MF_STRING, 1915, "Same Artist Station");}
133
134
_menu.AppendMenuSeparator();
135
_menu.AppendMenuItem(MF_STRING, 403, "Open Same Video");
136
_menu.AppendMenuItem(MF_STRING, 404, "Find in Browser");
137
					
138
					
139
_menu.AppendMenuSeparator();
140
}				
141
}
142-
this.colors_changed = function() {
142+
143-
		if (this.dui) {
143+
_menu.AppendMenuItem(MF_STRING, 9, "Properties...");
144-
            this.background_mode=(1);
144+
145-
			this.textcolour = window.GetColorDUI(0);
145+
}       
146-
			this.textcolour_hl = window.GetColorDUI(2);
146+
147-
			this.backcolour = window.GetColorDUI(1);
147+
148
		idx = _menu.TrackPopupMenu(x, y);
149-
            this.background_mode=(0);
149+
150-
			this.textcolour = window.GetColorCUI(0);
150+
151-
			this.textcolour_hl = window.GetColorCUI(0);
151+
152-
			this.backcolour = window.GetColorCUI(3);
152+
153
            case 10:
154-
		window.Repaint();
154+
155
				break;
156
            case 21:
157-
	this.font_changed = function() {
157+
				downloadLFM1();
158-
		this.font = this.dui ? window.GetFontDUI(0) : window.GetFontCUI(0);
158+
159
			case 22:
160-
			this.font_name = this.font.Name;
160+
				downloadLFM1();
161
				break;
162-
			this.console("Unable to use your default font. Using Segoe UI instead.");
162+
163-
			this.font_name = "Segoe ui";
163+
164
				break;
165-
		this.title_font = gdi.Font(this.font_name, 16, 1);
165+
            case 403:
166-
		this.normal_font = gdi.Font("segoe ui", 12, 1);
166+
            this.metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
167-
		this.fixed_font = gdi.Font("Lucida Console", this.normal_font_size);
167+
168-
		this.list_font = gdi.Font(this.font_name, this.list_font_size);
168+
            downloadART_TITLE();
169-
		this.row_height = this.normal_font.Height + 2;
169+
170-
		if (typeof t == "object") t.size();
170+
171-
		window.Repaint();
171+
172
            p.browser("http://www.youtube.com/results?search_query=" + encodeURIComponent(p.artist));
173
            break;
174
           case 1902:
175
                auto_yt = 0;
176
                window.SetProperty("YT Radio", "0");
177
                break;
178
       
179
           case 1903:
180
                auto_yt = 1;
181
                window.SetProperty("YT Radio", "1");
182
                break; 
183
        case 1914:
184
            Start = START_ARTIST;
185
            START_ARTIST = this.InputBox("Type Artist to Start Station\n\n( *genre - will play genre station)", this.name, START_ARTIST);
186-
		var _custom_background = window.CreatePopupMenu();
186+
187-
		var _metadb = window.CreatePopupMenu();
187+
188-
		var _cover = window.CreatePopupMenu();
188+
189-
		var _font = window.CreatePopupMenu();
189+
190-
		var _sub1 = window.CreatePopupMenu();
190+
191-
		var _sub2 = window.CreatePopupMenu();
191+
192-
		var _sub3 = window.CreatePopupMenu();
192+
193-
		var _sub4 = window.CreatePopupMenu();
193+
194-
		var _sub5 = window.CreatePopupMenu();
194+
            downloadLFM0();
195
            }
196
            break;
197-
			case typeof a == "object" && a.trace(x, y):
197+
198-
				/*_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
198+
        case 1915:
199-
				_menu.AppendMenuSeparator();
199+
            this.metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
200-
				_menu.AppendMenuItem(MF_STRING, 2, "Front");
200+
201-
				_menu.AppendMenuItem(MF_STRING, 3, "Back");
201+
202-
				_menu.AppendMenuItem(MF_STRING, 4, "Disc");
202+
203-
				_menu.AppendMenuItem(MF_STRING, 5, "Icon");
203+
204-
				_menu.AppendMenuItem(MF_STRING, 6, "Artist");
204+
205-
				_menu.CheckMenuRadioItem(2, 6, a.id + 2);
205+
206-
				_menu.AppendMenuSeparator();*/
206+
207-
				_menu.AppendMenuItem(MF_STRING, 15, "Crop (focus on centre)");
207+
208-
				_menu.AppendMenuItem(MF_STRING, 16, "Crop (focus on top)");
208+
209-
				_menu.AppendMenuItem(MF_STRING, 17, "adjust");
209+
210-
				_menu.AppendMenuItem(MF_STRING, 18, "Stretch");
210+
211-
				_menu.CheckMenuRadioItem(15, 18, a.type == "centre" ? 15 : a.type == "top" ? 16 : a.type == "adjust" ? 17 : 18);
211+
212-
				_menu.AppendMenuSeparator();
212+
213-
				_cover.AppendMenuItem(this.metadb ? MF_STRING : MF_GRAYED, 21, "Google images (launches browser)");
213+
            downloadLFM0();
214-
				_cover.AppendMenuItem(this.metadb ? MF_STRING : MF_GRAYED, 22, "Album Art Downloader");
214+
215-
				_cover.AppendMenuSeparator();
215+
216-
				//_cover.AppendMenuItem(MF_STRING, 23, "Help");
216+
217-
				//_cover.AppendTo(_menu, MF_STRING, "Cover search");
217+
218-
				//_menu.AppendMenuSeparator();
218+
219
		_menu.Dispose();
220-
			case typeof c == "object" && c.trace(x, y):
220+
221-
				if (this.check_feature("now_playing") && !np_cd) break;
221+
222-
				/*_menu.AppendMenuItem(MF_STRING, 1, "Refresh");
222+
223-
				_menu.AppendMenuSeparator();
223+
//Features init
224-
				_menu.AppendMenuItem(MF_STRING, 11, "Gloss effect");
224+
225-
				_menu.CheckMenuItem(11, c.gloss);
225+
226-
				_menu.AppendMenuItem(MF_STRING, 12, "Shadow effect");
226+
227-
				_menu.CheckMenuItem(12, c.shadow);
227+
228-
				_menu.AppendMenuSeparator();
228+
229-
				_cover.AppendMenuItem(this.metadb ? MF_STRING : MF_GRAYED, 21, "Google images (launches browser)");
229+
230-
				_cover.AppendMenuItem(this.metadb ? MF_STRING : MF_GRAYED, 22, "Album Art Downloader");
230+
231-
				_cover.AppendMenuSeparator();
231+
232-
				_cover.AppendMenuItem(MF_STRING, 23, "Help");
232+
233-
				_cover.AppendTo(_menu, MF_STRING, "Cover search");
233+
234-
				_menu.AppendMenuSeparator();*/
234+
235
	}
236-
			case typeof li == "object" && li.trace(x, y):
236+
237-
				switch(li.mode) {
237+
238-
					case "autoplaylists":
238+
239-
						_menu.AppendMenuItem(MF_STRING, 600, "Change title...");
239+
240-
						_menu.AppendMenuSeparator();
240+
241-
						for (i = 1; i < 9; i++) {
241+
242-
							_sub1.AppendMenuItem(MF_STRING, i + 600, i);
242+
243-
						}
243+
244-
						_sub1.AppendTo(_menu, MF_STRING, "Save slot");
244+
245-
						_sub1.CheckMenuRadioItem(601, 608, li.autoplaylists_slot + 600);
245+
246-
						_menu.AppendMenuSeparator();
246+
247-
						_sub2.AppendMenuItem(MF_STRING, 610, "run query");
247+
248-
						_sub2.AppendMenuItem(MF_STRING, 611, "do nothing");
248+
249-
						_sub2.CheckMenuRadioItem(610, 611, li.autoplaylists_success ? 610 : 611);
249+
250-
						_sub2.AppendTo(_menu, MF_STRING, "On successful creation/edit");
250+
251-
						for (i = 0; i < li.autoplaylists_deleted_items.length; i++) {
251+
252-
							var temp = li.autoplaylists_deleted_items[i].split("¬");
252+
253-
							_sub3.AppendMenuItem(MF_STRING, i + 620, temp[0]);
253+
//Console Msg
254-
						}
254+
255-
						if (li.autoplaylists_deleted_items.length > 0) _sub3.AppendTo(_menu, MF_STRING, "Restore");
255+
	this.name = "Youtube Radio"	
256-
						_menu.AppendMenuSeparator();
256+
        fb.trace(this.name + ": " + message);
257-
						_menu.AppendMenuItem(MF_STRING, 650, "Replace exisiting playlists with the same name");
257+
258-
						_menu.CheckMenuItem(650, li.autoplaylists_remove_duplicates);
258+
259-
						_menu.AppendMenuSeparator();
259+
//Input Box
260-
						break;
260+
261-
					case "discogs":
261+
262-
						_menu.AppendMenuItem(MF_STRING, 29, "Show exact artist matches only");
262+
}    
263-
						_menu.CheckMenuItem(29, li.discogs_match);
263+
264-
						_menu.AppendMenuSeparator();
264+
265-
						_menu.AppendMenuItem(MF_STRING, 28, "Show timestamp");
265+
266-
						_menu.CheckMenuItem(28, li.show_timestamp);
266+
		//title = title.replace(/"/g, '" + Chr(34) + "');
267-
						_menu.AppendMenuSeparator();
267+
268-
						break;
268+
269-
					case "echonest":
269+
270-
						for (i = 0; i < li.echonest_modes.length; i++) {
270+
271-
							_menu.AppendMenuItem(MF_STRING, i + 500, li.echonest_modes[i].ucfirst());
271+
272-
						}
272+
273-
						_menu.CheckMenuRadioItem(500, 502, li.echonest_mode + 500);
273+
274-
						_menu.AppendMenuSeparator();
274+
//Msg Box	
275-
						_menu.AppendMenuItem(MF_STRING, 28, "Show timestamp");
275+
276-
						_menu.CheckMenuItem(28, li.show_timestamp);
276+
277-
						_menu.AppendMenuSeparator();
277+
278-
						break;
278+
279-
					case "lastfm":
279+
280-
						for (i = 0; i < li.lastfm_modes.length; i++) {
280+
281-
							_menu.AppendMenuItem(MF_STRING, 801 + i, li.lastfm_modes[i].ucfirst());
281+
//Browser	
282-
						}
282+
283-
						_menu.CheckMenuRadioItem(801, 805, li.lastfm_mode + 801);
283+
284-
						_menu.AppendMenuSeparator();
284+
285-
						if (li.lastfm_mode == 0) {
285+
286-
							if (li.lastfm_button == "spotify") {
286+
//Run Command	
287-
								_menu.AppendMenuItem(MF_STRING, 810, "Pause playback when launching Spotify");
287+
288-
								_menu.CheckMenuItem(810, li.lastfm_pause);
288+
289-
								_menu.AppendMenuSeparator();
289+
290-
							}
290+
291-
							/*_sub1.AppendMenuItem(MF_STRING, 811, "Spotify");
291+
292-
							_sub1.AppendMenuItem(MF_STRING, 812, "Autoplaylist");
292+
293-
							_sub1.CheckMenuRadioItem(811, 812, li.lastfm_button == "spotify" ? 811 : 812);
293+
294-
							_sub1.AppendTo(_menu, MF_STRING, "Buttons");
294+
295-
							_menu.AppendMenuSeparator();*/
295+
296-
						}
296+
297-
						/*_menu.AppendMenuItem(MF_STRING, 28, "Show timestamp");
297+
298-
						_menu.CheckMenuItem(28, li.show_timestamp);
298+
//futures	
299-
						_menu.AppendMenuSeparator();
299+
    this.metadb_func = typeof on_metadb_changed == "function";
300-
						_menu.AppendMenuItem(MF_STRING, 51, "Last.fm auto-correct");
300+
301-
						_menu.CheckMenuItem(51, l.auto_correct);
301+
302-
						_menu.AppendMenuSeparator();*/
302+
303-
						break;
303+
304-
					case "lastfm_charts":
304+
305-
						_menu.AppendMenuItem(l.username.length > 0 ? MF_STRING : MF_GRAYED, 1000, "Refresh");
305+
306-
						_menu.AppendMenuSeparator();
306+
307-
						for (i = 0; i < li.lastfm_charts_modes.length; i++) {
307+
308-
							_menu.AppendMenuItem(MF_STRING, i + 1001, li.lastfm_charts_modes[i].ucfirst());
308+
309-
						}
309+
    this.metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
310-
						_menu.CheckMenuRadioItem(1001, 1003, li.lastfm_charts_mode + 1001);
310+
    if (fb.GetFocusItem())
311-
						_menu.AppendMenuSeparator();
311+
    {this.artist = fb.TitleFormat(this.artist_tf).EvalWithMetadb(this.metadb);}
312-
						for (i = 0; i < li.lastfm_charts_periods_display.length; i++) {
312+
313-
							_menu.AppendMenuItem(MF_STRING, i + 1004, li.lastfm_charts_periods_display[i].ucfirst());
313+
314-
						}
314+
315-
						/*_menu.CheckMenuRadioItem(1004, 1009, li.lastfm_charts_period + 1004);
315+
316-
						_menu.AppendMenuSeparator();
316+
317-
						_menu.AppendMenuItem(MF_STRING, 1010, "Bar colour...");
317+
318-
						_menu.AppendMenuSeparator();
318+
//YT RADIO-------------------------------------------------
319-
						_menu.AppendMenuItem(MF_STRING, 28, "Show timestamp");
319+
320-
						_menu.CheckMenuItem(28, li.show_timestamp);
320+
321-
						_menu.AppendMenuSeparator();*/
321+
322-
						break;
322+
323-
					case "musicbrainz":
323+
324-
						_menu.AppendMenuItem(MF_STRING, 700, "Releases");
324+
325-
						_menu.AppendMenuItem(MF_STRING, 701, "Links");
325+
326-
						_menu.CheckMenuRadioItem(700, 701, li.musicbrainz_mode == "releases" ? 700 : 701);
326+
327-
						_menu.AppendMenuSeparator();
327+
328-
						if (li.musicbrainz_mode == "releases") {
328+
        p.artist = p.eval("%path%");
329-
							/*_menu.AppendMenuItem(MF_STRING, 702, "Include albums");
329+
330-
							_menu.CheckMenuItem(702, li.musicbrainz_album);
330+
331-
							_menu.AppendMenuItem(MF_STRING, 703, "Include EPs");
331+
332-
							_menu.CheckMenuItem(703, li.musicbrainz_ep);
332+
333-
							_menu.AppendMenuItem(MF_STRING, 704, "Include singles");
333+
334-
							_menu.CheckMenuItem(704, li.musicbrainz_single);
334+
335-
							_menu.AppendMenuSeparator();
335+
336-
							_menu.AppendMenuItem(MF_STRING, 705, "Include 'Live' releases");
336+
337-
							_menu.CheckMenuItem(705, li.musicbrainz_live);
337+
338-
							_menu.AppendMenuItem(MF_STRING, 706, "Include 'Remix' releases");
338+
339-
							_menu.CheckMenuItem(706, li.musicbrainz_remix);
339+
340-
							_menu.AppendMenuItem(MF_STRING, 707, "Include 'Compilation' releases");
340+
			if (this.xmlhttp.readyState == 4) {
341-
							_menu.CheckMenuItem(707, li.musicbrainz_compilation);
341+
				if (this.xmlhttp.status == 200) {
342-
							_menu.AppendMenuSeparator();
342+
					var text = this.xmlhttp.responsetext;
343-
							_menu.AppendMenuItem(MF_STRING, 708, "Show release type");
343+
					if (!this.doc) this.doc = new ActiveXObject("htmlfile");
344-
							_menu.CheckMenuItem(708, li.musicbrainz_show_release_type);
344+
					this.doc.open();
345-
							_menu.AppendMenuSeparator();*/
345+
					var div = this.doc.createElement("div");
346-
						}
346+
347-
						/*_menu.AppendMenuItem(MF_STRING, 28, "Show timestamp");
347+
348-
						_menu.CheckMenuItem(28, li.show_timestamp);
348+
349-
						_menu.AppendMenuSeparator();*/
349+
350-
						break;
350+
351-
				}
351+
352
for (i = 0; i < data.length; i++) {
353-
			case typeof ps == "object" && b.buttons.ps.trace(x, y):
353+
354-
				/*_sub1.AppendMenuItem(utils.CheckComponent("foo_customdb", true) && !ps.loved_working && !ps.playcount_working && l.username.length > 0 ? MF_STRING : MF_GRAYED, 1100, "loved tracks and playcount");
354+
355-
				_sub1.AppendMenuItem(utils.CheckComponent("foo_customdb", true) && !ps.loved_working && !ps.playcount_working && l.username.length > 0 ? MF_STRING : MF_GRAYED, 1109, "loved tracks only");
355+
356-
				_sub1.AppendMenuSeparator();
356+
357-
				_sub1.AppendMenuItem(utils.CheckComponent("foo_customdb", true) && this.fso.FileExists(ps.sql_file) ? MF_STRING : MF_GRAYED, 1101, "from file");
357+
358-
				_sub1.AppendMenuSeparator();
358+
359-
				_sub1.AppendMenuItem(MF_STRING, 1102, "Show console");
359+
360-
				_sub1.CheckMenuItem(1102, ps.show_console);
360+
361-
				_sub1.AppendTo(_menu, MF_STRING, "Library import");
361+
362-
				_menu.AppendMenuSeparator();
362+
363-
				_sub2.AppendMenuItem(MF_STRING, 1103, "Only update tracks in library");
363+
364-
				_sub2.CheckMenuItem(1103, ps.library);
364+
365-
				_sub2.AppendMenuItem(MF_STRING, 52, "Last.fm auto-correct");
365+
366-
				_sub2.CheckMenuItem(52, l.auto_correct);
366+
367-
				_sub2.AppendTo(_menu, MF_STRING, "Auto-updates");
367+
368-
				_menu.AppendMenuSeparator();
368+
369-
				_sub3.AppendMenuItem(MF_STRING, 1104, "Off");
369+
370-
				_sub3.AppendMenuItem(MF_STRING, 1105, "On");
370+
371-
				_sub3.CheckMenuRadioItem(1104, 1105, ps.auto_love ? 1105 : 1104);
371+
372-
				_sub3.AppendMenuSeparator();
372+
373-
				_sub3.AppendMenuItem(ps.auto_love ? MF_STRING : MF_GRAYED, 1106, "Condition");
373+
374-
				_sub3.AppendTo(_menu, MF_STRING, "Automatically love tracks");
374+
375-
				_menu.AppendMenuSeparator();
375+
376-
				_sub4.AppendMenuItem(MF_STRING, 1107, "tango");
376+
377-
				_sub4.AppendMenuItem(MF_STRING, 1108, "silk");
377+
378-
				_sub4.CheckMenuRadioItem(1107, 1108, ps.icon == "tango" ? 1107 : 1108);
378+
379-
				_sub4.AppendTo(_menu, MF_STRING, "Icon");
379+
380-
				_menu.AppendMenuSeparator();*/
380+
381
}                 
382-
			case typeof s == "object" && s.mode == "spectrogram" && s.trace(x, y) :
382+
383-
				/*_menu.AppendMenuItem(MF_STRING, 1804, "SoX options...");
383+
384-
				_menu.AppendMenuSeparator();
384+
385-
				_menu.AppendMenuItem(MF_STRING, 1805, "Marker colour...");
385+
                this.doc.close();
386-
				_menu.AppendMenuSeparator();
386+
                this.working=false;
387-
				_menu.AppendMenuItem(MF_STRING, 1803, "Only analyse tracks in library");
387+
                if (START_ARTIST.indexOf("*")== 0) {downloadGENRE2();}
388-
				_menu.CheckMenuItem(1803, s.library);
388+
389-
				_menu.AppendMenuSeparator();
389+
                if (last_fm == "" || last_fm == "?") {downloadLFM();}
390-
				_sub1.AppendMenuItem(MF_STRING, 1800, "Clear all");
390+
391-
				_sub1.AppendMenuItem(MF_STRING, 1801, "Clear older than 1 day");
391+
                downloadTRACK();
392-
				_sub1.AppendMenuItem(MF_STRING, 1802, "Clear older than 1 week");
392+
393-
				_sub1.AppendMenuSeparator();
393+
					if (START_ARTIST.indexOf("*")== 0) {} else {p.console("HTTP error: " + this.xmlhttp.status);}
394-
				_sub1.AppendMenuItem(MF_GRAYED, 1803, "In use: " + (this.fso.GetFolder(spectrogram_cache).size / 1048576).toFixed(2) + "MB");
394+
395-
				_sub1.AppendTo(_menu, MF_STRING, "Cached images");
395+
                    if (START_ARTIST.indexOf("*")== 0) {downloadGENRE2();}
396-
				_menu.AppendMenuSeparator();*/
396+
397
                    if (this.xmlhttp.status == 404) {downloadLFM();}
398-
			case typeof t == "object" && t.trace(x, y):
398+
399-
				if (this.check_feature("now_playing") && !np_bio) break;
399+
400-
				/*_font.AppendMenuItem(MF_STRING, 30, 12);
400+
401-
				_font.AppendMenuItem(MF_STRING, 31, 14);
401+
402-
				_font.AppendMenuItem(MF_STRING, 32, 16);
402+
403-
				_font.AppendTo(_menu, MF_STRING, "Font size");
403+
404-
				_font.CheckMenuRadioItem(30, 33, this.normal_font_size == 12 ? 30 : this.normal_font_size == 14 ? 31 : 32);
404+
405-
				_menu.AppendMenuSeparator();*/
405+
406-
				switch(t.mode) {
406+
407-
					case "lastfm_album":
407+
408-
						/*_menu.AppendMenuItem(MF_STRING, 53, "Last.fm auto-correct");
408+
409-
						_menu.CheckMenuItem(53, l.auto_correct);
409+
410-
						_menu.AppendMenuSeparator();*/
410+
411-
						break;
411+
412-
					case "lastfm_wiki":
412+
413-
						/*_menu.AppendMenuItem(MF_STRING, 25, "Last.fm");
413+
414-
						_menu.AppendMenuItem(MF_STRING, 26, "Wikipedia");
414+
415-
						_menu.CheckMenuRadioItem(25, 26, t.source == "last.fm" ? 25 : 26);
415+
416-
						_menu.AppendMenuSeparator();*/
416+
417-
						break;
417+
418-
					case "simple_tag":
418+
419-
						/*_menu.AppendMenuItem(MF_STRING, 1700, "Custom title...");
419+
420-
						_menu.AppendMenuItem(MF_STRING, 1701, "Custom tag...");
420+
421-
						_menu.AppendMenuSeparator();
421+
422-
						_menu.AppendMenuItem(MF_STRING, 1702, "Centre text");
422+
423-
						_menu.CheckMenuItem(1702, t.centre);
423+
			if (this.xmlhttp.readyState == 4) {
424-
						_menu.AppendMenuSeparator();*/
424+
				if (this.xmlhttp.status == 200) {
425-
						break;
425+
					var text = this.xmlhttp.responsetext;
426-
					case "simple_text":
426+
					if (!this.doc) this.doc = new ActiveXObject("htmlfile");
427-
						/*_menu.AppendMenuItem(MF_STRING, 1700, "Custom title...");
427+
					this.doc.open();
428-
						_menu.AppendMenuItem(MF_STRING, 200, "Custom path...");
428+
					var div = this.doc.createElement("tr");
429-
						_menu.AppendMenuSeparator();
429+
430-
						_menu.AppendMenuItem(MF_STRING, 201, "Fixed width font");
430+
431-
						_menu.CheckMenuItem(201, t.fixed);
431+
432-
						_menu.AppendMenuSeparator();*/
432+
433-
						break;
433+
434-
				}
434+
435
for (i = 0; i < data.length; i++) {
436
    if (data[i].title) urls.push(data[i].title.replace(/about:\//,"").replace(",","").replace("1","").replace("2","").replace("3","").replace("4","").replace("5","").replace("6","").replace("7","").replace("8","").replace("9","").replace("0","").replace("listeners","").replace("listener","").split("(")[0].split("[")[0].split(",")[0].split("{")[0].replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'")); 
437-
			case typeof im == "object" && im.trace(x, y):
437+
438-
				if (im.mode == "last.fm") {
438+
439-
					/*_menu.AppendMenuItem(this.metadb ? MF_STRING : MF_GRAYED, 450, "Download artist art from Last.fm");
439+
440-
					_menu.AppendMenuSeparator();
440+
441-
					_sub1.AppendMenuItem(MF_STRING, 451, "Off");
441+
442-
					_sub1.AppendMenuItem(MF_STRING, 452, "Library tracks only");
442+
443-
					_sub1.AppendMenuItem(MF_STRING, 453, "All tracks");
443+
444-
					_sub1.CheckMenuRadioItem(451, 453, im.auto_download == "off" ? 451 : im.auto_download == "library" ? 452 : 453);
444+
445-
					//_sub1.AppendTo(_menu, MF_STRING, "Automatic download");
445+
446-
					_sub2.AppendMenuItem(MF_STRING, 461, "1");
446+
447-
					_sub2.AppendMenuItem(MF_STRING, 463, "3");
447+
448-
					_sub2.AppendMenuItem(MF_STRING, 465, "5");
448+
449-
					//_sub2.AppendMenuItem(MF_STRING, 470, "10");
449+
450-
					//_sub2.AppendMenuItem(MF_STRING, 480, "20");
450+
//clean track name
451-
					_sub2.CheckMenuRadioItem(461, 480, im.limit + 460);
451+
var urls0 = ((urls[i]).trim().replace("  ","").replace("   ","").replace(" 1 ","").replace(" 2 ","").replace(" 3 ","").replace(" 4 ","").replace(" 5 ","").replace(" 6 ","").replace(" 7 ","").replace(" 8 ","").replace(" 9 ","").replace(" 0 ","").replace("1","").replace("2","").replace("3","").replace("4","").replace("5","").replace("6","").replace("7","").replace("8","").replace("9","").replace("0","").replace(".mp","").replace(" - Remastered ","").replace(" - Remastered","").replace("- "," ").replace(decodeURIComponent(last_fm) + " -"," ").replace(decodeURIComponent(last_fm) + " - ","").replace(" - Live ","").replace(" - Live","").replace(" Pt.1","").replace(" - Demo;2 Digital Remaster 66  ","").replace(" - Demo;2 Digital Remaster","").replace(" - Demo;","").replace(" - Demo","").replace("Digital Remaster","").replace("Original-  ","").replace("Original- ","").replace("Original-","").replace(" - Vocal Version","").replace(" Mega-Mix","").replace("Mega-Mix","").replace(" - Original Mix","").replace(" Pop Radio Edit","").replace(" Radio Edit","").replace(" - Single Version","").replace(" - Edited Version","").replace(" - "," ").replace(" - Extended Version","").replace(" -Remaster","").replace("`","'").replace(". "," ").replace(" Version","").replace(" edit","").replace(" - Edit","").replace("  Simple Mix","").replace("  Almighty Mix","").replace(" - Vocal","").replace(" Vocal","").replace("  Remix","").replace("  Extended Version","").replace(" - Explicit Version","").replace("- Explicit Version","").replace(" Explicit Version","").replace("Explicit Version","").replace(" Anthology", "").replace("The " + decodeURIComponent(last_fm), "").replace(" - Survival Remix","").replace(" Survival Remix","").replace("Survival Remix","").replace(decodeURIComponent(last_fm) + "-"," ").replace(decodeURIComponent(last_fm)," ").replace(" Club Mix","").replace("  wwwi.info","").replace(" Edit","").replace("feat","").replace("ft","").replace("live","").replace("Single","").replace("  Acoustic","").replace("Remix","").replace("Part","").replace("Part&","").replace("  +","").replace(" % ","").replace(' /"/"',"").replace("  remastered","").replace(" // СЛУШАЮТ:","").split(" | '' |")[0].split(" |")[0].split("| On:")[0].trim());
452-
					//_sub2.AppendTo(_menu, MF_STRING, "Limit");*/
452+
p.console("" + last_fm + " - " + urls0);
453
454
ooo2 = window.SetProperty("YT Track", urls0);
455-
					//_menu.AppendMenuItem(MF_STRING, 442, "Set custom folder...");
455+
ooo2 = urls0;
456-
				}
456+
window.SetProperty("YT Track", urls0);
457-
var _settings = window.CreatePopupMenu();
457+
458-
var _auto_cycle = window.CreatePopupMenu();
458+
459-
var _download_source = window.CreatePopupMenu();
459+
460-
var _download_limit = window.CreatePopupMenu();
460+
461-
var _download_quality = window.CreatePopupMenu();
461+
462-
var _thumbs = window.CreatePopupMenu();                
462+
463-
var MF_POPUP = 0x00000010;              
463+
464-
var MF_GRAYED = 0x00000001;                
464+
465-
				//_menu.AppendMenuSeparator();
465+
466-
//_menu.AppendMenuItem(MF_STRING, 403, "Auto YT");
466+
467-
				//_menu.AppendMenuSeparator();
467+
                this.doc.close();
468
                this.working=false;
469
                if (ooo2 == "" || ooo2 == "?") {downloadLFM();}
470-
//Settings Menu
470+
471-
//_menu.AppendMenuItem(MF_STRING | MF_POPUP, _settings.ID, "Auto YT");
471+
                do_youtube_search1(decodeURIComponent(last_fm), decodeURIComponent(ooo2));
472
				} else {
473-
//_menu.AppendMenuSeparator();
473+
					p.console("HTTP error: " + this.xmlhttp.status);
474
                    if (START_ARTIST.indexOf("*")== 0) {downloadGENRE2();}
475-
//_settings.AppendMenuItem(MF_STRING | MF_POPUP, _auto_cycle.ID, "Auto Cycle");
475+
476
                    if (this.xmlhttp.status == 404) {downloadLFM();}
477-
				//_auto_cycle.AppendMenuItem(MF_STRING, 415, "05 sec");
477+
478-
				//_auto_cycle.AppendMenuItem(MF_STRING, 420, "10 sec");
478+
479-
				//_auto_cycle.AppendMenuItem(MF_STRING, 425, "15 sec");
479+
480-
                //_auto_cycle.AppendMenuItem(MF_STRING, 430, "20 sec");
480+
481-
                //_auto_cycle.AppendMenuItem(MF_STRING, 410, "Off");
481+
482-
                //_auto_cycle.CheckMenuRadioItem(410, 430, cycle2 + 410);
482+
483
484
485-
//_settings.AppendMenuItem(MF_STRING | MF_POPUP, _download_source.ID, "Download Source");
485+
//YT RADIO(One)--------------------------------------------
486
487
//open simmilar artist
488-
                  if(auto_yt==1) _menu.AppendMenuItem(MF_STRING, 1902, "Youtube Radio");
488+
489-
                  if(auto_yt==0) _menu.AppendMenuItem(MF_STRING, 1903, "Youtube Radio");
489+
490-
                  _menu.CheckMenuItem(1902, auto_yt?1:0);
490+
491
        {
492-
                  //if(auto_lfm==1) _menu.AppendMenuItem(MF_STRING, 1905, "Last.fm Radio");
492+
493-
                  //if(auto_lfm==0) _menu.AppendMenuItem(MF_STRING, 1906, "Last.fm Radio");
493+
494-
                  //_menu.CheckMenuItem(1905, auto_lfm?1:0);
494+
495
   
496
    
497-
                  _menu.AppendMenuSeparator();
497+
498
      var a=randomnumber;
499
        this.working=true;
500-
//_settings.AppendMenuItem(MF_STRING | MF_POPUP, _download_limit.ID, "Download Limit");
500+
501-
                   
501+
502-
                   //_download_limit.AppendMenuItem(MF_STRING, 1905, "1x");
502+
503-
                   //_download_limit.AppendMenuItem(MF_STRING, 1906, "2x");
503+
504-
                   //_download_limit.AppendMenuItem(MF_STRING, 1907, "3x");
504+
505-
                   //_download_limit.AppendMenuItem(MF_STRING, 1908, "4x");
505+
			if (this.xmlhttp.readyState == 4) {
506-
                   //_download_limit.AppendMenuItem(MF_STRING, 1909, "5x");
506+
				if (this.xmlhttp.status == 200) {
507-
                   //_download_limit.AppendMenuItem(MF_STRING, 1910, "6x");
507+
					var text = this.xmlhttp.responsetext;
508-
                   //_download_limit.CheckMenuRadioItem(1905, 1910, im.limit + 1904);
508+
					if (!this.doc) this.doc = new ActiveXObject("htmlfile");
509
					this.doc.open();
510
					var div = this.doc.createElement("div");
511-
//if (server=="last.fm") _settings.AppendMenuItem(MF_STRING | MF_POPUP, _download_quality.ID, "Download Quality");
511+
512-
                       /*_download_quality.AppendMenuItem(MF_STRING, 1911, "Low");
512+
513-
                       _download_quality.AppendMenuItem(MF_STRING, 1912, "Medium");
513+
514-
                       _download_quality.AppendMenuItem(MF_STRING, 1913, "High");
514+
515-
                       _download_quality.CheckMenuRadioItem(1911, 1913, size == "low" ? 1911 : size == "medium" ? 1912 : size == "high" ? 1913 : 1913);
515+
516
517
for (i = 0; i < data.length; i++) {
518
     if (data[i].href.indexOf("about:/music/") == 0) urls.push(data[i].href.replace(/about:\//,"").replace("music/","").replace("/_/"," - ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("+"," ").replace("free-music-downloads","").replace("/+similar?page=2","").replace("/+events","").replace("/+wiki","").replace("-+","").replace("/+albums","").replace("/+tags","").replace("/+images","").replace("/journal","").replace("/charts","").replace("/images","").replace("/listeners","").replace("/similar?page=17","").replace("/news","").replace("/groups","").replace("/albums","").replace("/videos","").replace("/tracks","").replace("/similar","").replace("/tags","").replace("noredirect/","").replace("listeners/+tracks","").replace("videos/+tracks","").replace("/+videos/","").replace("?page=1","").replace("?page=8","").replace("?page=5","").replace("?page=7","").replace("?page=9","").replace("?page=8","").replace(" wiki/edit","").replace("/ similar","").replace("?page=","'").replace("/ charts","'").replace("-","").replace("%2F%E3%82%A4%E3%83%95%E3%83%BB%E3%83%8E%E3%83%83%E3%83%88%E3%83%BB%E3%83%95%E3%82%A9%E3%83%BE3%83%BB%E3%83%A6%E3%83%BC","").replace("Ajoutez ce titre sur Deezer exclusivement sur www.hotmixradio.fr","").replace("www.Hituri.net","").replace("%E3%81%97%E3%82%83%E3%81%AB%E3%82%80%E3%81%AB%E3%82%B7%E3%82%A7%E3%82%A4%E3%82%AF%EF","").replace("%B81%E3%82%B7%E3%82%A7%E3%82%A4%E3%82%AF%EF%B81","").replace("%E4%BD%95%E3%82%88%E3%82%8A%E3%82%82%E5%83%95%E3%82%89%E3%81%97%E3%81%8F%E3%80%81%E4%BD%95%E3%82%88%E3%82%8A","").replace("%E3%82%82%E5%90%9B%E3%82%89%E3%81%97%E3%81%8F","").replace("%D0%91%D1%8D0%B5%D1%82 %D0%BF%D0%BE %D0%B3%D0%BB%D0%B0%D0%B7%D0%B0%D0%BC","").replace("%E3%83%9E%E3%82%A4%E3%83%BB%E3%83%9E3%83%87%E3%82%A3","").replace("%D0%9B%D0%B5%D1%82%D0%B5%D1%82%D1%8C","").replace("%2F%2F %D0%A1%D0%9B%D0%A3%D0%A8%D0%90%D0%AE%D0%A2","").replace("%D0%9F%D0%BE%D0%BF-%D0%A5%D0%B8%D1%82","").replace("/","").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'"));    
519-
_settings.AppendMenuItem(MF_STRING | MF_POPUP, _thumbs.ID, "Thumbs");
519+
520
521-
                    _thumbs.AppendMenuItem(MF_STRING, 1201, "Left");
521+
522-
					_thumbs.AppendMenuItem(MF_STRING, 1202, "Right");
522+
523-
					_thumbs.AppendMenuItem(MF_STRING, 1203, "Top");
523+
524-
					_thumbs.AppendMenuItem(MF_STRING, 1204, "Bottom");
524+
525-
					_thumbs.AppendMenuItem(MF_STRING, 1205, "Off");
525+
526-
					_thumbs.CheckMenuRadioItem(1200, 1205, th.mode == "grid" ? 1200 : th.mode == "left" ? 1201 : th.mode == "right" ? 1202 : th.mode == "top" ? 1203 : th.mode == "bottom" ? 1204 : 1205);
526+
527
i=randomnumber;
528
529
{
530-
if (th.mode == "left" | th.mode == "right" | th.mode == "top" | th.mode == "bottom")
530+
531
//do something with urls[i]
532-
                  _thumbs.AppendMenuSeparator();
532+
533-
                  _thumbs.AppendMenuItem(MF_STRING, 1240, "40px");
533+
534-
                  _thumbs.AppendMenuItem(MF_STRING, 1250, "50px");
534+
535-
                  _thumbs.AppendMenuItem(MF_STRING, 1260, "60px");
535+
536-
                  _thumbs.AppendMenuItem(MF_STRING, 1270, "70px");
536+
537-
                  _thumbs.AppendMenuItem(MF_STRING, 1280, "80px");
537+
538-
                  _thumbs.AppendMenuItem(MF_STRING, 1290, "90px");
538+
539-
                  _thumbs.AppendMenuItem(MF_STRING, 1300, "100px");
539+
540-
                  _thumbs.AppendMenuItem(MF_STRING, 1350, "150px");
540+
541-
                  _thumbs.AppendMenuItem(MF_STRING, 1400, "200px");
541+
542-
                  _thumbs.AppendMenuItem(MF_STRING, 1450, "250px");
542+
543-
                  _thumbs.AppendMenuItem(MF_STRING, 1500, "300px");
543+
544-
                  _thumbs.CheckMenuRadioItem(1240, 1500, th.px + 1200);
544+
545-
              }*/
545+
546
547-
			/*	_sub3.AppendMenuItem(MF_STRING, 440, "Last.fm artist art");
547+
548-
				_sub3.AppendMenuItem(MF_STRING, 441, "Custom folder");
548+
549-
				_sub3.CheckMenuRadioItem(440, 441, im.mode == "last.fm" ? 440 : 441);
549+
                this.doc.close();
550-
				//_sub3.AppendTo(_menu, MF_STRING, "Image source");
550+
                this.working=false;
551-
               
551+
                if (START_ARTIST.indexOf("*")== 0) {downloadGENRE2();}
552-
				_menu.AppendMenuSeparator();
552+
553-
				/*_sub4.AppendMenuItem(MF_STRING, 410, "Off");
553+
                if (last_fm == "" || last_fm == "?") {downloadLFM1();}
554-
				_sub4.AppendMenuItem(MF_STRING, 415, "5 seconds");
554+
555-
				_sub4.AppendMenuItem(MF_STRING, 420, "10 seconds");
555+
                downloadTRACK1();
556-
				_sub4.AppendMenuItem(MF_STRING, 430, "20 seconds");
556+
557-
				_sub4.CheckMenuRadioItem(410, 430, im.cycle + 410);
557+
					if (START_ARTIST.indexOf("*")== 0) {} else {p.console("HTTP error: " + this.xmlhttp.status);}
558-
				_sub4.CheckMenuRadioItem(410, 430, im.cycle + 410);
558+
                    if (START_ARTIST.indexOf("*")== 0) {downloadGENRE2();}
559-
				_menu.AppendMenuSeparator();*/
559+
560-
				if (typeof th == "object") {
560+
                    if (this.xmlhttp.status == 404) {downloadLFM1();}
561-
					if (!this.check_feature("now_playing")) _sub5.AppendMenuItem(MF_STRING, 1200, "Grid");
561+
562-
					/*_sub5.AppendMenuItem(MF_STRING, 1201, "Left");
562+
563-
					_sub5.AppendMenuItem(MF_STRING, 1202, "Right");
563+
564-
					_sub5.AppendMenuItem(MF_STRING, 1203, "Top");
564+
565-
					_sub5.AppendMenuItem(MF_STRING, 1204, "Bottom");
565+
566-
					_sub5.AppendMenuItem(MF_STRING, 1205, "Off");
566+
567-
					_sub5.CheckMenuRadioItem(1200, 1205, th.mode == "grid" ? 1200 : th.mode == "left" ? 1201 : th.mode == "right" ? 1202 : th.mode == "top" ? 1203 : th.mode == "bottom" ? 1204 : 1205);*/
567+
568-
					if (th.mode != "off") {
568+
569-
						/*_sub5.AppendMenuSeparator();
569+
570-
						_sub5.AppendMenuItem(MF_STRING, 1275, "75px");
570+
571-
						_sub5.AppendMenuItem(MF_STRING, 1300, "100px");
571+
572-
						_sub5.AppendMenuItem(MF_STRING, 1350, "150px");
572+
573-
						_sub5.AppendMenuItem(MF_STRING, 1400, "200px");
573+
574-
						_sub5.AppendMenuItem(MF_STRING, 1450, "250px");
574+
575-
						_sub5.AppendMenuItem(MF_STRING, 1500, "300px");
575+
576-
						_sub5.CheckMenuRadioItem(1275, 1500, th.px + 1200);*/
576+
577-
					}
577+
578-
					//_sub5.AppendTo(_menu, MF_STRING, "Thumbs");
578+
579-
					//_menu.AppendMenuSeparator();
579+
580-
				}
580+
581-
				//if (im.trace(x, y) && im.images.length > 0 && (!this.check_feature("thumbs") || th.mode != "grid")) 
581+
582-
                {
582+
583
		this.xmlhttp.send();
584-
//if (auto_lfm=="1") _menu.AppendMenuItem(MF_STRING, 22, "Get Next Video");
584+
585
			if (this.xmlhttp.readyState == 4) {
586-
//_menu.AppendMenuItem(MF_STRING, 400, "Get All Videos")
586+
				if (this.xmlhttp.status == 200) {
587
					var text = this.xmlhttp.responsetext;
588
					if (!this.doc) this.doc = new ActiveXObject("htmlfile");
589-
//_menu.AppendMenuItem(MF_STRING, 402, "Search For Artist");
589+
					this.doc.open();
590
					var div = this.doc.createElement("tr");
591
					div.innerHTML = text;
592
					var data = div.getElementsByTagName("td");
593
					var urls = [];
594
    
595
			
596
597
for (i = 0; i < data.length; i++) {
598
    if (data[i].title) urls.push(data[i].title.replace(/about:\//,"").replace(",","").replace("1","").replace("2","").replace("3","").replace("4","").replace("5","").replace("6","").replace("7","").replace("8","").replace("9","").replace("0","").replace("listeners","").replace("listener","").split("(")[0].split("[")[0].split(",")[0].split("{")[0].replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'").replace("%27","'")); 
599-
					//_menu.AppendMenuItem(MF_STRING, 402, "Delete image");
599+
600-
					//_menu.AppendMenuSeparator();
600+
601-
					//_menu.AppendMenuItem(MF_STRING, 405, "Top");
601+
602-
                    //_menu.AppendMenuItem(MF_STRING, 404, "Centre");
602+
603-
					//_menu.AppendMenuItem(MF_STRING, 406, "Adjust");
603+
604-
					//_menu.AppendMenuItem(MF_STRING, 407, "Stretch");
604+
605-
					_menu.CheckMenuRadioItem(404, 407, im.type == "centre" ? 404 : im.type == "top" ? 405 : im.type == "adjust" ? 406 : 407);
605+
606-
					_menu.AppendMenuSeparator();
606+
607-
				}
607+
608
if (urls[i] > "") 
609
610-
		if (this.check_feature("now_playing")) {
610+
611-
			/*_menu.AppendMenuItem(MF_STRING, 44, "Top style");
611+
//clean track name
612-
			_menu.AppendMenuItem(MF_STRING, 45, "Bottom style");
612+
var urls0 = ((urls[i]).trim().replace("  ","").replace("   ","").replace(" 1 ","").replace(" 2 ","").replace(" 3 ","").replace(" 4 ","").replace(" 5 ","").replace(" 6 ","").replace(" 7 ","").replace(" 8 ","").replace(" 9 ","").replace(" 0 ","").replace("1","").replace("2","").replace("3","").replace("4","").replace("5","").replace("6","").replace("7","").replace("8","").replace("9","").replace("0","").replace(".mp","").replace(" - Remastered ","").replace(" - Remastered","").replace("- "," ").replace(decodeURIComponent(last_fm) + " -"," ").replace(decodeURIComponent(last_fm) + " - ","").replace(" - Live ","").replace(" - Live","").replace(" Pt.1","").replace(" - Demo;2 Digital Remaster 66  ","").replace(" - Demo;2 Digital Remaster","").replace(" - Demo;","").replace(" - Demo","").replace("Digital Remaster","").replace("Original-  ","").replace("Original- ","").replace("Original-","").replace(" - Vocal Version","").replace(" Mega-Mix","").replace("Mega-Mix","").replace(" - Original Mix","").replace(" Pop Radio Edit","").replace(" Radio Edit","").replace(" - Single Version","").replace(" - Edited Version","").replace(" - "," ").replace(" - Extended Version","").replace(" -Remaster","").replace("`","'").replace(". "," ").replace(" Version","").replace(" edit","").replace(" - Edit","").replace("  Simple Mix","").replace("  Almighty Mix","").replace(" - Vocal","").replace(" Vocal","").replace("  Remix","").replace("  Extended Version","").replace(" - Explicit Version","").replace("- Explicit Version","").replace(" Explicit Version","").replace("Explicit Version","").replace(" Anthology", "").replace("The " + decodeURIComponent(last_fm), "").replace(" - Survival Remix","").replace(" Survival Remix","").replace("Survival Remix","").replace(decodeURIComponent(last_fm) + "-"," ").replace(decodeURIComponent(last_fm)," ").replace(" Club Mix","").replace("  wwwi.info","").replace(" Edit","").replace("feat","").replace("ft","").replace("live","").replace("Single","").replace("  Acoustic","").replace("Remix","").replace("Part","").replace("Part&","").replace("  +","").replace(" % ","").replace(' /"/"',"").replace("  remastered","").replace(" // СЛУШАЮТ:","").split(" | '' |")[0].split(" |")[0].split("| On:")[0].trim());
613-
			_menu.CheckMenuRadioItem(44, 45, np_track_top ? 44 : 45);
613+
p.console("" + last_fm + " - " + urls0);
614-
			_menu.AppendMenuSeparator();
614+
615-
			_menu.AppendMenuItem(MF_STRING, 41, "Show CD cover");
615+
ooo2 = window.SetProperty("YT Track", urls0);
616-
			_menu.CheckMenuItem(41, np_cd);
616+
ooo2 = urls0;
617-
			_menu.AppendMenuItem(MF_STRING, 42, "Show track info");
617+
window.SetProperty("YT Track", urls0);
618-
			_menu.CheckMenuItem(42, np_track);
618+
619-
			_menu.AppendMenuItem(MF_STRING, 46, "Show rating");
619+
620-
			_menu.CheckMenuItem(46, np_rating);
620+
621-
			_menu.AppendMenuItem(MF_STRING, 40, "Show web links");
621+
622-
			_menu.CheckMenuItem(40, np_buttons);
622+
623-
			_menu.AppendMenuItem(MF_STRING, 43, "Show biography");
623+
624-
			_menu.CheckMenuItem(43, np_bio);
624+
625-
			_menu.AppendMenuSeparator();*/
625+
626
}
627-
		if (this.check_feature("custom_background")) {
627+
628-
			if (!this.dui) _custom_background.AppendMenuItem(MF_STRING, 100, "None");
628+
                this.doc.close();
629-
			/*_custom_background.AppendMenuItem(MF_STRING, 101, this.dui ? "Use default UI setting" : "Use columns UI setting");
629+
                this.working=false;
630-
			_custom_background.AppendMenuItem(MF_STRING, 102, "Splitter");
630+
                if (ooo2 == "" || ooo2 == "?") {downloadLFM1();}
631-
			_custom_background.AppendMenuItem(MF_STRING, 104, "Pattern");
631+
632-
			_custom_background.AppendMenuItem(MF_STRING, 103, "Custom");
632+
                do_youtube_search1(decodeURIComponent(last_fm), decodeURIComponent(ooo2));
633-
			_custom_background.AppendMenuSeparator();
633+
634-
			_custom_background.AppendMenuItem(this.background_mode == 3 ? MF_STRING : MF_GRAYED, 105, "Set custom colour...");
634+
					p.console("HTTP error: " + this.xmlhttp.status);
635-
			_custom_background.CheckMenuRadioItem(101, 104, this.background_mode + 100);
635+
                    if (START_ARTIST.indexOf("*")== 0) {downloadGENRE2();}
636-
			_custom_background.AppendTo(_menu, MF_STRING, "Background");
636+
637-
			_menu.AppendMenuSeparator();*/
637+
                    if (this.xmlhttp.status == 404) {downloadLFM1();}
638
                
639-
		if (typeof l == "object") {
639+
640-
			//_menu.AppendMenuItem(MF_STRING, 1900, "Last.fm username...");
640+
641-
			if (typeof ps == "object") _menu.AppendMenuItem(l.username.length > 0 ? MF_STRING : MF_GRAYED, 1901, "Last.fm password...");
641+
642-
			//_menu.AppendMenuSeparator();
642+
643
}}}
644-
		if (this.check_feature("metadb")) {
644+
645-
			/*_metadb.AppendMenuItem(MF_STRING, 900, "Use display preferences");
645+
646-
			_metadb.AppendMenuItem(MF_STRING, 901, "Prefer now playing");
646+
647-
			_metadb.AppendMenuItem(MF_STRING, 902, "Follow selected track");
647+
//CHECK IF ARTIST EXIST------------------------------------
648-
			_metadb.CheckMenuRadioItem(900, 903, this.selection_mode + 900);*/
648+
649-
			//_metadb.AppendTo(_menu, MF_STRING, "Selection mode");
649+
650-
			//_menu.AppendMenuSeparator();
650+
651
    {   
652-
		if (this.check_feature("remap")) {
652+
653-
			//_menu.AppendMenuItem(MF_STRING, 7, "Artist field remapping...");
653+
654-
			//_menu.AppendMenuSeparator();
654+
655
		this.xmlhttp.open("GET", "http://www.last.fm/music/" + encodeURIComponent(START_ARTIST) + "/+similar", true);
656-
		//_menu.AppendMenuItem(MF_STRING, 20, "Update script");
656+
657-
		//_menu.AppendMenuSeparator();
657+
658-
		//if (utils.IsKeyPressed(0x10)) _menu.AppendMenuItem(MF_STRING, 9, "Properties");
658+
			if (this.xmlhttp.readyState == 4) {
659-
        _menu.AppendMenuItem(MF_STRING, 9, "Properties...");
659+
				if (this.xmlhttp.status == 200) {
660
					var text = this.xmlhttp.responsetext;
661
					if (!this.doc) this.doc = new ActiveXObject("htmlfile");
662
					this.doc.open();
663
					var div = this.doc.createElement("div");
664-
				on_item_focus_change();
664+
665
					var data = div.getElementsByTagName("a");
666
					var urls = [];
667-
			case 3:
667+
668-
			case 4:
668+
669-
			case 5:
669+
670-
			case 6:
670+
671-
				a.id = idx - 2;
671+
                this.doc.close();
672-
				window.SetProperty("artreader_id", a.id);
672+
                this.working=false;
673-
				on_item_focus_change();
673+
                downloadLFM000();
674
				
675-
			case 7:
675+
676-
				this.artist_tf = this.InputBox("The default is %artist%\n\nYou can use the full foobar2000 title formatting syntax here.", "Artist field remapping", this.artist_tf);
676+
					if (START_ARTIST.indexOf("*")== 0) {} else {p.console("HTTP error: " + this.xmlhttp.status);}
677-
				if (this.artist_tf == "") this.artist_tf = "%path%";
677+
                    if (START_ARTIST.indexOf("*")== 0) {downloadGENRE2();}
678-
				window.SetProperty("YT Search", this.artist_tf);
678+
679-
				on_item_focus_change();
679+
                    if (this.xmlhttp.status == 404)
680
                    {
681
                    p.MsgBox("This Artist Not Found!", 0, p.name);
682
                    }
683
                    
684-
			case 10:
684+
685
                }
686
			}
687-
			case 11:
687+
688-
				c.gloss = !c.gloss;
688+
689-
				window.SetProperty("cd_gloss", c.gloss);
689+
690-
				window.Repaint();
690+
691
692-
			case 12:
692+
//START ARTIST RADIO(same artist)--------------------------
693-
				c.shadow = !c.shadow;
693+
694-
				window.SetProperty("cd_shadow", c.shadow);
694+
695-
				window.Repaint();
695+
696
     {
697-
			case 15:
697+
698-
			case 16:
698+
699-
			case 17:
699+
700-
			case 18:
700+
701-
				a.type = idx == 15 ? "centre" : idx == 16 ? "top" : idx == 17 ? "adjust" : "stretch";
701+
702-
				window.SetProperty("artreader_image_type", a.type);
702+
703-
				window.RepaintRect(a.x, a.y, a.w, a.h);
703+
704
    { var randomnumber=Math.floor(Math.random()*18)
705-
			case 20:
705+
706-
				this.update_script();
706+
707
        if (START_ARTIST == "" || START_ARTIST == "?") return;
708-
			case 21:
708+
709-
				im.downloadLFM1();
709+
710
		this.xmlhttp.send();
711
		this.xmlhttp.onreadystatechange = function() {
712-
				im.downloadLFM1();
712+
			if (this.xmlhttp.readyState == 4) {
713
				if (this.xmlhttp.status == 200) {
714-
			case 23:
714+
					var text = this.xmlhttp.responsetext;
715-
				fb.ShowPopupMessage("You can get Album Art Downloader here:\n\nhttp://www.hydrogenaudio.org/forums/index.php?showtopic=57392", this.name);
715+
					if (!this.doc) this.doc = new ActiveXObject("htmlfile");
716
					this.doc.open();
717-
			case 25:
717+
					var div = this.doc.createElement("div");
718-
			case 26:
718+
719-
				t.source = idx == 25 ? "last.fm" : "wikipedia";
719+
720-
				window.SetProperty("biography_source", t.source);
720+
721-
				t.artist = "";
721+
722-
				on_item_focus_change();
722+
723
724-
			case 28:
724+
725-
				li.show_timestamp = !li.show_timestamp;
725+
726-
				window.SetProperty("show_timestamp", li.show_timestamp);
726+
727-
				window.RepaintRect(li.x, li.y, li.w, li.h);
727+
728
729-
			case 29:
729+
730-
				li.discogs_match = !li.discogs_match;
730+
731-
				window.SetProperty("discogs_match", li.discogs_match);
731+
732-
				li.artist = "";
732+
733-
				on_item_focus_change();
733+
734
i=randomnumber;
735-
			case 30:
735+
736-
			case 31:
736+
737-
			case 32:
737+
738-
				this.normal_font_size = idx == 30 ? 12 : idx == 31 ? 14 : 16;
738+
739-
				window.SetProperty("normal_font_size", this.normal_font_size);
739+
740-
				this.font_changed();
740+
741
{
742-
			case 40:
742+
743-
				np_buttons = !np_buttons;
743+
744-
				window.SetProperty("np_buttons", np_buttons);
744+
745-
				on_size();
745+
746-
				window.Repaint();
746+
747
else
748-
			case 41:
748+
749-
				np_cd = !np_cd;
749+
750-
				window.SetProperty("np_cd", np_cd);
750+
751-
				window.Repaint();
751+
752
window.SetProperty("YT Similar", "");
753-
			case 42:
753+
754-
				np_track = !np_track;
754+
755-
				window.SetProperty("np_track", np_track);
755+
756-
				on_size();
756+
757-
				window.Repaint();
757+
                this.doc.close();
758
                this.working=false;
759-
			case 43:
759+
                if (START_ARTIST.indexOf("*")== 0) {downloadGENRE2();}
760-
				np_bio = !np_bio;
760+
761-
				window.SetProperty("np_bio", np_bio);
761+
                if (last_fm == "" || last_fm == "?") {downloadLFM000();}
762-
				window.Repaint();
762+
763
                downloadTRACK11();
764-
			case 44:
764+
765-
			case 45:
765+
766-
				np_track_top = idx == 44 ? true : false;
766+
					if (START_ARTIST.indexOf("*")== 0) {} else {p.console("HTTP error: " + this.xmlhttp.status);}
767-
				window.SetProperty("np_track_top", np_track_top);
767+
                    if (START_ARTIST.indexOf("*")== 0) {downloadGENRE2();}
768-
				on_size();
768+
769-
				window.Repaint();
769+
                    if (this.xmlhttp.status == 404) {downloadLFM000();}
770
771-
			case 46:
771+
772-
				np_rating = !np_rating;
772+
773-
				window.SetProperty("np_rating", np_rating);
773+
774-
				on_size();
774+
775-
				window.Repaint();
775+
776
777-
			case 51:
777+
778-
			case 52:
778+
779-
			case 53:
779+
780-
				l.auto_correct = !l.auto_correct;
780+
781-
				window.SetProperty("lastfm_auto_correct", l.auto_correct);
781+
782-
				if (this.metadb) {
782+
783-
					if (idx == 51) li.get();
783+
784-
					if (idx == 53) t.get();
784+
785-
				}
785+
786
    
787-
			case 100:
787+
788-
			case 101:
788+
789-
			case 102:
789+
790-
			case 103:
790+
791-
			case 104:
791+
792-
				this.background_mode = idx - 100;
792+
793-
				window.SetProperty("background_mode", this.background_mode);
793+
794-
				window.Repaint();
794+
795
			if (this.xmlhttp.readyState == 4) {
796-
			case 105:
796+
				if (this.xmlhttp.status == 200) {
797-
				this.background_custom_colour = this.InputBox("Enter a custom colour for the background. Uses RGB. Example usage:\n\n234-211-74", this.name, this.background_custom_colour);
797+
					var text = this.xmlhttp.responsetext;
798-
				window.SetProperty("background_custom_colour", this.background_custom_colour);
798+
					if (!this.doc) this.doc = new ActiveXObject("htmlfile");
799-
				window.Repaint();
799+
					this.doc.open();
800
					var div = this.doc.createElement("tr");
801-
			case 200:
801+
802-
				t.filename_tf = this.InputBox("Use title formatting to specify a path to your text file. eg: $directory_path(%path%)\\info.txt\n\nIf you prefer, you can specify just the path to a folder and the first txt or log file will be used.", this.name, t.filename_tf);
802+
803-
				window.SetProperty("text_filename_tf", t.filename_tf);
803+
804-
				on_item_focus_change();
804+
805
			
806-
			case 201:
806+
807-
				t.fixed = !t.fixed;
807+
808-
				window.SetProperty("text_fixed_font", t.fixed);
808+
809-
				t.calc();
809+
810-
				window.RepaintRect(t.x, t.y, t.w, t.h);
810+
811
//select random URL
812-
			case 400:
812+
813-
				im.downloadALL();
813+
814
815
{
816
817
//do something with urls[i]
818-
			case 402:
818+
819-
				im.downloadART();
819+
820
{
821-
			case 403:
821+
//clean track name
822-
				im.downloadART_TITLE();
822+
var urls0 = ((urls[i]).trim().replace("  ","").replace("   ","").replace(" 1 ","").replace(" 2 ","").replace(" 3 ","").replace(" 4 ","").replace(" 5 ","").replace(" 6 ","").replace(" 7 ","").replace(" 8 ","").replace(" 9 ","").replace(" 0 ","").replace("1","").replace("2","").replace("3","").replace("4","").replace("5","").replace("6","").replace("7","").replace("8","").replace("9","").replace("0","").replace(".mp","").replace(" - Remastered ","").replace(" - Remastered","").replace("- "," ").replace(decodeURIComponent(last_fm) + " -"," ").replace(decodeURIComponent(last_fm) + " - ","").replace(" - Live ","").replace(" - Live","").replace(" Pt.1","").replace(" - Demo;2 Digital Remaster 66  ","").replace(" - Demo;2 Digital Remaster","").replace(" - Demo;","").replace(" - Demo","").replace("Digital Remaster","").replace("Original-  ","").replace("Original- ","").replace("Original-","").replace(" - Vocal Version","").replace(" Mega-Mix","").replace("Mega-Mix","").replace(" - Original Mix","").replace(" Pop Radio Edit","").replace(" Radio Edit","").replace(" - Single Version","").replace(" - Edited Version","").replace(" - "," ").replace(" - Extended Version","").replace(" -Remaster","").replace("`","'").replace(". "," ").replace(" Version","").replace(" edit","").replace(" - Edit","").replace("  Simple Mix","").replace("  Almighty Mix","").replace(" - Vocal","").replace(" Vocal","").replace("  Remix","").replace("  Extended Version","").replace(" - Explicit Version","").replace("- Explicit Version","").replace(" Explicit Version","").replace("Explicit Version","").replace(" Anthology", "").replace("The " + decodeURIComponent(last_fm), "").replace(" - Survival Remix","").replace(" Survival Remix","").replace("Survival Remix","").replace(decodeURIComponent(last_fm) + "-"," ").replace(decodeURIComponent(last_fm)," ").replace(" Club Mix","").replace("  wwwi.info","").replace(" Edit","").replace("feat","").replace("ft","").replace("live","").replace("Single","").replace("  Acoustic","").replace("Remix","").replace("Part","").replace("Part&","").replace("  +","").replace(" % ","").replace(' /"/"',"").replace("  remastered","").replace(" // СЛУШАЮТ:","").split(" | '' |")[0].split(" |")[0].split("| On:")[0].trim());
823
p.console("" + last_fm + " - " + urls0);
824
825
ooo2 = window.SetProperty("YT Track", urls0);
826
ooo2 = urls0;
827
window.SetProperty("YT Track", urls0);
828-
			case 405:
828+
829-
			case 406:
829+
830-
			case 407:
830+
831-
				im.type = idx == 404 ? "centre" : idx == 405 ? "top" : idx == 406 ? "adjust" : "stretch";
831+
832-
				//window.SetProperty("Image type", im.type);
832+
833-
				window.Repaint();
833+
834
window.SetProperty("YT Track", "");
835-
			case 410:
835+
836-
			case 415:
836+
837-
			case 420:
837+
838-
			case 425:
838+
                this.doc.close();
839-
            case 430:
839+
                this.working=false;
840-
				cycle2 = idx - 410;
840+
                if (ooo2 == "" || ooo2 == "?") {downloadLFM000();}
841-
				window.SetProperty("Image cycle", cycle2);
841+
842-
                cicleTimer = undefined;
842+
                do_youtube_search1(decodeURIComponent(last_fm), decodeURIComponent(ooo2));
843-
                cicleTimerStarted = false;
843+
844-
                stopTimer();
844+
					p.console("HTTP error: " + this.xmlhttp.status);
845-
                startTimer();
845+
                    if (START_ARTIST.indexOf("*")== 0) {downloadGENRE2();}
846-
                cicleTimerStarted = true;
846+
847
                    if (this.xmlhttp.status == 404) {downloadLFM000();}
848-
			case 440:
848+
849-
			case 441:
849+
850-
				im.mode = idx == 440 ? "last.fm" : "custom";
850+
851-
				window.SetProperty("image_mode", im.mode);
851+
852-
				im.artist = "";
852+
853-
				im.folder = "";
853+
854-
				on_item_focus_change();
854+
855
856-
			case 442:
856+
857-
				im.custom_folder_tf = this.InputBox("Enter title formatting or an absolute path to a folder. You can specify multiple folders using | as a separator.", this.name, im.custom_folder_tf);
857+
//DOWNLOAD YOUTUBE VIDEO-----------------------------------
858-
				if (im.custom_folder_tf == "") im.custom_folder_tf = "$directory_path(%path%)";
858+
strip_title = function (t1, t2)
859-
				window.SetProperty("image_custom_folder_tf", im.custom_folder_tf);
859+
860-
				im.folder = "";
860+
    try
861-
				on_item_focus_change();
861+
862
        var a = "(by |the |\\(|\\[|)";
863-
			case 450:
863+
        var b = "(\\) |\\] | - |-| \/\/ |, | |)";
864-
				im.download();
864+
        return t1.replace(RegExp((a + t2 + b), "gi"), "");
865
    }
866-
			case 451:
866+
    catch (e)
867-
			case 452:
867+
    {}
868-
			case 453:
868+
869-
				im.auto_download = idx == 451 ? "on" : idx == 452 ? "library" : "off";
869+
870-
				window.SetProperty("image_auto_download", im.auto_download);
870+
871
872-
			case 461:
872+
convert = function(min)
873-
			case 463:
873+
874-
			case 465:
874+
    var parts = min.split(':'),
875-
				im.limit = idx - 460;
875+
    minutes = +parts[0],
876-
				window.SetProperty("image_limit", 50);
876+
    seconds = +parts[1];
877
    return minutes * 60 + seconds;
878-
			case 490:
878+
879-
			case 491:
879+
880-
			case 492:
880+
881-
			case 493:
881+
882-
				im.type = idx == 490 ? "centre" : idx == 491 ? "top" : idx == 492 ? "adjust" : "stretch";
882+
strip = function (t)
883-
				window.SetProperty("image_type", im.type);
883+
884-
				window.RepaintRect(im.x, im.y, im.w, im.h);
884+
    try
885
    {
886-
			case 500:
886+
        t = t.replace(/\//g, "\\/"); t = t.replace(/\?/g, "\\?"); t = t.replace(/\+/g, "\\+"); t = t.replace(/\-/g, "\\-"); t = t.replace(/\*/g, "\\*");
887-
			case 501:
887+
        t = t.replace(/\^/g, "\\^"); t = t.replace(/\[/g, "\\["); t = t.replace(/\]/g, "\\]"); t = t.replace(/\(/g, "\\("); t = t.replace(/\)/g, "\\)"); t = t.replace(/\{/g, "\\{");
888-
			case 502:
888+
        t = t.replace(/\}/g, "\\}"); t = t.replace(/\&/g, "\\&"); t = t.replace(/\|/g, "\\|"); t = t.replace(/\!/g, "\\!"); t = t.replace(/\:/g, "\\:"); return t;
889-
				li.echonest_mode = idx - 500;
889+
    } catch (e) {}
890-
				window.SetProperty("echonest_mode", li.echonest_mode);
890+
891-
				li.artist = "";
891+
892-
				on_item_focus_change();
892+
clean = function (t)
893
{
894-
			case 600:
894+
    try
895-
				li.autoplaylists_title = this.InputBox("Enter a new title", this.name, li.autoplaylists_title);
895+
896-
				if (li.autoplaylists_title == "") li.autoplaylists_title = "Autoplaylists";
896+
        return t.replace(/'/g, "’").toLowerCase();
897-
				window.SetProperty("autoplaylists_title", li.autoplaylists_title);
897+
    } catch (e) {}
898-
				window.Repaint();
898+
899
900-
			case 601:
900+
901-
			case 602:
901+
902-
			case 603:
902+
903-
			case 604:
903+
youtube_search = function (state_change_callback, p_on_search_finished_callback)
904-
			case 605:
904+
905-
			case 606:
905+
    this.xmlhttp = null;
906-
			case 607:
906+
    this.http_callback_funct = null;
907-
			case 608:
907+
    this.ready_state_change_callback = state_change_callback;
908-
				li.autoplaylists_slot = idx - 600;
908+
    this.search_done = false;
909-
				window.SetProperty("autoplaylists_slot", li.autoplaylists_slot);
909+
    this.on_search_finished_callback = p_on_search_finished_callback;
910-
				li.filename = this.settings_folder + "autoplaylists" + li.autoplaylists_slot;
910+
    this.yt_link;
911-
				li.offset = 0;
911+
    this.search_artist;
912-
				li.update();
912+
    this.search_title;
913
    this.metadata;
914-
			case 610:
914+
915-
			case 611:
915+
    this.on_state_change = function ()
916-
				li.autoplaylists_success = idx == 610 ? true : false;
916+
917-
				window.SetProperty("autoplaylists_success", li.autoplaylists_success);
917+
        if (this.xmlhttp != null && this.xmlhttp.readyState == 4 && this.xmlhttp.status == 200 && this.http_callback_funct != null)
918
            this.http_callback_funct();
919-
			case 620:
919+
    }
920-
			case 621:
920+
921-
			case 622:
921+
    this.StartSearch = function (p_artist, p_title, p_extra_metadata)
922-
			case 623:
922+
923-
			case 624:
923+
        this.search_artist = p_artist;
924-
			case 625:
924+
        this.search_title = p_title;
925-
			case 626:
925+
        this.metadata = p_extra_metadata;
926-
			case 627:
926+
        this.http_callback_funct = null;
927-
				li.data.push(li.autoplaylists_deleted_items[idx - 620]);
927+
        this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
928-
				if (li.data.length > li.rows) li.offset = li.data.length - li.rows;
928+
929-
				li.autoplaylists_deleted_items.splice(idx - 620, 1);
929+
        var URL = "http://www.youtube.com/results?search_query=" + encodeURIComponent(p_artist + " " + p_title);
930-
				this.save(li.data.join("\n"), li.filename);
930+
931-
				window.NotifyOthers("autoplaylists", "update");
931+
        this.http_callback_funct = this.AnalyseSearch;
932-
				li.update();
932+
        this.xmlhttp.open("GET", URL);
933
        this.xmlhttp.onreadystatechange = this.ready_state_change_callback;
934-
			case 650:
934+
        this.xmlhttp.send();
935-
				li.autoplaylists_remove_duplicates = !li.autoplaylists_remove_duplicates
935+
    }
936-
				window.SetProperty("autoplaylists_remove_duplicates", li.autoplaylists_remove_duplicates);
936+
937
    this.AnalyseSearch = function ()
938-
			case 700:
938+
939-
			case 701:
939+
        var text = this.xmlhttp.responsetext;
940-
				li.musicbrainz_mode = idx == 700 ? "releases" : "URLs";
940+
        var doc = new ActiveXObject("htmlfile");
941-
				window.SetProperty("musicbrainz_mode", li.musicbrainz_mode);
941+
        doc.open();
942-
				li.artist = "";
942+
        var div = doc.createElement("div");
943-
				on_item_focus_change();
943+
        div.innerHTML = text;
944
        var data = div.getElementsByTagName("a");
945-
			case 702:
945+
        var url = "";
946-
				li.musicbrainz_album = !li.musicbrainz_album;
946+
        var first_match;
947-
				window.SetProperty("musicbrainz_album", li.musicbrainz_album);
947+
948-
				li.artist = "";
948+
        re_test:
949-
				on_item_focus_change();
949+
950
        for (var i = 0; i < data.length; i++)
951-
			case 703:
951+
952-
				li.musicbrainz_ep = !li.musicbrainz_ep;
952+
            if (data[i].href.indexOf("about:/watch?v=") == 0)
953-
				window.SetProperty("musicbrainz_ep", li.musicbrainz_ep);
953+
954-
				li.artist = "";
954+
                i++; //the title is on the second link
955-
				on_item_focus_change();
955+
956
//check if track exist?                
957-
			case 704:
957+
//if((data[i].title.toLowerCase()).indexOf(decodeURIComponent(last_fm.toLowerCase()).split(" ")[0]) > 0)
958-
				li.musicbrainz_single = !li.musicbrainz_single;
958+
//if((data[i].title.toLowerCase()).indexOf(decodeURIComponent(ooo2.toLowerCase()).split(" ")[0]) > 0)
959-
				window.SetProperty("musicbrainz_single", li.musicbrainz_single);
959+
//if((data[i].title.toLowerCase()).indexOf(decodeURIComponent(ooo2.toLowerCase()).split(" ")[1]) > 0)
960-
				li.artist = "";
960+
//if((data[i].title.toLowerCase()).indexOf(decodeURIComponent(ooo2.toLowerCase()).split(" ")[2]) > 0)
961-
				on_item_focus_change();
961+
962
                var radio_on = (auto_yt ? 1:0);
963-
			case 705:
963+
                var s = text.indexOf( data[i].href.replace("about:/watch?", "") );
964-
				li.musicbrainz_live = !li.musicbrainz_live;
964+
                var str = "<span class=\"video-time\">";
965-
				window.SetProperty("musicbrainz_live", li.musicbrainz_live);
965+
                s = text.indexOf(str, s) + str.length;
966-
				li.artist = "";
966+
                var e = text.indexOf("</span>", s);
967-
				on_item_focus_change();
967+
                var length = text.substr(s, e - s);
968
                length = convert(length);
969-
			case 706:
969+
                length = length ? length : "";
970-
				li.musicbrainz_remix = !li.musicbrainz_remix;
970+
                if (!first_match)
971-
				window.SetProperty("musicbrainz_remix", li.musicbrainz_remix);
971+
{                   
972-
				li.artist = "";
972+
                    // title stripped of artist name if same as search_artist
973-
				on_item_focus_change();
973+
                    var stripped_title = strip_title(data[i].title, this.search_artist); 
974
                    first_match = "3dydfy://www.youtube.com/watch?" + (this.metadata ? this.metadata + "&" : "") + "fb2k_title=" + encodeURIComponent(stripped_title + (!radio_on ? " [" + this.search_title + "]" : "")) + "&3dydfy_alt_length=" + encodeURIComponent(length) + "&fb2k_artist=" + encodeURIComponent(this.search_artist) + "&" + data[i].href.replace("about:/watch?", "");
975-
			case 707:
975+
976-
				li.musicbrainz_compilation = !li.musicbrainz_compilation;
976+
                //3dydfy
977-
				window.SetProperty("musicbrainz_compilation", li.musicbrainz_compilation);
977+
                if (!this.IsGoodMatch(data[i].title))
978-
				li.artist = "";
978+
                    continue;
979-
				on_item_focus_change();
979+
980
                url = "3dydfy://www.youtube.com/watch?" + (this.metadata ? this.metadata + "&" : "") + "fb2k_title=" + encodeURIComponent(this.search_title) + "&3dydfy_alt_length=" + encodeURIComponent(length) + "&fb2k_artist=" + encodeURIComponent(this.search_artist) + "&" + data[i].href.replace("about:/watch?", "");
981-
			case 708:
981+
982-
				li.musicbrainz_show_release_type = !li.musicbrainz_show_release_type;
982+
983-
				window.SetProperty("musicbrainz_show_release_type", li.musicbrainz_show_release_type);
983+
984-
				window.RepaintRect(li.x, li.y, li.w, li.h);
984+
985
986-
			case 801:
986+
987-
			case 802:
987+
        if (!url.length)
988-
			case 803:
988+
            url = first_match;
989-
			case 804:
989+
990-
			case 805:
990+
        this.yt_link = url;
991-
				li.lastfm_mode = idx - 801;
991+
992-
				window.SetProperty("lastfm_mode", li.lastfm_mode);
992+
        doc.close();
993-
				li.artist = "";
993+
994-
				on_item_focus_change();
994+
        this.on_search_finished_callback(url, this.search_artist, this.search_title);
995
    }
996-
			case 810:
996+
997-
				li.lastfm_pause = !li.lastfm_pause;
997+
998-
				window.SetProperty("lastfm_pause", li.lastfm_pause);
998+
    this.IsGoodMatch = function (video_name)
999
    {
1000-
			case 811:
1000+
        var clean_vid_name = clean(strip(video_name));
1001-
			case 812:
1001+
        var clean_artist = clean(strip(this.search_artist));
1002-
				li.lastfm_button = idx == 811 ? "spotify" : "auto";
1002+
        var clean_title = clean(strip(this.search_title));
1003-
				window.SetProperty("lastfm_button", li.lastfm_button);
1003+
1004-
				window.RepaintRect(li.x, li.y, li.w, li.h);
1004+
        if (clean_vid_name.indexOf(clean_artist) != -1 && clean_vid_name.indexOf(clean_title) != -1 && clean_vid_name.indexOf("full album") == -1)
1005
        {
1006-
			case 900:
1006+
            //p.console("GOOD MATCH");
1007-
			case 901:
1007+
            return true;
1008-
			case 902:
1008+
1009-
				this.selection_mode = idx - 900;
1009+
        else
1010-
				window.SetProperty("selection_mode", this.selection_mode);
1010+
1011-
				on_item_focus_change();
1011+
            //p.console("BAD MATCH");
1012
            return false;
1013-
			case 1000:
1013+
1014-
				li.get();
1014+
    }
1015
1016-
			case 1001:
1016+
1017-
			case 1002:
1017+
1018-
			case 1003:
1018+
//Call Search
1019-
				li.lastfm_charts_mode = idx - 1001;
1019+
do_youtube_search1 = function (p_artist, p_title)
1020-
				window.SetProperty("lastfm_charts_mode", li.lastfm_charts_mode);
1020+
1021-
				li.update();
1021+
        var yt_search1 = new youtube_search(function ()
1022
        {
1023-
			case 1004:
1023+
            yt_search1.on_state_change();
1024-
			case 1005:
1024+
        }, on_youtube_search1_done);
1025-
			case 1006:
1025+
        yt_search1.StartSearch(p_artist, p_title);
1026-
			case 1007:
1026+
    }
1027-
			case 1008:
1027+
1028-
			case 1009:
1028+
    on_youtube_search1_done = function (link, p_artist, p_title)
1029-
				li.lastfm_charts_period = idx - 1004;
1029+
1030-
				window.SetProperty("lastfm_charts_period", li.lastfm_charts_period);
1030+
var url2="";
1031-
				li.update();
1031+
url2 = link;
1032
if (!url2)
1033-
			case 1010:
1033+
{p.console("Track Or Artist - Not Exist!"); downloadLFM1();} 
1034-
				li.lastfm_charts_bar_colour = this.InputBox("Enter a custom colour for the bars. Uses RGB. Example usage:\n\n234-211-74", this.name, li.lastfm_charts_bar_colour);
1034+
1035-
				window.SetProperty("lastfm_charts_bar_colour", li.lastfm_charts_bar_colour);
1035+
        if (link && link.length)
1036-
				window.Repaint();
1036+
1037
            
1038-
			case 1100:
1038+
p.console("" + "\"" + link + "\"");
1039-
			case 1109:
1039+
YT_URL = window.SetProperty("YT URL", link);
1040-
				ps.full_import = idx == 1100 ? true : false;
1040+
1041-
				ps.start_import();
1041+
1042
var go = str + link;
1043-
			case 1101:
1043+
1044-
				ps.finish_import();
1044+
1045
        if (link == "" || link == "?") {downloadLFM1();}
1046-
			case 1102:
1046+
    }
1047-
				ps.show_console = !ps.show_console;
1047+
//END------------------------------------------------------
1048-
				window.SetProperty("playcount_sync_show_console", ps.show_console);
1048+
1049
1050-
			case 1103:
1050+
1051-
				ps.library = !ps.library;
1051+
1052-
				window.SetProperty("playcount_sync_library", ps.library);
1052+
1053
1054-
			case 1104:
1054+
//Download Same Video--------------------------------------
1055-
			case 1105:
1055+
1056-
				ps.auto_love = idx == 1104 ? false : true;
1056+
1057-
				window.SetProperty("playcount_sync_auto_love", ps.auto_love);
1057+
       var artist0 = p.eval("%artist%");
1058
       var title0 = p.eval("%title%");
1059-
			case 1106:
1059+
       do_youtube_search1(decodeURIComponent(artist0), decodeURIComponent(title0));
1060-
				ps.auto_love_tf = this.InputBox("The result of the title formatting set here must equal 1 for a track to be automatically loved.\n\nExample:\n\n$ifequal(%rating%,5,1,0)", this.name, ps.auto_love_tf);
1060+
1061-
				window.SetProperty("playcount_sync_auto_love_tf", ps.auto_love_tf);
1061+
1062
1063-
			case 1107:
1063+
1064-
			case 1108:
1064+
//GENRE----------------------------------------------------
1065-
				ps.icon = idx == 1107 ? "tango" : "silk";
1065+
1066-
				window.SetProperty("playcount_sync_icon", ps.icon);
1066+
1067-
				b.update();
1067+
1068
     {
1069-
			case 1200:
1069+
1070-
			case 1201:
1070+
1071-
			case 1202:
1071+
1072-
			case 1203:
1072+
1073-
			case 1204:
1073+
1074-
			case 1205:
1074+
1075-
				th.mode = idx == 1200 ? "grid" : idx == 1201 ? "left" : idx == 1202 ? "right" : idx == 1203 ? "top" : idx == 1204 ? "bottom" : "off";
1075+
1076-
				//window.SetProperty("Thumbs mode", th.mode);
1076+
1077-
				th.nc = true;
1077+
1078-
				on_size();
1078+
1079-
				window.Repaint();
1079+
1080
		if (!this.xmlhttp) this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
1081-
			case 1240:
1081+
1082-
			case 1250:
1082+
1083-
			case 1260:
1083+
1084-
			case 1270:
1084+
			if (this.xmlhttp.readyState == 4) {
1085-
			case 1280:
1085+
				if (this.xmlhttp.status == 200) {
1086-
			case 1290:
1086+
					var text = this.xmlhttp.responsetext;
1087-
            case 1300:
1087+
					if (!this.doc) this.doc = new ActiveXObject("htmlfile");
1088-
			case 1350:
1088+
					this.doc.open();
1089-
			case 1400:
1089+
					var div = this.doc.createElement("li");
1090-
			case 1450:
1090+
1091-
			case 1500:
1091+
1092-
				th.px = idx - 1200;
1092+
1093
    
1094-
				th.nc = true;
1094+
1095-
				on_size();
1095+
1096-
				window.Repaint();
1096+
1097
    if (data[i].className.indexOf("name") == 0)
1098-
			case 1700:
1098+
1099-
				t.title = this.InputBox("You can use full title formatting here.", this.name, t.title);
1099+
1100-
				window.SetProperty("text_title", t.title);
1100+
1101-
				window.Repaint();
1101+
1102
var randomnumber = Math.floor(Math.random()*(0-9)+9);
1103-
			case 1701:
1103+
1104-
				t.tag = this.InputBox("Enter a custom tag.", this.name, t.tag);
1104+
1105-
				window.SetProperty("text_tag", t.tag);
1105+
1106-
				t.filename = "";
1106+
1107-
				on_item_focus_change();
1107+
1108
1109-
			case 1702:
1109+
1110-
				t.centre = !t.centre;
1110+
1111-
				window.SetProperty("text_centre", t.centre);
1111+
1112-
				window.RepaintRect(t.x, t.y, t.w, t.h);
1112+
1113
{
1114-
			case 1800:
1114+
1115-
			case 1801:
1115+
1116-
			case 1802:
1116+
1117-
				var period = idx == 1800 ? 0 : idx == 1801 ? ONE_DAY : ONE_WEEK;
1117+
1118-
				s.clear_images(period);
1118+
1119
else
1120-
			case 1803:
1120+
1121-
				s.library = !s.library;
1121+
1122-
				window.SetProperty("seekbar_library", s.library);
1122+
1123
window.SetProperty("YT Similar", "");
1124-
			case 1804:
1124+
1125-
				s.sox_params = this.InputBox("All SoX spectrogram options should work here.\n\n-r, -d and -o are already configured so do not use those. Check sox.pdf for everything else.", this.name, s.sox_params);
1125+
1126-
				window.SetProperty("sox_params", s.sox_params);
1126+
1127-
				if (fb.IsPlaying) s.playback_new_track();
1127+
1128
                this.doc.close();
1129-
			case 1805:
1129+
                this.working=false;
1130-
				s.marker = this.InputBox("Enter a custom colour for the marker. Uses RGB. Example usage:\n\n234-211-74", this.name, s.marker);
1130+
                if (last_fm == "" || last_fm == "?") {downloadGENRE2();}
1131-
				window.SetProperty("seekbar_marker", s.marker);
1131+
1132
                downloadTRACK1();
1133-
			case 1900:
1133+
1134-
				l.update_username();
1134+
					p.console("HTTP error: " + this.xmlhttp.status);
1135
				    if (this.xmlhttp.status == 404)
1136-
			case 1901:
1136+
                    {downloadGENRE2();}
1137-
				l.update_password();
1137+
1138
			}
1139
		}
1140
	}
1141
}}                             
1142
1143
}
1144
1145
1146
this.artist = "";
1147
function pan1() { }
1148
function pan2(x, y, w, h) { }
1149
1150
1151
//Begin----------------------------------------------------
1152-
            case 1904:
1152+
var p = new panel("Youtube Radio", ["remap", "metadb"]);
1153-
            if (server=="on")server = window.SetProperty("YT Radio", "off");
1153+
var im = new pan2(0, 0, 0, 0);
1154-
            if (server=="off")server = window.SetProperty("YT Radio", "on");
1154+
var th = new pan1();
1155
1156
on_item_focus_change();
1157-
            case 1905: 
1157+
1158-
            auto_lfm = 0;
1158+
1159-
            window.SetProperty("LFM Radio", "0");
1159+
1160
function on_metadb_changed() {
1161
}
1162-
            case 1906:  
1162+
1163-
             auto_lfm = 1;
1163+
//Button---------------------------------------------------
1164-
             window.SetProperty("LFM Radio", "1");
1164+
1165-
             break;
1165+
1166
1167-
            case 1907: 
1167+
1168-
            case 1908:    
1168+
1169-
            case 1909:    
1169+
1170-
            case 1910: 
1170+
1171-
            im.limit = idx - 1904;
1171+
1172-
            //window.SetProperty("Download limit", im.limit);
1172+
1173
ButtonStates = {
1174
	normal: 0,
1175-
            case 1911:    
1175+
1176-
            case 1912:    
1176+
1177-
            case 1913: 
1177+
1178-
            size = idx == 1911 ? "low" : idx == 1912 ? "medium" : idx == 1913 ? "high" : "high";
1178+
1179-
		    window.SetProperty("Download quality", size);
1179+
1180
	this.left = x;
1181
	this.top = y;
1182-
            case 1914:
1182+
1183
	this.h = h;
1184
	this.right = x + w;
1185
	this.bottom = y + h;
1186
	this.func = func;
1187
	this.tiptext = tiptext;
1188
	this.state = ButtonStates.normal;
1189
	this.img_normal = img_src && img_src.normal ? gdi.Image(img_src.normal) : null;
1190
	this.img_hover = img_src && img_src.hover ? gdi.Image(img_src.hover) : this.img_normal;
1191
	this.img_down = img_src && img_src.down ? gdi.Image(img_src.down) : this.img_hover;
1192
	this.img = this.img_normal;
1193-
            im.downloadLFM0();
1193+
1194
	this.alterImage = function(img_src) {
1195
		this.img_normal = img_src && img_src.normal ? gdi.Image(img_src.normal) : null;
1196
		this.img_hover = img_src && img_src.hover ? gdi.Image(img_src.hover) : this.img_normal;
1197-
            case 1915:
1197+
1198
		
1199
		this.changeState(this.state);
1200
	}
1201
	
1202
	this.traceMouse = function (x, y) {
1203
		var b = (this.left < x) && (x < this.right) && (this.top < y) && (y < this.bottom);
1204
		if (b)
1205
			g_down ? this.changeState(ButtonStates.down) : this.changeState(ButtonStates.hover);
1206
		else
1207
			this.changeState(ButtonStates.normal);
1208
		return b;
1209
	}
1210
	
1211-
            im.downloadLFM0();
1211+
1212
	this.changeState = function (newstate) {
1213
		if (newstate != this.state)
1214
			window.RepaintRect(this.left, this.top, this.w, this.h);
1215
		this.state = newstate;
1216
		switch (this.state)
1217
		{
1218-
		_custom_background.Dispose();
1218+
1219-
		_metadb.Dispose();
1219+
1220-
		_cover.Dispose();
1220+
1221-
		_font.Dispose();
1221+
1222-
		_sub1.Dispose();
1222+
1223-
		_sub2.Dispose();
1223+
1224-
		_sub3.Dispose();
1224+
1225-
		_sub4.Dispose();
1225+
1226-
		_sub5.Dispose();
1226+
1227
			this.img = this.img_down;
1228
			break;
1229
			
1230
		default:
1231
			this.img = null;
1232-
				case "custom_background":
1232+
1233-
					//this.background_mode = (0);
1233+
1234-
                    //window.GetProperty("background_mode", 0);
1234+
1235-
					//this.background_custom_colour = ("0-0-0");
1235+
1236-
                    //window.GetProperty("background_custom_colour", "0-0-0");
1236+
1237
	}
1238
	
1239
	this.onClick = function () {
1240
		this.func && this.func(x,y);
1241-
				case "themes":
1241+
1242-
					this.themed_seekbar = window.CreateThemeManager("Progress");
1242+
1243-
					this.themed_header = window.CreateThemeManager("Header");
1243+
1244-
					this.themed_header.SetPartAndStateId(1, 1);
1244+
1245-
					this.themed_button = window.CreateThemeManager("Button");
1245+
1246
	}
1247
	
1248
	this.onMouseOut = function() {
1249
		g_tooltip.Deactivate();
1250
	}
1251
}
1252
1253
function buttonsDraw(gr) {
1254
	for (i in Buttons) {
1255
		Buttons[i].draw(gr);
1256
	}
1257
}
1258
1259
function buttonsTraceMouse(x, y) {
1260
	var btn = null;
1261
	for (i in Buttons) {
1262
		if (Buttons[i].traceMouse(x, y) && !btn)
1263
			btn = Buttons[i];
1264
	}
1265
1266
	return btn;
1267
}
1268
1269
function on_mouse_move(x, y) {
1270-
	this.open = function(filename) {
1270+
1271-
		return utils.ReadTextFile(filename);
1271+
1272
	if (btn != cur_btn) {
1273
		cur_btn && cur_btn.onMouseOut();
1274-
	this.save = function(t, f) {
1274+
1275
	}
1276-
			var ts = this.fso.OpenTextFile(f, 2, true, -1);
1276+
1277-
			ts.WriteLine(t);
1277+
1278-
			ts.Close();
1278+
1279
1280
function on_mouse_lbtn_down(x, y) {
1281
	g_down = true;
1282
	btn_down = cur_btn;
1283
1284
	if (cur_btn) {
1285
		cur_btn.changeState(ButtonStates.down);
1286-
		fb.trace(this.name + ": " + message);
1286+
1287
}
1288
1289-
	this.strip_tags = function(value) {
1289+
1290-
		if (!this.doc) this.doc = new ActiveXObject("htmlfile");
1290+
1291
		cur_btn.changeState(ButtonStates.hover);
1292-
			this.doc.open();
1292+
1293-
			var div = this.doc.createElement("div");
1293+
1294-
			div.innerHTML = value.replace(/\n/g, "<br>");
1294+
1295-
			return div.innerText.trim();
1295+
1296
}
1297-
			return "Error reading content.";
1297+
1298
function on_mouse_leave() {
1299
	if (cur_btn) {
1300
		cur_btn.changeState(ButtonStates.normal);
1301
	}
1302
}
1303
1304
function on_size() {
1305
	ww = window.Width;
1306
	wh = window.Height;
1307
    window.Repaint();
1308
}
1309
1310
//Background
1311
this.dui = window.InstanceType;
1312
function on_paint(gr) {
1313
	
1314
        if (this.dui) {
1315
			col = window.GetColorDUI(1);
1316
			gr.FillSolidRect(0, 0, ww, wh, col);
1317
        } 
1318
        else
1319
        {
1320
        col = window.GetColorCUI(3);    
1321
		}
1322
1323
	buttonsDraw(gr);
1324
	
1325
}
1326
1327
function RGB(r,g,b) {
1328
	return (0xff000000|(r<<16)|(g<<8)|(b)); 
1329
}
1330-
	this.aad = function() {
1330+
1331-
		if (!this.app) this.app = new ActiveXObject("Shell.Application");
1331+
1332-
		var aad_path = window.GetProperty("aad_path", "");
1332+
1333-
		if (!this.fso.FileExists(aad_path)) {
1333+
1334-
			var folder = this.app.BrowseForFolder(0, "Locate Album Art Downloader", 0x00000200);
1334+
1335-
			var file = folder ? folder.items().item().path + "\\AlbumArt.exe" : "";
1335+
//init Buttons--------------------------------------------
1336-
			if (this.fso.FileExists(file)) {
1336+
1337-
				aad_path = file;
1337+
//custom colour
1338-
				window.SetProperty("aad_path", file);
1338+
1339
1340
//button width
1341-
		if (this.fso.FileExists(aad_path)) {
1341+
1342-
			var album_artist = "/ar \"" + this.eval("[%album artist%]") + "\"";
1342+
1343-
			var album = " /al \"" + this.eval("[%album%]") + "\"";
1343+
1344-
			this.run("\"" + aad_path + "\"" + album_artist + album);
1344+
1345
1346
//Button position
1347
var top_margin = -1;
1348-
	this.tt = function(t) {
1348+
1349-
		if (this.tooltip.Text == t) return;
1349+
1350-
		this.tooltip.Text = t;
1350+
1351-
		this.tooltip.Activate();
1351+
1352
1353
//these 2 lines of code lock the panel size.
1354-
	this.ttd = function() {
1354+
1355-
		this.tooltip.Text = "";
1355+
1356-
		this.tooltip.Deactivate();
1356+
1357
1358
Buttons = {
1359-
	this.splitRGB = function(value) {
1359+
1360-
		var temp_col = value.split("-");
1360+
1361-
		return RGB(temp_col[0], temp_col[1], temp_col[2]);
1361+
        //downloadONE();
1362
        }, "Youtube")
1363
	
1364-
	this.draw_background = function(gr) {
1364+
1365-
		if (this.check_feature("custom_background")) {
1365+
1366-
			var col;
1366+
1367-
			switch(this.background_mode) {
1367+
1368-
				case 0:
1368+