home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 November / CDVD1105.ISO / Util / Winamp / Skins / boxOr.wal / opensource_notifier / opensource_notifier.maki (.txt) < prev   
Winamp Compiled Maki Script  |  2004-08-29  |  11KB  |  396 lines

  1. /* Note: a decompiler is no invitation to steal code.
  2.    Please respect the the copyright */
  3.  
  4. #include "std.mi"
  5. Global Container Container11;
  6. Global Container Container12;
  7. Global Layout Layout13;
  8. Global Layout Layout14;
  9. Global Group Group15;
  10. Global Text Text16;
  11. Global Text Text17;
  12. Global Text Text18;
  13. Global Text Text19;
  14. Global Text Text20;
  15. Global Text Text21;
  16. Global Text Text22;
  17. Global Text Text23;
  18. Global Slider Slider24;
  19. Global Slider Slider25;
  20. Global Slider Slider26;
  21. Global CheckBox CheckBox27;
  22. Global CheckBox CheckBox28;
  23. Global CheckBox CheckBox29;
  24. Global Timer Timer32;
  25. Global Timer Timer33;
  26. Global Int Int34;
  27. Global Int Int36;
  28. Global Float Float37;
  29. Global Float Float38;
  30. Global Float Float39;
  31. Global String String40;
  32. Global String String41;
  33.  
  34. Function func2258();
  35. Function func2476();
  36. Function func3589();
  37. Function func4451(Float 5.87747175411144e-39, Float 5.87747175411144e-39);
  38.  
  39. System.onScriptLoaded()
  40. {
  41. Layout Layout51;
  42. Container11 = System.getContainer(( "opensource_notifier"));
  43. Container12 = System.getContainer(( "opensource_notifier_prefs"));
  44. Layout13 = Container11.getLayout(( "normal"));
  45. Layout14 = Container11.getLayout(( "normal"));
  46. Group15 = Layout13.findObject(( "notifier\.text"));
  47. Text16 = Layout13.findObject(( "artist"));
  48. Text17 = Layout13.findObject(( "title"));
  49. Text18 = Layout13.findObject(( "album"));
  50. Text19 = Layout13.findObject(( "plentry"));
  51. Text20 = Layout13.findObject(( "nexttrack"));
  52. Layout51 = Container12.getLayout(( "normal"));
  53. Text21 = Layout51.findObject(( "fadein\.text"));
  54. Text22 = Layout51.findObject(( "stay\.text"));
  55. Text23 = Layout51.findObject(( "fadeout\.text"));
  56. Slider24 = Layout51.findObject(( "fadein\.slider"));
  57. Slider25 = Layout51.findObject(( "stay\.slider"));
  58. Slider26 = Layout51.findObject(( "fadeout\.slider"));
  59. CheckBox29 = Layout51.findObject(( "fullscreen"));
  60. CheckBox27 = Layout51.findObject(( "radio\.fade"));
  61. CheckBox28 = Layout51.findObject(( "radio\.slide"));
  62. Float37 = System.getPrivateInt(( "OpenNote"), ( "FadeIn"), 6);
  63. Float38 = System.getPrivateInt(( "OpenNote"), ( "FadeOut"), 2);
  64. Float39 = System.getPrivateInt(( "OpenNote"), ( "Stay"), 16);
  65. String40 = System.getPrivateString(( "OpenNote"), ( "Effect"), ( "Fade"));
  66. if(( String40 == ( "Fade"))) {
  67. CheckBox27.setChecked(1);
  68. } else {
  69. CheckBox28.setChecked(1);
  70. }
  71. Timer32 = ( new Timer);
  72. Timer33 = ( new Timer);
  73. Timer33.setDelay(100);
  74. Slider24.setPosition(Float37);
  75. Slider26.setPosition(Float38);
  76. Slider25.setPosition(Float39);
  77. CheckBox29.setChecked(System.getPrivateInt(( "OpenNote"), ( "fullscreen"), 0));
  78. Layout13.hide();
  79. func3589();
  80. return Null;
  81. }
  82.  
  83. System.onScriptUnloading()
  84. {
  85. System.setPrivateInt(( "OpenNote"), ( "FadeIn"), ( Float37 * 4));
  86. System.setPrivateInt(( "OpenNote"), ( "FadeOut"), ( Float38 * 4));
  87. System.setPrivateInt(( "OpenNote"), ( "Stay"), ( ( Float39 * 4) / 1000));
  88. System.setPrivateString(( "OpenNote"), ( "Effect"), String40);
  89. return Null;
  90. }
  91.  
  92. CheckBox29.onToggle(int newstate)
  93. {
  94. System.setPrivateInt(( "OpenNote"), ( "fullscreen"), newstate);
  95. return Null;
  96. }
  97.  
  98. CheckBox27.onToggle(int newstate)
  99. {
  100. if(( CheckBox27.isChecked() == 1)) {
  101. String40 = ( "Fade");
  102. Slider24.setPosition(( Float37 * 4));
  103. Slider26.setPosition(( Float38 * 4));
  104. Slider25.setPosition(( ( Float39 * 4) / 1000));
  105. }
  106. return Null;
  107. }
  108.  
  109. CheckBox28.onToggle(int newstate)
  110. {
  111. if(( CheckBox28.isChecked() == 1)) {
  112. String40 = ( "Slide");
  113. Slider24.setPosition(( Float37 * 4));
  114. Slider26.setPosition(( Float38 * 4));
  115. Slider25.setPosition(( ( Float39 * 4) / 1000));
  116. if(( Int34 == 2)) {
  117. Layout13.setXmlParam(( "y"), System.integerToString(( System.getViewportHeight() + 5)));
  118. }
  119. }
  120. return Null;
  121. }
  122.  
  123. Slider24.onSetPosition(int newpos)
  124. {
  125. Text21.setText(( ( ( String40 + ( "\-in\ Time\ \(")) + System.floatToString(( newpos / 4), 1)) + ( "s\)\:")));
  126. Float37 = ( newpos / 4);
  127. return Null;
  128. }
  129.  
  130. Slider26.onSetPosition(int newpos)
  131. {
  132. Text23.setText(( ( ( String40 + ( "\-out\ Time\ \(")) + System.floatToString(( newpos / 4), 1)) + ( "s\)\:")));
  133. Float38 = ( newpos / 4);
  134. return Null;
  135. }
  136.  
  137. Slider25.onSetPosition(int newpos)
  138. {
  139. Text22.setText(( ( ( "Hold\ Time\ \(") + System.floatToString(( newpos / 4), 1)) + ( "s\)\:")));
  140. Float39 = ( ( newpos / 4) * 1000);
  141. Timer32.setDelay(Float39);
  142. return Null;
  143. }
  144.  
  145. System.onTitleChange(String newtitle)
  146. {
  147. Timer33.start();
  148. return Null;
  149. }
  150.  
  151. System.onPlay()
  152. {
  153. Timer33.start();
  154. return Null;
  155. }
  156.  
  157. System.onResume()
  158. {
  159. Timer33.start();
  160. return Null;
  161. }
  162.  
  163. Int System.onShowNotification()
  164. {
  165. Timer33.start();
  166. complete;
  167. return 1;
  168. }
  169.  
  170. Timer33.onTimer()
  171. {
  172. Timer33.stop();
  173. func2258();
  174. return Null;
  175. }
  176.  
  177. Layout13.onLeftButtonDown(int x, int y)
  178. {
  179. Container12.show();
  180. return Null;
  181. }
  182.  
  183. Layout13.onRightButtonDown(int x, int y)
  184. {
  185. Layout13.hide();
  186. return Null;
  187. }
  188.  
  189. func2258()
  190. {
  191. String String93;
  192. String93 = System.getPrivateString(( "OpenNote"), ( "Freq"), ( "Always\ Show\ Notifications"));
  193. if(( ( ( CheckBox29.isChecked() == 1) && ( System.isVideoFullscreen() == 0)) || ( CheckBox29.isChecked() == 0))) {
  194. if(( String93 == ( "Always\ Show\ Notifications"))) {
  195. func2476();
  196. func3589();
  197. func4451(Float37, Float38);
  198. }
  199. if(( ( String93 == ( "Show\ Notifications\ When\ Minimized")) && ( System.isMinimized() == 1))) {
  200. func2476();
  201. func3589();
  202. func4451(Float37, Float38);
  203. }
  204. }
  205. return Null;
  206. }
  207.  
  208. func2476()
  209. {
  210. Int Int100;
  211. Int Int102;
  212. String String99;
  213. String String112;
  214. String String107;
  215. Int Int95;
  216. String String104;
  217. String String98;
  218. Int Int103;
  219. Int95 = 0;
  220. if(( System.Strleft(System.getPlayItemString(), 7) == ( "http\:\/\/"))) {
  221. Int95 = 1;
  222. }
  223. String98 = System.integerToString(System.getPlaylistLength());
  224. String99 = System.integerToString(( System.getPlaylistIndex() + 1));
  225. if(( ! Int95)) {
  226. Int100 = ( System.getPlayItemLength() / 1000);
  227. Int102 = ( Int100 / 60);
  228. Int103 = ( Int100 - ( Int102 * 60));
  229. if(( Int103 > 10)) {
  230. String104 = ( ( "0") + System.integerToString(Int103));
  231. } else {
  232. String104 = System.integerToString(Int103);
  233. }
  234. if(( System.getPlayItemMetaDataString(( "title")) == ( ""))) {
  235. String107 = ( "\?\?\?");
  236. } else {
  237. String107 = System.getPlayItemMetaDataString(( "title"));
  238. }
  239. Text17.setXmlParam(( "ticker"), ( "1"));
  240. if(( Int100 != 0)) {
  241. String112 = ( ( System.integerToString(Int102) + ( "\:")) + String104);
  242. Text17.setText(( ( ( String107 + ( "\ \(")) + String112) + ( "\)")));
  243. } else {
  244. Text17.setText(( String107 + ( "\ \ \ \ ")));
  245. }
  246. if(( System.getPlayItemMetaDataString(( "artist")) == ( ""))) {
  247. Text16.setText(( ( "by\ ") + ( "\?\?\?")));
  248. } else {
  249. Text16.setText(( ( "by\ ") + System.getPlayItemMetaDataString(( "artist"))));
  250. }
  251. if(( System.getPlayItemMetaDataString(( "album")) == ( ""))) {
  252. Text18.setText(( ""));
  253. }
  254. if(( System.getPlayItemMetaDataString(( "album")) != ( ""))) {
  255. if(( System.getPlayItemMetaDataString(( "track")) <= ( "0"))) {
  256. Text18.setText(( ( ( System.getPlayItemMetaDataString(( "album")) + ( "\ \(Track\ ")) + System.getPlayItemMetaDataString(( "track"))) + ( "\)")));
  257. } else {
  258. Text18.setText(System.getPlayItemMetaDataString(( "album")));
  259. }
  260. } else {
  261. Text18.setText(( ""));
  262. }
  263. }
  264. if(Int95) {
  265. Text20.setText(( "On\ Air"));
  266. Text17.setXmlParam(( "ticker"), ( "1"));
  267. Text17.setXmlParam(( "display"), ( "songtitle"));
  268. Text17.setText(( ""));
  269. if(( ! System.isVideo())) {
  270. Text16.setText(( "Internet\ Radio"));
  271. } else {
  272. Text16.setText(( "Internet\ TV"));
  273. }
  274. Text18.setText(( ""));
  275. Text18.setXmlParam(( "display"), ( "songinfo"));
  276. }
  277. Text19.setText(( ( String99 + ( "\/")) + String98));
  278. return Null;
  279. }
  280.  
  281. func3589()
  282. {
  283. Int Int132;
  284. Int Int131;
  285. Int Int130;
  286. String String129;
  287. String129 = System.getPrivateString(( "Abducted_OpenNote"), ( "NotifierPosition"), ( "1\.\ Bottom\ Right"));
  288. Int130 = System.getViewportWidth();
  289. Int131 = System.getViewportHeight();
  290. Int132 = System.strlen(Text17.getText());
  291. Int36 = Text16.getAutoWidth();
  292. if(( Int36 > Text18.getAutoWidth())) {
  293. Int36 = Text18.getAutoWidth();
  294. }
  295. if(( Int36 > Text17.getAutoWidth())) {
  296. Int36 = Text17.getAutoWidth();
  297. }
  298. if(( Int36 > 128)) {
  299. Int36 = 150;
  300. }
  301. if(( Int36 < ( System.getViewportWidth() / 4))) {
  302. Int36 = ( System.getViewportWidth() / 4);
  303. }
  304. Int36 = ( Int36 + 40);
  305. if(( String129 == ( "1\.\ Bottom\ Right"))) {
  306. String41 = ( "b");
  307. Layout13.setXmlParam(( "x"), System.integerToString(( Int130 - Int36)));
  308. Layout13.setXmlParam(( "y"), System.integerToString(( Int131 - 85)));
  309. }
  310. if(( String129 == ( "2\.\ Bottom\ Left"))) {
  311. String41 = ( "b");
  312. Layout13.setXmlParam(( "x"), System.integerToString(0));
  313. Layout13.setXmlParam(( "y"), System.integerToString(( Int131 - 85)));
  314. }
  315. if(( String129 == ( "3\.\ Top\ Right"))) {
  316. String41 = ( "t");
  317. Layout13.setXmlParam(( "x"), System.integerToString(( Int130 - Int36)));
  318. Layout13.setXmlParam(( "y"), System.integerToString(0));
  319. }
  320. if(( String129 == ( "4\.\ Top\ Left"))) {
  321. String41 = ( "t");
  322. Layout13.setXmlParam(( "x"), System.integerToString(0));
  323. Layout13.setXmlParam(( "y"), System.integerToString(0));
  324. }
  325. Layout13.setXmlParam(( "h"), System.integerToString(80));
  326. Layout13.setXmlParam(( "w"), System.integerToString(Int36));
  327. return Null;
  328. }
  329.  
  330. func4451(Float 5.87747175411144e-39, Float 5.87747175411144e-39)
  331. {
  332. Int34 = 1;
  333. if(( CheckBox27.isChecked() == 1)) {
  334. Layout13.show();
  335. Layout13.setTargetA(255);
  336. Layout13.setTargetY(System.StringToInteger(Layout13.getXmlParam(( "y"))));
  337. Layout13.setTargetW(Int36);
  338. Layout13.setTargetX(System.StringToInteger(Layout13.getXmlParam(( "x"))));
  339. Layout13.setTargetSpeed(Float146);
  340. Layout13.gotoTarget();
  341. } else {
  342. Layout13.setAlpha(255);
  343. Layout13.show();
  344. Layout13.setTargetA(255);
  345. Layout13.setTargetY(System.StringToInteger(Layout13.getXmlParam(( "y"))));
  346. Layout13.setTargetW(Int36);
  347. Layout13.setTargetX(System.StringToInteger(Layout13.getXmlParam(( "x"))));
  348. Layout13.setTargetSpeed(Float146);
  349. Layout13.gotoTarget();
  350. }
  351. return Null;
  352. }
  353.  
  354. Layout13.onTargetReached()
  355. {
  356. if(( Int34 == 1)) {
  357. Timer32.start();
  358. }
  359. if(( Int34 == 2)) {
  360. Layout13.hide();
  361. }
  362. return Null;
  363. }
  364.  
  365. Timer32.onTimer()
  366. {
  367. Float Float147;
  368. Float Float146;
  369. Timer32.stop();
  370. Int34 = 2;
  371. if(( CheckBox27.isChecked() == 1)) {
  372. Layout13.setTargetA(0);
  373. Layout13.setTargetY(System.StringToInteger(Layout13.getXmlParam(( "y"))));
  374. Layout13.setTargetW(Int36);
  375. Layout13.setTargetX(System.StringToInteger(Layout13.getXmlParam(( "x"))));
  376. Layout13.setTargetSpeed(Float147);
  377. Layout13.gotoTarget();
  378. } else {
  379. Layout13.show();
  380. Layout13.setTargetA(255);
  381. if(( String41 == ( "b"))) {
  382. Layout13.setTargetY(( System.StringToInteger(Layout13.getXmlParam(( "y"))) + 90));
  383. }
  384. if(( String41 == ( "t"))) {
  385. Layout13.setTargetY(( System.StringToInteger(Layout13.getXmlParam(( "y"))) - 90));
  386. }
  387. Layout13.setTargetW(Int36);
  388. Layout13.setTargetX(System.StringToInteger(Layout13.getXmlParam(( "x"))));
  389. Layout13.setTargetSpeed(Float146);
  390. Layout13.gotoTarget();
  391. }
  392. return Null;
  393. }
  394.  
  395.  
  396.