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