suicore.m 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. /*---------------------------------------------------
  2. -----------------------------------------------------
  3. Filename: suicore.m
  4. Version: 4.4
  5. Type: maki
  6. Date: 02. Sep. 2007 - 17:35
  7. Author: Martin Poehlmann aka Deimos
  8. E-Mail: [email protected]
  9. Internet: www.skinconsortium.com
  10. www.martin.deimos.de.vu
  11. Note: This script is based on drawer.m
  12. from Winamp Modern, but extended to
  13. 4 components that can be closed!
  14. Like in drawer.m I warn everybody not
  15. to modify this script, cause it can be
  16. harmed very fast! And you don't want
  17. a buggy winamp skin, want you?
  18. Since script version 3.1
  19. (onesie build #022)
  20. the script is devided into subscripts
  21. for better debugging.
  22. -----------------------------------------------------
  23. ---------------------------------------------------*/
  24. #include <lib/std.mi>
  25. #include <lib/config.mi>
  26. #include <lib/winampconfig.mi>
  27. #include attribs/init_windowpage.m
  28. #include attribs/init_Autoresize.m
  29. #include attribs/init_vis.m
  30. #include attribs/init_appearance.m
  31. // #define DEBUG
  32. #define FILE_NAME "suicore.m"
  33. #include <lib/com/debug.m>
  34. #define ML_GUID "{6B0EDF80-C9A5-11D3-9F26-00C04F39FFC6}"
  35. #define VIS_GUID "{0000000A-000C-0010-FF7B-01014263450C}"
  36. #define VIDEO_GUID "{F0816D7B-FFFC-4343-80F2-E8199AA15CC3}"
  37. #define PL_GUID "{45F3F7C1-A6F3-4EE6-A15E-125E92FC3F8D}"
  38. Function switchToMl();
  39. Function switchToPl();
  40. Function switchToVideo();
  41. Function switchToVis();
  42. //--Function switchToBrw();
  43. //--Function switchToExp();
  44. //--Function switchToCfg();
  45. Function switchToNoComp();
  46. Function switchFromNoComp();
  47. Function hideMl();
  48. Function showMl();
  49. Function hidePl();
  50. Function showPl();
  51. Function hideVis();
  52. Function showVis();
  53. Function showVideo();
  54. Function hideVideo();
  55. //--Function hideExp();
  56. //--Function showExp();
  57. //--Function hideBrw();
  58. //--Function showBrw();
  59. //--Function hideCfg();
  60. //--Function showCfg();
  61. Function onShowMl();
  62. Function onHideMl();
  63. Function onShowPl();
  64. Function onHidePl();
  65. Function onShowVis();
  66. Function onHideVis();
  67. Function onShowVideo();
  68. Function onHideVideo();
  69. //--Function onShowExp();
  70. //--Function onHideExp();
  71. //--Function onShowBrw();
  72. //--Function onHideBrw();
  73. //--Function onShowCfg();
  74. //--Function onHideCfg();
  75. Function onShowSUI();
  76. Function onHideSUI();
  77. Function onBeforeHideSUI();
  78. Function dc_showMl();
  79. Function dc_hideMl();
  80. Function dc_showPl();
  81. Function dc_hidePl();
  82. Function dc_showVis();
  83. Function dc_showVideo();
  84. Function dc_hideVis();
  85. Function dc_hideVideo();
  86. //--Function dc_showExp();
  87. //--Function dc_hideExp();
  88. //--Function dc_showBrw();
  89. //--Function dc_hideBrw();
  90. //--Function dc_showCfg();
  91. //--Function dc_hideCfg();
  92. Function dc_showSUI();
  93. Function dc_closeSUI();
  94. Global GuiObject sui_window;
  95. Global Group sui_components;
  96. Global Group sui_vis, sui_video, sui_ml, sui_pl /*--, sui_brw, sui_exp, sui_cfg--*/;
  97. Global WindowHolder sui_vis_wdh;
  98. Global Button switch_ml, switch_pl, switch_video, switch_vis /*--, switch_exp, switch_brw, switch_cfg--*/;
  99. Global Button hide_sui, show_sui;
  100. Global Boolean bypasscancel;
  101. Global Boolean showing_vis, hiding_vis, showing_video, hiding_video, showing_ml, hiding_ml, showing_pl, hiding_pl;
  102. /*--Global Boolean showing_exp, hiding_exp, showing_brw, hiding_brw, showing_cfg, hiding_cfg;--*/
  103. Global Int play_auto_fs_video;
  104. Global Boolean callback_showing_vis, callback_hiding_vis, callback_showing_video, callback_hiding_video, callback_showing_ml, callback_hiding_ml, callback_showing_pl, callback_hiding_pl;
  105. /*--Global Boolean callback_showing_exp, callback_hiding_exp, callback_showing_brw, callback_hiding_brw, callback_showing_cfg, callback_hiding_cfg;--*/
  106. Global Boolean callback_closing_sui, callback_showing_sui;
  107. Global Layout normal;
  108. Global Container player;
  109. Global Boolean Mychange;
  110. Global Boolean startup;
  111. Global layer normal_resizer, normal_resizer2, normal_resizer3, normal_resizer4, normal_TBresizer, normal_TBresizer2, normal_TBresizer3;
  112. Global string h;
  113. Global Timer callbackTimer, tempDisable;
  114. Global button pe_move_top;
  115. //Global Button b_maximize, b_minimize, b_shade;
  116. // init special handles for video
  117. #include suicore/video_handles.m
  118. // script loading/unloading goes here
  119. #include suicore/load_handles.m
  120. // open / hiding components not caused by button clicks
  121. #include suicore/external_handles.m
  122. // showing and hiding the components
  123. #include suicore/show_hide.m
  124. /** Button Clicks */
  125. switch_video.onLeftClick ()
  126. {
  127. debugString("switch_video.Clicked()", D_WTF);
  128. switchToVideo();
  129. }
  130. switch_vis.onLeftClick ()
  131. {
  132. debugString("switch_vis.Clicked()", D_WTF);
  133. vis_inbig_attrib.setData("1");
  134. switchToVis();
  135. }
  136. switch_ml.onLeftClick ()
  137. {
  138. debugString("switch_ml.Clicked()", D_WTF);
  139. switchToMl();
  140. }
  141. switch_pl.onLeftClick ()
  142. {
  143. debugString("switch_pl.Clicked()", D_WTF);
  144. switchToPl();
  145. }
  146. /*--
  147. switch_brw.onLeftClick ()
  148. {
  149. debugString("switch_brw.Clicked()", D_WTF);
  150. switchToBrw();
  151. }
  152. --*/
  153. /*--
  154. switch_exp.onLeftClick ()
  155. {
  156. debugString("switch_exp.Clicked()", D_WTF);
  157. switchToExp();
  158. }
  159. --*/
  160. /*--switch_cfg.onLeftClick ()
  161. {
  162. debugString("switch_cfg.Clicked()", D_WTF);
  163. switchToCfg();
  164. }--*/
  165. show_sui.onLeftClick ()
  166. {
  167. debugString("show_sui.Clicked()", D_WTF);
  168. switchFromNoComp();
  169. }
  170. hide_sui.onLeftClick ()
  171. {
  172. debugString("hide_sui.Clicked()", D_WTF);
  173. switchToNoComp();
  174. }
  175. /** Calls after comp is shown */
  176. onShowMl()
  177. {
  178. switch_ml.setActivated(1);
  179. switch_pl.setActivated(0);
  180. switch_vis.setActivated(0);
  181. switch_video.setActivated(0);
  182. //--switch_brw.setActivated(0);
  183. //--switch_exp.setActivated(0);
  184. switch_ml.setXmlParam("ghost", "1");
  185. switch_pl.setXmlParam("ghost", "0");
  186. switch_video.setXmlParam("ghost", "0");
  187. switch_vis.setXmlParam("ghost", "0");
  188. //--switch_brw.setXmlParam("ghost", "0");
  189. //--switch_Cfg.setActivated(0);
  190. }
  191. onHideMl() {
  192. //switch_ml.setXmlParam("ghost", "0");
  193. }
  194. onShowPl()
  195. {
  196. switch_ml.setActivated(0);
  197. switch_pl.setActivated(1);
  198. switch_vis.setActivated(0);
  199. switch_video.setActivated(0);
  200. //--switch_brw.setActivated(0);
  201. //--switch_exp.setActivated(0);
  202. switch_ml.setXmlParam("ghost", "0");
  203. switch_pl.setXmlParam("ghost", "1");
  204. switch_video.setXmlParam("ghost", "0");
  205. switch_vis.setXmlParam("ghost", "0");
  206. //--switch_brw.setXmlParam("ghost", "0");
  207. //--switch_Cfg.setActivated(0);
  208. }
  209. onHidePl() {
  210. //switch_ml.setXmlParam("ghost", "0");
  211. }
  212. onShowVis()
  213. {
  214. switch_ml.setActivated(0);
  215. switch_pl.setActivated(0);
  216. switch_vis.setActivated(1);
  217. switch_video.setActivated(0);
  218. //--switch_brw.setActivated(0);
  219. //--switch_exp.setActivated(0);
  220. switch_vis.setXmlParam("ghost", "1");
  221. switch_video.setXmlParam("ghost", "0");
  222. switch_ml.setXmlParam("ghost", "0");
  223. switch_pl.setXmlParam("ghost", "0");
  224. //--switch_brw.setXmlParam("ghost", "0");
  225. //hideNamedWindow(ML_GUID);
  226. //--switch_Cfg.setActivated(0);
  227. }
  228. onHideVis() {
  229. //switch_vis.setXmlParam("ghost", "0");
  230. }
  231. onShowVideo()
  232. {
  233. switch_ml.setActivated(0);
  234. switch_pl.setActivated(0);
  235. switch_vis.setActivated(0);
  236. switch_video.setActivated(1);
  237. //--switch_brw.setActivated(0);
  238. //--switch_exp.setActivated(0);
  239. switch_video.setXmlParam("ghost", "1");
  240. switch_vis.setXmlParam("ghost", "0");
  241. switch_ml.setXmlParam("ghost", "0");
  242. switch_pl.setXmlParam("ghost", "0");
  243. //--switch_brw.setXmlParam("ghost", "0");
  244. //hideNamedWindow(ML_GUID);
  245. //--switch_Cfg.setActivated(0);
  246. }
  247. onHideVideo() {
  248. //switch_video.setXmlParam("ghost", "0");
  249. }
  250. /*--
  251. onShowBrw()
  252. {
  253. switch_ml.setActivated(0);
  254. switch_pl.setActivated(0);
  255. switch_vis.setActivated(0);
  256. switch_video.setActivated(0);
  257. switch_brw.setActivated(1);
  258. switch_exp.setActivated(0);
  259. switch_brw.setXmlParam("ghost", "1");
  260. switch_vis.setXmlParam("ghost", "0");
  261. switch_ml.setXmlParam("ghost", "0");
  262. switch_pl.setXmlParam("ghost", "0");
  263. switch_video.setXmlParam("ghost", "0");
  264. hideNamedWindow(ML_GUID);
  265. switch_Cfg.setActivated(0);
  266. }
  267. onHideBrw() {
  268. switch_brw.setXmlParam("ghost", "0");
  269. }
  270. --*/
  271. /*--
  272. onShowExp()
  273. {
  274. switch_ml.setActivated(0);
  275. switch_vis.setActivated(0);
  276. switch_video.setActivated(0);
  277. switch_brw.setActivated(0);
  278. //--switch_exp.setActivated(1);
  279. //--switch_exp.setXmlParam("ghost", "1");
  280. //hideNamedWindow(ML_GUID);
  281. //--switch_Cfg.setActivated(0);
  282. }
  283. onHideExp() {
  284. switch_exp.setXmlParam("ghost", "0");
  285. }
  286. --*/
  287. /*--onShowCfg()
  288. {
  289. switch_ml.setActivated(0);
  290. switch_vis.setActivated(0);
  291. switch_video.setActivated(0);
  292. switch_brw.setActivated(0);
  293. switch_exp.setActivated(0);
  294. //--switch_Cfg.setActivated(1);
  295. }
  296. onHideCfg() {}--*/
  297. onShowSUI ()
  298. {
  299. /*string x = b_shade.getXmlParam("x");
  300. b_shade.setXmlParam("x", b_minimize.getXmlParam("x"));
  301. b_minimize.setXmlParam("x", b_maximize.getXmlParam("x"));
  302. b_maximize.setXmlParam("x", x);
  303. b_maximize.show();*/
  304. sui_window.sendAction("callback", "onshowsui", 0,0,0,0);
  305. }
  306. onHideSUI ()
  307. {
  308. //hideNamedWindow(ML_GUID);
  309. /*string x = b_minimize.getXmlParam("x");
  310. debugInt(b_shade.getGuiX());
  311. b_minimize.setXmlParam("x", b_shade.getXmlParam("x"));
  312. b_shade.setXmlParam("x", b_maximize.getXmlParam("x"));
  313. b_maximize.setXmlParam("x", x);
  314. b_maximize.hide();*/
  315. // sui_window.sendAction("callback", "onhidesui", 0,0,0,0);
  316. }
  317. onBeforeHideSUI ()
  318. {
  319. //hideNamedWindow(ML_GUID);
  320. /*string x = b_minimize.getXmlParam("x");
  321. debugInt(b_shade.getGuiX());
  322. b_minimize.setXmlParam("x", b_shade.getXmlParam("x"));
  323. b_shade.setXmlParam("x", b_maximize.getXmlParam("x"));
  324. b_maximize.setXmlParam("x", x);
  325. b_maximize.hide();*/
  326. sui_window.sendAction("callback", "onbeforehidesui", 0,0,0,0);
  327. }
  328. pe_move_top.onLeftClick ()
  329. {
  330. normal.sendAction("load_comp", "pledit", 0,0,0,0);
  331. }
  332. #ifdef DEBUG
  333. /** Debug Stuff */
  334. sui_ml.onSetVisible (Boolean onoff)
  335. {
  336. debugString(DEBUG_PREFIX "sui_ml.setVisible(" +integerToString(onoff)+ ");", D_WTF);
  337. }
  338. sui_vis.onSetVisible (Boolean onoff)
  339. {
  340. debugString(DEBUG_PREFIX "sui_vis.setVisible(" +integerToString(onoff)+ ");", D_WTF);
  341. }
  342. sui_video.onSetVisible (Boolean onoff)
  343. {
  344. debugString(DEBUG_PREFIX "sui_video.setVisible(" +integerToString(onoff)+ ");", D_WTF);
  345. }
  346. /*--
  347. sui_brw.onSetVisible (Boolean onoff)
  348. {
  349. debugString(DEBUG_PREFIX "sui_brw.setVisible(" +integerToString(onoff)+ ");", D_WTF);
  350. }
  351. --*/
  352. /*--
  353. sui_exp.onSetVisible (Boolean onoff)
  354. {
  355. debugString(DEBUG_PREFIX "sui_exp.setVisible(" +integerToString(onoff)+ ");", D_WTF);
  356. }--*/
  357. /*--sui_cfg.onSetVisible (Boolean onoff)
  358. {
  359. debugString(DEBUG_PREFIX "sui_cfg.setVisible(" +integerToString(onoff)+ ");", D_WTF);
  360. }--*/
  361. #endif