attribs.m 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. #ifndef included
  2. #error This script can only be compiled as a #include
  3. #endif
  4. #ifndef __ATTRIBS_M
  5. #define __ATTRIBS_M
  6. #include <lib/config.mi>
  7. // -----------------------------------------------------------------------------------------------------------------
  8. // this is the page that maps its items to the options menu, you can add attribs or more pages (submenus)
  9. #define CUSTOM_OPTIONSMENU_ITEMS "{1828D28F-78DD-4647-8532-EBA504B8FC04}"
  10. // this is the page that maps its items to the windows menu (aka View), you can add attribs or more pages (submenus)
  11. #define CUSTOM_WINDOWSMENU_ITEMS "{6559CA61-7EB2-4415-A8A9-A2AEEF762B7F}"
  12. // custom options submenu item page, you can add more, just use guidgen and Config.newItem()
  13. #define CUSTOM_PAGE "{26E26319-AECA-4433-B8F1-F4A5BF2A9ED5}"
  14. // drawer config page
  15. #define CUSTOM_PAGE_DRAWER "{C338B30F-2A04-4b10-871F-4E9D52D62806}"
  16. // menubars config page
  17. #define CUSTOM_PAGE_MENUBARS "{12ED320E-6813-45ac-9F8E-78EE5B2B5F6D}"
  18. // main windowshade config page
  19. #define CUSTOM_PAGE_WINDOWSHADE "{58F07E21-AE96-4899-B7BC-3640B40029FB}"
  20. // vis button config page
  21. #define CUSTOM_PAGE_VISCMD "{D70E3ABF-D2FF-4b82-9A70-4B5DF1A5D942}"
  22. // notifier config page
  23. #define CUSTOM_PAGE_NOTIFIER "{1AB968B3-8687-4a35-BA70-FCF6D92FB57F}"
  24. // songticker config page
  25. #define CUSTOM_PAGE_SONGTICKER "{7061FDE0-0E12-11D8-BB41-0050DA442EF3}"
  26. // non exposed attribs page
  27. #define CUSTOM_PAGE_NONEXPOSED "{E9C2D926-53CA-400f-9A4D-85E31755A4CF}"
  28. // -----------------------------------------------------------------------------------------------------------------
  29. Function initAttribs();
  30. // -----------------------------------------------------------------------------------------------------------------
  31. Global ConfigAttribute scrolldrawerattrib;
  32. Global ConfigAttribute scrollconfigdrawerattrib;
  33. Global ConfigAttribute vis_detach_attrib;
  34. Global ConfigAttribute video_detach_attrib;
  35. Global ConfigAttribute drawer_directiontop_attrib;
  36. Global ConfigAttribute drawer_directionbottom_attrib;
  37. Global ConfigAttribute drawer_directionbypass_attrib;
  38. Global ConfigAttribute eq_visible_attrib, albumart_visible_attrib;
  39. Global ConfigAttribute menubar_main_attrib;
  40. Global ConfigAttribute menubar_pe_attrib;
  41. Global ConfigAttribute menubar_ml_attrib;
  42. Global ConfigAttribute windowshade_linkall_attrib;
  43. Global ConfigAttribute windowshade_linkposition_attrib;
  44. Global ConfigAttribute windowshade_linknone_attrib;
  45. Global ConfigAttribute beatvisualization_attrib;
  46. Global ConfigAttribute viscmd_config_attrib;
  47. Global ConfigAttribute viscmd_menu_attrib;
  48. Global ConfigAttribute notifier_minimized_attrib;
  49. Global ConfigAttribute notifier_windowshade_attrib;
  50. Global ConfigAttribute notifier_always_attrib;
  51. Global ConfigAttribute notifier_never_attrib;
  52. Global ConfigAttribute notifier_fadeintime_attrib;
  53. Global ConfigAttribute notifier_fadeouttime_attrib;
  54. Global ConfigAttribute notifier_holdtime_attrib;
  55. Global ConfigAttribute notifier_disablefullscreen_attrib;
  56. //Global ConfigAttribute notifier_opennowplaying_attrib;
  57. Global ConfigAttribute notifier_artworkinnotification_attrib;
  58. Class ConfigAttribute songticker_scrolling_attrib;
  59. Global songticker_scrolling_attrib songticker_scrolling_modern_attrib;
  60. Global songticker_scrolling_attrib songticker_scrolling_classic_attrib;
  61. Global songticker_scrolling_attrib songticker_scrolling_disabled_attrib;
  62. // -----------------------------------------------------------------------------------------------------------------
  63. initAttribs() {
  64. // create the custom cfgpage for this session (if it does exist, it just returns it)
  65. ConfigItem custom_page = Config.newItem("Winamp Modern", CUSTOM_PAGE);
  66. ConfigItem custom_page_drawer = Config.newItem("Drawers", CUSTOM_PAGE_DRAWER);
  67. ConfigItem custom_page_menubars = Config.newItem("Menus", CUSTOM_PAGE_MENUBARS);
  68. ConfigItem custom_page_windowshade = Config.newItem("Main Windowshade Mode", CUSTOM_PAGE_WINDOWSHADE);
  69. ConfigItem custom_page_viscmd = Config.newItem("Vis Buttons", CUSTOM_PAGE_VISCMD);
  70. ConfigItem custom_page_notifier = Config.newItem("Notifications", CUSTOM_PAGE_NOTIFIER);
  71. ConfigItem custom_page_songticker = Config.newItem("Songticker", CUSTOM_PAGE_SONGTICKER);
  72. ConfigItem custom_page_nonexposed = Config.newItem("Hidden", CUSTOM_PAGE_NONEXPOSED);
  73. // load up the cfgpage in which we'll insert our custom page
  74. ConfigItem custom_options_page = Config.getItem(CUSTOM_OPTIONSMENU_ITEMS);
  75. ConfigItem custom_windows_page = Config.getItem(CUSTOM_WINDOWSMENU_ITEMS);
  76. // this creates a submenu for this attribute
  77. ConfigAttribute submenuattrib = custom_options_page.newAttribute("Winamp Modern", "");
  78. submenuattrib.setData(CUSTOM_PAGE); // discard any default value and point at our custom cfgpage
  79. ConfigAttribute drawersubmenu = custom_page.newAttribute("Drawers", "");
  80. drawersubmenu.setData(CUSTOM_PAGE_DRAWER);
  81. ConfigAttribute menubarssubmenu = custom_page.newAttribute("Menus", "");
  82. menubarssubmenu.setData(CUSTOM_PAGE_MENUBARS);
  83. ConfigAttribute windowshadesubmenu = custom_page.newAttribute("Main Windowshade Mode", "");
  84. windowshadesubmenu.setData(CUSTOM_PAGE_WINDOWSHADE);
  85. ConfigAttribute viscmdsubmenu = custom_page.newAttribute("Vis Shortcut Button", "");
  86. viscmdsubmenu.setData(CUSTOM_PAGE_VISCMD);
  87. ConfigAttribute notifiersubmenu = custom_page.newAttribute("Notifications", "");
  88. notifiersubmenu.setData(CUSTOM_PAGE_NOTIFIER);
  89. ConfigAttribute songtickersubmenu = custom_page.newAttribute("Songticker", "");
  90. songtickersubmenu.setData(CUSTOM_PAGE_SONGTICKER);
  91. scrolldrawerattrib = custom_page_drawer.newAttribute("Animate Video/Vis Drawer (disabled if opacity < 100%)", "0");
  92. scrollconfigdrawerattrib = custom_page_drawer.newAttribute("Animate Config Drawer", "0");
  93. ConfigAttribute sep = custom_page_drawer.newAttribute("sep1", ""); sep.setData("-");
  94. drawer_directiontop_attrib = custom_page_drawer.newAttribute("Open Video/Vis from the top", "0");
  95. drawer_directionbottom_attrib = custom_page_drawer.newAttribute("Open Video/Vis from the bottom", "1");
  96. drawer_directionbypass_attrib = custom_page_drawer.newAttribute("Bypass setting to keep in screen", "1");
  97. if (drawer_directiontop_attrib.getData() == "1") drawer_directiontop_attrib.onDataChanged(); else drawer_directionbottom_attrib.onDataChanged();
  98. menubar_main_attrib = custom_page_menubars.newAttribute("Show Menus in Main Window", "1");
  99. menubar_pe_attrib = custom_page_menubars.newAttribute("Show Menus in Playlist Editor", "1");
  100. menubar_ml_attrib = custom_page_menubars.newAttribute("Show Menus in Media Library", "1");
  101. // create an attribute for each of our options, if the attribute already exists, it is returned
  102. sep = custom_page.newAttribute("sep1", ""); sep.setData("-");
  103. vis_detach_attrib = custom_page.newAttribute("Detach Vis Window", "0");
  104. video_detach_attrib = custom_page.newAttribute("Detach Video Window", "0");
  105. eq_visible_attrib = custom_windows_page.newAttribute("Equalizer\tAlt+G", "0");
  106. albumart_visible_attrib = custom_windows_page.newAttribute("Album Art\tAlt+A", "1");
  107. sep = custom_page.newAttribute("sep2", ""); sep.setData("-");
  108. beatvisualization_attrib = custom_page.newAttribute("Enable Beat Visualization", "1");
  109. windowshade_linkall_attrib = custom_page_windowshade.newAttribute("Link Position and Width", "1");
  110. windowshade_linkposition_attrib = custom_page_windowshade.newAttribute("Link Position, Unlink Width", "0");
  111. windowshade_linknone_attrib = custom_page_windowshade.newAttribute("Unlink Position and Width", "0");
  112. viscmd_menu_attrib = custom_page_viscmd.newAttribute("Open Context Menu", "1");
  113. viscmd_config_attrib = custom_page_viscmd.newAttribute("Open Configuration", "0");
  114. notifier_always_attrib = custom_page_notifier.newAttribute("Show always", "0");
  115. notifier_windowshade_attrib = custom_page_notifier.newAttribute("Show with windowshade and when minimized", "0");
  116. notifier_minimized_attrib = custom_page_notifier.newAttribute("Show only when minimized", "0");
  117. notifier_never_attrib = custom_page_notifier.newAttribute("Never show", "1");
  118. sep = custom_page_notifier.newAttribute("sep1", ""); sep.setData("-");
  119. notifier_disablefullscreen_attrib = custom_page_notifier.newAttribute("Disable in fullscreen", "1");
  120. sep = custom_page_notifier.newAttribute("sep666", ""); sep.setData("-");
  121. //notifier_opennowplaying_attrib = custom_page_notifier.newAttribute("Open Now Playing on Click", "1");
  122. sep = custom_page_notifier.newAttribute("sep333", ""); sep.setData("-");
  123. notifier_artworkinnotification_attrib = custom_page_notifier.newAttribute("Show Now Playing Artwork", "1");
  124. notifier_fadeintime_attrib = custom_page_nonexposed.newAttribute("Notifications fade in time", "1000");
  125. notifier_fadeouttime_attrib = custom_page_nonexposed.newAttribute("Notifications fade out time", "5000");
  126. notifier_holdtime_attrib = custom_page_nonexposed.newAttribute("Notifications display time", "2000");
  127. songticker_scrolling_disabled_attrib = custom_page_songticker.newAttribute("Disable Songticker scrolling", "0");
  128. if (songticker_scrolling_disabled_attrib.getData() == "0") songticker_scrolling_modern_attrib = custom_page_songticker.newAttribute("Modern Songticker scrolling", "1");
  129. else songticker_scrolling_modern_attrib = custom_page_songticker.newAttribute("Modern Songticker scrolling", "0");
  130. songticker_scrolling_classic_attrib = custom_page_songticker.newAttribute("Classic Songticker scrolling", "0");
  131. }
  132. // -----------------------------------------------------------------------------------------------------------------
  133. #ifdef MAIN_ATTRIBS_MGR
  134. Global Int attribs_mychange;
  135. #define NOOFF if (getData()=="0") { setData("1"); return; }
  136. drawer_directiontop_attrib.onDataChanged() {
  137. if (attribs_mychange) return;
  138. NOOFF
  139. attribs_mychange = 1;
  140. drawer_directionbottom_attrib.setData("0");
  141. drawer_directiontop_attrib.setData("1");
  142. attribs_mychange = 0;
  143. }
  144. drawer_directionbottom_attrib.onDataChanged() {
  145. if (attribs_mychange) return;
  146. NOOFF
  147. attribs_mychange = 1;
  148. drawer_directiontop_attrib.setData("0");
  149. drawer_directionbottom_attrib.setData("1");
  150. attribs_mychange = 0;
  151. }
  152. windowshade_linkall_attrib.onDataChanged() {
  153. if (attribs_mychange) return;
  154. NOOFF
  155. attribs_mychange = 1;
  156. windowshade_linkposition_attrib.setData("0");
  157. windowshade_linknone_attrib.setData("0");
  158. attribs_mychange = 0;
  159. }
  160. windowshade_linkposition_attrib.onDataChanged() {
  161. if (attribs_mychange) return;
  162. NOOFF
  163. attribs_mychange = 1;
  164. windowshade_linkall_attrib.setData("0");
  165. windowshade_linknone_attrib.setData("0");
  166. attribs_mychange = 0;
  167. }
  168. windowshade_linknone_attrib.onDataChanged() {
  169. if (attribs_mychange) return;
  170. NOOFF
  171. attribs_mychange = 1;
  172. windowshade_linkall_attrib.setData("0");
  173. windowshade_linkposition_attrib.setData("0");
  174. attribs_mychange = 0;
  175. }
  176. viscmd_menu_attrib.onDataChanged() {
  177. if (attribs_mychange) return;
  178. NOOFF
  179. attribs_mychange = 1;
  180. viscmd_config_attrib.setData("0");
  181. attribs_mychange = 0;
  182. updateVisCmd();
  183. }
  184. viscmd_config_attrib.onDataChanged() {
  185. if (attribs_mychange) return;
  186. NOOFF
  187. attribs_mychange = 1;
  188. viscmd_menu_attrib.setData("0");
  189. attribs_mychange = 0;
  190. updateVisCmd();
  191. }
  192. notifier_always_attrib.onDataChanged() {
  193. if (attribs_mychange) return;
  194. NOOFF
  195. attribs_mychange = 1;
  196. notifier_never_attrib.setData("0");
  197. notifier_windowshade_attrib.setData("0");
  198. notifier_minimized_attrib.setData("0");
  199. attribs_mychange = 0;
  200. }
  201. notifier_never_attrib.onDataChanged() {
  202. if (attribs_mychange) return;
  203. NOOFF
  204. attribs_mychange = 1;
  205. notifier_always_attrib.setData("0");
  206. notifier_windowshade_attrib.setData("0");
  207. notifier_minimized_attrib.setData("0");
  208. attribs_mychange = 0;
  209. }
  210. notifier_minimized_attrib.onDataChanged() {
  211. if (attribs_mychange) return;
  212. NOOFF
  213. attribs_mychange = 1;
  214. notifier_never_attrib.setData("0");
  215. notifier_windowshade_attrib.setData("0");
  216. notifier_always_attrib.setData("0");
  217. attribs_mychange = 0;
  218. }
  219. notifier_windowshade_attrib.onDataChanged() {
  220. if (attribs_mychange) return;
  221. NOOFF
  222. attribs_mychange = 1;
  223. notifier_never_attrib.setData("0");
  224. notifier_always_attrib.setData("0");
  225. notifier_minimized_attrib.setData("0");
  226. attribs_mychange = 0;
  227. }
  228. songticker_scrolling_modern_attrib.onDataChanged() {
  229. if (attribs_mychange) return;
  230. NOOFF
  231. attribs_mychange = 1;
  232. songticker_scrolling_disabled_attrib.setData("0");
  233. songticker_scrolling_classic_attrib.setData("0");
  234. attribs_mychange = 0;
  235. }
  236. songticker_scrolling_disabled_attrib.onDataChanged() {
  237. if (attribs_mychange) return;
  238. NOOFF
  239. attribs_mychange = 1;
  240. songticker_scrolling_modern_attrib.setData("0");
  241. songticker_scrolling_classic_attrib.setData("0");
  242. attribs_mychange = 0;
  243. }
  244. songticker_scrolling_classic_attrib.onDataChanged() {
  245. if (attribs_mychange) return;
  246. NOOFF
  247. attribs_mychange = 1;
  248. songticker_scrolling_modern_attrib.setData("0");
  249. songticker_scrolling_disabled_attrib.setData("0");
  250. attribs_mychange = 0;
  251. }
  252. #endif
  253. #endif