fileinfo.m 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277
  1. /*---------------------------------------------------
  2. -----------------------------------------------------
  3. Filename: fileinfo.m
  4. Version: 3.3
  5. Type: maki
  6. Date: 10. Aug. 2007 - 20:42
  7. Author: Martin Poehlmann aka Deimos
  8. E-Mail: [email protected]
  9. Internet: www.skinconsortium.com
  10. www.martin.deimos.de.vu
  11. -----------------------------------------------------
  12. ---------------------------------------------------*/
  13. #include <lib/std.mi>
  14. #include attribs/init_windowpage.m
  15. #include <lib/com/songinfo.m>
  16. //#define DEBUG
  17. #define FILE_NAME "fileinfo.m"
  18. #include <lib/com/debug.m>
  19. #define WEBCOVER_SHOUTCAST "winamp.cover.shoutcast"
  20. Function loadFileInfo();
  21. Function loadPlaylistArtWork();
  22. Class GuiObject TextObject;
  23. Class GuiObject CycleObject;
  24. Function refreshRating(int rating);
  25. Class Button RatingButton;
  26. Function showBranding();
  27. Class Group Infoline;
  28. Function getTextHeight(InfoLine gn);
  29. Global Group scriptGroup, g_cover;
  30. Global AlbumArtLayer l_albumart;
  31. Global AlbumArtLayer AlbumArt;
  32. Global InfoLine g_rating, g_title, g_album, g_artist, g_year, g_genre, g_track, g_publisher, g_sname, g_surl, g_albumartist, g_composer, g_format, g_disc;
  33. Global InfoLine g_target;
  34. Global Text t_title, t_album, t_artist, t_year, t_genre, t_track, t_publisher, t_sname, t_surl, t_composer, t_albumartist, t_format, t_disc, t_rating;
  35. Global Timer cycler;
  36. // Global String stationLink = "";
  37. Global List cycle;
  38. Global Boolean cycler_paused, quick_change, HAVE_ML = TRUE;
  39. Global List ratingStars;
  40. #define CENTER_VAR Branding
  41. Global layer l_branding;
  42. #include <lib/com/centerlayer.m>
  43. #undef CENTER_VAR
  44. Global TextObject TextArtist, TextAlbum, TextTitle, TextGenre, TextPublisher, TextSURl, TextSname;
  45. Global CycleObject cycleGenre, cyclePublisher, cycleTrack, cycleYear, cycleComposer, cycleAlbumartist, cycleFormat, cycleDisc;
  46. Global RatingButton rate1, rate2, rate3, rate4, rate5, rate0;
  47. Global Layer star1, star2, star3, star4, star5;
  48. Global Int startwith = 0;
  49. Global Int artRetries = 0;
  50. Global Int maxlines;
  51. Global timer delayLoad;
  52. System.onScriptLoaded()
  53. {
  54. initAttribs_windowpage();
  55. HAVE_ML = stringToInteger(getToken(getParam(), ",", 0));
  56. maxlines = stringToInteger(getToken(getParam(), ",", 1));
  57. scriptGroup = getScriptGroup();
  58. cycler = new Timer;
  59. cycler.setDelay(4000);
  60. delayLoad = new Timer;
  61. delayLoad.setDelay(10);
  62. //debug(getWinampVersion() + "#" + integerToString(getBuildNumber()));
  63. g_rating = scriptGroup.findObject("infodisplay.line.rating");
  64. g_title = scriptGroup.findObject("infodisplay.line.title");
  65. g_album = scriptGroup.findObject("infodisplay.line.album");
  66. g_artist = scriptGroup.findObject("infodisplay.line.artist");
  67. g_year = scriptGroup.findObject("infodisplay.line.year");
  68. g_genre = scriptGroup.findObject("infodisplay.line.genre");
  69. g_track = scriptGroup.findObject("infodisplay.line.track");
  70. g_publisher = scriptGroup.findObject("infodisplay.line.publisher");
  71. g_sname = scriptGroup.findObject("infodisplay.line.sname");
  72. g_surl = scriptGroup.findObject("infodisplay.line.surl");
  73. g_composer = scriptGroup.findObject("infodisplay.line.composer");
  74. g_albumartist = scriptGroup.findObject("infodisplay.line.albumartist");
  75. g_format = scriptGroup.findObject("infodisplay.line.format");
  76. g_disc = scriptGroup.findObject("infodisplay.line.disc");
  77. t_title = g_title.findObject("text");
  78. t_album = g_album.findObject("text");
  79. t_artist = g_artist.findObject("text");
  80. t_year = g_year.findObject("text");
  81. t_genre = g_genre.findObject("text");
  82. t_track = g_track.findObject("text");
  83. t_Publisher = g_publisher.findObject("text");
  84. t_sname = g_sname.findObject("text");
  85. t_surl = g_surl.findObject("text");
  86. t_albumartist = g_albumartist.findObject("text");
  87. t_composer = g_composer.findObject("text");
  88. t_format = g_format.findObject("text");
  89. t_disc = g_disc.findObject("text");
  90. textArtist = g_artist.findObject("text");
  91. textAlbum = g_album.findObject("text");
  92. textTitle = g_title.findObject("text");
  93. textsUrl = g_surl.findObject("text");
  94. textSname = g_sname.findObject("text");
  95. cycleGenre = g_genre.findObject("link");
  96. cyclePublisher = g_publisher.findObject("link");
  97. cycleTrack = g_track.findObject("link");
  98. cycleYear = g_year.findObject("link");
  99. cycleAlbumartist = g_albumartist.findObject("text");
  100. cycleComposer = g_composer.findObject("text");
  101. cycleFormat = g_format.findObject("link");
  102. cycleDisc = g_disc.findObject("link");
  103. cycle = new List;
  104. ratingStars = new List;
  105. group parent = scriptGroup.getParent();
  106. l_branding = parent.findObject("branding");
  107. g_cover = parent.findObject("info.component.cover");
  108. _BrandingInit(l_branding, parent, 1, 0);
  109. l_albumart = g_cover.getObjecT("winamp.albumart");
  110. rate1 = g_rating.findObject("rate.1");
  111. rate2 = g_rating.findObject("rate.2");
  112. rate3 = g_rating.findObject("rate.3");
  113. rate4 = g_rating.findObject("rate.4");
  114. rate5 = g_rating.findObject("rate.5");
  115. rate0 = g_rating.findObject("rate.0");
  116. ratingStars.addItem(rate1);
  117. ratingStars.addItem(rate2);
  118. ratingStars.addItem(rate3);
  119. ratingStars.addItem(rate4);
  120. ratingStars.addItem(rate5);
  121. star1 = g_rating.findObject("star.1");
  122. star2 = g_rating.findObject("star.2");
  123. star3 = g_rating.findObject("star.3");
  124. star4 = g_rating.findObject("star.4");
  125. star5 = g_rating.findObject("star.5");
  126. t_rating = g_rating.findObject("label");
  127. t_rating.onTextChanged ("");
  128. refreshRating(System.getCurrentTrackRating());
  129. loadFileInfo();
  130. if (ic_fileinfo.getData() == "1")
  131. {
  132. if (getStatus() == STATUS_STOPPED && songinfo_location == "") showBranding(); // show branding if playback is stopped and the playlist is empty
  133. if (removePath(getPlayItemString()) == "demo.mp3") // Show branding if playing DJ Mike
  134. {
  135. if (getPlayitemmetadatastring("artist") == "DJ Mike Llama" && getplayitemmetadatastring("title") == "Llama Whippin' Intro")
  136. {
  137. showBranding();
  138. }
  139. }
  140. }
  141. }
  142. System.onScriptUnloading ()
  143. {
  144. cycler.stop();
  145. delete cycler;
  146. delayLoad.stop();
  147. delete delayLoad;
  148. }
  149. // Reload fileInfo if track has changed
  150. delayLoad.onTimer()
  151. {
  152. System.onTitleChange (getPlayItemString());
  153. delayLoad.stop();
  154. }
  155. System.onTitleChange (String newtitle)
  156. {
  157. // Get rid of "" calls
  158. if (newtitle == "" && getplayitemmetadatastring("title") == "" && !delayLoad.isRunning())
  159. {
  160. delayLoad.start();
  161. }
  162. // Get rid of buffering during stream connection & playback
  163. if (StrLeft(newtitle, 1) == "[") {
  164. if (StrLeft(newtitle, 7) == "[Buffer" || StrLeft(newtitle, 4) == "[ICY") return;
  165. }
  166. // Show branding for DJ Mike
  167. if (removePath(getPlayItemString()) == "demo.mp3")
  168. {
  169. if (getPlayitemmetadatastring("artist") == "DJ Mike Llama" && getplayitemmetadatastring("title") == "Llama Whippin' Intro")
  170. {
  171. showBranding();
  172. return;
  173. }
  174. }
  175. debugString(DEBUG_PREFIX "System.onTitleChange() -> loadFileInfo();", D_WTF);
  176. refreshRating(System.getCurrentTrackRating());
  177. loadFileInfo();
  178. }
  179. // Reload fileInfo if textline attribs have changed
  180. InfoLineAttribute.onDataChanged ()
  181. {
  182. if (l_branding.isVisible()) return;
  183. loadFileInfo ();
  184. }
  185. /*l_albumart.onAlbumArtLoaded(boolean success)
  186. {
  187. if(songinfo_streamType == SONGINFO_STREAMTYPE_SHOUTCAST2)
  188. {
  189. if(!l_albumart.isInvalid())
  190. {
  191. l_albumart.show();
  192. l_webcover.hide();
  193. }
  194. }
  195. }*/
  196. //----------------------------------------------------------------------------------------------------------------
  197. // Our main machine.
  198. //----------------------------------------------------------------------------------------------------------------
  199. loadPlaylistArtWork()
  200. {
  201. Group g_cover2;
  202. Container player;
  203. Frame dualwnd, pl_dualwnd, mainframe;
  204. Layout mainframe;
  205. player = getContainer("main");
  206. if(player)
  207. {
  208. mainframe=player.getLayout("normal");
  209. if(mainframe)
  210. {
  211. dualwnd = mainframe.findObject("player.dualwnd");
  212. if(dualwnd)
  213. {
  214. pl_dualwnd = dualwnd.findObject("playlist.dualwnd");
  215. if(pl_dualwnd)
  216. {
  217. g_cover2 = pl_dualwnd.findObject("player.component.playlist.albumart");
  218. if(g_cover2)
  219. {
  220. AlbumArt = g_cover2.findObject("winamp.albumart");
  221. }
  222. }
  223. }
  224. }
  225. }
  226. }
  227. loadFileInfo ()
  228. {
  229. songinfo_reload(); // refresh vars
  230. debugString(DEBUG_PREFIX "loadFileInfo() {", D_WTF);
  231. debugString(DEBUG_PREFIX " songinfo_location: " + songinfo_location, D_WTF);
  232. debugString(DEBUG_PREFIX " songinfo_displayTitle: " + songinfo_displayTitle, D_WTF);
  233. // cancel g_target
  234. if (g_target) g_target.cancelTarget();
  235. if (g_target) g_target.setAlpha(255);
  236. g_target = NULL;
  237. // hide all lines and cycle buttons
  238. g_rating.hide();
  239. g_title.hide();
  240. g_album.hide();
  241. g_artist.hide();
  242. g_year.hide();
  243. g_genre.hide();
  244. l_branding.hide();
  245. g_track.hide();
  246. g_publisher.hide();
  247. g_cover.setAlpha(255);
  248. g_surl.hide();
  249. g_sname.hide();
  250. g_albumartist.hide();
  251. g_composer.hide();
  252. g_format.hide();
  253. g_disc.hide();
  254. cycleTrack.hide();
  255. cycleGenre.hide();
  256. cyclePublisher.hide();
  257. cycleFormat.hide();
  258. cycleYear.hide();
  259. cycleDisc.hide();
  260. cycler.stop();
  261. cycler_paused = 0;
  262. // stationLink = "";
  263. artRetries = 0;
  264. l_albumart.setXMLParam("notfoundImage", "winamp.cover.notfound.xxl");
  265. Boolean _cycle = (infocomp_cycle.getData() == "1");
  266. Boolean _rating = (infocomp_show_rating.getData() == "1");
  267. // empty cycle list
  268. cycle.removeAll();
  269. int pos = 1;
  270. if (maxlines > 5)
  271. {
  272. pos += 2;
  273. }
  274. int n = 0;
  275. debugString(DEBUG_PREFIX " songinfo_streamName: " + songinfo_streamName, D_WTF);
  276. debugString(DEBUG_PREFIX " songinfo_streamType: " + integerToString(songinfo_streamType), D_WTF);
  277. if (songinfo_isStream)
  278. {
  279. debugString(DEBUG_PREFIX " -> A stream is detected!", D_WTF);
  280. debugString(DEBUG_PREFIX " songinfo_artist: " + songinfo_artist, D_WTF);
  281. debugString(DEBUG_PREFIX " songinfo_title: " + songinfo_title, D_WTF);
  282. if (songinfo_title != "")
  283. {
  284. // Title
  285. if (n > 0) pos += getTextHeight(g_title);
  286. t_title.setText(songinfo_title);
  287. g_title.setXmlParam("y", integerToString(pos));
  288. g_title.show();
  289. n++;
  290. cycle.addItem(g_title);
  291. // Artist
  292. if (songinfo_artist != "")
  293. {
  294. if (n > 0) pos += getTextHeight(g_artist);
  295. t_artist.setText(songinfo_artist);
  296. g_artist.setXmlParam("y", integerToString(pos));
  297. g_artist.show();
  298. n++;
  299. cycle.addItem(g_artist);
  300. }
  301. }
  302. else
  303. {
  304. debugString(DEBUG_PREFIX " songinfo_streamtitle: " + songinfo_streamtitle, D_WTF);
  305. if (songinfo_streamtitle != "")
  306. {
  307. int v = strsearch(songinfo_streamtitle, " - ");
  308. if (v > 0) {
  309. string s1 = strleft (songinfo_streamtitle, v);
  310. string s2 = strright (songinfo_streamtitle, strlen(songinfo_streamtitle) - 3 - v);
  311. // Title
  312. if (n > 0) pos += getTextHeight(g_title);
  313. t_title.setText(s2);
  314. g_title.setXmlParam("y", integerToString(pos));
  315. g_title.show();
  316. n++;
  317. cycle.addItem(g_title);
  318. // Artist
  319. if (n > 0) pos += getTextHeight(g_artist);
  320. if (songinfo_artist == "") t_artist.setText(s1);
  321. else t_artist.setText(songinfo_artist);
  322. g_artist.setXmlParam("y", integerToString(pos));
  323. g_artist.show();
  324. n++;
  325. cycle.addItem(g_artist);
  326. }
  327. else
  328. {
  329. // Title
  330. if (n > 0) pos += getTextHeight(g_title);
  331. t_title.setText(songinfo_streamtitle);
  332. g_title.setXmlParam("y", integerToString(pos));
  333. g_title.show();
  334. n++;
  335. cycle.addItem(g_title);
  336. // Artist
  337. if (songinfo_artist != "") {
  338. if (n > 0) pos += getTextHeight(g_artist);
  339. t_artist.setText(songinfo_artist);
  340. g_artist.setXmlParam("y", integerToString(pos));
  341. g_artist.show();
  342. n++;
  343. cycle.addItem(g_artist);
  344. }
  345. }
  346. }
  347. }
  348. // Stream Album
  349. debugString(DEBUG_PREFIX " songinfo_album: " + songinfo_album, D_WTF);
  350. if (songinfo_album != "")
  351. {
  352. if (n > 0) pos += getTextHeight(g_album);
  353. t_album.setText(songinfo_album);
  354. g_album.setXmlParam("y", integerToString(pos));
  355. g_album.show();
  356. n++;
  357. cycle.addItem(g_album);
  358. }
  359. // Stream Genre
  360. String s = getPlayItemMetaDataString("streamgenre");
  361. debugString(DEBUG_PREFIX " System.getPlayItemMetaDataString(streamgenre): " + s, D_WTF);
  362. if (s != "")
  363. {
  364. t_genre.setText(s);
  365. cycleGenre.setXmlParam("w", "0");
  366. cycle.addItem(g_genre);
  367. if (n > 0) pos += getTextHeight(g_genre);
  368. g_genre.setXmlParam("y", integerToString(pos));
  369. g_genre.show();
  370. n++;
  371. }
  372. // Set Stream Name
  373. if (songinfo_streamName != "")
  374. {
  375. if (n > 0) pos += getTextHeight(g_sname);
  376. t_sname.setText(songinfo_streamName);
  377. g_sname.setXmlParam("y", integerToString(pos));
  378. g_sname.show();
  379. n++;
  380. cycle.addItem(g_sname);
  381. }
  382. // Stream URL (only visible if we have less than 4 lines till now)
  383. debugString(DEBUG_PREFIX " songinfo_streamURL: " + songinfo_streamURL, D_WTF);
  384. if (songinfo_streamURL != "")
  385. {
  386. if (n > 0) pos += getTextHeight(g_surl);
  387. t_surl.setText(songinfo_streamURL);
  388. g_surl.setXmlParam("y", integerToString(pos));
  389. g_surl.show();
  390. n++;
  391. cycle.addItem(g_surl);
  392. }
  393. // setCover either from a supplied url or from in-stream artwork or default to a generic image
  394. if (songinfo_streamAlbumArt != "")
  395. {
  396. debugString(DEBUG_PREFIX " songinfo_streamAlbumArt: " + songinfo_streamAlbumArt, D_WTF);
  397. l_albumart.setXMLParam("image", songinfo_streamAlbumArt);
  398. l_albumart.setXMLParam("notfoundImage", "winamp.cover.notfound.xxl");
  399. }
  400. if(songinfo_streamType == SONGINFO_STREAMTYPE_SHOUTCAST || songinfo_streamType == SONGINFO_STREAMTYPE_SHOUTCAST2)
  401. {
  402. if(songinfo_streamType == SONGINFO_STREAMTYPE_SHOUTCAST2)
  403. {
  404. if(l_albumart.isInvalid() && artRetries < 3)
  405. {
  406. if(!artRetries)
  407. {
  408. l_albumart.setXMLParam("notfoundImage", WEBCOVER_SHOUTCAST);
  409. }
  410. artRetries += 1;
  411. l_albumart.refresh();
  412. if(!AlbumArt) loadPlaylistArtWork();
  413. if(AlbumArt) AlbumArt.refresh();
  414. }
  415. }
  416. else
  417. {
  418. l_albumart.setXMLParam("notfoundImage", WEBCOVER_SHOUTCAST);
  419. }
  420. }
  421. }
  422. // ---------- Local Info ----------
  423. else
  424. {
  425. debugString(DEBUG_PREFIX " -> No stream is detected! we do the normal procedure", D_WTF);
  426. string s = songinfo_title;
  427. if (s == "") songinfo_displayTitle;
  428. if (s != "")
  429. {
  430. t_title.setText(s);
  431. g_title.setXmlParam("y", integerToString(pos));
  432. g_title.show();
  433. n++;
  434. cycle.addItem(g_title);
  435. }
  436. if (songinfo_artist != "")
  437. {
  438. if (n > 0) pos += getTextHeight(g_artist);
  439. t_artist.setText(songinfo_artist);
  440. g_artist.setXmlParam("y", integerToString(pos));
  441. g_artist.show();
  442. n++;
  443. cycle.addItem(g_artist);
  444. }
  445. if (songinfo_album != "")
  446. {
  447. if (n > 0) pos += getTextHeight(g_album);
  448. t_album.setText(songinfo_album);
  449. g_album.setXmlParam("y", integerToString(pos));
  450. g_album.show();
  451. n++;
  452. cycle.addItem(g_album);
  453. }
  454. if (infocomp_show_track.getData() == "1")
  455. {
  456. s = getPlayitemMetaDataString("track");
  457. if (s != "" && s != "-1")
  458. {
  459. // if tracknumber is like 1/9 we display 1 of 9
  460. if (strsearch(s, "/") != -1)
  461. {
  462. s = getToken(s, "/", 0) + translate(" of ") + getToken(s, "/", 1);
  463. }
  464. if (n > 0) pos += getTextHeight(g_track);
  465. t_track.setText(s);
  466. g_track.setXmlParam("y", integerToString(pos));
  467. g_track.show();
  468. n++;
  469. cycle.addItem(g_track);
  470. }
  471. }
  472. if (infocomp_show_year.getData() == "1")
  473. {
  474. s = getPlayItemMetaDataString("year");
  475. if (s != "")
  476. {
  477. t_year.setText(s);
  478. cycle.addItem(g_year);
  479. if ((!_rating && n < maxlines) || (_rating && n < maxlines-1))
  480. {
  481. if (n > 0) pos += getTextHeight(g_year);
  482. g_year.setXmlParam("y", integerToString(pos));
  483. g_year.show();
  484. n++;
  485. }
  486. else
  487. {
  488. if (g_Track.getGuiY() == pos) cycleTrack.show();
  489. cycleYear.show();
  490. g_year.setXmlParam("y", integerToString(pos));
  491. if (_cycle) cycler.start();
  492. else if (getPrivateString (getSkinName(), "FileInfo_usersel", "") == "year")
  493. {
  494. if (g_Track.getGuiY() == pos) g_track.hide();
  495. startwith = cycle.getNumitems() - 1;
  496. g_year.show();
  497. }
  498. }
  499. }
  500. }
  501. if (infocomp_show_genre.getData() == "1")
  502. {
  503. s = getPlayItemMetaDataString("genre");
  504. if (s != "")
  505. {
  506. t_genre.setText(s);
  507. cycle.addItem(g_genre);
  508. if ((!_rating && n < maxlines) || (_rating && n < maxlines-1))
  509. {
  510. if (n > 0) pos += getTextHeight(g_genre);
  511. g_genre.setXmlParam("y", integerToString(pos));
  512. g_genre.show();
  513. n++;
  514. }
  515. else
  516. {
  517. if (g_Track.getGuiY() == pos) cycleTrack.show();
  518. if (g_year.getGuiY() == pos) cycleYear.show();
  519. cycleGenre.show();
  520. g_genre.setXmlParam("y", integerToString(pos));
  521. if (_cycle) cycler.start();
  522. else if (getPrivateString (getSkinName(), "FileInfo_usersel", "") == "genre")
  523. {
  524. if (g_Track.getGuiY() == pos) g_Track.hide();
  525. if (g_year.getGuiY() == pos) g_year.hide();
  526. startwith = cycle.getNumitems() - 1;
  527. g_genre.show();
  528. }
  529. }
  530. }
  531. }
  532. if (infocomp_show_disc.getData() == "1")
  533. {
  534. s = getPlayItemMetaDataString("disc");
  535. if (s != "")
  536. {
  537. t_disc.setText(s);
  538. cycle.addItem(g_disc);
  539. if ((!_rating && n < maxlines) || (_rating && n < maxlines-1))
  540. {
  541. if (n > 0) pos += getTextHeight(g_disc);
  542. g_disc.setXmlParam("y", integerToString(pos));
  543. g_disc.show();
  544. n++;
  545. }
  546. else
  547. {
  548. if (g_Track.getGuiY() == pos) cycleTrack.show();
  549. if (g_year.getGuiY() == pos) cycleYear.show();
  550. if (g_genre.getGuiY() == pos) cycleGenre.show();
  551. cycleDisc.show();
  552. g_disc.setXmlParam("y", integerToString(pos));
  553. if (_cycle) cycler.start();
  554. else if (getPrivateString (getSkinName(), "FileInfo_usersel", "") == "disc")
  555. {
  556. if (g_Track.getGuiY() == pos) g_Track.hide();
  557. if (g_year.getGuiY() == pos) g_year.hide();
  558. if (g_genre.getGuiY() == pos) g_genre.hide();
  559. startwith = cycle.getNumitems() - 1;
  560. g_disc.show();
  561. }
  562. }
  563. }
  564. }
  565. if (infocomp_show_albumartist.getData() == "1")
  566. {
  567. s = getPlayItemMetaDataString("albumartist");
  568. if (s != "")
  569. {
  570. t_albumartist.setText(s);
  571. cycle.addItem(g_albumartist);
  572. if ((!_rating && n < maxlines) || (_rating && n < maxlines-1))
  573. {
  574. if (n > 0) pos += getTextHeight(g_albumartist);
  575. g_albumartist.setXmlParam("y", integerToString(pos));
  576. g_albumartist.show();
  577. n++;
  578. }
  579. else
  580. {
  581. if (g_Track.getGuiY() == pos) cycleTrack.show();
  582. if (g_year.getGuiY() == pos) cycleYear.show();
  583. if (g_genre.getGuiY() == pos) cycleGenre.show();
  584. if (g_disc.getGuiY() == pos) cycleDisc.show();
  585. cycleAlbumartist.show();
  586. g_albumartist.setXmlParam("y", integerToString(pos));
  587. if (_cycle) cycler.start();
  588. else if (getPrivateString (getSkinName(), "FileInfo_usersel", "") == "albumartist")
  589. {
  590. if (g_Track.getGuiY() == pos) g_Track.hide();
  591. if (g_year.getGuiY() == pos) g_year.hide();
  592. if (g_genre.getGuiY() == pos) g_genre.hide();
  593. if (g_disc.getGuiY() == pos) cycleDisc.show();
  594. startwith = cycle.getNumitems() - 1;
  595. g_albumartist.show();
  596. }
  597. }
  598. }
  599. }
  600. if (infocomp_show_composer.getData() == "1")
  601. {
  602. s = getPlayItemMetaDataString("composer");
  603. if (s != "")
  604. {
  605. t_composer.setText(s);
  606. cycle.addItem(g_composer);
  607. if ((!_rating && n < maxlines) || (_rating && n < maxlines-1))
  608. {
  609. if (n > 0) pos += getTextHeight(g_composer);
  610. g_composer.setXmlParam("y", integerToString(pos));
  611. g_composer.show();
  612. n++;
  613. }
  614. else
  615. {
  616. if (g_Track.getGuiY() == pos) cycleTrack.show();
  617. if (g_year.getGuiY() == pos) cycleYear.show();
  618. if (g_genre.getGuiY() == pos) cycleGenre.show();
  619. if (g_disc.getGuiY() == pos) cycleDisc.show();
  620. if (g_albumartist.getGuiY() == pos) cycleAlbumartist.show();
  621. cycleComposer.show();
  622. g_composer.setXmlParam("y", integerToString(pos));
  623. if (_cycle) cycler.start();
  624. else if (getPrivateString (getSkinName(), "FileInfo_usersel", "") == "composer")
  625. {
  626. if (g_Track.getGuiY() == pos) g_Track.hide();
  627. if (g_year.getGuiY() == pos) g_year.hide();
  628. if (g_genre.getGuiY() == pos) g_genre.hide();
  629. if (g_disc.getGuiY() == pos) cycleDisc.show();
  630. if (g_albumartist.getGuiY() == pos) g_albumartist.hide();
  631. startwith = cycle.getNumitems() - 1;
  632. g_composer.show();
  633. }
  634. }
  635. }
  636. }
  637. if (infocomp_show_publisher.getData() == "1")
  638. {
  639. s = getPlayItemMetaDataString("publisher");
  640. if (s != "")
  641. {
  642. t_publisher.setText(s);
  643. cycle.addItem(g_publisher);
  644. if ((!_rating && n < maxlines) || (_rating && n < maxlines-1))
  645. {
  646. if (n > 0) pos += getTextHeight(g_publisher);
  647. g_publisher.setXmlParam("y", integerToString(pos));
  648. g_publisher.show();
  649. n++;
  650. }
  651. else
  652. {
  653. if (g_Track.getGuiY() == pos) cycleTrack.show();
  654. if (g_year.getGuiY() == pos) cycleYear.show();
  655. if (g_genre.getGuiY() == pos) cycleGenre.show();
  656. if (g_disc.getGuiY() == pos) cycleDisc.show();
  657. if (g_albumartist.getGuiY() == pos) cycleAlbumartist.show();
  658. if (g_composer.getGuiY() == pos) cycleComposer.show();
  659. cyclePublisher.show();
  660. g_publisher.setXmlParam("y", integerToString(pos));
  661. if (_cycle) cycler.start();
  662. else if (getPrivateString (getSkinName(), "FileInfo_usersel", "") == "publisher")
  663. {
  664. if (g_Track.getGuiY() == pos) g_Track.hide();
  665. if (g_year.getGuiY() == pos) g_year.hide();
  666. if (g_genre.getGuiY() == pos) g_genre.hide();
  667. if (g_disc.getGuiY() == pos) cycleDisc.show();
  668. if (g_albumartist.getGuiY() == pos) g_albumartist.hide();
  669. if (g_composer.getGuiY() == pos) g_composer.hide();
  670. startwith = cycle.getNumitems() - 1;
  671. g_publisher.show();
  672. }
  673. }
  674. }
  675. }
  676. if (infocomp_show_format.getData() == "1")
  677. {
  678. s = system.getDecoderName(system.getPlayItemString());
  679. if (s != "")
  680. {
  681. t_format.setText(s);
  682. cycle.addItem(g_format);
  683. if ((!_rating && n < maxlines) || (_rating && n < maxlines-1))
  684. {
  685. if (n > 0) pos += getTextHeight(g_format);
  686. g_format.setXmlParam("y", integerToString(pos));
  687. g_format.show();
  688. n++;
  689. }
  690. else
  691. {
  692. if (g_Track.getGuiY() == pos) cycleTrack.show();
  693. if (g_year.getGuiY() == pos) cycleYear.show();
  694. if (g_genre.getGuiY() == pos) cycleGenre.show();
  695. if (g_disc.getGuiY() == pos) cycleDisc.show();
  696. if (g_disc.getGuiY() == pos) cycleDisc.show();
  697. if (g_albumartist.getGuiY() == pos) cycleAlbumartist.show();
  698. if (g_composer.getGuiY() == pos) cycleComposer.show();
  699. if (g_publisher.getGuiY() == pos) cyclePublisher.show();
  700. cycleFormat.show();
  701. g_format.setXmlParam("y", integerToString(pos));
  702. if (_cycle) cycler.start();
  703. else if (getPrivateString (getSkinName(), "FileInfo_usersel", "") == "format")
  704. {
  705. if (g_Track.getGuiY() == pos) g_Track.hide();
  706. if (g_year.getGuiY() == pos) g_year.hide();
  707. if (g_genre.getGuiY() == pos) g_genre.hide();
  708. if (g_albumartist.getGuiY() == pos) g_albumartist.hide();
  709. if (g_composer.getGuiY() == pos) g_composer.hide();
  710. if (g_publisher.getGuiY() == pos) g_publisher.hide();
  711. startwith = cycle.getNumitems() - 1;
  712. g_format.show();
  713. }
  714. }
  715. }
  716. }
  717. // check the media library status as well as input plug-in support
  718. // to help determine if we show the rating control or not for here
  719. if (_rating)
  720. {
  721. if (!HAVE_ML)
  722. {
  723. s = getPlayitemMetaDataString("rateable");
  724. if (s != "" && s == "1")
  725. {
  726. if (n > 0) pos += getTextHeight(g_rating);
  727. g_rating.setXmlParam("y", integerToString(pos));
  728. g_rating.show();
  729. }
  730. } else {
  731. if (n > 0) pos += getTextHeight(g_rating);
  732. g_rating.setXmlParam("y", integerToString(pos));
  733. g_rating.show();
  734. }
  735. }
  736. }
  737. if (n==0)
  738. {
  739. showBranding();
  740. }
  741. debugString(DEBUG_PREFIX "}", D_WTF);
  742. }
  743. //----------------------------------------------------------------------------------------------------------------
  744. // Item Cycler: Only active if we have more items to display as lines
  745. // if you click on a cycle line, this group is saved as g_target
  746. //----------------------------------------------------------------------------------------------------------------
  747. cycler.onTimer ()
  748. {
  749. // Important: stop the cycler if branding is visible
  750. if (l_branding.isvisible()) cycler.stop();
  751. if (infocomp_cycle.getData() == "0" && !quick_change) { cycler.stop(); return; }
  752. // g_target is defined --> we save the currently shown line as g_target
  753. if (!g_target)
  754. {
  755. // check if rating is visible...
  756. if (infocomp_show_rating.getData() == "1")
  757. {
  758. // if auto-cycler is disabled, and not the default line is shown, the line number is stored in startwith.
  759. if (startwith)
  760. {
  761. // resort the cycle list and set startwith to 0
  762. for ( int i = maxlines-2; i < startwith; i++ )
  763. {
  764. g_target = cycle.enumItem(maxlines-2);
  765. cycle.removeItem(maxlines-2);
  766. cycle.addItem(g_target);
  767. }
  768. startwith = 0;
  769. }
  770. // save g_target and remove from cycle
  771. g_target = cycle.enumItem(maxlines-2);
  772. cycle.removeItem(maxlines-2);
  773. }
  774. else
  775. {
  776. if (startwith)
  777. {
  778. for ( int i = maxlines-1; i < startwith; i++ )
  779. {
  780. g_target = cycle.enumItem(maxlines-1);
  781. cycle.removeItem(maxlines-1);
  782. cycle.addItem(g_target);
  783. }
  784. startwith = 0;
  785. }
  786. g_target = cycle.enumItem(maxlines-1);
  787. cycle.removeItem(maxlines-1);
  788. }
  789. // put g_target at the end of cycle
  790. cycle.addItem(g_target);
  791. }
  792. // otherwise g_target is the last item of cycle
  793. else g_target = cycle.enumItem(cycle.getNumItems()-1);
  794. // TODO verify fix from pieter!
  795. if (g_target == null)
  796. return;
  797. // fade out g_target
  798. g_target.setTargetA(0);
  799. g_target.setTargetY(g_target.getGuiY());
  800. if (!quick_change) g_target.setTargetSpeed(0.25); // fade or quick show/hide
  801. else g_target.setTargetSpeed(0);
  802. g_target.gotoTarget();
  803. }
  804. g_target.onTargetReached ()
  805. {
  806. if (g_target.getAlpha() == 0)
  807. {
  808. // setback g_target to default values
  809. g_target.hide();
  810. g_target.setAlpha(255);
  811. // detect if rating stars are visible and store the line tb shown in g_target
  812. if (infocomp_show_rating.getData() == "1")
  813. {
  814. g_target = cycle.enumItem(maxlines-2);
  815. cycle.removeItem(maxlines-2);
  816. }
  817. else
  818. {
  819. g_target = cycle.enumItem(maxlines-1);
  820. cycle.removeItem(maxlines-1);
  821. }
  822. // better set g-target alpha to 0 and, show this line and fade in
  823. g_target.setAlpha(0);
  824. g_target.show();
  825. g_target.setTargetA(255);
  826. g_target.setTargetY(getGuiY());
  827. if (!quick_change) g_target.setTargetSpeed(0.25); // fade or quick show/hide
  828. else
  829. {
  830. g_target.setTargetSpeed(0);
  831. string v = getToken(g_target.getID(), ".", 2);
  832. setPrivateString (getSkinName(), "FileInfo_usersel", v); // save current line
  833. }
  834. g_target.gotoTarget();
  835. // add g_target to end of cycle
  836. cycle.addItem(g_target);
  837. if (infocomp_cycle.getData() == "1" && !cycler.isRunning()) cycler.start(); // check if we should start cycler
  838. quick_change = 0;
  839. }
  840. }
  841. // Automatic cycling through items on/off
  842. infocomp_cycle.onDataChanged ()
  843. {
  844. if (l_branding.isVisible()) return;
  845. if (getData() == "1")
  846. {
  847. if (cycler_paused) cycler.start();
  848. else loadFileInfo();
  849. cycler_paused = 0;
  850. }
  851. else
  852. {
  853. if (cycler.isRunning()) cycler_paused = 1;
  854. cycler.stop();
  855. if (g_track.isVisible()) setPrivateString (getSkinName(), "FileInfo_usersel", "track");
  856. else if (g_year.isVisible()) setPrivateString (getSkinName(), "FileInfo_usersel", "year");
  857. else if (g_genre.isVisible()) setPrivateString (getSkinName(), "FileInfo_usersel", "genre");
  858. else if (g_publisher.isVisible()) setPrivateString (getSkinName(), "FileInfo_usersel", "publisher");
  859. else if (g_albumartist.isVisible()) setPrivateString (getSkinName(), "FileInfo_usersel", "albumartist");
  860. else if (g_composer.isVisible()) setPrivateString (getSkinName(), "FileInfo_usersel", "composer");
  861. else if (g_format.isVisible()) setPrivateString (getSkinName(), "FileInfo_usersel", "format");
  862. else if (g_disc.isVisible()) setPrivateString (getSkinName(), "FileInfo_usersel", "disc");
  863. }
  864. }
  865. // Visual Stuff
  866. CycleObject.onEnterArea ()
  867. {
  868. CycleObject.getParent().findObject("label").setAlpha(255);
  869. }
  870. CycleObject.onLeaveArea ()
  871. {
  872. CycleObject.getParent().findObject("label").setAlpha(180);
  873. }
  874. CycleObject.onLeftButtonDown (int x, int y)
  875. {
  876. CycleObject.getParent().findObject("label").setAlpha(220);
  877. }
  878. CycleObject.onLeftButtonUp (int x, int y)
  879. {
  880. if (getAlpha() < 255) return;
  881. setAlpha(255);
  882. if (quick_change) return;
  883. quick_change = 1;
  884. cycler.onTimer ();
  885. }
  886. //----------------------------------------------------------------------------------------------------------------
  887. // If user clicks on a link item (artist, album, title), let's start a web search
  888. // Therefore we will send an action to the group "sui.content". This action is either "browser_navigate" or
  889. // "browser_search". This action is then proccessed by suicore.maki (showing browser) and then (again) delivered
  890. // to browser.maki (from suicore.maki)
  891. //----------------------------------------------------------------------------------------------------------------
  892. /*
  893. LinkObject.onEnterArea ()
  894. {
  895. LinkObject.getParent().findObject("label").setAlpha(255);
  896. }
  897. LinkObject.onLeaveArea ()
  898. {
  899. LinkObject.getParent().findObject("label").setAlpha(180);
  900. }
  901. LinkObject.onLeftButtonDown (int x, int y)
  902. {
  903. LinkObject.getParent().findObject("label").setAlpha(220);
  904. }
  905. LinkObject.onLeftButtonUp (int x, int y)
  906. {
  907. if (getAlpha() < 255) return;
  908. setAlpha(255);
  909. // 5.56: special handling for url/streamname
  910. if (LinkObject == linkSurl || LinkObject == linkSname)
  911. {
  912. String nav = t_surl.getText();
  913. group sui = scriptGroup.getParentLayout().findObject("sui.content");
  914. if (nav != "")
  915. {
  916. sui.sendAction ("browser_navigate", nav, 0, 0, 0, 0);
  917. return;
  918. }
  919. }
  920. string s;
  921. if (infocomp_browser.getData() == "1")
  922. {
  923. if (LinkObject == linkArtist) s = t_artist.getText();
  924. if (LinkObject == linkAlbum) s = t_artist.getText() + " " + t_album.getText();
  925. if (LinkObject == linkTitle) s = t_artist.getText() + " " + t_title.getText();
  926. if (s == "") return;
  927. group sui = scriptGroup.getParentLayout().findObject("sui.content");
  928. sui.sendAction ("browser_search", s, 0, 0, 0, 0);
  929. return;
  930. }
  931. if (stationLink != "" && ( LinkObject == linkSname || LinkObject == linkSurl))
  932. {
  933. group sui = scriptGroup.getParentLayout().findObject("sui.content");
  934. sui.sendAction ("browser_navigate", stationLink, 0, 0, 0, 0);
  935. return;
  936. }
  937. String icid = "fileinfotitle";
  938. if (LinkObject == linkArtist) icid = "fileinfoartist";
  939. if (LinkObject == linkAlbum) icid = "fileinfoalbum";
  940. String artist = t_artist.getText();
  941. if (artist == "") return;
  942. System.navigateUrlBrowser("http://client.winamp.com/nowplaying/artist/?artistName=" + artist);
  943. }
  944. */
  945. //----------------------------------------------------------------------------------------------------------------
  946. // Rating System
  947. //----------------------------------------------------------------------------------------------------------------
  948. System.onCurrentTrackRated (int rating)
  949. {
  950. refreshRating(rating);
  951. }
  952. RatingButton.onLeftButtonDown (int x, int y)
  953. {
  954. RatingButton.setAlpha(255);
  955. RatingButton.getParent().findObject("label").setAlpha(220);
  956. }
  957. RatingButton.onleftClick ()
  958. {
  959. int rating = stringToInteger(getToken(getId(), ".", 1));
  960. refreshRating(rating);
  961. setCurrentTrackRating(rating);
  962. for ( int i = 1; i <= rating; i++ )
  963. {
  964. guiobject o = ratingStars.enumItem(i-1);
  965. o.setAlpha(255);
  966. }
  967. }
  968. RatingButton.onEnterArea ()
  969. {
  970. RatingButton.getParent().findObject("label").setAlpha(255);
  971. int pos = stringToInteger(getToken(getId(), ".", 1));
  972. int rating = System.getCurrentTrackRating();
  973. star1.hide();
  974. star2.hide();
  975. star3.hide();
  976. star4.hide();
  977. star5.hide();
  978. if (pos >= 1) star1.show();
  979. if (pos >= 2) star2.show();
  980. if (pos >= 3) star3.show();
  981. if (pos >= 4) star4.show();
  982. if (pos >= 5) star5.show();
  983. if (pos > rating)
  984. {
  985. for ( int i = 1; i <= 5; i++ )
  986. {
  987. guiobject o = ratingStars.enumItem(i-1);
  988. if ( i > pos || i <= rating)
  989. {
  990. o.setAlpha(255);
  991. }
  992. else
  993. {
  994. o.setAlpha(0);
  995. }
  996. }
  997. }
  998. else
  999. {
  1000. rate1.setAlpha(255);
  1001. rate2.setAlpha(255);
  1002. rate3.setAlpha(255);
  1003. rate4.setAlpha(255);
  1004. rate5.setAlpha(255);
  1005. }
  1006. }
  1007. RatingButton.onLeaveArea ()
  1008. {
  1009. RatingButton.getParent().findObject("label").setAlpha(180);
  1010. star1.hide();
  1011. star2.hide();
  1012. star3.hide();
  1013. star4.hide();
  1014. star5.hide();
  1015. rate1.setAlpha(255);
  1016. rate2.setAlpha(255);
  1017. rate3.setAlpha(255);
  1018. rate4.setAlpha(255);
  1019. rate5.setAlpha(255);
  1020. }
  1021. refreshRating (int rating)
  1022. {
  1023. rate1.setActivated(rating >= 1);
  1024. rate2.setActivated(rating >= 2);
  1025. rate3.setActivated(rating >= 3);
  1026. rate4.setActivated(rating >= 4);
  1027. rate5.setActivated(rating >= 5);
  1028. }
  1029. RatingButton.onRightButtonUp (int x, int y)
  1030. {
  1031. popupmenu rmenu = new popupmenu;
  1032. rmenu.addcommand("Remove Rating", 1, 0,0);
  1033. int result = rmenu.popAtMouse();
  1034. if (result == 1)
  1035. {
  1036. setCurrentTrackRating(0);
  1037. refreshRating(0);
  1038. }
  1039. complete;
  1040. }
  1041. t_rating.onTextChanged (String newtxt)
  1042. {
  1043. int w = t_rating.getAutoWidth();
  1044. group g = g_rating.findObject("infodisplay.line.rating.stars");
  1045. g.setXmlParam("x", integerToString(w));
  1046. g.setXmlParam("w", integerToString(-w));
  1047. rate0.setXmlParam("w", integerToString(w));
  1048. }
  1049. //----------------------------------------------------------------------------------------------------------------
  1050. // Winamp Branding
  1051. //----------------------------------------------------------------------------------------------------------------
  1052. showBranding()
  1053. {
  1054. // stop cycler and hide all infolines
  1055. cycler.stop();
  1056. g_cover.setAlpha(0);
  1057. g_rating.hide();
  1058. g_title.hide();
  1059. g_album.hide();
  1060. g_artist.hide();
  1061. g_year.hide();
  1062. g_genre.hide();
  1063. g_track.hide();
  1064. g_publisher.hide();
  1065. g_composer.hide();
  1066. g_format.hide();
  1067. g_albumartist.hide();
  1068. g_surl.hide();
  1069. g_sname.hide();
  1070. g_disc.hide();
  1071. if (ic_vis_fileinfo.getData() == "1")
  1072. {
  1073. _BrandingsetXSpace((g_cover.getGuiW() + 2) / 2);
  1074. _BrandingsetWSpace(-2);
  1075. }
  1076. else
  1077. {
  1078. _BrandingsetXSpace(2);
  1079. _BrandingsetWSpace(-2);
  1080. }
  1081. _BrandinghandleResize();
  1082. l_branding.show();
  1083. }
  1084. _BrandingsizeError (boolean iserror)
  1085. {
  1086. if (iserror)
  1087. {
  1088. l_branding.setAlpha(0);
  1089. }
  1090. else
  1091. {
  1092. l_branding.setAlpha(255);
  1093. }
  1094. }
  1095. // Hide branding of we start playback
  1096. System.onPlay ()
  1097. {
  1098. if (ic_fileinfo.getData() == "1" && removePath(getPlayItemString()) == "demo.mp3")
  1099. {
  1100. if (getPlayitemmetadatastring("artist") == "DJ Mike Llama" && getplayitemmetadatastring("title") == "Llama Whippin' Intro")
  1101. {
  1102. showBranding();
  1103. return;
  1104. }
  1105. }
  1106. refreshRating(System.getCurrentTrackRating());
  1107. loadFileInfo();
  1108. }
  1109. ic_fileinfo.onDataChanged ()
  1110. {
  1111. if (getData() == "0")
  1112. {
  1113. cycler.stop();
  1114. l_branding.hide();
  1115. }
  1116. else if (l_branding.isVisible())
  1117. {
  1118. showBranding();
  1119. }
  1120. else
  1121. {
  1122. loadFileInfo();
  1123. }
  1124. }
  1125. ic_cover_fileinfo.onDataChanged ()
  1126. {
  1127. if (l_branding.isVisible())
  1128. {
  1129. showBranding();
  1130. }
  1131. }
  1132. ic_vis_fileinfo.onDataChanged ()
  1133. {
  1134. if (l_branding.isVisible())
  1135. {
  1136. showBranding();
  1137. }
  1138. }
  1139. getTextHeight (InfoLine gn)
  1140. {
  1141. return stringToInteger(gn.getXmlParam("h"));
  1142. }