1
0

options_classic.cpp 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. /** (c) Nullsoft, Inc. C O N F I D E N T I A L
  2. ** Filename:
  3. ** Project:
  4. ** Description:
  5. ** Author:
  6. ** Created:
  7. **/
  8. #include "main.h"
  9. #include "resource.h"
  10. #include "options.h"
  11. static HWND subWnd;
  12. static LRESULT CALLBACK ClassicUIProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam)
  13. {
  14. hi helpinfo[]={
  15. {IDC_SNAP,IDS_P_DISP_SNAP},
  16. {IDC_SNAPW,IDS_P_DISP_SNAPW},
  17. {IDC_HIGHLIGHT,IDS_P_DISP_HILITE},
  18. {IDC_CLUTTERBAR,IDS_P_DISP_CB},
  19. {IDC_TTIPS,IDS_P_DISP_TTIPS},
  20. {IDC_WA_CURSORS,IDS_P_DISP_CURSORS},
  21. {IDC_BIFONT,IDS_P_DISP_BIFONT},
  22. {IDC_BIFONT_ALT,IDS_P_DISP_BIFONT_ALT},
  23. {IDC_EQDSIZE,IDS_P_O_EQDS},
  24. {IDC_SPLB,IDS_P_O_SPLB},
  25. {IDC_CHECK2,IDS_P_DISP_FREESIZE},
  26. {IDC_KEEPONSCREEN,IDS_P_O_LITESTEP},
  27. {IDC_AOVD,IDS_P_O_AOVD},
  28. {IDC_POS_IN_SONGTICKER,IDS_P_DISP_PLPOS},
  29. };
  30. DO_HELP();
  31. switch (uMsg)
  32. {
  33. case WM_INITDIALOG:
  34. CheckDlgButton(hwndDlg,IDC_SNAP,config_snap?1:0);
  35. SetDlgItemInt(hwndDlg,IDC_SNAPW,config_snaplen,0);
  36. CheckDlgButton(hwndDlg,IDC_HIGHLIGHT,config_hilite?1:0);
  37. CheckDlgButton(hwndDlg,IDC_CLUTTERBAR,config_ascb_new?1:0);
  38. CheckDlgButton(hwndDlg,IDC_TTIPS,config_ttips?1:0);
  39. CheckDlgButton(hwndDlg,IDC_WA_CURSORS,config_usecursors?1:0);
  40. CheckDlgButton(hwndDlg,IDC_BIFONT,config_bifont?1:0);
  41. CheckDlgButton(hwndDlg,IDC_BIFONT_ALT,config_bifont_alt?1:0);
  42. CheckDlgButton(hwndDlg,IDC_SPLB,config_ospb?1:0);
  43. CheckDlgButton(hwndDlg,IDC_CHECK2,config_embedwnd_freesize?1:0);
  44. CheckDlgButton(hwndDlg,IDC_EQDSIZE,config_eqdsize?1:0);
  45. CheckDlgButton(hwndDlg,IDC_KEEPONSCREEN,(config_keeponscreen&1)?0:1);
  46. CheckDlgButton(hwndDlg,IDC_AOVD,(config_keeponscreen&2)?1:0);
  47. CheckDlgButton(hwndDlg,IDC_POS_IN_SONGTICKER,config_dotitlenum?1:0);
  48. EnableWindow(GetDlgItem(hwndDlg,IDC_BIFONT_ALT),!config_bifont);
  49. break;
  50. case WM_COMMAND:
  51. switch (LOWORD(wParam))
  52. {
  53. case IDC_CHECK2:
  54. config_embedwnd_freesize=!!IsDlgButtonChecked(hwndDlg,IDC_CHECK2);
  55. return 0;
  56. case IDC_EQDSIZE:
  57. config_eqdsize = (BST_CHECKED == IsDlgButtonChecked(hwndDlg,IDC_EQDSIZE));
  58. set_aot(0);
  59. break;
  60. case IDC_SPLB:
  61. config_ospb = (BST_CHECKED == IsDlgButtonChecked(hwndDlg,IDC_SPLB));
  62. break;
  63. case IDC_BIFONT:
  64. config_bifont = (BST_CHECKED == IsDlgButtonChecked(hwndDlg,IDC_BIFONT)) ? 1 : 0;
  65. EnableWindow(GetDlgItem(hwndDlg,IDC_BIFONT_ALT),!config_bifont);
  66. g_need_titleupd=1;
  67. InvalidateRect(hPLWindow, NULL, TRUE);
  68. break;
  69. case IDC_BIFONT_ALT:
  70. config_bifont_alt = (BST_CHECKED == IsDlgButtonChecked(hwndDlg,IDC_BIFONT_ALT)) ? 1 : 0;
  71. if (config_dsize)
  72. {
  73. draw_reinit_plfont(1);
  74. }
  75. break;
  76. case IDC_POS_IN_SONGTICKER:
  77. config_dotitlenum = IsDlgButtonChecked(hwndDlg,IDC_POS_IN_SONGTICKER)?1:0;
  78. draw_songname(FileTitle, &ui_songposition, PlayList_getcurrentlength());
  79. break;
  80. case IDC_SNAP: config_snap = IsDlgButtonChecked(hwndDlg,IDC_SNAP)?1:0; break;
  81. case IDC_SNAPW:
  82. if (HIWORD(wParam) == EN_CHANGE) {
  83. int t,a;
  84. a=GetDlgItemInt(hwndDlg,IDC_SNAPW,&t,0);
  85. if (t) config_snaplen= (unsigned char)a;
  86. }
  87. break;
  88. case IDC_HIGHLIGHT: config_hilite = IsDlgButtonChecked(hwndDlg,IDC_HIGHLIGHT)?1:0; set_aot(0); break;
  89. case IDC_CLUTTERBAR:
  90. config_ascb_new = IsDlgButtonChecked(hwndDlg,IDC_CLUTTERBAR)?1:0;
  91. if (hMainWindow) draw_clutterbar(0);
  92. break;
  93. case IDC_TTIPS:
  94. config_ttips = IsDlgButtonChecked(hwndDlg,IDC_TTIPS)?1:0;
  95. set_aot(0);
  96. break;
  97. case IDC_WA_CURSORS:
  98. config_usecursors = IsDlgButtonChecked(hwndDlg,IDC_WA_CURSORS)?1:0;
  99. break;
  100. case IDC_KEEPONSCREEN:
  101. case IDC_AOVD:
  102. {
  103. config_keeponscreen = IsDlgButtonChecked(hwndDlg,IDC_KEEPONSCREEN)?0:1;
  104. config_keeponscreen |= IsDlgButtonChecked(hwndDlg,IDC_AOVD)?2:0;
  105. SetWindowLongPtrW(hMainWindow,GWLP_USERDATA,(config_keeponscreen&2)?0x49474541:0);
  106. SetWindowLongPtrW(hPLWindow,GWLP_USERDATA,(config_keeponscreen&2)?0x49474541:0);
  107. SetWindowLongPtrW(hEQWindow,GWLP_USERDATA,(config_keeponscreen&2)?0x49474541:0);
  108. // SetWindowLong(hMBWindow,GWL_USERDATA,(config_keeponscreen&2)?0x49474541:0);
  109. SetWindowLongPtrW(hVideoWindow,GWLP_USERDATA,(config_keeponscreen&2)?0x49474541:0);
  110. }
  111. break;
  112. }
  113. return FALSE;
  114. }
  115. return FALSE;
  116. } //display
  117. static LRESULT CALLBACK ClassicVisProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam)
  118. {
  119. static int text_ids[4]=
  120. {
  121. IDS_P_CLASSIC_70FPS,
  122. IDS_P_CLASSIC_35FPS,
  123. IDS_P_CLASSIC_18FPS,
  124. IDS_P_CLASSIC_9FPS
  125. };
  126. #if 0
  127. hi helpinfo[]={
  128. {IDC_USEID4,IDS_P_O_ONLOAD},
  129. };
  130. DO_HELP();
  131. #endif
  132. if(uMsg == WM_INITDIALOG)
  133. {
  134. SendMessageW(GetDlgItem(hwndDlg,IDC_SLIDER3),TBM_SETRANGEMAX,0,3);
  135. SendMessageW(GetDlgItem(hwndDlg,IDC_SLIDER3),TBM_SETRANGEMIN,0,0);
  136. SendMessageW(GetDlgItem(hwndDlg,IDC_SLIDER3),TBM_SETPOS,1,4-config_saref);
  137. SendMessageW(GetDlgItem(hwndDlg,IDC_SLIDER1),TBM_SETRANGEMAX,0,4);
  138. SendMessageW(GetDlgItem(hwndDlg,IDC_SLIDER1),TBM_SETRANGEMIN,0,0);
  139. SendMessageW(GetDlgItem(hwndDlg,IDC_SLIDER1),TBM_SETPOS,1,config_safalloff);
  140. SendMessageW(GetDlgItem(hwndDlg,IDC_SLIDER2),TBM_SETRANGEMAX,0,4);
  141. SendMessageW(GetDlgItem(hwndDlg,IDC_SLIDER2),TBM_SETRANGEMIN,0,0);
  142. SendMessageW(GetDlgItem(hwndDlg,IDC_SLIDER2),TBM_SETPOS,1,config_sa_peak_falloff);
  143. SetDlgItemTextW(hwndDlg,IDC_RRATE,getStringW(text_ids[config_saref-1],NULL,0));
  144. if (config_sa == 1) CheckDlgButton(hwndDlg,IDC_RADIO1,BST_CHECKED);
  145. else if (config_sa == 2) CheckDlgButton(hwndDlg,IDC_RADIO2,BST_CHECKED);
  146. else CheckDlgButton(hwndDlg,IDC_RADIO3,BST_CHECKED);
  147. if ((config_safire&3) == 1) CheckDlgButton(hwndDlg,IDC_RADIO5,BST_CHECKED);
  148. else if ((config_safire&3) == 2) CheckDlgButton(hwndDlg,IDC_RADIO6,BST_CHECKED);
  149. else CheckDlgButton(hwndDlg,IDC_RADIO4,BST_CHECKED);
  150. if (config_sa_peaks) CheckDlgButton(hwndDlg,IDC_CHECK1,BST_CHECKED);
  151. if ((config_safire&32)) CheckDlgButton(hwndDlg,IDC_RADIO7,BST_CHECKED);
  152. else CheckDlgButton(hwndDlg,IDC_RADIO8,BST_CHECKED);
  153. if (((config_safire>>2)&3)==0) CheckDlgButton(hwndDlg,IDC_RADIO9,BST_CHECKED);
  154. else if (((config_safire>>2)&3)==1) CheckDlgButton(hwndDlg,IDC_RADIO10,BST_CHECKED);
  155. else CheckDlgButton(hwndDlg,IDC_RADIO11,BST_CHECKED);
  156. }
  157. if (uMsg == WM_HSCROLL)
  158. {
  159. HWND swnd = (HWND) lParam;
  160. int t=(int)SendMessageW(swnd,TBM_GETPOS,0,0);
  161. if (swnd == GetDlgItem(hwndDlg,IDC_SLIDER3))
  162. {
  163. config_saref=(unsigned char)(4-t);
  164. SetDlgItemTextW(hwndDlg,IDC_RRATE,getStringW(text_ids[config_saref-1],NULL,0));
  165. }
  166. if (swnd == GetDlgItem(hwndDlg,IDC_SLIDER2))
  167. {
  168. config_sa_peak_falloff = (unsigned char)t;
  169. }
  170. if (swnd == GetDlgItem(hwndDlg,IDC_SLIDER1))
  171. {
  172. config_safalloff= (unsigned char)t;
  173. }
  174. }
  175. if (uMsg == WM_COMMAND)
  176. switch (LOWORD(wParam))
  177. {
  178. case IDC_RADIO1:
  179. case IDC_RADIO2:
  180. case IDC_RADIO3:
  181. if (IsDlgButtonChecked(hwndDlg,IDC_RADIO1)) config_sa=1;
  182. else if (IsDlgButtonChecked(hwndDlg,IDC_RADIO2)) config_sa=2;
  183. else config_sa=0;
  184. sa_setthread(config_sa);
  185. break;
  186. case IDC_RADIO4:
  187. case IDC_RADIO5:
  188. case IDC_RADIO6:
  189. config_safire &= ~3;
  190. if (IsDlgButtonChecked(hwndDlg,IDC_RADIO5)) config_safire |= 1;
  191. else if (IsDlgButtonChecked(hwndDlg,IDC_RADIO6)) config_safire |= 2;
  192. break;
  193. case IDC_CHECK1:
  194. config_sa_peaks = IsDlgButtonChecked(hwndDlg,IDC_CHECK1)?1:0;
  195. break;
  196. case IDC_RADIO7:
  197. case IDC_RADIO8:
  198. if (IsDlgButtonChecked(hwndDlg,IDC_RADIO7)) config_safire|=32;
  199. else config_safire&=~32;
  200. break;
  201. case IDC_RADIO9:
  202. case IDC_RADIO10:
  203. case IDC_RADIO11:
  204. config_safire &= ~(3<<2);
  205. if (IsDlgButtonChecked(hwndDlg,IDC_RADIO10)) config_safire |= 1<<2;
  206. else if (IsDlgButtonChecked(hwndDlg,IDC_RADIO11)) config_safire |= 2<<2;
  207. break;
  208. }
  209. const int controls[] =
  210. {
  211. IDC_SLIDER1,
  212. IDC_SLIDER2,
  213. IDC_SLIDER3,
  214. };
  215. if (FALSE != DirectMouseWheel_ProcessDialogMessage(hwndDlg, uMsg, wParam, lParam, controls, ARRAYSIZE(controls)))
  216. return TRUE;
  217. return FALSE;
  218. } // vis options
  219. multiPage classicPages[] = {
  220. {IDD_CLASSIC_UI, ClassicUIProc},
  221. {IDD_CLASSIC_VIS, ClassicVisProc},
  222. };
  223. INT_PTR CALLBACK classicSkinProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam)
  224. {
  225. switch (uMsg)
  226. {
  227. case WM_INITDIALOG:
  228. {
  229. TCITEMW item = {0};
  230. HWND tabwnd=GetDlgItem(hwndDlg,IDC_TAB1);
  231. item.mask=TCIF_TEXT;
  232. item.pszText=getStringW(IDS_P_CLASSICUI,NULL,0);
  233. SendMessageW(tabwnd, TCM_INSERTITEMW, 0, (LPARAM)&item);
  234. item.pszText=getStringW(IDS_P_CLASSICVIS,NULL,0);
  235. SendMessageW(tabwnd, TCM_INSERTITEMW, 1, (LPARAM)&item);
  236. TabCtrl_SetCurSel(tabwnd,config_last_classic_skin_page);
  237. subWnd = _dosetsel(hwndDlg,subWnd,&config_last_classic_skin_page,classicPages,sizeof(classicPages)/sizeof(classicPages[0]));
  238. }
  239. return 0;
  240. case WM_NOTIFY:
  241. {
  242. LPNMHDR p=(LPNMHDR)lParam;
  243. if (p->idFrom == IDC_TAB1 && p->code == TCN_SELCHANGE)
  244. subWnd = _dosetsel(hwndDlg,subWnd,&config_last_classic_skin_page,classicPages,sizeof(classicPages)/sizeof(classicPages[0]));
  245. }
  246. return 0;
  247. case WM_DESTROY:
  248. subWnd=NULL;
  249. return 0;
  250. }
  251. return 0;
  252. }