Revisión | 98c3c9781b5fd104574429c179b4f497abcac176 (tree) |
---|---|
Tiempo | 2019-11-13 04:01:19 |
Autor | Starg <starg@user...> |
Commiter | Starg |
Import UnkoTim228
@@ -192,7 +192,7 @@ static int ctl_open(int using_stdin, int using_stdout); | ||
192 | 192 | static void ctl_close(void); |
193 | 193 | static int ctl_pass_playing_list(int number_of_files, char *list_of_files[]); |
194 | 194 | static int ctl_read(ptr_size_t *valp); |
195 | -static int32 ctl_write(const uint8 *valp, int32 size); | |
195 | +static int32 ctl_write(const uint8 *valp, size_t size); | |
196 | 196 | static int cmsg(int type, int verbosity_level, const char *fmt, ...); |
197 | 197 | static void ctl_event(CtlEvent *e); |
198 | 198 |
@@ -56,6 +56,7 @@ | ||
56 | 56 | (http://www.suse.de/~mana/alsa090_howto.html#sect05 ). |
57 | 57 | */ |
58 | 58 | |
59 | + | |
59 | 60 | //#define USE_PORTMIDI 1 |
60 | 61 | //#define USE_GTK_GUI 1 |
61 | 62 |
@@ -63,6 +64,12 @@ | ||
63 | 64 | #include "config.h" |
64 | 65 | #endif /* HAVE_CONFIG_H */ |
65 | 66 | |
67 | +#ifdef __W32__ | |
68 | +#include "interface.h" | |
69 | +#endif | |
70 | + | |
71 | +#ifdef IA_PORTMIDISYN | |
72 | + | |
66 | 73 | |
67 | 74 | #include "rtsyn.h" |
68 | 75 | #ifdef USE_GTK_GUI |
@@ -540,4 +547,5 @@ ControlMode *interface_P_loader(void) | ||
540 | 547 | return &ctl; |
541 | 548 | } |
542 | 549 | |
550 | +#endif | |
543 | 551 |
@@ -31,7 +31,6 @@ | ||
31 | 31 | #ifdef HAVE_CONFIG_H |
32 | 32 | #include "config.h" |
33 | 33 | #endif /* HAVE_CONFIG_H */ |
34 | - | |
35 | 34 | #include "interface.h" |
36 | 35 | |
37 | 36 | #ifdef IA_NPSYN |
@@ -87,7 +86,6 @@ static double mim_start_time; | ||
87 | 86 | |
88 | 87 | static uint8 npipe_buffer[2 * PIPE_BUFFER_SIZE]; |
89 | 88 | static int npipe_len = 0; |
90 | - | |
91 | 89 | static void rtsyn_np_get_port_list(void); |
92 | 90 | static int rtsyn_np_synth_start(void); |
93 | 91 | static void rtsyn_np_synth_stop(void); |
@@ -191,9 +189,9 @@ static int rtsyn_np_buf_check(void) | ||
191 | 189 | |
192 | 190 | static int rtsyn_np_play_some_data(void) |
193 | 191 | { |
194 | - UINT wMsg; | |
195 | - DWORD dwParam1; | |
196 | - DWORD dwParam2; | |
192 | + UINT wMsg; | |
193 | + DWORD dwParam1; | |
194 | + DWORD dwParam2; | |
197 | 195 | FLOAT fParam2; |
198 | 196 | MidiEvent ev; |
199 | 197 | MidiEvent evm[260]; |
@@ -205,7 +203,7 @@ static int rtsyn_np_play_some_data(void) | ||
205 | 203 | static DWORD pre_time; |
206 | 204 | static DWORD timeoffset; |
207 | 205 | double event_time; |
208 | - | |
206 | + | |
209 | 207 | // rtsyn_play_one_data(0, 0x007f3c90, get_current_calender_time()); |
210 | 208 | if (0 != read_pipe_data()) return 0; |
211 | 209 |
@@ -268,17 +266,17 @@ static int rtsyn_np_play_some_data(void) | ||
268 | 266 | |
269 | 267 | static void parse_ev(uint8 *buffer, int *len) |
270 | 268 | { |
271 | - UINT wMsg; | |
272 | - UINT port; | |
273 | - DWORD dwParam1; | |
274 | - DWORD dwParam2; | |
269 | + UINT wMsg; | |
270 | + UINT port; | |
271 | + DWORD dwParam1; | |
272 | + DWORD dwParam2; | |
275 | 273 | FLOAT fParam2; |
276 | 274 | int exlen; |
277 | 275 | uint8 *exbuffer = 0; |
278 | 276 | uint8 *bp, *sp; |
279 | 277 | UINT evbpoint; |
280 | 278 | RtsynNpEvBuf *npevbuf; |
281 | - | |
279 | + | |
282 | 280 | /* |
283 | 281 | ctl->cmsg(CMSG_INFO, VERB_DEBUG_SILLY, "buhihi %d ", *len); |
284 | 282 | { |
@@ -420,3 +418,4 @@ static void rtsyn_np_midiports_close(void) | ||
420 | 418 | } |
421 | 419 | |
422 | 420 | #endif /* IA_NPSYN */ |
421 | + |
@@ -163,6 +163,7 @@ static void w32g_init_ext_control_thread(void) | ||
163 | 163 | hThread = crt_beginthreadex(NULL, 0, w32g_ext_control_thread, 0, 0, &ThreadID); |
164 | 164 | if(hThread == NULL) |
165 | 165 | return; |
166 | + set_thread_description((ptr_size_t)hThread, "W32G Ext Control Thread"); | |
166 | 167 | } |
167 | 168 | |
168 | 169 | static int w32g_go_ext_control_thread(int rc, ptr_size_t value) |
@@ -734,6 +734,20 @@ static void UpdateOutputMenu(HWND hWnd, UINT wId) | ||
734 | 734 | } |
735 | 735 | } |
736 | 736 | |
737 | +static void RefreshModuleMenu(HWND hWnd) | |
738 | +{ | |
739 | + UINT flags; | |
740 | + int i; | |
741 | + | |
742 | + for (i = 0; i < module_list_num; i++) { | |
743 | + flags = MF_STRING; | |
744 | + if (st_temp->opt_default_module == module_list[i].num) { | |
745 | + flags |= MFS_CHECKED; | |
746 | + } | |
747 | + CheckMenuItem(hMenuModule, IDM_MODULE + i, MF_BYCOMMAND | flags); | |
748 | + } | |
749 | +} | |
750 | + | |
737 | 751 | static void RefreshOutputMenu(HWND hWnd) |
738 | 752 | { |
739 | 753 | MENUITEMINFOA mii; |
@@ -1602,6 +1616,7 @@ static void CallPrefWnd(UINT_PTR cId) | ||
1602 | 1616 | W32G_VOLUME_MAX - output_amplification, TRUE); |
1603 | 1617 | |
1604 | 1618 | RefreshOutputMenu(hMainWnd); |
1619 | + RefreshModuleMenu(hMainWnd); | |
1605 | 1620 | } |
1606 | 1621 | |
1607 | 1622 |
@@ -1710,7 +1725,7 @@ void MainWndUpdateSoundSpecButton(void) | ||
1710 | 1725 | #undef SUBWINDOW_POS_IS_OLD_CLOSED_WINDOW |
1711 | 1726 | void ShowSubWindow(HWND hwnd,int showflag) |
1712 | 1727 | { |
1713 | - int i, num; | |
1728 | + int i, num = 0; | |
1714 | 1729 | RECT rc; |
1715 | 1730 | #ifdef SUBWINDOW_POS_IS_OLD_CLOSED_WINDOW |
1716 | 1731 | RECT rc2; |
@@ -1820,7 +1835,8 @@ void DebugThreadInit(void) | ||
1820 | 1835 | DWORD dwThreadID; |
1821 | 1836 | if(!DebugThreadExit) |
1822 | 1837 | return; |
1823 | - hDebugThread = crt_beginthreadex(NULL,0,(LPTHREAD_START_ROUTINE)DebugThread,0,0,&dwThreadID); | |
1838 | + hDebugThread = crt_beginthreadex(NULL,0,(LPTHREAD_START_ROUTINE)DebugThread,0,0,&dwThreadID); | |
1839 | + set_thread_description((ptr_size_t)hDebugThread, "W32G Debug Thread"); | |
1824 | 1840 | } |
1825 | 1841 | #endif |
1826 | 1842 |
@@ -4227,6 +4243,7 @@ void MPanelUpdate(void) | ||
4227 | 4243 | ExtTextOut(MPanel.hmdc,MPanel.rcMessage.left,MPanel.rcMessage.top, |
4228 | 4244 | ETO_CLIPPED | ETO_OPAQUE,&(MPanel.rcMessage), |
4229 | 4245 | MPanelMessageData.buff,strlen(MPanelMessageData.buff),NULL); |
4246 | + break; | |
4230 | 4247 | case 1: |
4231 | 4248 | ExtTextOut(MPanel.hmdc,MPanel.rcMessage.left,MPanel.rcMessage.top, |
4232 | 4249 | ETO_CLIPPED | ETO_OPAQUE,&(MPanel.rcMessage), |
@@ -4234,15 +4251,18 @@ void MPanelUpdate(void) | ||
4234 | 4251 | // ExtTextOut(MPanel.hmdc,MPanel.rcMessage.left-(MPanel.rcMessage.bottom-MPanel.rcMessage.top)*2, |
4235 | 4252 | // MPanel.rcMessage.top, ETO_CLIPPED | ETO_OPAQUE,&(MPanel.rcMessage), |
4236 | 4253 | // MPanelMessageData.buff,strlen(MPanelMessageData.buff),NULL); |
4254 | + break; | |
4237 | 4255 | case 2: |
4238 | 4256 | ExtTextOut(MPanel.hmdc,MPanel.rcMessage.left,MPanel.rcMessage.top, |
4239 | 4257 | ETO_CLIPPED | ETO_OPAQUE,&(MPanel.rcMessage), |
4240 | 4258 | MPanelMessageData.buff,strlen(MPanelMessageData.buff),NULL); |
4259 | + break; | |
4241 | 4260 | case -1: |
4242 | 4261 | default: |
4243 | 4262 | ExtTextOut(MPanel.hmdc,MPanel.rcMessage.left,MPanel.rcMessage.top, |
4244 | 4263 | ETO_CLIPPED | ETO_OPAQUE,&(MPanel.rcMessage), |
4245 | 4264 | MPanelMessageData.buff,strlen(MPanelMessageData.buff),NULL); |
4265 | + break; | |
4246 | 4266 | } |
4247 | 4267 | if((HGDIOBJ)hgdiobj!=(HGDIOBJ)NULL && (HGDIOBJ)hgdiobj!=(HGDIOBJ)GDI_ERROR) |
4248 | 4268 | SelectObject(MPanel.hmdc,hgdiobj); |
@@ -5341,12 +5361,22 @@ UrlOpenWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | ||
5341 | 5361 | static void DlgPlaylistOpen(HWND hwnd) |
5342 | 5362 | { |
5343 | 5363 | char *dir, *file; |
5344 | - char *filter = | |
5345 | - "playlist file\0*.pls;*.m3u;*.asx\0" | |
5346 | - "all files\0*.*\0" | |
5347 | - "\0\0"; | |
5364 | + const char* filter, | |
5365 | + filter_en[] = | |
5366 | + "playlist file\0*.pls;*.m3u;*.asx\0" | |
5367 | + "all files\0*.*\0" | |
5368 | + "\0\0", | |
5369 | + filter_jp[] = | |
5370 | + "プレイリストファイル (*.pls;*.m3u;*.asx)\0*.pls;*.m3u;*.asx\0" | |
5371 | + "すべてのファイル (*.*)\0*.*\0" | |
5372 | + "\0\0"; | |
5348 | 5373 | |
5349 | - if(w32g_lock_open_file) | |
5374 | + if (PlayerLanguage == LANGUAGE_JAPANESE) | |
5375 | + filter = filter_jp; | |
5376 | + else | |
5377 | + filter = filter_en; | |
5378 | + | |
5379 | + if(w32g_lock_open_file) | |
5350 | 5380 | return; |
5351 | 5381 | |
5352 | 5382 | if(MidiFileOpenDir[0]) |
@@ -5395,10 +5425,20 @@ static void DlgPlaylistSave(HWND hwnd) | ||
5395 | 5425 | { |
5396 | 5426 | OPENFILENAME ofn; |
5397 | 5427 | static char *dir; |
5398 | - char *filter = | |
5399 | - "playlist file\0*.pls;*.m3u;*.asx\0" | |
5400 | - "all files\0*.*\0" | |
5401 | - "\0\0"; | |
5428 | + const char* filter, | |
5429 | + filter_en[] = | |
5430 | + "playlist file\0*.pls;*.m3u;*.asx\0" | |
5431 | + "all files\0*.*\0" | |
5432 | + "\0\0", | |
5433 | + filter_jp[] = | |
5434 | + "プレイリストファイル (*.pls;*.m3u;*.asx)\0*.pls;*.m3u;*.asx\0" | |
5435 | + "すべてのファイル (*.*)\0*.*\0" | |
5436 | + "\0\0"; | |
5437 | + | |
5438 | + if (PlayerLanguage == LANGUAGE_JAPANESE) | |
5439 | + filter = filter_jp; | |
5440 | + else | |
5441 | + filter = filter_en; | |
5402 | 5442 | |
5403 | 5443 | if(w32g_lock_open_file) |
5404 | 5444 | return; |
@@ -5627,6 +5667,7 @@ int w32g_open(void) | ||
5627 | 5667 | hPlayerThread = GetCurrentThread(); |
5628 | 5668 | w32g_wait_for_init = 1; |
5629 | 5669 | hMainThread = crt_beginthreadex(NULL, 0, (LPTHREAD_START_ROUTINE)MainThread, NULL, 0, &dwMainThreadID); |
5670 | + set_thread_description((ptr_size_t)hMainThread, "W32G Main Thread"); | |
5630 | 5671 | |
5631 | 5672 | while(w32g_wait_for_init) |
5632 | 5673 | { |
@@ -31,7 +31,11 @@ | ||
31 | 31 | #ifdef HAVE_STDDEF_H |
32 | 32 | #include <stddef.h> |
33 | 33 | #endif /* HAVE_STDDEF_H */ |
34 | -#include "_string.h" | |
34 | +#ifndef NO_STRING_H | |
35 | +#include <string.h> | |
36 | +#else | |
37 | +#include <strings.h> | |
38 | +#endif | |
35 | 39 | |
36 | 40 | #include "timidity.h" |
37 | 41 | #include "common.h" |
@@ -76,15 +80,15 @@ static char ISIniFileOpenDir[FILEPATH_MAX] = ""; | ||
76 | 80 | #ifdef DLG_CHECKBUTTON_TO_FLAG |
77 | 81 | #undef DLG_CHECKBUTTON_TO_FLAG |
78 | 82 | #endif |
79 | -#define DLG_CHECKBUTTON_TO_FLAG(hwnd,ctlid,x) \ | |
80 | - ((SendDlgItemMessage((hwnd),(ctlid),BM_GETCHECK,0,0))?((x)=1):((x)=0)) | |
83 | +#define DLG_CHECKBUTTON_TO_FLAG(hwnd,ctlid,x) \ | |
84 | + ((SendDlgItemMessage((hwnd),(ctlid),BM_GETCHECK,0,0))?((x)=1):((x)=0)) | |
81 | 85 | |
82 | 86 | #ifdef DLG_FLAG_TO_CHECKBUTTON |
83 | 87 | #undef DLG_FLAG_TO_CHECKBUTTON |
84 | 88 | #endif |
85 | -#define DLG_FLAG_TO_CHECKBUTTON(hwnd,ctlid,x) \ | |
86 | - ((x)?(SendDlgItemMessage((hwnd),(ctlid),BM_SETCHECK,1,0)):\ | |
87 | - (SendDlgItemMessage((hwnd),(ctlid),BM_SETCHECK,0,0))) | |
89 | +#define DLG_FLAG_TO_CHECKBUTTON(hwnd,ctlid,x) \ | |
90 | + ((x)?(SendDlgItemMessage((hwnd),(ctlid),BM_SETCHECK,1,0)):\ | |
91 | + (SendDlgItemMessage((hwnd),(ctlid),BM_SETCHECK,0,0))) | |
88 | 92 | |
89 | 93 | #ifdef CHECKRANGE_ISEDITOR_PARAM |
90 | 94 | #undef CHECKRANGE_ISEDITOR_PARAM |
@@ -93,1416 +97,1416 @@ static char ISIniFileOpenDir[FILEPATH_MAX] = ""; | ||
93 | 97 | |
94 | 98 | static INT_PTR CALLBACK ISEditorSCCDATAProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) |
95 | 99 | { |
96 | - int i, tmp, num; | |
97 | - WORD clid = 0; | |
98 | - static WORD focus_clid = 0; | |
99 | - int16 wheel_speed = 0; | |
100 | - static HWND hISEScrollbarValWnd[32]; | |
100 | + int i, tmp, num; | |
101 | + WORD clid = 0; | |
102 | + static WORD focus_clid = 0; | |
103 | + int16 wheel_speed = 0; | |
104 | + static HWND hISEScrollbarValWnd[32]; | |
101 | 105 | |
102 | - switch (uMess) { | |
103 | - case WM_INITDIALOG: | |
104 | - DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHK_SCC_DATA_OVERRIDE, scc_data_editor_override); | |
105 | - SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_SETRANGEMAX, (WPARAM) 0, (LPARAM) SCC_DATA_MAX - 1); | |
106 | - SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_SETRANGEMIN, (WPARAM) 0, (LPARAM) 0); | |
107 | - SetDlgItemText(hwnd,IDC_EDIT_SCC_DATA_NAME, scc_data_editor_load_name(scc_data_num)); | |
108 | - for (i = 0; i < SCC_DATA_LENGTH; i++) { | |
109 | - int sb_id = IDC_SCROLLBAR_SCC_DATA_VAL1 + i; | |
110 | - hISEScrollbarValWnd[i] = GetDlgItem(hwnd, sb_id); | |
111 | - EnableScrollBar(hISEScrollbarValWnd[i], SB_CTL, ESB_ENABLE_BOTH); | |
112 | - SetScrollRange(hISEScrollbarValWnd[i], SB_CTL, 0, 256, TRUE); // 256 -128 ~ 128 | |
113 | - } | |
114 | - case WM_ISE_RESTORE: | |
115 | - DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHK_SCC_DATA_OVERRIDE, scc_data_editor_override); | |
116 | - SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_data_num); | |
117 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_DATA_NUM, scc_data_num, TRUE); | |
118 | - for (i = 0; i < SCC_DATA_LENGTH; i++) { | |
119 | - int ed_id = IDC_EDIT_SCC_DATA_VAL1 + i; | |
120 | - tmp = scc_data_editor_get_param(i); | |
121 | - SetDlgItemInt(hwnd, ed_id, tmp, TRUE); | |
122 | - SetScrollPos(hISEScrollbarValWnd[i], SB_CTL, 128 - tmp, TRUE); | |
123 | - } | |
124 | - break; | |
125 | - case WM_HSCROLL: | |
126 | - case WM_VSCROLL: | |
127 | - tmp = SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_GETPOS, (WPARAM) 0, (LPARAM) 0); | |
128 | - if (tmp != scc_data_num) { | |
129 | - scc_data_num = tmp; | |
130 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_DATA_NUM, tmp, TRUE); | |
131 | - break; | |
132 | - } else { | |
133 | - int nScrollCode = (int) LOWORD(wParam); | |
134 | - int nPos = (int) HIWORD(wParam); | |
135 | - HWND bar = (HWND) lParam; | |
136 | - static int pos = -1; | |
106 | + switch (uMess) { | |
107 | + case WM_INITDIALOG: | |
108 | + DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHK_SCC_DATA_OVERRIDE, scc_data_editor_override); | |
109 | + SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_SETRANGEMAX, (WPARAM) 0, (LPARAM) SCC_DATA_MAX - 1); | |
110 | + SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_SETRANGEMIN, (WPARAM) 0, (LPARAM) 0); | |
111 | + SetDlgItemText(hwnd,IDC_EDIT_SCC_DATA_NAME, scc_data_editor_load_name(scc_data_num)); | |
112 | + for(i = 0; i < SCC_DATA_LENGTH; i++){ | |
113 | + int sb_id = IDC_SCROLLBAR_SCC_DATA_VAL1 + i; | |
114 | + hISEScrollbarValWnd[i] = GetDlgItem(hwnd, sb_id); | |
115 | + EnableScrollBar(hISEScrollbarValWnd[i], SB_CTL, ESB_ENABLE_BOTH); | |
116 | + SetScrollRange(hISEScrollbarValWnd[i], SB_CTL, 0, 256, TRUE); // 256 -128 ~ 128 | |
117 | + } | |
118 | + case WM_ISE_RESTORE: | |
119 | + DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHK_SCC_DATA_OVERRIDE, scc_data_editor_override); | |
120 | + SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_data_num); | |
121 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_DATA_NUM, scc_data_num, TRUE); | |
122 | + for(i = 0; i < SCC_DATA_LENGTH; i++){ | |
123 | + int ed_id = IDC_EDIT_SCC_DATA_VAL1 + i; | |
124 | + tmp = scc_data_editor_get_param(i); | |
125 | + SetDlgItemInt(hwnd, ed_id, tmp, TRUE); | |
126 | + SetScrollPos(hISEScrollbarValWnd[i], SB_CTL, 128 - tmp, TRUE); | |
127 | + } | |
128 | + break; | |
129 | + case WM_HSCROLL: | |
130 | + case WM_VSCROLL: | |
131 | + tmp = SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_GETPOS, (WPARAM) 0, (LPARAM)0); | |
132 | + if(tmp != scc_data_num){ | |
133 | + scc_data_num = tmp; | |
134 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_DATA_NUM, tmp, TRUE); | |
135 | + break; | |
136 | + }else{ | |
137 | + int nScrollCode = (int) LOWORD(wParam); | |
138 | + int nPos = (int) HIWORD(wParam); | |
139 | + HWND bar = (HWND) lParam; | |
140 | + static int pos = -1; | |
137 | 141 | |
138 | - num = -1; | |
139 | - for (i = 0; i < SCC_DATA_LENGTH; i++) { | |
140 | - if (bar == hISEScrollbarValWnd[i]) { | |
141 | - num = i; | |
142 | - break; | |
143 | - } | |
144 | - } | |
145 | - if (num == -1) | |
146 | - break; | |
147 | - switch (nScrollCode) { | |
148 | - case SB_THUMBTRACK: | |
149 | - case SB_THUMBPOSITION: | |
150 | - pos = nPos; | |
151 | - break; | |
152 | - case SB_LINEUP: | |
153 | - case SB_PAGEUP: | |
154 | - pos = GetScrollPos(bar, SB_CTL) - (nScrollCode == SB_LINEUP ? 1 : 10); | |
155 | - if (pos < 0) | |
156 | - pos = 0; | |
157 | - SetScrollPos(bar, SB_CTL, pos, TRUE); | |
158 | - break; | |
159 | - case SB_LINEDOWN: | |
160 | - case SB_PAGEDOWN: | |
161 | - pos = GetScrollPos(bar, SB_CTL) + (nScrollCode == SB_LINEDOWN ? 1 : 10); | |
162 | - if (pos > 256) | |
163 | - pos = 256; | |
164 | - SetScrollPos(bar, SB_CTL, pos, TRUE); | |
165 | - break; | |
166 | - case SB_ENDSCROLL: | |
167 | - if (pos != -1) { | |
168 | - SetScrollPos(bar, SB_CTL, pos, TRUE); | |
169 | - pos = -1; | |
170 | - } | |
171 | - break; | |
172 | - } | |
173 | - if (pos == -1) | |
174 | - break; | |
175 | - tmp = 128 - pos; | |
176 | - if (tmp != scc_data_editor_get_param(num)) { | |
177 | - scc_data_editor_set_param(num, tmp); | |
178 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_DATA_VAL1 + num, tmp, TRUE); | |
179 | - break; | |
180 | - } | |
181 | - } | |
182 | - break; | |
183 | - case WM_MOUSEWHEEL: | |
184 | - if (focus_wnd != 1) | |
185 | - break; | |
186 | - wheel_speed = (int16) GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; // upper 16bit sined int // 1knoch = 120 | |
187 | - wheel_speed *= (LOWORD(wParam) & MK_SHIFT) ? 10 : 1; | |
188 | - if (focus_clid == IDC_EDIT_SCC_DATA_NUM) { | |
189 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
190 | - if (tmp < 0) | |
191 | - tmp = 0; | |
192 | - else if (tmp > (SCC_DATA_MAX - 1)) | |
193 | - tmp = SCC_DATA_MAX - 1; | |
194 | - scc_data_num = tmp; | |
195 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_DATA_NUM, scc_data_num, TRUE); | |
196 | - SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_data_num); | |
197 | - } else if (focus_clid >= IDC_EDIT_SCC_DATA_VAL1 && focus_clid <= IDC_EDIT_SCC_DATA_VAL32) { | |
198 | - num = focus_clid - IDC_EDIT_SCC_DATA_VAL1; | |
199 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
200 | - if (tmp < -128) | |
201 | - tmp = -128; | |
202 | - else if (tmp > 128) | |
203 | - tmp = 128; | |
204 | - if (tmp != scc_data_editor_get_param(num)) { | |
205 | - scc_data_editor_set_param(num, tmp); | |
206 | - SetScrollPos(hISEScrollbarValWnd[num], SB_CTL, 128 - tmp, TRUE); | |
207 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
208 | - } | |
209 | - } | |
210 | - break; | |
211 | - case WM_COMMAND: | |
212 | - clid = LOWORD(wParam); | |
213 | - focus_clid = clid; | |
214 | - focus_wnd = 1; | |
215 | - switch (clid) { | |
216 | - case IDC_CHK_SCC_DATA_OVERRIDE: | |
217 | - DLG_CHECKBUTTON_TO_FLAG(hwnd, IDC_CHK_SCC_DATA_OVERRIDE, scc_data_editor_override); | |
218 | - break; | |
219 | - case IDC_BUTTON_SCC_DATA_LOAD_PRESET: | |
220 | - SetDlgItemText(hwnd,IDC_EDIT_SCC_DATA_NAME, scc_data_editor_load_name(scc_data_num)); | |
221 | - scc_data_editor_load_preset(scc_data_num); | |
222 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
223 | - break; | |
224 | - case IDC_BUTTON_SCC_DATA_SAVE_PRESET: | |
225 | - { | |
226 | - char buff[256]; | |
227 | - GetDlgItemText(hwnd, IDC_EDIT_SCC_DATA_NAME, buff, (WPARAM) sizeof(buff)); | |
228 | - scc_data_editor_store_name(scc_data_num, (const char*) buff); | |
229 | - scc_data_editor_store_preset(scc_data_num); | |
230 | - } | |
231 | - break; | |
232 | - case IDC_BUTTON_SCC_DATA_LOAD_TEMP: | |
233 | - scc_data_editor_load_preset(-1); | |
234 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
235 | - break; | |
236 | - case IDC_BUTTON_SCC_DATA_SAVE_TEMP: | |
237 | - scc_data_editor_store_preset(-1); | |
238 | - break; | |
239 | - case IDC_EDIT_SCC_DATA_NUM: | |
240 | - tmp = (int) GetDlgItemInt(hwnd, IDC_EDIT_SCC_DATA_NUM, NULL, TRUE); | |
241 | - if (tmp < 0) | |
242 | - tmp = 0; | |
243 | - else if (tmp > (SCC_DATA_MAX - 1)) | |
244 | - tmp = SCC_DATA_MAX - 1; | |
245 | - scc_data_num = tmp; | |
246 | - SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_data_num); | |
247 | - break; | |
248 | - case IDC_BUTTON_SCC_DATA_CLEAR: | |
249 | - scc_data_editor_clear_param(); | |
250 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
251 | - break; | |
252 | - default: | |
253 | - if (clid >= IDC_EDIT_SCC_DATA_VAL1 && clid <= IDC_EDIT_SCC_DATA_VAL32) { | |
254 | - num = clid - IDC_EDIT_SCC_DATA_VAL1; | |
255 | - tmp = (int) GetDlgItemInt(hwnd, clid, NULL, TRUE); | |
256 | - if (tmp < -128) | |
257 | - tmp = -128; | |
258 | - else if (tmp > 128) | |
259 | - tmp = 128; | |
260 | - if (tmp != scc_data_editor_get_param(num)) { | |
261 | - scc_data_editor_set_param(num, tmp); | |
262 | - SetScrollPos(hISEScrollbarValWnd[num], SB_CTL, 128 - tmp, TRUE); | |
263 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
264 | - } | |
265 | - } | |
266 | - break; | |
267 | - } | |
268 | - break; | |
269 | - case WM_SIZE: | |
270 | - return FALSE; | |
271 | - case WM_DESTROY: | |
272 | - break; | |
273 | - default: | |
274 | - break; | |
275 | - } | |
276 | - return FALSE; | |
142 | + num = -1; | |
143 | + for(i = 0; i < SCC_DATA_LENGTH; i++){ | |
144 | + if(bar == hISEScrollbarValWnd[i]){ | |
145 | + num = i; | |
146 | + break; | |
147 | + } | |
148 | + } | |
149 | + if(num == -1) | |
150 | + break; | |
151 | + switch(nScrollCode){ | |
152 | + case SB_THUMBTRACK: | |
153 | + case SB_THUMBPOSITION: | |
154 | + pos = nPos; | |
155 | + break; | |
156 | + case SB_LINEUP: | |
157 | + case SB_PAGEUP: | |
158 | + pos = GetScrollPos(bar, SB_CTL) - (nScrollCode == SB_LINEUP ? 1 : 10); | |
159 | + if(pos < 0) | |
160 | + pos = 0; | |
161 | + SetScrollPos(bar, SB_CTL, pos, TRUE); | |
162 | + break; | |
163 | + case SB_LINEDOWN: | |
164 | + case SB_PAGEDOWN: | |
165 | + pos = GetScrollPos(bar, SB_CTL) + (nScrollCode == SB_LINEDOWN ? 1 : 10); | |
166 | + if(pos > 256) | |
167 | + pos = 256; | |
168 | + SetScrollPos(bar, SB_CTL, pos, TRUE); | |
169 | + break; | |
170 | + case SB_ENDSCROLL: | |
171 | + if(pos != -1){ | |
172 | + SetScrollPos(bar, SB_CTL, pos, TRUE); | |
173 | + pos = -1; | |
174 | + } | |
175 | + break; | |
176 | + } | |
177 | + if (pos == -1) | |
178 | + break; | |
179 | + tmp = 128 - pos; | |
180 | + if(tmp != scc_data_editor_get_param(num)){ | |
181 | + scc_data_editor_set_param(num, tmp); | |
182 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_DATA_VAL1 + num, tmp, TRUE); | |
183 | + break; | |
184 | + } | |
185 | + } | |
186 | + break; | |
187 | + case WM_MOUSEWHEEL: | |
188 | + if(focus_wnd != 1) | |
189 | + break; | |
190 | + wheel_speed = (int16)GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; // upper 16bit sined int // 1knoch = 120 | |
191 | + wheel_speed *= (LOWORD(wParam) & MK_SHIFT) ? 10 : 1; | |
192 | + if(focus_clid == IDC_EDIT_SCC_DATA_NUM){ | |
193 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
194 | + if(tmp < 0) | |
195 | + tmp = 0; | |
196 | + else if(tmp > (SCC_DATA_MAX - 1)) | |
197 | + tmp = SCC_DATA_MAX - 1; | |
198 | + scc_data_num = tmp; | |
199 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_DATA_NUM, scc_data_num, TRUE); | |
200 | + SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_data_num); | |
201 | + }else if(focus_clid >= IDC_EDIT_SCC_DATA_VAL1 && focus_clid <= IDC_EDIT_SCC_DATA_VAL32){ | |
202 | + num = focus_clid - IDC_EDIT_SCC_DATA_VAL1; | |
203 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
204 | + if(tmp < -128) | |
205 | + tmp = -128; | |
206 | + else if(tmp > 128) | |
207 | + tmp = 128; | |
208 | + if(tmp != scc_data_editor_get_param(num)){ | |
209 | + scc_data_editor_set_param(num, tmp); | |
210 | + SetScrollPos(hISEScrollbarValWnd[num], SB_CTL, 128 - tmp, TRUE); | |
211 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
212 | + } | |
213 | + } | |
214 | + break; | |
215 | + case WM_COMMAND: | |
216 | + clid = LOWORD(wParam); | |
217 | + focus_clid = clid; | |
218 | + focus_wnd = 1; | |
219 | + switch (clid) { | |
220 | + case IDC_CHK_SCC_DATA_OVERRIDE: | |
221 | + DLG_CHECKBUTTON_TO_FLAG(hwnd, IDC_CHK_SCC_DATA_OVERRIDE, scc_data_editor_override); | |
222 | + break; | |
223 | + case IDC_BUTTON_SCC_DATA_LOAD_PRESET: | |
224 | + SetDlgItemText(hwnd,IDC_EDIT_SCC_DATA_NAME, scc_data_editor_load_name(scc_data_num)); | |
225 | + scc_data_editor_load_preset(scc_data_num); | |
226 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
227 | + break; | |
228 | + case IDC_BUTTON_SCC_DATA_SAVE_PRESET: | |
229 | + { | |
230 | + char buff[256]; | |
231 | + GetDlgItemText(hwnd, IDC_EDIT_SCC_DATA_NAME, buff, (WPARAM)sizeof(buff)); | |
232 | + scc_data_editor_store_name(scc_data_num, (const char *)buff); | |
233 | + scc_data_editor_store_preset(scc_data_num); | |
234 | + } | |
235 | + break; | |
236 | + case IDC_BUTTON_SCC_DATA_LOAD_TEMP: | |
237 | + scc_data_editor_load_preset(-1); | |
238 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
239 | + break; | |
240 | + case IDC_BUTTON_SCC_DATA_SAVE_TEMP: | |
241 | + scc_data_editor_store_preset(-1); | |
242 | + break; | |
243 | + case IDC_EDIT_SCC_DATA_NUM: | |
244 | + tmp = (int)GetDlgItemInt(hwnd, IDC_EDIT_SCC_DATA_NUM, NULL, TRUE); | |
245 | + if(tmp < 0) | |
246 | + tmp = 0; | |
247 | + else if(tmp > (SCC_DATA_MAX - 1)) | |
248 | + tmp = SCC_DATA_MAX - 1; | |
249 | + scc_data_num = tmp; | |
250 | + SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_DATA_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_data_num); | |
251 | + break; | |
252 | + case IDC_BUTTON_SCC_DATA_CLEAR: | |
253 | + scc_data_editor_clear_param(); | |
254 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
255 | + break; | |
256 | + default: | |
257 | + if(clid >= IDC_EDIT_SCC_DATA_VAL1 && clid <= IDC_EDIT_SCC_DATA_VAL32){ | |
258 | + num = clid - IDC_EDIT_SCC_DATA_VAL1; | |
259 | + tmp = (int)GetDlgItemInt(hwnd, clid, NULL, TRUE); | |
260 | + if(tmp < -128) | |
261 | + tmp = -128; | |
262 | + else if(tmp > 128) | |
263 | + tmp = 128; | |
264 | + if(tmp != scc_data_editor_get_param(num)){ | |
265 | + scc_data_editor_set_param(num, tmp); | |
266 | + SetScrollPos(hISEScrollbarValWnd[num], SB_CTL, 128 - tmp, TRUE); | |
267 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
268 | + } | |
269 | + } | |
270 | + break; | |
271 | + } | |
272 | + break; | |
273 | + case WM_SIZE: | |
274 | + return FALSE; | |
275 | + case WM_DESTROY: | |
276 | + break; | |
277 | + default: | |
278 | + break; | |
279 | + } | |
280 | + return FALSE; | |
277 | 281 | } |
278 | 282 | |
279 | 283 | |
280 | -static INT_PTR CALLBACK ISEditorSCCProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | |
284 | +static INT_PTR APIENTRY CALLBACK ISEditorSCCProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | |
281 | 285 | { |
282 | - int i, tmp; | |
283 | - WORD clid = 0; | |
284 | - static WORD focus_clid = 0; | |
285 | - int16 wheel_speed = 0; | |
286 | + int i, tmp; | |
287 | + WORD clid = 0; | |
288 | + static WORD focus_clid = 0; | |
289 | + int16 wheel_speed = 0; | |
286 | 290 | |
287 | - switch (uMess) { | |
288 | - case WM_INITDIALOG: | |
289 | - SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_SETRANGEMAX, (WPARAM) 0, (LPARAM) SCC_SETTING_MAX - 1); | |
290 | - SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_SETRANGEMIN, (WPARAM) 0, (LPARAM) 0); | |
291 | - SetDlgItemText(hwnd,IDC_EDIT_SCC_NAME, scc_editor_load_name(scc_preset_num)); | |
292 | - case WM_ISE_RESTORE: | |
293 | - DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHK_SCC_OVERRIDE, scc_editor_override); | |
294 | - SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_preset_num); | |
295 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_NUM, scc_preset_num, TRUE); | |
296 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_G1_P1, scc_editor_get_param(0, 0), TRUE); // pram | |
297 | - for (i = 0; i < SCC_OSC_MAX; i++) | |
298 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_G2_P1 + i, scc_editor_get_param(1, i), TRUE); // osc | |
299 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_G3_P1, scc_editor_get_param(2, 0), TRUE); // amp | |
300 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_G4_P1, scc_editor_get_param(3, 0), TRUE); // pitch | |
301 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_G4_P2, scc_editor_get_param(3, 1), TRUE); | |
302 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE1_DATA_NAME, scc_editor_load_wave_name(0)); | |
303 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE2_DATA_NAME, scc_editor_load_wave_name(1)); | |
304 | - for (i = 0; i < SCC_ENV_PARAM; i++) | |
305 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_G5_P1 + i, scc_editor_get_param(4, i), TRUE); | |
306 | - for (i = 0; i < SCC_ENV_PARAM; i++) | |
307 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_G6_P1 + i, scc_editor_get_param(5, i), TRUE); | |
308 | - for (i = 0; i < SCC_LFO_PARAM; i++) | |
309 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_G7_P1 + i, scc_editor_get_param(6, i), TRUE); | |
310 | - for (i = 0; i < SCC_LFO_PARAM; i++) | |
311 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_G8_P1 + i, scc_editor_get_param(7, i), TRUE); | |
312 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_G9_P1, scc_editor_get_param(8, 0), TRUE); // loop | |
313 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO1_WAVE_NAME, scc_editor_load_wave_name(8)); | |
314 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO2_WAVE_NAME, scc_editor_load_wave_name(9)); | |
315 | - break; | |
316 | - case WM_HSCROLL: | |
317 | - case WM_VSCROLL: | |
318 | - tmp = SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_GETPOS, (WPARAM) 0, (LPARAM) 0); | |
319 | - if (tmp != scc_preset_num) { | |
320 | - scc_preset_num = tmp; | |
321 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_NUM, tmp, TRUE); | |
322 | - } | |
323 | - break; | |
324 | - case WM_MOUSEWHEEL: | |
325 | - if (focus_wnd != 2) | |
326 | - break; | |
327 | - wheel_speed = (int16) GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; // upper 16bit sined int // 1knoch = 120 | |
328 | - wheel_speed *= (LOWORD(wParam) & MK_SHIFT) ? 10 : 1; | |
329 | - switch (focus_clid) { | |
330 | - case IDC_EDIT_SCC_NUM: | |
331 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
332 | - if (tmp < 0) | |
333 | - tmp = 0; | |
334 | - else if (tmp > (SCC_SETTING_MAX - 1)) | |
335 | - tmp = SCC_SETTING_MAX - 1; | |
336 | - scc_preset_num = tmp; | |
337 | - SetDlgItemInt(hwnd, IDC_EDIT_SCC_NUM, scc_preset_num, TRUE); | |
338 | - SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_preset_num); | |
339 | - break; | |
340 | - case IDC_EDIT_SCC_G1_P1: | |
341 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
342 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
343 | - scc_editor_set_param(0, 0, tmp); // param | |
344 | - break; | |
345 | - case IDC_EDIT_SCC_G2_P1: | |
346 | - case IDC_EDIT_SCC_G2_P2: | |
347 | - case IDC_EDIT_SCC_G2_P3: | |
348 | - case IDC_EDIT_SCC_G2_P4: | |
349 | - case IDC_EDIT_SCC_G2_P5: | |
350 | - case IDC_EDIT_SCC_G2_P6: | |
351 | - case IDC_EDIT_SCC_G2_P7: | |
352 | - case IDC_EDIT_SCC_G2_P8: | |
353 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
354 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
355 | - scc_editor_set_param(1, focus_clid - IDC_EDIT_SCC_G2_P1, tmp); // osc | |
356 | - if (focus_clid == IDC_EDIT_SCC_G2_P4) | |
357 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE1_DATA_NAME, scc_editor_load_wave_name(0)); | |
358 | - else if (focus_clid == IDC_EDIT_SCC_G2_P6) | |
359 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE2_DATA_NAME, scc_editor_load_wave_name(1)); | |
360 | - else if (focus_clid == IDC_EDIT_SCC_G2_P8) | |
361 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE3_DATA_NAME, scc_editor_load_wave_name(2)); | |
362 | - break; | |
363 | - case IDC_EDIT_SCC_G3_P1: | |
364 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
365 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
366 | - scc_editor_set_param(2, focus_clid - IDC_EDIT_SCC_G3_P1, tmp); // amp | |
367 | - break; | |
368 | - case IDC_EDIT_SCC_G4_P1: | |
369 | - case IDC_EDIT_SCC_G4_P2: | |
370 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
371 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
372 | - scc_editor_set_param(3, focus_clid - IDC_EDIT_SCC_G4_P1, tmp); // pitch | |
373 | - break; | |
374 | - case IDC_EDIT_SCC_G5_P1: | |
375 | - case IDC_EDIT_SCC_G5_P2: | |
376 | - case IDC_EDIT_SCC_G5_P3: | |
377 | - case IDC_EDIT_SCC_G5_P4: | |
378 | - case IDC_EDIT_SCC_G5_P5: | |
379 | - case IDC_EDIT_SCC_G5_P6: | |
380 | - case IDC_EDIT_SCC_G5_P7: | |
381 | - case IDC_EDIT_SCC_G5_P8: | |
382 | - case IDC_EDIT_SCC_G5_P9: | |
383 | - case IDC_EDIT_SCC_G5_P10: | |
384 | - case IDC_EDIT_SCC_G5_P11: | |
385 | - case IDC_EDIT_SCC_G5_P12: | |
386 | - case IDC_EDIT_SCC_G5_P13: | |
387 | - case IDC_EDIT_SCC_G5_P14: | |
388 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
389 | - if (tmp < 0) tmp = 0; | |
390 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
391 | - scc_editor_set_param(4, focus_clid - IDC_EDIT_SCC_G5_P1, tmp); // ampenv | |
392 | - break; | |
393 | - case IDC_EDIT_SCC_G6_P1: | |
394 | - case IDC_EDIT_SCC_G6_P2: | |
395 | - case IDC_EDIT_SCC_G6_P3: | |
396 | - case IDC_EDIT_SCC_G6_P4: | |
397 | - case IDC_EDIT_SCC_G6_P5: | |
398 | - case IDC_EDIT_SCC_G6_P6: | |
399 | - case IDC_EDIT_SCC_G6_P7: | |
400 | - case IDC_EDIT_SCC_G6_P8: | |
401 | - case IDC_EDIT_SCC_G6_P9: | |
402 | - case IDC_EDIT_SCC_G6_P10: | |
403 | - case IDC_EDIT_SCC_G6_P11: | |
404 | - case IDC_EDIT_SCC_G6_P12: | |
405 | - case IDC_EDIT_SCC_G6_P13: | |
406 | - case IDC_EDIT_SCC_G6_P14: | |
407 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
408 | - if (tmp < 0) tmp = 0; | |
409 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
410 | - scc_editor_set_param(5, focus_clid - IDC_EDIT_SCC_G6_P1, tmp); // pitenv | |
411 | - break; | |
412 | - case IDC_EDIT_SCC_G7_P1: | |
413 | - case IDC_EDIT_SCC_G7_P2: | |
414 | - case IDC_EDIT_SCC_G7_P3: | |
415 | - case IDC_EDIT_SCC_G7_P4: | |
416 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
417 | - if (tmp < 0) tmp = 0; | |
418 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
419 | - scc_editor_set_param(6, focus_clid - IDC_EDIT_SCC_G7_P1, tmp); // lfo1 | |
420 | - if (focus_clid == IDC_EDIT_SCC_G7_P3) | |
421 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO1_WAVE_NAME, scc_editor_load_wave_name(8)); | |
422 | - break; | |
423 | - case IDC_EDIT_SCC_G8_P1: | |
424 | - case IDC_EDIT_SCC_G8_P2: | |
425 | - case IDC_EDIT_SCC_G8_P3: | |
426 | - case IDC_EDIT_SCC_G8_P4: | |
427 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
428 | - if (tmp < 0) tmp = 0; | |
429 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
430 | - scc_editor_set_param(7, focus_clid - IDC_EDIT_SCC_G8_P1, tmp); // lfo2 | |
431 | - if (focus_clid == IDC_EDIT_SCC_G8_P3) | |
432 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO2_WAVE_NAME, scc_editor_load_wave_name(9)); | |
433 | - break; | |
434 | - case IDC_EDIT_SCC_G9_P1: | |
435 | - case IDC_EDIT_SCC_G9_P2: | |
436 | - case IDC_EDIT_SCC_G9_P3: | |
437 | - case IDC_EDIT_SCC_G9_P4: | |
438 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
439 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
440 | - scc_editor_set_param(8, focus_clid - IDC_EDIT_SCC_G9_P1, tmp); // loop | |
441 | - break; | |
442 | - } | |
443 | - break; | |
444 | - case WM_COMMAND: | |
445 | - clid = LOWORD(wParam); | |
446 | - focus_clid = clid; | |
447 | - focus_wnd = 2; | |
448 | - switch (clid) { | |
449 | - case IDC_CHK_SCC_OVERRIDE: | |
450 | - DLG_CHECKBUTTON_TO_FLAG(hwnd, IDC_CHK_SCC_OVERRIDE, scc_editor_override); | |
451 | - break; | |
452 | - case IDC_BUTTON_SCC_DELETE_PRESET: | |
453 | - scc_editor_delete_preset(scc_preset_num); | |
454 | - break; | |
455 | - case IDC_BUTTON_SCC_LOAD_PRESET: | |
456 | - SetDlgItemText(hwnd,IDC_EDIT_SCC_NAME, scc_editor_load_name(scc_preset_num)); | |
457 | - scc_editor_load_preset(scc_preset_num); | |
458 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
459 | - break; | |
460 | - case IDC_BUTTON_SCC_SAVE_PRESET: | |
461 | - { | |
462 | - char buff[256]; | |
463 | - GetDlgItemText(hwnd, IDC_EDIT_SCC_NAME, buff, (WPARAM) sizeof(buff)); | |
464 | - scc_editor_store_name(scc_preset_num, (const char*) buff); | |
465 | - scc_editor_store_preset(scc_preset_num); | |
466 | - } | |
467 | - break; | |
468 | - case IDC_BUTTON_SCC_LOAD_TEMP: | |
469 | - scc_editor_load_preset(-1); | |
470 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
471 | - break; | |
472 | - case IDC_BUTTON_SCC_SAVE_TEMP: | |
473 | - scc_editor_store_preset(-1); | |
474 | - break; | |
475 | - case IDC_EDIT_SCC_NUM: | |
476 | - tmp = (int) GetDlgItemInt(hwnd, IDC_EDIT_SCC_NUM, NULL, TRUE); | |
477 | - if (tmp < 0) | |
478 | - tmp = 0; | |
479 | - else if (tmp > (SCC_SETTING_MAX - 1)) | |
480 | - tmp = SCC_SETTING_MAX - 1; | |
481 | - scc_preset_num = tmp; | |
482 | - SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_preset_num); | |
483 | - break; | |
484 | - case IDC_BUTTON_SCC_CLEAR: | |
485 | - scc_editor_set_default_param(-1); | |
486 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
487 | - break; | |
488 | - case IDC_EDIT_SCC_G1_P1: | |
489 | - scc_editor_set_param(0, 0, (int) GetDlgItemInt(hwnd, IDC_EDIT_SCC_G1_P1, NULL, TRUE)); // param | |
490 | - break; | |
491 | - case IDC_EDIT_SCC_G2_P1: | |
492 | - case IDC_EDIT_SCC_G2_P2: | |
493 | - case IDC_EDIT_SCC_G2_P3: | |
494 | - case IDC_EDIT_SCC_G2_P4: | |
495 | - case IDC_EDIT_SCC_G2_P5: | |
496 | - case IDC_EDIT_SCC_G2_P6: | |
497 | - case IDC_EDIT_SCC_G2_P7: | |
498 | - case IDC_EDIT_SCC_G2_P8: | |
499 | - tmp = (int) GetDlgItemInt(hwnd, clid, NULL, TRUE); | |
500 | - scc_editor_set_param(1, clid - IDC_EDIT_SCC_G2_P1, tmp); // osc | |
501 | - if (clid == IDC_EDIT_SCC_G2_P4) | |
502 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE1_DATA_NAME, scc_editor_load_wave_name(0)); | |
503 | - else if (clid == IDC_EDIT_SCC_G2_P6) | |
504 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE2_DATA_NAME, scc_editor_load_wave_name(1)); | |
505 | - else if (clid == IDC_EDIT_SCC_G2_P8) | |
506 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE3_DATA_NAME, scc_editor_load_wave_name(2)); | |
507 | - break; | |
508 | - case IDC_EDIT_SCC_G3_P1: | |
509 | - scc_editor_set_param(2, clid - IDC_EDIT_SCC_G3_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // amp | |
510 | - break; | |
511 | - case IDC_EDIT_SCC_G4_P1: | |
512 | - case IDC_EDIT_SCC_G4_P2: | |
513 | - scc_editor_set_param(3, clid - IDC_EDIT_SCC_G4_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitch | |
514 | - break; | |
515 | - case IDC_EDIT_SCC_G5_P1: | |
516 | - case IDC_EDIT_SCC_G5_P2: | |
517 | - case IDC_EDIT_SCC_G5_P3: | |
518 | - case IDC_EDIT_SCC_G5_P4: | |
519 | - case IDC_EDIT_SCC_G5_P5: | |
520 | - case IDC_EDIT_SCC_G5_P6: | |
521 | - case IDC_EDIT_SCC_G5_P7: | |
522 | - case IDC_EDIT_SCC_G5_P8: | |
523 | - case IDC_EDIT_SCC_G5_P9: | |
524 | - case IDC_EDIT_SCC_G5_P10: | |
525 | - case IDC_EDIT_SCC_G5_P11: | |
526 | - case IDC_EDIT_SCC_G5_P12: | |
527 | - case IDC_EDIT_SCC_G5_P13: | |
528 | - case IDC_EDIT_SCC_G5_P14: | |
529 | - scc_editor_set_param(4, clid - IDC_EDIT_SCC_G5_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // ampenv | |
530 | - break; | |
531 | - case IDC_EDIT_SCC_G6_P1: | |
532 | - case IDC_EDIT_SCC_G6_P2: | |
533 | - case IDC_EDIT_SCC_G6_P3: | |
534 | - case IDC_EDIT_SCC_G6_P4: | |
535 | - case IDC_EDIT_SCC_G6_P5: | |
536 | - case IDC_EDIT_SCC_G6_P6: | |
537 | - case IDC_EDIT_SCC_G6_P7: | |
538 | - case IDC_EDIT_SCC_G6_P8: | |
539 | - case IDC_EDIT_SCC_G6_P9: | |
540 | - case IDC_EDIT_SCC_G6_P10: | |
541 | - case IDC_EDIT_SCC_G6_P11: | |
542 | - case IDC_EDIT_SCC_G6_P12: | |
543 | - case IDC_EDIT_SCC_G6_P13: | |
544 | - case IDC_EDIT_SCC_G6_P14: | |
545 | - scc_editor_set_param(5, clid - IDC_EDIT_SCC_G6_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitenv | |
546 | - break; | |
547 | - case IDC_EDIT_SCC_G7_P1: | |
548 | - case IDC_EDIT_SCC_G7_P2: | |
549 | - case IDC_EDIT_SCC_G7_P3: | |
550 | - case IDC_EDIT_SCC_G7_P4: | |
551 | - scc_editor_set_param(6, clid - IDC_EDIT_SCC_G7_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo1 | |
552 | - if (clid == IDC_EDIT_SCC_G7_P3) | |
553 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO1_WAVE_NAME, scc_editor_load_wave_name(8)); | |
554 | - break; | |
555 | - case IDC_EDIT_SCC_G8_P1: | |
556 | - case IDC_EDIT_SCC_G8_P2: | |
557 | - case IDC_EDIT_SCC_G8_P3: | |
558 | - case IDC_EDIT_SCC_G8_P4: | |
559 | - scc_editor_set_param(7, clid - IDC_EDIT_SCC_G8_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo2 | |
560 | - if (clid == IDC_EDIT_SCC_G8_P3) | |
561 | - SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO2_WAVE_NAME, scc_editor_load_wave_name(9)); | |
562 | - break; | |
563 | - case IDC_EDIT_SCC_G9_P1: | |
564 | - case IDC_EDIT_SCC_G9_P2: | |
565 | - case IDC_EDIT_SCC_G9_P3: | |
566 | - case IDC_EDIT_SCC_G9_P4: | |
567 | - scc_editor_set_param(8, clid - IDC_EDIT_SCC_G9_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // loop | |
568 | - break; | |
569 | - case IDC_EDIT_SCC_WAVE1_DATA_NAME: | |
570 | - focus_clid = IDC_EDIT_SCC_G2_P4; | |
571 | - break; | |
572 | - case IDC_EDIT_SCC_WAVE2_DATA_NAME: | |
573 | - focus_clid = IDC_EDIT_SCC_G2_P6; | |
574 | - break; | |
575 | - case IDC_EDIT_SCC_WAVE3_DATA_NAME: | |
576 | - focus_clid = IDC_EDIT_SCC_G2_P8; | |
577 | - break; | |
578 | - case IDC_EDIT_SCC_LFO1_WAVE_NAME: | |
579 | - focus_clid = IDC_EDIT_SCC_G7_P3; | |
580 | - break; | |
581 | - case IDC_EDIT_SCC_LFO2_WAVE_NAME: | |
582 | - focus_clid = IDC_EDIT_SCC_G8_P3; | |
583 | - break; | |
584 | - } | |
585 | - break; | |
586 | - case WM_SIZE: | |
587 | - return FALSE; | |
588 | - case WM_DESTROY: | |
589 | - break; | |
590 | - default: | |
591 | - break; | |
592 | - } | |
593 | - return FALSE; | |
291 | + switch (uMess) { | |
292 | + case WM_INITDIALOG: | |
293 | + SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_SETRANGEMAX, (WPARAM) 0, (LPARAM) SCC_SETTING_MAX - 1); | |
294 | + SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_SETRANGEMIN, (WPARAM) 0, (LPARAM) 0); | |
295 | + SetDlgItemText(hwnd,IDC_EDIT_SCC_NAME, scc_editor_load_name(scc_preset_num)); | |
296 | + case WM_ISE_RESTORE: | |
297 | + DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHK_SCC_OVERRIDE, scc_editor_override); | |
298 | + SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_preset_num); | |
299 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_NUM, scc_preset_num, TRUE); | |
300 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_G1_P1, scc_editor_get_param(0, 0), TRUE); // pram | |
301 | + for(i = 0; i < SCC_OSC_MAX; i++) | |
302 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_G2_P1 + i, scc_editor_get_param(1, i), TRUE); // osc | |
303 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_G3_P1, scc_editor_get_param(2, 0), TRUE); // amp | |
304 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_G4_P1, scc_editor_get_param(3, 0), TRUE); // pitch | |
305 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_G4_P2, scc_editor_get_param(3, 1), TRUE); | |
306 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE1_DATA_NAME, scc_editor_load_wave_name(0)); | |
307 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE2_DATA_NAME, scc_editor_load_wave_name(1)); | |
308 | + for(i = 0; i < SCC_ENV_PARAM; i++) | |
309 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_G5_P1 + i, scc_editor_get_param(4, i), TRUE); | |
310 | + for(i = 0; i < SCC_ENV_PARAM; i++) | |
311 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_G6_P1 + i, scc_editor_get_param(5, i), TRUE); | |
312 | + for(i = 0; i < SCC_LFO_PARAM; i++) | |
313 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_G7_P1 + i, scc_editor_get_param(6, i), TRUE); | |
314 | + for(i = 0; i < SCC_LFO_PARAM; i++) | |
315 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_G8_P1 + i, scc_editor_get_param(7, i), TRUE); | |
316 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_G9_P1, scc_editor_get_param(8, 0), TRUE); // mode | |
317 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO1_WAVE_NAME, scc_editor_load_wave_name(8)); | |
318 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO2_WAVE_NAME, scc_editor_load_wave_name(9)); | |
319 | + break; | |
320 | + case WM_HSCROLL: | |
321 | + case WM_VSCROLL: | |
322 | + tmp = SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_GETPOS, (WPARAM) 0, (LPARAM)0); | |
323 | + if(tmp != scc_preset_num){ | |
324 | + scc_preset_num = tmp; | |
325 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_NUM, tmp, TRUE); | |
326 | + } | |
327 | + break; | |
328 | + case WM_MOUSEWHEEL: | |
329 | + if(focus_wnd != 2) | |
330 | + break; | |
331 | + wheel_speed = (int16)GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; // upper 16bit sined int // 1knoch = 120 | |
332 | + wheel_speed *= (LOWORD(wParam) & MK_SHIFT) ? 10 : 1; | |
333 | + switch (focus_clid) { | |
334 | + case IDC_EDIT_SCC_NUM: | |
335 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
336 | + if(tmp < 0) | |
337 | + tmp = 0; | |
338 | + else if(tmp > (SCC_SETTING_MAX - 1)) | |
339 | + tmp = SCC_SETTING_MAX - 1; | |
340 | + scc_preset_num = tmp; | |
341 | + SetDlgItemInt(hwnd, IDC_EDIT_SCC_NUM, scc_preset_num, TRUE); | |
342 | + SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_preset_num); | |
343 | + break; | |
344 | + case IDC_EDIT_SCC_G1_P1: | |
345 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
346 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
347 | + scc_editor_set_param(0, 0, tmp); // param | |
348 | + break; | |
349 | + case IDC_EDIT_SCC_G2_P1: | |
350 | + case IDC_EDIT_SCC_G2_P2: | |
351 | + case IDC_EDIT_SCC_G2_P3: | |
352 | + case IDC_EDIT_SCC_G2_P4: | |
353 | + case IDC_EDIT_SCC_G2_P5: | |
354 | + case IDC_EDIT_SCC_G2_P6: | |
355 | + case IDC_EDIT_SCC_G2_P7: | |
356 | + case IDC_EDIT_SCC_G2_P8: | |
357 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
358 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
359 | + scc_editor_set_param(1, focus_clid - IDC_EDIT_SCC_G2_P1, tmp); // osc | |
360 | + if(focus_clid == IDC_EDIT_SCC_G2_P4) | |
361 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE1_DATA_NAME, scc_editor_load_wave_name(0)); | |
362 | + else if(focus_clid == IDC_EDIT_SCC_G2_P6) | |
363 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE2_DATA_NAME, scc_editor_load_wave_name(1)); | |
364 | + else if(focus_clid == IDC_EDIT_SCC_G2_P8) | |
365 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE3_DATA_NAME, scc_editor_load_wave_name(2)); | |
366 | + break; | |
367 | + case IDC_EDIT_SCC_G3_P1: | |
368 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
369 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
370 | + scc_editor_set_param(2, focus_clid - IDC_EDIT_SCC_G3_P1, tmp); // amp | |
371 | + break; | |
372 | + case IDC_EDIT_SCC_G4_P1: | |
373 | + case IDC_EDIT_SCC_G4_P2: | |
374 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
375 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
376 | + scc_editor_set_param(3, focus_clid - IDC_EDIT_SCC_G4_P1, tmp); // pitch | |
377 | + break; | |
378 | + case IDC_EDIT_SCC_G5_P1: | |
379 | + case IDC_EDIT_SCC_G5_P2: | |
380 | + case IDC_EDIT_SCC_G5_P3: | |
381 | + case IDC_EDIT_SCC_G5_P4: | |
382 | + case IDC_EDIT_SCC_G5_P5: | |
383 | + case IDC_EDIT_SCC_G5_P6: | |
384 | + case IDC_EDIT_SCC_G5_P7: | |
385 | + case IDC_EDIT_SCC_G5_P8: | |
386 | + case IDC_EDIT_SCC_G5_P9: | |
387 | + case IDC_EDIT_SCC_G5_P10: | |
388 | + case IDC_EDIT_SCC_G5_P11: | |
389 | + case IDC_EDIT_SCC_G5_P12: | |
390 | + case IDC_EDIT_SCC_G5_P13: | |
391 | + case IDC_EDIT_SCC_G5_P14: | |
392 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
393 | + if(tmp < 0) tmp = 0; | |
394 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
395 | + scc_editor_set_param(4, focus_clid - IDC_EDIT_SCC_G5_P1, tmp); // ampenv | |
396 | + break; | |
397 | + case IDC_EDIT_SCC_G6_P1: | |
398 | + case IDC_EDIT_SCC_G6_P2: | |
399 | + case IDC_EDIT_SCC_G6_P3: | |
400 | + case IDC_EDIT_SCC_G6_P4: | |
401 | + case IDC_EDIT_SCC_G6_P5: | |
402 | + case IDC_EDIT_SCC_G6_P6: | |
403 | + case IDC_EDIT_SCC_G6_P7: | |
404 | + case IDC_EDIT_SCC_G6_P8: | |
405 | + case IDC_EDIT_SCC_G6_P9: | |
406 | + case IDC_EDIT_SCC_G6_P10: | |
407 | + case IDC_EDIT_SCC_G6_P11: | |
408 | + case IDC_EDIT_SCC_G6_P12: | |
409 | + case IDC_EDIT_SCC_G6_P13: | |
410 | + case IDC_EDIT_SCC_G6_P14: | |
411 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
412 | + if(tmp < 0) tmp = 0; | |
413 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
414 | + scc_editor_set_param(5, focus_clid - IDC_EDIT_SCC_G6_P1, tmp); // pitenv | |
415 | + break; | |
416 | + case IDC_EDIT_SCC_G7_P1: | |
417 | + case IDC_EDIT_SCC_G7_P2: | |
418 | + case IDC_EDIT_SCC_G7_P3: | |
419 | + case IDC_EDIT_SCC_G7_P4: | |
420 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
421 | + if(tmp < 0) tmp = 0; | |
422 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
423 | + scc_editor_set_param(6, focus_clid - IDC_EDIT_SCC_G7_P1, tmp); // lfo1 | |
424 | + if(focus_clid == IDC_EDIT_SCC_G7_P3) | |
425 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO1_WAVE_NAME, scc_editor_load_wave_name(8)); | |
426 | + break; | |
427 | + case IDC_EDIT_SCC_G8_P1: | |
428 | + case IDC_EDIT_SCC_G8_P2: | |
429 | + case IDC_EDIT_SCC_G8_P3: | |
430 | + case IDC_EDIT_SCC_G8_P4: | |
431 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
432 | + if(tmp < 0) tmp = 0; | |
433 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
434 | + scc_editor_set_param(7, focus_clid - IDC_EDIT_SCC_G8_P1, tmp); // lfo2 | |
435 | + if(focus_clid == IDC_EDIT_SCC_G8_P3) | |
436 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO2_WAVE_NAME, scc_editor_load_wave_name(9)); | |
437 | + break; | |
438 | + case IDC_EDIT_SCC_G9_P1: | |
439 | + case IDC_EDIT_SCC_G9_P2: | |
440 | + case IDC_EDIT_SCC_G9_P3: | |
441 | + case IDC_EDIT_SCC_G9_P4: | |
442 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
443 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
444 | + scc_editor_set_param(8, focus_clid - IDC_EDIT_SCC_G9_P1, tmp); // mode | |
445 | + break; | |
446 | + } | |
447 | + break; | |
448 | + case WM_COMMAND: | |
449 | + clid = LOWORD(wParam); | |
450 | + focus_clid = clid; | |
451 | + focus_wnd = 2; | |
452 | + switch (clid) { | |
453 | + case IDC_CHK_SCC_OVERRIDE: | |
454 | + DLG_CHECKBUTTON_TO_FLAG(hwnd, IDC_CHK_SCC_OVERRIDE, scc_editor_override); | |
455 | + break; | |
456 | + case IDC_BUTTON_SCC_DELETE_PRESET: | |
457 | + scc_editor_delete_preset(scc_preset_num); | |
458 | + break; | |
459 | + case IDC_BUTTON_SCC_LOAD_PRESET: | |
460 | + SetDlgItemText(hwnd,IDC_EDIT_SCC_NAME, scc_editor_load_name(scc_preset_num)); | |
461 | + scc_editor_load_preset(scc_preset_num); | |
462 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
463 | + break; | |
464 | + case IDC_BUTTON_SCC_SAVE_PRESET: | |
465 | + { | |
466 | + char buff[256]; | |
467 | + GetDlgItemText(hwnd, IDC_EDIT_SCC_NAME, buff, (WPARAM)sizeof(buff)); | |
468 | + scc_editor_store_name(scc_preset_num, (const char *)buff); | |
469 | + scc_editor_store_preset(scc_preset_num); | |
470 | + } | |
471 | + break; | |
472 | + case IDC_BUTTON_SCC_LOAD_TEMP: | |
473 | + scc_editor_load_preset(-1); | |
474 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
475 | + break; | |
476 | + case IDC_BUTTON_SCC_SAVE_TEMP: | |
477 | + scc_editor_store_preset(-1); | |
478 | + break; | |
479 | + case IDC_EDIT_SCC_NUM: | |
480 | + tmp = (int)GetDlgItemInt(hwnd, IDC_EDIT_SCC_NUM, NULL, TRUE); | |
481 | + if(tmp < 0) | |
482 | + tmp = 0; | |
483 | + else if(tmp > (SCC_SETTING_MAX - 1)) | |
484 | + tmp = SCC_SETTING_MAX - 1; | |
485 | + scc_preset_num = tmp; | |
486 | + SendDlgItemMessage(hwnd, IDC_SLIDER_SCC_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) scc_preset_num); | |
487 | + break; | |
488 | + case IDC_BUTTON_SCC_CLEAR: | |
489 | + scc_editor_set_default_param(-1); | |
490 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
491 | + break; | |
492 | + case IDC_EDIT_SCC_G1_P1: | |
493 | + scc_editor_set_param(0, 0, (int)GetDlgItemInt(hwnd, IDC_EDIT_SCC_G1_P1, NULL, TRUE)); // param | |
494 | + break; | |
495 | + case IDC_EDIT_SCC_G2_P1: | |
496 | + case IDC_EDIT_SCC_G2_P2: | |
497 | + case IDC_EDIT_SCC_G2_P3: | |
498 | + case IDC_EDIT_SCC_G2_P4: | |
499 | + case IDC_EDIT_SCC_G2_P5: | |
500 | + case IDC_EDIT_SCC_G2_P6: | |
501 | + case IDC_EDIT_SCC_G2_P7: | |
502 | + case IDC_EDIT_SCC_G2_P8: | |
503 | + tmp = (int)GetDlgItemInt(hwnd, clid, NULL, TRUE); | |
504 | + scc_editor_set_param(1, clid - IDC_EDIT_SCC_G2_P1, tmp); // osc | |
505 | + if(clid == IDC_EDIT_SCC_G2_P4) | |
506 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE1_DATA_NAME, scc_editor_load_wave_name(0)); | |
507 | + else if(clid == IDC_EDIT_SCC_G2_P6) | |
508 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE2_DATA_NAME, scc_editor_load_wave_name(1)); | |
509 | + else if(clid == IDC_EDIT_SCC_G2_P8) | |
510 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_WAVE3_DATA_NAME, scc_editor_load_wave_name(2)); | |
511 | + break; | |
512 | + case IDC_EDIT_SCC_G3_P1: | |
513 | + scc_editor_set_param(2, clid - IDC_EDIT_SCC_G3_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // amp | |
514 | + break; | |
515 | + case IDC_EDIT_SCC_G4_P1: | |
516 | + case IDC_EDIT_SCC_G4_P2: | |
517 | + scc_editor_set_param(3, clid - IDC_EDIT_SCC_G4_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitch | |
518 | + break; | |
519 | + case IDC_EDIT_SCC_G5_P1: | |
520 | + case IDC_EDIT_SCC_G5_P2: | |
521 | + case IDC_EDIT_SCC_G5_P3: | |
522 | + case IDC_EDIT_SCC_G5_P4: | |
523 | + case IDC_EDIT_SCC_G5_P5: | |
524 | + case IDC_EDIT_SCC_G5_P6: | |
525 | + case IDC_EDIT_SCC_G5_P7: | |
526 | + case IDC_EDIT_SCC_G5_P8: | |
527 | + case IDC_EDIT_SCC_G5_P9: | |
528 | + case IDC_EDIT_SCC_G5_P10: | |
529 | + case IDC_EDIT_SCC_G5_P11: | |
530 | + case IDC_EDIT_SCC_G5_P12: | |
531 | + case IDC_EDIT_SCC_G5_P13: | |
532 | + case IDC_EDIT_SCC_G5_P14: | |
533 | + scc_editor_set_param(4, clid - IDC_EDIT_SCC_G5_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // ampenv | |
534 | + break; | |
535 | + case IDC_EDIT_SCC_G6_P1: | |
536 | + case IDC_EDIT_SCC_G6_P2: | |
537 | + case IDC_EDIT_SCC_G6_P3: | |
538 | + case IDC_EDIT_SCC_G6_P4: | |
539 | + case IDC_EDIT_SCC_G6_P5: | |
540 | + case IDC_EDIT_SCC_G6_P6: | |
541 | + case IDC_EDIT_SCC_G6_P7: | |
542 | + case IDC_EDIT_SCC_G6_P8: | |
543 | + case IDC_EDIT_SCC_G6_P9: | |
544 | + case IDC_EDIT_SCC_G6_P10: | |
545 | + case IDC_EDIT_SCC_G6_P11: | |
546 | + case IDC_EDIT_SCC_G6_P12: | |
547 | + case IDC_EDIT_SCC_G6_P13: | |
548 | + case IDC_EDIT_SCC_G6_P14: | |
549 | + scc_editor_set_param(5, clid - IDC_EDIT_SCC_G6_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitenv | |
550 | + break; | |
551 | + case IDC_EDIT_SCC_G7_P1: | |
552 | + case IDC_EDIT_SCC_G7_P2: | |
553 | + case IDC_EDIT_SCC_G7_P3: | |
554 | + case IDC_EDIT_SCC_G7_P4: | |
555 | + scc_editor_set_param(6, clid - IDC_EDIT_SCC_G7_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo1 | |
556 | + if(clid == IDC_EDIT_SCC_G7_P3) | |
557 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO1_WAVE_NAME, scc_editor_load_wave_name(8)); | |
558 | + break; | |
559 | + case IDC_EDIT_SCC_G8_P1: | |
560 | + case IDC_EDIT_SCC_G8_P2: | |
561 | + case IDC_EDIT_SCC_G8_P3: | |
562 | + case IDC_EDIT_SCC_G8_P4: | |
563 | + scc_editor_set_param(7, clid - IDC_EDIT_SCC_G8_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo2 | |
564 | + if(clid == IDC_EDIT_SCC_G8_P3) | |
565 | + SetDlgItemText(hwnd, IDC_EDIT_SCC_LFO2_WAVE_NAME, scc_editor_load_wave_name(9)); | |
566 | + break; | |
567 | + case IDC_EDIT_SCC_G9_P1: | |
568 | + case IDC_EDIT_SCC_G9_P2: | |
569 | + case IDC_EDIT_SCC_G9_P3: | |
570 | + case IDC_EDIT_SCC_G9_P4: | |
571 | + scc_editor_set_param(8, clid - IDC_EDIT_SCC_G9_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // mode | |
572 | + break; | |
573 | + case IDC_EDIT_SCC_WAVE1_DATA_NAME: | |
574 | + focus_clid = IDC_EDIT_SCC_G2_P4; | |
575 | + break; | |
576 | + case IDC_EDIT_SCC_WAVE2_DATA_NAME: | |
577 | + focus_clid = IDC_EDIT_SCC_G2_P6; | |
578 | + break; | |
579 | + case IDC_EDIT_SCC_WAVE3_DATA_NAME: | |
580 | + focus_clid = IDC_EDIT_SCC_G2_P8; | |
581 | + break; | |
582 | + case IDC_EDIT_SCC_LFO1_WAVE_NAME: | |
583 | + focus_clid = IDC_EDIT_SCC_G7_P3; | |
584 | + break; | |
585 | + case IDC_EDIT_SCC_LFO2_WAVE_NAME: | |
586 | + focus_clid = IDC_EDIT_SCC_G8_P3; | |
587 | + break; | |
588 | + } | |
589 | + break; | |
590 | + case WM_SIZE: | |
591 | + return FALSE; | |
592 | + case WM_DESTROY: | |
593 | + break; | |
594 | + default: | |
595 | + break; | |
596 | + } | |
597 | + return FALSE; | |
594 | 598 | } |
595 | 599 | |
596 | -static INT_PTR CALLBACK ISEditorMMSProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | |
600 | +static INT_PTR APIENTRY CALLBACK ISEditorMMSProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | |
597 | 601 | { |
598 | - int i, tmp; | |
599 | - WORD clid = 0; | |
600 | - static WORD focus_clid = 0, prv_focus_clid = 0; | |
601 | - int16 wheel_speed = 0; | |
602 | + int i, tmp; | |
603 | + WORD clid = 0; | |
604 | + static WORD focus_clid = 0, prv_focus_clid = 0; | |
605 | + int16 wheel_speed = 0; | |
602 | 606 | |
603 | - switch (uMess) { | |
604 | - case WM_INITDIALOG: | |
605 | - SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_SETRANGEMAX, (WPARAM) 0, (LPARAM) MMS_SETTING_MAX - 1); | |
606 | - SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_SETRANGEMIN, (WPARAM) 0, (LPARAM) 0); | |
607 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_NUM, mms_preset_num, TRUE); | |
608 | - SetDlgItemText(hwnd,IDC_EDIT_MMS_NAME, mms_editor_load_name(mms_preset_num)); | |
609 | - case WM_ISE_RESTORE: | |
610 | - DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHK_MMS_OVERRIDE, mms_editor_override); | |
611 | - SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) mms_preset_num); | |
612 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_OP_NUM, mms_editor_get_param(0, 0, 0), TRUE); // op max | |
613 | - for (i = 0; i < MMS_OP_MAX; i++) | |
614 | - DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_BUTTON_MMS_OP0 + i, (i == mms_op_num) ? 1 : 0); | |
615 | - for (i = 0; i < MMS_OP_RANGE_MAX; i++) | |
616 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G1_P1 + i, mms_editor_get_param(1, mms_op_num, i), TRUE); // range | |
617 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G2_P1, mms_editor_get_param(2, mms_op_num, 0), TRUE); // param | |
618 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G2_P2, mms_editor_get_param(2, mms_op_num, 1), TRUE); // param | |
619 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G2_P3, mms_editor_get_param(2, mms_op_num, 2), TRUE); // param | |
620 | - for (i = 0; i < MMS_OP_CON_MAX; i++) | |
621 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G3_P1 + i, mms_editor_get_param(3, mms_op_num, i), TRUE); // con | |
622 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G4_P1, mms_editor_get_param(4, mms_op_num, 0), TRUE); // osc | |
623 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G4_P2, mms_editor_get_param(4, mms_op_num, 1), TRUE); // osc | |
624 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G4_P3, mms_editor_get_param(4, mms_op_num, 2), TRUE); // osc | |
625 | - for (i = 0; i < MMS_OP_WAVE_MAX; i++) | |
626 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G5_P1 + i, mms_editor_get_param(5, mms_op_num, i), TRUE); // wave | |
627 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_WAVE_DATA_NAME, mms_editor_load_wave_name(mms_op_num, -1)); | |
628 | - for (i = 0; i < MMS_OP_SUB_MAX; i++) | |
629 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G6_P1 + i, mms_editor_get_param(6, mms_op_num, i), TRUE); // sub | |
630 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G7_P1, mms_editor_get_param(7, mms_op_num, 0), TRUE); // amp | |
631 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G8_P1, mms_editor_get_param(8, mms_op_num, 0), TRUE); // pit | |
632 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G8_P2, mms_editor_get_param(8, mms_op_num, 1), TRUE); // pit | |
633 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G8_P3, mms_editor_get_param(8, mms_op_num, 2), TRUE); // pit | |
634 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G9_P1, mms_editor_get_param(9, mms_op_num, 0), TRUE); // wid | |
635 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G9_P2, mms_editor_get_param(9, mms_op_num, 1), TRUE); // wid | |
636 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G9_P3, mms_editor_get_param(9, mms_op_num, 2), TRUE); // wid | |
637 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G10_P1, mms_editor_get_param(10, mms_op_num, 0), TRUE); // flt | |
638 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_FILTER_NAME, mms_editor_load_filter_name(mms_op_num)); // flt type | |
639 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G10_P2, mms_editor_get_param(10, mms_op_num, 1), TRUE); // flt | |
640 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G10_P3, mms_editor_get_param(10, mms_op_num, 2), TRUE); // flt | |
641 | - for (i = 0; i < MMS_OP_CUT_PARAM; i++) | |
642 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G11_P1 + i, mms_editor_get_param(11, mms_op_num, i), TRUE); // cutoff | |
643 | - for (i = 0; i < MMS_OP_ENV_PARAM; i++) { | |
644 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G12_P1 + i, mms_editor_get_param(12, mms_op_num, i), TRUE); // ampenv | |
645 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G13_P1 + i, mms_editor_get_param(13, mms_op_num, i), TRUE); // pitenv | |
646 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G14_P1 + i, mms_editor_get_param(14, mms_op_num, i), TRUE); // widenv | |
647 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G15_P1 + i, mms_editor_get_param(15, mms_op_num, i), TRUE); // modenv | |
648 | - if (i >= 12) continue; | |
649 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G16_P1 + i, mms_editor_get_param(16, mms_op_num, i), TRUE); // ampenv_keyf | |
650 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G17_P1 + i, mms_editor_get_param(17, mms_op_num, i), TRUE); // pitenv_keyf | |
651 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G18_P1 + i, mms_editor_get_param(18, mms_op_num, i), TRUE); // widenv_keyf | |
652 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G19_P1 + i, mms_editor_get_param(19, mms_op_num, i), TRUE); // modenv_keyf | |
653 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G20_P1 + i, mms_editor_get_param(20, mms_op_num, i), TRUE); // ampenv_velf | |
654 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G21_P1 + i, mms_editor_get_param(21, mms_op_num, i), TRUE); // pitenv_velf | |
655 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G22_P1 + i, mms_editor_get_param(22, mms_op_num, i), TRUE); // widenv_velf | |
656 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G23_P1 + i, mms_editor_get_param(23, mms_op_num, i), TRUE); // modenv_velf | |
657 | - } | |
658 | - for (i = 0; i < MMS_OP_LFO_PARAM; i++) { | |
659 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G24_P1 + i, mms_editor_get_param(24, mms_op_num, i), TRUE); // lfo1 | |
660 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G25_P1 + i, mms_editor_get_param(25, mms_op_num, i), TRUE); // lfo2 | |
661 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G26_P1 + i, mms_editor_get_param(26, mms_op_num, i), TRUE); // lfo3 | |
662 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G27_P1 + i, mms_editor_get_param(27, mms_op_num, i), TRUE); // lfo4 | |
663 | - } | |
664 | - for (i = 0; i < MMS_OP_LOOP_MAX; i++) | |
665 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_G28_P1 + i, mms_editor_get_param(28, mms_op_num, i), TRUE); // loop | |
666 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO1_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 0)); | |
667 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO2_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 1)); | |
668 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO3_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 2)); | |
669 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO4_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 3)); | |
670 | - break; | |
671 | - case WM_HSCROLL: | |
672 | - case WM_VSCROLL: | |
673 | - tmp = SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_GETPOS, (WPARAM) 0, (LPARAM) 0); | |
674 | - if (tmp != mms_preset_num) { | |
675 | - mms_preset_num = tmp; | |
676 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_NUM, tmp, TRUE); | |
677 | - } | |
678 | - break; | |
679 | - case WM_MOUSEWHEEL: | |
680 | - if (focus_wnd != 3) | |
681 | - break; | |
682 | - wheel_speed = (int16) GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; // upper 16bit sined int // 1knoch = 120 | |
683 | - wheel_speed *= (LOWORD(wParam) & MK_SHIFT) ? 10 : 1; | |
684 | - switch (focus_clid) { | |
685 | - case IDC_EDIT_MMS_NUM: | |
686 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
687 | - if (tmp < 0) | |
688 | - tmp = 0; | |
689 | - else if (tmp > (MMS_SETTING_MAX - 1)) | |
690 | - tmp = MMS_SETTING_MAX - 1; | |
691 | - mms_preset_num = tmp; | |
692 | - SetDlgItemInt(hwnd, IDC_EDIT_MMS_NUM, mms_preset_num, TRUE); | |
693 | - SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) mms_preset_num); | |
694 | - break; | |
695 | - case IDC_EDIT_MMS_OP_NUM: | |
696 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
697 | - if (tmp < 0) | |
698 | - tmp = 0; | |
699 | - else if (tmp > MMS_OP_MAX) | |
700 | - tmp = MMS_OP_MAX; | |
701 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
702 | - mms_editor_set_param(0, 0, 0, tmp); // op max | |
703 | - break; | |
704 | - case IDC_EDIT_MMS_G1_P1: | |
705 | - case IDC_EDIT_MMS_G1_P2: | |
706 | - case IDC_EDIT_MMS_G1_P3: | |
707 | - case IDC_EDIT_MMS_G1_P4: | |
708 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
709 | - if (tmp < 0) tmp = 0; | |
710 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
711 | - mms_editor_set_param(1, mms_op_num, focus_clid - IDC_EDIT_MMS_G1_P1, tmp); // range | |
712 | - break; | |
713 | - case IDC_EDIT_MMS_G2_P1: | |
714 | - case IDC_EDIT_MMS_G2_P2: | |
715 | - case IDC_EDIT_MMS_G2_P3: | |
716 | - case IDC_EDIT_MMS_G2_P4: | |
717 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
718 | - if (tmp < 0) tmp = 0; | |
719 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
720 | - mms_editor_set_param(2, mms_op_num, focus_clid - IDC_EDIT_MMS_G2_P1, tmp); // param | |
721 | - break; | |
722 | - case IDC_EDIT_MMS_G3_P1: | |
723 | - case IDC_EDIT_MMS_G3_P2: | |
724 | - case IDC_EDIT_MMS_G3_P3: | |
725 | - case IDC_EDIT_MMS_G3_P4: | |
726 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
727 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
728 | - mms_editor_set_param(3, mms_op_num, focus_clid - IDC_EDIT_MMS_G3_P1, tmp); // connect | |
729 | - break; | |
730 | - case IDC_EDIT_MMS_G4_P1: | |
731 | - case IDC_EDIT_MMS_G4_P2: | |
732 | - case IDC_EDIT_MMS_G4_P3: | |
733 | - case IDC_EDIT_MMS_G4_P4: | |
734 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
735 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
736 | - mms_editor_set_param(4, mms_op_num, focus_clid - IDC_EDIT_MMS_G4_P1, tmp); // osc | |
737 | - break; | |
738 | - case IDC_EDIT_MMS_G5_P1: | |
739 | - case IDC_EDIT_MMS_G5_P2: | |
740 | - case IDC_EDIT_MMS_G5_P3: | |
741 | - case IDC_EDIT_MMS_G5_P4: | |
742 | - case IDC_EDIT_MMS_G5_P5: | |
743 | - case IDC_EDIT_MMS_G5_P6: | |
744 | - case IDC_EDIT_MMS_G5_P7: | |
745 | - case IDC_EDIT_MMS_G5_P8: | |
746 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
747 | - if (tmp < 0) tmp = 0; | |
748 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
749 | - mms_editor_set_param(5, mms_op_num, focus_clid - IDC_EDIT_MMS_G5_P1, tmp); // wave | |
750 | - if (focus_clid == IDC_EDIT_MMS_G5_P1 || focus_clid == IDC_EDIT_MMS_G5_P2) | |
751 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_WAVE_DATA_NAME, mms_editor_load_wave_name(mms_op_num, -1)); | |
752 | - break; | |
753 | - case IDC_EDIT_MMS_G6_P1: | |
754 | - case IDC_EDIT_MMS_G6_P2: | |
755 | - case IDC_EDIT_MMS_G6_P3: | |
756 | - case IDC_EDIT_MMS_G6_P4: | |
757 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
758 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
759 | - mms_editor_set_param(6, mms_op_num, focus_clid - IDC_EDIT_MMS_G6_P1, tmp); // sub | |
760 | - break; | |
761 | - case IDC_EDIT_MMS_G7_P1: | |
762 | - case IDC_EDIT_MMS_G7_P2: | |
763 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
764 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
765 | - mms_editor_set_param(7, mms_op_num, focus_clid - IDC_EDIT_MMS_G7_P1, tmp); // amp | |
766 | - break; | |
767 | - case IDC_EDIT_MMS_G8_P1: | |
768 | - case IDC_EDIT_MMS_G8_P2: | |
769 | - case IDC_EDIT_MMS_G8_P3: | |
770 | - case IDC_EDIT_MMS_G8_P4: | |
771 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
772 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
773 | - mms_editor_set_param(8, mms_op_num, focus_clid - IDC_EDIT_MMS_G8_P1, tmp); // pitch | |
774 | - break; | |
775 | - case IDC_EDIT_MMS_G9_P1: | |
776 | - case IDC_EDIT_MMS_G9_P2: | |
777 | - case IDC_EDIT_MMS_G9_P3: | |
778 | - case IDC_EDIT_MMS_G9_P4: | |
779 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
780 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
781 | - mms_editor_set_param(9, mms_op_num, focus_clid - IDC_EDIT_MMS_G9_P1, tmp); // width | |
782 | - break; | |
783 | - case IDC_EDIT_MMS_G10_P1: | |
784 | - case IDC_EDIT_MMS_G10_P2: | |
785 | - case IDC_EDIT_MMS_G10_P3: | |
786 | - case IDC_EDIT_MMS_G10_P4: | |
787 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
788 | - if (tmp < 0) tmp = 0; | |
789 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
790 | - mms_editor_set_param(10, mms_op_num, focus_clid - IDC_EDIT_MMS_G10_P1, tmp); // filter | |
791 | - if (focus_clid == IDC_EDIT_MMS_G10_P1) | |
792 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_FILTER_NAME, mms_editor_load_filter_name(mms_op_num)); | |
793 | - break; | |
794 | - case IDC_EDIT_MMS_G11_P1: | |
795 | - case IDC_EDIT_MMS_G11_P2: | |
796 | - case IDC_EDIT_MMS_G11_P3: | |
797 | - case IDC_EDIT_MMS_G11_P4: | |
798 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
799 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
800 | - mms_editor_set_param(11, mms_op_num, focus_clid - IDC_EDIT_MMS_G11_P1, tmp); // cutoff | |
801 | - break; | |
802 | - case IDC_EDIT_MMS_G12_P1: | |
803 | - case IDC_EDIT_MMS_G12_P2: | |
804 | - case IDC_EDIT_MMS_G12_P3: | |
805 | - case IDC_EDIT_MMS_G12_P4: | |
806 | - case IDC_EDIT_MMS_G12_P5: | |
807 | - case IDC_EDIT_MMS_G12_P6: | |
808 | - case IDC_EDIT_MMS_G12_P7: | |
809 | - case IDC_EDIT_MMS_G12_P8: | |
810 | - case IDC_EDIT_MMS_G12_P9: | |
811 | - case IDC_EDIT_MMS_G12_P10: | |
812 | - case IDC_EDIT_MMS_G12_P11: | |
813 | - case IDC_EDIT_MMS_G12_P12: | |
814 | - case IDC_EDIT_MMS_G12_P13: | |
815 | - case IDC_EDIT_MMS_G12_P14: | |
816 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
817 | - if (tmp < 0) tmp = 0; | |
818 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
819 | - mms_editor_set_param(12, mms_op_num, focus_clid - IDC_EDIT_MMS_G12_P1, tmp); // ampenv | |
820 | - break; | |
821 | - case IDC_EDIT_MMS_G13_P1: | |
822 | - case IDC_EDIT_MMS_G13_P2: | |
823 | - case IDC_EDIT_MMS_G13_P3: | |
824 | - case IDC_EDIT_MMS_G13_P4: | |
825 | - case IDC_EDIT_MMS_G13_P5: | |
826 | - case IDC_EDIT_MMS_G13_P6: | |
827 | - case IDC_EDIT_MMS_G13_P7: | |
828 | - case IDC_EDIT_MMS_G13_P8: | |
829 | - case IDC_EDIT_MMS_G13_P9: | |
830 | - case IDC_EDIT_MMS_G13_P10: | |
831 | - case IDC_EDIT_MMS_G13_P11: | |
832 | - case IDC_EDIT_MMS_G13_P12: | |
833 | - case IDC_EDIT_MMS_G13_P13: | |
834 | - case IDC_EDIT_MMS_G13_P14: | |
835 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
836 | - if (tmp < 0) tmp = 0; | |
837 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
838 | - mms_editor_set_param(13, mms_op_num, focus_clid - IDC_EDIT_MMS_G13_P1, tmp); // pitenv | |
839 | - break; | |
840 | - case IDC_EDIT_MMS_G14_P1: | |
841 | - case IDC_EDIT_MMS_G14_P2: | |
842 | - case IDC_EDIT_MMS_G14_P3: | |
843 | - case IDC_EDIT_MMS_G14_P4: | |
844 | - case IDC_EDIT_MMS_G14_P5: | |
845 | - case IDC_EDIT_MMS_G14_P6: | |
846 | - case IDC_EDIT_MMS_G14_P7: | |
847 | - case IDC_EDIT_MMS_G14_P8: | |
848 | - case IDC_EDIT_MMS_G14_P9: | |
849 | - case IDC_EDIT_MMS_G14_P10: | |
850 | - case IDC_EDIT_MMS_G14_P11: | |
851 | - case IDC_EDIT_MMS_G14_P12: | |
852 | - case IDC_EDIT_MMS_G14_P13: | |
853 | - case IDC_EDIT_MMS_G14_P14: | |
854 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
855 | - if (tmp < 0) tmp = 0; | |
856 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
857 | - mms_editor_set_param(14, mms_op_num, focus_clid - IDC_EDIT_MMS_G14_P1, tmp); // widenv | |
858 | - break; | |
859 | - case IDC_EDIT_MMS_G15_P1: | |
860 | - case IDC_EDIT_MMS_G15_P2: | |
861 | - case IDC_EDIT_MMS_G15_P3: | |
862 | - case IDC_EDIT_MMS_G15_P4: | |
863 | - case IDC_EDIT_MMS_G15_P5: | |
864 | - case IDC_EDIT_MMS_G15_P6: | |
865 | - case IDC_EDIT_MMS_G15_P7: | |
866 | - case IDC_EDIT_MMS_G15_P8: | |
867 | - case IDC_EDIT_MMS_G15_P9: | |
868 | - case IDC_EDIT_MMS_G15_P10: | |
869 | - case IDC_EDIT_MMS_G15_P11: | |
870 | - case IDC_EDIT_MMS_G15_P12: | |
871 | - case IDC_EDIT_MMS_G15_P13: | |
872 | - case IDC_EDIT_MMS_G15_P14: | |
873 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
874 | - if (tmp < 0) tmp = 0; | |
875 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
876 | - mms_editor_set_param(15, mms_op_num, focus_clid - IDC_EDIT_MMS_G15_P1, tmp); // modenv | |
877 | - break; | |
878 | - case IDC_EDIT_MMS_G16_P1: | |
879 | - case IDC_EDIT_MMS_G16_P2: | |
880 | - case IDC_EDIT_MMS_G16_P3: | |
881 | - case IDC_EDIT_MMS_G16_P4: | |
882 | - case IDC_EDIT_MMS_G16_P5: | |
883 | - case IDC_EDIT_MMS_G16_P6: | |
884 | - case IDC_EDIT_MMS_G16_P7: | |
885 | - case IDC_EDIT_MMS_G16_P8: | |
886 | - case IDC_EDIT_MMS_G16_P9: | |
887 | - case IDC_EDIT_MMS_G16_P10: | |
888 | - case IDC_EDIT_MMS_G16_P11: | |
889 | - case IDC_EDIT_MMS_G16_P12: | |
890 | - case IDC_EDIT_MMS_G16_P13: | |
891 | - case IDC_EDIT_MMS_G16_P14: | |
892 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
893 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
894 | - mms_editor_set_param(16, mms_op_num, focus_clid - IDC_EDIT_MMS_G16_P1, tmp); // ampenv_keyf | |
895 | - break; | |
896 | - case IDC_EDIT_MMS_G17_P1: | |
897 | - case IDC_EDIT_MMS_G17_P2: | |
898 | - case IDC_EDIT_MMS_G17_P3: | |
899 | - case IDC_EDIT_MMS_G17_P4: | |
900 | - case IDC_EDIT_MMS_G17_P5: | |
901 | - case IDC_EDIT_MMS_G17_P6: | |
902 | - case IDC_EDIT_MMS_G17_P7: | |
903 | - case IDC_EDIT_MMS_G17_P8: | |
904 | - case IDC_EDIT_MMS_G17_P9: | |
905 | - case IDC_EDIT_MMS_G17_P10: | |
906 | - case IDC_EDIT_MMS_G17_P11: | |
907 | - case IDC_EDIT_MMS_G17_P12: | |
908 | - case IDC_EDIT_MMS_G17_P13: | |
909 | - case IDC_EDIT_MMS_G17_P14: | |
910 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
911 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
912 | - mms_editor_set_param(17, mms_op_num, focus_clid - IDC_EDIT_MMS_G17_P1, tmp); // pitenv_keyf | |
913 | - break; | |
914 | - case IDC_EDIT_MMS_G18_P1: | |
915 | - case IDC_EDIT_MMS_G18_P2: | |
916 | - case IDC_EDIT_MMS_G18_P3: | |
917 | - case IDC_EDIT_MMS_G18_P4: | |
918 | - case IDC_EDIT_MMS_G18_P5: | |
919 | - case IDC_EDIT_MMS_G18_P6: | |
920 | - case IDC_EDIT_MMS_G18_P7: | |
921 | - case IDC_EDIT_MMS_G18_P8: | |
922 | - case IDC_EDIT_MMS_G18_P9: | |
923 | - case IDC_EDIT_MMS_G18_P10: | |
924 | - case IDC_EDIT_MMS_G18_P11: | |
925 | - case IDC_EDIT_MMS_G18_P12: | |
926 | - case IDC_EDIT_MMS_G18_P13: | |
927 | - case IDC_EDIT_MMS_G18_P14: | |
928 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
929 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
930 | - mms_editor_set_param(18, mms_op_num, focus_clid - IDC_EDIT_MMS_G18_P1, tmp); // widenv_keyf | |
931 | - break; | |
932 | - case IDC_EDIT_MMS_G19_P1: | |
933 | - case IDC_EDIT_MMS_G19_P2: | |
934 | - case IDC_EDIT_MMS_G19_P3: | |
935 | - case IDC_EDIT_MMS_G19_P4: | |
936 | - case IDC_EDIT_MMS_G19_P5: | |
937 | - case IDC_EDIT_MMS_G19_P6: | |
938 | - case IDC_EDIT_MMS_G19_P7: | |
939 | - case IDC_EDIT_MMS_G19_P8: | |
940 | - case IDC_EDIT_MMS_G19_P9: | |
941 | - case IDC_EDIT_MMS_G19_P10: | |
942 | - case IDC_EDIT_MMS_G19_P11: | |
943 | - case IDC_EDIT_MMS_G19_P12: | |
944 | - case IDC_EDIT_MMS_G19_P13: | |
945 | - case IDC_EDIT_MMS_G19_P14: | |
946 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
947 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
948 | - mms_editor_set_param(19, mms_op_num, focus_clid - IDC_EDIT_MMS_G19_P1, tmp); // modenv_keyf | |
949 | - break; | |
950 | - case IDC_EDIT_MMS_G20_P1: | |
951 | - case IDC_EDIT_MMS_G20_P2: | |
952 | - case IDC_EDIT_MMS_G20_P3: | |
953 | - case IDC_EDIT_MMS_G20_P4: | |
954 | - case IDC_EDIT_MMS_G20_P5: | |
955 | - case IDC_EDIT_MMS_G20_P6: | |
956 | - case IDC_EDIT_MMS_G20_P7: | |
957 | - case IDC_EDIT_MMS_G20_P8: | |
958 | - case IDC_EDIT_MMS_G20_P9: | |
959 | - case IDC_EDIT_MMS_G20_P10: | |
960 | - case IDC_EDIT_MMS_G20_P11: | |
961 | - case IDC_EDIT_MMS_G20_P12: | |
962 | - case IDC_EDIT_MMS_G20_P13: | |
963 | - case IDC_EDIT_MMS_G20_P14: | |
964 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
965 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
966 | - mms_editor_set_param(20, mms_op_num, focus_clid - IDC_EDIT_MMS_G20_P1, tmp); // ampenv_velf | |
967 | - break; | |
968 | - case IDC_EDIT_MMS_G21_P1: | |
969 | - case IDC_EDIT_MMS_G21_P2: | |
970 | - case IDC_EDIT_MMS_G21_P3: | |
971 | - case IDC_EDIT_MMS_G21_P4: | |
972 | - case IDC_EDIT_MMS_G21_P5: | |
973 | - case IDC_EDIT_MMS_G21_P6: | |
974 | - case IDC_EDIT_MMS_G21_P7: | |
975 | - case IDC_EDIT_MMS_G21_P8: | |
976 | - case IDC_EDIT_MMS_G21_P9: | |
977 | - case IDC_EDIT_MMS_G21_P10: | |
978 | - case IDC_EDIT_MMS_G21_P11: | |
979 | - case IDC_EDIT_MMS_G21_P12: | |
980 | - case IDC_EDIT_MMS_G21_P13: | |
981 | - case IDC_EDIT_MMS_G21_P14: | |
982 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
983 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
984 | - mms_editor_set_param(21, mms_op_num, focus_clid - IDC_EDIT_MMS_G21_P1, tmp); // pitenv_velf | |
985 | - break; | |
986 | - case IDC_EDIT_MMS_G22_P1: | |
987 | - case IDC_EDIT_MMS_G22_P2: | |
988 | - case IDC_EDIT_MMS_G22_P3: | |
989 | - case IDC_EDIT_MMS_G22_P4: | |
990 | - case IDC_EDIT_MMS_G22_P5: | |
991 | - case IDC_EDIT_MMS_G22_P6: | |
992 | - case IDC_EDIT_MMS_G22_P7: | |
993 | - case IDC_EDIT_MMS_G22_P8: | |
994 | - case IDC_EDIT_MMS_G22_P9: | |
995 | - case IDC_EDIT_MMS_G22_P10: | |
996 | - case IDC_EDIT_MMS_G22_P11: | |
997 | - case IDC_EDIT_MMS_G22_P12: | |
998 | - case IDC_EDIT_MMS_G22_P13: | |
999 | - case IDC_EDIT_MMS_G22_P14: | |
1000 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1001 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1002 | - mms_editor_set_param(22, mms_op_num, focus_clid - IDC_EDIT_MMS_G22_P1, tmp); // widenv_velf | |
1003 | - break; | |
1004 | - case IDC_EDIT_MMS_G23_P1: | |
1005 | - case IDC_EDIT_MMS_G23_P2: | |
1006 | - case IDC_EDIT_MMS_G23_P3: | |
1007 | - case IDC_EDIT_MMS_G23_P4: | |
1008 | - case IDC_EDIT_MMS_G23_P5: | |
1009 | - case IDC_EDIT_MMS_G23_P6: | |
1010 | - case IDC_EDIT_MMS_G23_P7: | |
1011 | - case IDC_EDIT_MMS_G23_P8: | |
1012 | - case IDC_EDIT_MMS_G23_P9: | |
1013 | - case IDC_EDIT_MMS_G23_P10: | |
1014 | - case IDC_EDIT_MMS_G23_P11: | |
1015 | - case IDC_EDIT_MMS_G23_P12: | |
1016 | - case IDC_EDIT_MMS_G23_P13: | |
1017 | - case IDC_EDIT_MMS_G23_P14: | |
1018 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1019 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1020 | - mms_editor_set_param(23, mms_op_num, focus_clid - IDC_EDIT_MMS_G23_P1, tmp); // modenv_velf | |
1021 | - break; | |
1022 | - case IDC_EDIT_MMS_G24_P1: | |
1023 | - case IDC_EDIT_MMS_G24_P2: | |
1024 | - case IDC_EDIT_MMS_G24_P3: | |
1025 | - case IDC_EDIT_MMS_G24_P4: | |
1026 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1027 | - if (tmp < 0) tmp = 0; | |
1028 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1029 | - mms_editor_set_param(24, mms_op_num, focus_clid - IDC_EDIT_MMS_G24_P1, tmp); // lfo1 | |
1030 | - if (focus_clid == IDC_EDIT_MMS_G24_P3) | |
1031 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO1_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 0)); | |
1032 | - break; | |
1033 | - case IDC_EDIT_MMS_G25_P1: | |
1034 | - case IDC_EDIT_MMS_G25_P2: | |
1035 | - case IDC_EDIT_MMS_G25_P3: | |
1036 | - case IDC_EDIT_MMS_G25_P4: | |
1037 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1038 | - if (tmp < 0) tmp = 0; | |
1039 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1040 | - mms_editor_set_param(25, mms_op_num, focus_clid - IDC_EDIT_MMS_G25_P1, tmp); // lfo2 | |
1041 | - if (focus_clid == IDC_EDIT_MMS_G25_P3) | |
1042 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO2_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 1)); | |
1043 | - break; | |
1044 | - case IDC_EDIT_MMS_G26_P1: | |
1045 | - case IDC_EDIT_MMS_G26_P2: | |
1046 | - case IDC_EDIT_MMS_G26_P3: | |
1047 | - case IDC_EDIT_MMS_G26_P4: | |
1048 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1049 | - if (tmp < 0) tmp = 0; | |
1050 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1051 | - mms_editor_set_param(26, mms_op_num, focus_clid - IDC_EDIT_MMS_G26_P1, tmp); // lfo3 | |
1052 | - if (focus_clid == IDC_EDIT_MMS_G26_P3) | |
1053 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO3_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 2)); | |
1054 | - break; | |
1055 | - case IDC_EDIT_MMS_G27_P1: | |
1056 | - case IDC_EDIT_MMS_G27_P2: | |
1057 | - case IDC_EDIT_MMS_G27_P3: | |
1058 | - case IDC_EDIT_MMS_G27_P4: | |
1059 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1060 | - if (tmp < 0) tmp = 0; | |
1061 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1062 | - mms_editor_set_param(27, mms_op_num, focus_clid - IDC_EDIT_MMS_G27_P1, tmp); // lfo4 | |
1063 | - if (focus_clid == IDC_EDIT_MMS_G27_P3) | |
1064 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO4_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 3)); | |
1065 | - break; | |
1066 | - case IDC_EDIT_MMS_G28_P1: | |
1067 | - case IDC_EDIT_MMS_G28_P2: | |
1068 | - case IDC_EDIT_MMS_G28_P3: | |
1069 | - case IDC_EDIT_MMS_G28_P4: | |
1070 | - tmp = (int) GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1071 | - if (tmp < 0) tmp = 0; | |
1072 | - SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1073 | - mms_editor_set_param(28, mms_op_num, focus_clid - IDC_EDIT_MMS_G28_P1, tmp); // loop | |
1074 | - break; | |
1075 | - } | |
1076 | - break; | |
1077 | - case WM_COMMAND: | |
1078 | - clid = LOWORD(wParam); | |
1079 | - prv_focus_clid = focus_clid; | |
1080 | - focus_clid = clid; | |
1081 | - focus_wnd = 3; | |
1082 | - switch (clid) { | |
1083 | - case IDC_CHK_MMS_OVERRIDE: | |
1084 | - DLG_CHECKBUTTON_TO_FLAG(hwnd, IDC_CHK_MMS_OVERRIDE, mms_editor_override); | |
1085 | - break; | |
1086 | - case IDC_BUTTON_MMS_DELETE_PRESET: | |
1087 | - mms_editor_delete_preset(mms_preset_num); | |
1088 | - break; | |
1089 | - case IDC_BUTTON_MMS_LOAD_PRESET: | |
1090 | - SetDlgItemText(hwnd,IDC_EDIT_MMS_NAME, mms_editor_load_name(mms_preset_num)); | |
1091 | - mms_editor_load_preset(mms_preset_num); | |
1092 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
1093 | - break; | |
1094 | - case IDC_BUTTON_MMS_SAVE_PRESET: | |
1095 | - { | |
1096 | - char buff[256]; | |
1097 | - GetDlgItemText(hwnd, IDC_EDIT_MMS_NAME, buff, (WPARAM) sizeof(buff)); | |
1098 | - mms_editor_store_name(mms_preset_num, (const char*) buff); | |
1099 | - mms_editor_store_preset(mms_preset_num); | |
1100 | - } | |
1101 | - break; | |
1102 | - case IDC_BUTTON_MMS_LOAD_TEMP: | |
1103 | - mms_editor_load_preset(-1); | |
1104 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
1105 | - break; | |
1106 | - case IDC_BUTTON_MMS_SAVE_TEMP: | |
1107 | - mms_editor_store_preset(-1); | |
1108 | - break; | |
1109 | - case IDC_BUTTON_MMS_MAGIC_PARAM: | |
1110 | - mms_editor_set_magic_param(); | |
1111 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
1112 | - break; | |
1113 | - case IDC_EDIT_MMS_NUM: | |
1114 | - tmp = (int) GetDlgItemInt(hwnd, IDC_EDIT_MMS_NUM, NULL, TRUE); | |
1115 | - if (tmp < 0) | |
1116 | - tmp = 0; | |
1117 | - else if (tmp > (MMS_SETTING_MAX - 1)) | |
1118 | - tmp = MMS_SETTING_MAX - 1; | |
1119 | - mms_preset_num = tmp; | |
1120 | - SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) mms_preset_num); | |
1121 | - break; | |
1122 | - case IDC_BUTTON_MMS_OP0: | |
1123 | - case IDC_BUTTON_MMS_OP1: | |
1124 | - case IDC_BUTTON_MMS_OP2: | |
1125 | - case IDC_BUTTON_MMS_OP3: | |
1126 | - case IDC_BUTTON_MMS_OP4: | |
1127 | - case IDC_BUTTON_MMS_OP5: | |
1128 | - case IDC_BUTTON_MMS_OP6: | |
1129 | - case IDC_BUTTON_MMS_OP7: | |
1130 | - case IDC_BUTTON_MMS_OP8: | |
1131 | - case IDC_BUTTON_MMS_OP9: | |
1132 | - case IDC_BUTTON_MMS_OP10: | |
1133 | - case IDC_BUTTON_MMS_OP11: | |
1134 | - case IDC_BUTTON_MMS_OP12: | |
1135 | - case IDC_BUTTON_MMS_OP13: | |
1136 | - case IDC_BUTTON_MMS_OP14: | |
1137 | - case IDC_BUTTON_MMS_OP15: | |
1138 | - tmp = clid - IDC_BUTTON_MMS_OP0; | |
1139 | - if (tmp != mms_op_num) { | |
1140 | - mms_op_num = tmp; // op change | |
1141 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
1142 | - } | |
1143 | - break; | |
1144 | - case IDC_EDIT_MMS_OP_NUM: | |
1145 | - mms_editor_set_param(0, 0, 0, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // op max | |
1146 | - break; | |
1147 | - case IDC_BUTTON_MMS_OP_ALL_CLEAR: | |
1148 | - mms_editor_set_default_param(-1, -1); | |
1149 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
1150 | - break; | |
1151 | - case IDC_BUTTON_MMS_OP_CLEAR: | |
1152 | - mms_editor_set_default_param(-1, mms_op_num); | |
1153 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
1154 | - break; | |
1155 | - case IDC_EDIT_MMS_G1_P1: | |
1156 | - case IDC_EDIT_MMS_G1_P2: | |
1157 | - case IDC_EDIT_MMS_G1_P3: | |
1158 | - case IDC_EDIT_MMS_G1_P4: | |
1159 | - mms_editor_set_param(1, mms_op_num, clid - IDC_EDIT_MMS_G1_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // range | |
1160 | - break; | |
1161 | - case IDC_EDIT_MMS_G2_P1: | |
1162 | - case IDC_EDIT_MMS_G2_P2: | |
1163 | - case IDC_EDIT_MMS_G2_P3: | |
1164 | - case IDC_EDIT_MMS_G2_P4: | |
1165 | - mms_editor_set_param(2, mms_op_num, clid - IDC_EDIT_MMS_G2_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // param | |
1166 | - break; | |
1167 | - case IDC_EDIT_MMS_G3_P1: | |
1168 | - case IDC_EDIT_MMS_G3_P2: | |
1169 | - case IDC_EDIT_MMS_G3_P3: | |
1170 | - case IDC_EDIT_MMS_G3_P4: | |
1171 | - mms_editor_set_param(3, mms_op_num, clid - IDC_EDIT_MMS_G3_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // connect | |
1172 | - break; | |
1173 | - case IDC_EDIT_MMS_G4_P1: | |
1174 | - case IDC_EDIT_MMS_G4_P2: | |
1175 | - case IDC_EDIT_MMS_G4_P3: | |
1176 | - case IDC_EDIT_MMS_G4_P4: | |
1177 | - mms_editor_set_param(4, mms_op_num, clid - IDC_EDIT_MMS_G4_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // osc | |
1178 | - break; | |
1179 | - case IDC_EDIT_MMS_G5_P1: | |
1180 | - case IDC_EDIT_MMS_G5_P2: | |
1181 | - case IDC_EDIT_MMS_G5_P3: | |
1182 | - case IDC_EDIT_MMS_G5_P4: | |
1183 | - case IDC_EDIT_MMS_G5_P5: | |
1184 | - case IDC_EDIT_MMS_G5_P6: | |
1185 | - case IDC_EDIT_MMS_G5_P7: | |
1186 | - case IDC_EDIT_MMS_G5_P8: | |
1187 | - mms_editor_set_param(5, mms_op_num, clid - IDC_EDIT_MMS_G5_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // wave | |
1188 | - if (clid == IDC_EDIT_MMS_G5_P1 || clid == IDC_EDIT_MMS_G5_P2) | |
1189 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_WAVE_DATA_NAME, mms_editor_load_wave_name(mms_op_num, -1)); | |
1190 | - break; | |
1191 | - case IDC_EDIT_MMS_G6_P1: | |
1192 | - case IDC_EDIT_MMS_G6_P2: | |
1193 | - case IDC_EDIT_MMS_G6_P3: | |
1194 | - case IDC_EDIT_MMS_G6_P4: | |
1195 | - mms_editor_set_param(6, mms_op_num, clid - IDC_EDIT_MMS_G6_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // sub | |
1196 | - break; | |
1197 | - case IDC_EDIT_MMS_G7_P1: | |
1198 | - case IDC_EDIT_MMS_G7_P2: | |
1199 | - mms_editor_set_param(7, mms_op_num, clid - IDC_EDIT_MMS_G7_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // amp | |
1200 | - break; | |
1201 | - case IDC_EDIT_MMS_G8_P1: | |
1202 | - case IDC_EDIT_MMS_G8_P2: | |
1203 | - case IDC_EDIT_MMS_G8_P3: | |
1204 | - case IDC_EDIT_MMS_G8_P4: | |
1205 | - mms_editor_set_param(8, mms_op_num, clid - IDC_EDIT_MMS_G8_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitch | |
1206 | - break; | |
1207 | - case IDC_EDIT_MMS_G9_P1: | |
1208 | - case IDC_EDIT_MMS_G9_P2: | |
1209 | - case IDC_EDIT_MMS_G9_P3: | |
1210 | - case IDC_EDIT_MMS_G9_P4: | |
1211 | - mms_editor_set_param(9, mms_op_num, clid - IDC_EDIT_MMS_G9_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // width | |
1212 | - break; | |
1213 | - case IDC_EDIT_MMS_G10_P1: | |
1214 | - case IDC_EDIT_MMS_G10_P2: | |
1215 | - case IDC_EDIT_MMS_G10_P3: | |
1216 | - case IDC_EDIT_MMS_G10_P4: | |
1217 | - mms_editor_set_param(10, mms_op_num, clid - IDC_EDIT_MMS_G10_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // filter | |
1218 | - if (clid == IDC_EDIT_MMS_G10_P1) | |
1219 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_FILTER_NAME, mms_editor_load_filter_name(mms_op_num)); | |
1220 | - break; | |
1221 | - case IDC_EDIT_MMS_G11_P1: | |
1222 | - case IDC_EDIT_MMS_G11_P2: | |
1223 | - case IDC_EDIT_MMS_G11_P3: | |
1224 | - case IDC_EDIT_MMS_G11_P4: | |
1225 | - mms_editor_set_param(11, mms_op_num, clid - IDC_EDIT_MMS_G11_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // cutoff | |
1226 | - break; | |
1227 | - case IDC_EDIT_MMS_G12_P1: | |
1228 | - case IDC_EDIT_MMS_G12_P2: | |
1229 | - case IDC_EDIT_MMS_G12_P3: | |
1230 | - case IDC_EDIT_MMS_G12_P4: | |
1231 | - case IDC_EDIT_MMS_G12_P5: | |
1232 | - case IDC_EDIT_MMS_G12_P6: | |
1233 | - case IDC_EDIT_MMS_G12_P7: | |
1234 | - case IDC_EDIT_MMS_G12_P8: | |
1235 | - case IDC_EDIT_MMS_G12_P9: | |
1236 | - case IDC_EDIT_MMS_G12_P10: | |
1237 | - case IDC_EDIT_MMS_G12_P11: | |
1238 | - case IDC_EDIT_MMS_G12_P12: | |
1239 | - case IDC_EDIT_MMS_G12_P13: | |
1240 | - case IDC_EDIT_MMS_G12_P14: | |
1241 | - mms_editor_set_param(12, mms_op_num, clid - IDC_EDIT_MMS_G12_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // ampenv | |
1242 | - break; | |
1243 | - case IDC_EDIT_MMS_G13_P1: | |
1244 | - case IDC_EDIT_MMS_G13_P2: | |
1245 | - case IDC_EDIT_MMS_G13_P3: | |
1246 | - case IDC_EDIT_MMS_G13_P4: | |
1247 | - case IDC_EDIT_MMS_G13_P5: | |
1248 | - case IDC_EDIT_MMS_G13_P6: | |
1249 | - case IDC_EDIT_MMS_G13_P7: | |
1250 | - case IDC_EDIT_MMS_G13_P8: | |
1251 | - case IDC_EDIT_MMS_G13_P9: | |
1252 | - case IDC_EDIT_MMS_G13_P10: | |
1253 | - case IDC_EDIT_MMS_G13_P11: | |
1254 | - case IDC_EDIT_MMS_G13_P12: | |
1255 | - case IDC_EDIT_MMS_G13_P13: | |
1256 | - case IDC_EDIT_MMS_G13_P14: | |
1257 | - mms_editor_set_param(13, mms_op_num, clid - IDC_EDIT_MMS_G13_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitenv | |
1258 | - break; | |
1259 | - case IDC_EDIT_MMS_G14_P1: | |
1260 | - case IDC_EDIT_MMS_G14_P2: | |
1261 | - case IDC_EDIT_MMS_G14_P3: | |
1262 | - case IDC_EDIT_MMS_G14_P4: | |
1263 | - case IDC_EDIT_MMS_G14_P5: | |
1264 | - case IDC_EDIT_MMS_G14_P6: | |
1265 | - case IDC_EDIT_MMS_G14_P7: | |
1266 | - case IDC_EDIT_MMS_G14_P8: | |
1267 | - case IDC_EDIT_MMS_G14_P9: | |
1268 | - case IDC_EDIT_MMS_G14_P10: | |
1269 | - case IDC_EDIT_MMS_G14_P11: | |
1270 | - case IDC_EDIT_MMS_G14_P12: | |
1271 | - case IDC_EDIT_MMS_G14_P13: | |
1272 | - case IDC_EDIT_MMS_G14_P14: | |
1273 | - mms_editor_set_param(14, mms_op_num, clid - IDC_EDIT_MMS_G14_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // widenv | |
1274 | - break; | |
1275 | - case IDC_EDIT_MMS_G15_P1: | |
1276 | - case IDC_EDIT_MMS_G15_P2: | |
1277 | - case IDC_EDIT_MMS_G15_P3: | |
1278 | - case IDC_EDIT_MMS_G15_P4: | |
1279 | - case IDC_EDIT_MMS_G15_P5: | |
1280 | - case IDC_EDIT_MMS_G15_P6: | |
1281 | - case IDC_EDIT_MMS_G15_P7: | |
1282 | - case IDC_EDIT_MMS_G15_P8: | |
1283 | - case IDC_EDIT_MMS_G15_P9: | |
1284 | - case IDC_EDIT_MMS_G15_P10: | |
1285 | - case IDC_EDIT_MMS_G15_P11: | |
1286 | - case IDC_EDIT_MMS_G15_P12: | |
1287 | - case IDC_EDIT_MMS_G15_P13: | |
1288 | - case IDC_EDIT_MMS_G15_P14: | |
1289 | - mms_editor_set_param(15, mms_op_num, clid - IDC_EDIT_MMS_G15_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // modenv | |
1290 | - break; | |
1291 | - case IDC_EDIT_MMS_G16_P1: | |
1292 | - case IDC_EDIT_MMS_G16_P2: | |
1293 | - case IDC_EDIT_MMS_G16_P3: | |
1294 | - case IDC_EDIT_MMS_G16_P4: | |
1295 | - case IDC_EDIT_MMS_G16_P5: | |
1296 | - case IDC_EDIT_MMS_G16_P6: | |
1297 | - case IDC_EDIT_MMS_G16_P7: | |
1298 | - case IDC_EDIT_MMS_G16_P8: | |
1299 | - case IDC_EDIT_MMS_G16_P9: | |
1300 | - case IDC_EDIT_MMS_G16_P10: | |
1301 | - case IDC_EDIT_MMS_G16_P11: | |
1302 | - case IDC_EDIT_MMS_G16_P12: | |
1303 | - case IDC_EDIT_MMS_G16_P13: | |
1304 | - case IDC_EDIT_MMS_G16_P14: | |
1305 | - mms_editor_set_param(16, mms_op_num, clid - IDC_EDIT_MMS_G16_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // ampenv_keyf | |
1306 | - break; | |
1307 | - case IDC_EDIT_MMS_G17_P1: | |
1308 | - case IDC_EDIT_MMS_G17_P2: | |
1309 | - case IDC_EDIT_MMS_G17_P3: | |
1310 | - case IDC_EDIT_MMS_G17_P4: | |
1311 | - case IDC_EDIT_MMS_G17_P5: | |
1312 | - case IDC_EDIT_MMS_G17_P6: | |
1313 | - case IDC_EDIT_MMS_G17_P7: | |
1314 | - case IDC_EDIT_MMS_G17_P8: | |
1315 | - case IDC_EDIT_MMS_G17_P9: | |
1316 | - case IDC_EDIT_MMS_G17_P10: | |
1317 | - case IDC_EDIT_MMS_G17_P11: | |
1318 | - case IDC_EDIT_MMS_G17_P12: | |
1319 | - case IDC_EDIT_MMS_G17_P13: | |
1320 | - case IDC_EDIT_MMS_G17_P14: | |
1321 | - mms_editor_set_param(17, mms_op_num, clid - IDC_EDIT_MMS_G17_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitenv_keyf | |
1322 | - break; | |
1323 | - case IDC_EDIT_MMS_G18_P1: | |
1324 | - case IDC_EDIT_MMS_G18_P2: | |
1325 | - case IDC_EDIT_MMS_G18_P3: | |
1326 | - case IDC_EDIT_MMS_G18_P4: | |
1327 | - case IDC_EDIT_MMS_G18_P5: | |
1328 | - case IDC_EDIT_MMS_G18_P6: | |
1329 | - case IDC_EDIT_MMS_G18_P7: | |
1330 | - case IDC_EDIT_MMS_G18_P8: | |
1331 | - case IDC_EDIT_MMS_G18_P9: | |
1332 | - case IDC_EDIT_MMS_G18_P10: | |
1333 | - case IDC_EDIT_MMS_G18_P11: | |
1334 | - case IDC_EDIT_MMS_G18_P12: | |
1335 | - case IDC_EDIT_MMS_G18_P13: | |
1336 | - case IDC_EDIT_MMS_G18_P14: | |
1337 | - mms_editor_set_param(18, mms_op_num, clid - IDC_EDIT_MMS_G18_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // widenv_keyf | |
1338 | - break; | |
1339 | - case IDC_EDIT_MMS_G19_P1: | |
1340 | - case IDC_EDIT_MMS_G19_P2: | |
1341 | - case IDC_EDIT_MMS_G19_P3: | |
1342 | - case IDC_EDIT_MMS_G19_P4: | |
1343 | - case IDC_EDIT_MMS_G19_P5: | |
1344 | - case IDC_EDIT_MMS_G19_P6: | |
1345 | - case IDC_EDIT_MMS_G19_P7: | |
1346 | - case IDC_EDIT_MMS_G19_P8: | |
1347 | - case IDC_EDIT_MMS_G19_P9: | |
1348 | - case IDC_EDIT_MMS_G19_P10: | |
1349 | - case IDC_EDIT_MMS_G19_P11: | |
1350 | - case IDC_EDIT_MMS_G19_P12: | |
1351 | - case IDC_EDIT_MMS_G19_P13: | |
1352 | - case IDC_EDIT_MMS_G19_P14: | |
1353 | - mms_editor_set_param(19, mms_op_num, clid - IDC_EDIT_MMS_G19_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // modenv_keyf | |
1354 | - break; | |
1355 | - case IDC_EDIT_MMS_G20_P1: | |
1356 | - case IDC_EDIT_MMS_G20_P2: | |
1357 | - case IDC_EDIT_MMS_G20_P3: | |
1358 | - case IDC_EDIT_MMS_G20_P4: | |
1359 | - case IDC_EDIT_MMS_G20_P5: | |
1360 | - case IDC_EDIT_MMS_G20_P6: | |
1361 | - case IDC_EDIT_MMS_G20_P7: | |
1362 | - case IDC_EDIT_MMS_G20_P8: | |
1363 | - case IDC_EDIT_MMS_G20_P9: | |
1364 | - case IDC_EDIT_MMS_G20_P10: | |
1365 | - case IDC_EDIT_MMS_G20_P11: | |
1366 | - case IDC_EDIT_MMS_G20_P12: | |
1367 | - case IDC_EDIT_MMS_G20_P13: | |
1368 | - case IDC_EDIT_MMS_G20_P14: | |
1369 | - mms_editor_set_param(20, mms_op_num, clid - IDC_EDIT_MMS_G20_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // ampenv_velf | |
1370 | - break; | |
1371 | - case IDC_EDIT_MMS_G21_P1: | |
1372 | - case IDC_EDIT_MMS_G21_P2: | |
1373 | - case IDC_EDIT_MMS_G21_P3: | |
1374 | - case IDC_EDIT_MMS_G21_P4: | |
1375 | - case IDC_EDIT_MMS_G21_P5: | |
1376 | - case IDC_EDIT_MMS_G21_P6: | |
1377 | - case IDC_EDIT_MMS_G21_P7: | |
1378 | - case IDC_EDIT_MMS_G21_P8: | |
1379 | - case IDC_EDIT_MMS_G21_P9: | |
1380 | - case IDC_EDIT_MMS_G21_P10: | |
1381 | - case IDC_EDIT_MMS_G21_P11: | |
1382 | - case IDC_EDIT_MMS_G21_P12: | |
1383 | - case IDC_EDIT_MMS_G21_P13: | |
1384 | - case IDC_EDIT_MMS_G21_P14: | |
1385 | - mms_editor_set_param(21, mms_op_num, clid - IDC_EDIT_MMS_G21_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitenv_velf | |
1386 | - break; | |
1387 | - case IDC_EDIT_MMS_G22_P1: | |
1388 | - case IDC_EDIT_MMS_G22_P2: | |
1389 | - case IDC_EDIT_MMS_G22_P3: | |
1390 | - case IDC_EDIT_MMS_G22_P4: | |
1391 | - case IDC_EDIT_MMS_G22_P5: | |
1392 | - case IDC_EDIT_MMS_G22_P6: | |
1393 | - case IDC_EDIT_MMS_G22_P7: | |
1394 | - case IDC_EDIT_MMS_G22_P8: | |
1395 | - case IDC_EDIT_MMS_G22_P9: | |
1396 | - case IDC_EDIT_MMS_G22_P10: | |
1397 | - case IDC_EDIT_MMS_G22_P11: | |
1398 | - case IDC_EDIT_MMS_G22_P12: | |
1399 | - case IDC_EDIT_MMS_G22_P13: | |
1400 | - case IDC_EDIT_MMS_G22_P14: | |
1401 | - mms_editor_set_param(22, mms_op_num, clid - IDC_EDIT_MMS_G22_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // widenv_velf | |
1402 | - break; | |
1403 | - case IDC_EDIT_MMS_G23_P1: | |
1404 | - case IDC_EDIT_MMS_G23_P2: | |
1405 | - case IDC_EDIT_MMS_G23_P3: | |
1406 | - case IDC_EDIT_MMS_G23_P4: | |
1407 | - case IDC_EDIT_MMS_G23_P5: | |
1408 | - case IDC_EDIT_MMS_G23_P6: | |
1409 | - case IDC_EDIT_MMS_G23_P7: | |
1410 | - case IDC_EDIT_MMS_G23_P8: | |
1411 | - case IDC_EDIT_MMS_G23_P9: | |
1412 | - case IDC_EDIT_MMS_G23_P10: | |
1413 | - case IDC_EDIT_MMS_G23_P11: | |
1414 | - case IDC_EDIT_MMS_G23_P12: | |
1415 | - case IDC_EDIT_MMS_G23_P13: | |
1416 | - case IDC_EDIT_MMS_G23_P14: | |
1417 | - mms_editor_set_param(23, mms_op_num, clid - IDC_EDIT_MMS_G23_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // modenv_velf | |
1418 | - break; | |
1419 | - case IDC_EDIT_MMS_G24_P1: | |
1420 | - case IDC_EDIT_MMS_G24_P2: | |
1421 | - case IDC_EDIT_MMS_G24_P3: | |
1422 | - case IDC_EDIT_MMS_G24_P4: | |
1423 | - mms_editor_set_param(24, mms_op_num, clid - IDC_EDIT_MMS_G24_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo1 | |
1424 | - if (clid == IDC_EDIT_MMS_G24_P3) | |
1425 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO1_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 0)); | |
1426 | - break; | |
1427 | - case IDC_EDIT_MMS_G25_P1: | |
1428 | - case IDC_EDIT_MMS_G25_P2: | |
1429 | - case IDC_EDIT_MMS_G25_P3: | |
1430 | - case IDC_EDIT_MMS_G25_P4: | |
1431 | - mms_editor_set_param(25, mms_op_num, clid - IDC_EDIT_MMS_G25_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo2 | |
1432 | - if (clid == IDC_EDIT_MMS_G25_P3) | |
1433 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO2_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 1)); | |
1434 | - break; | |
1435 | - case IDC_EDIT_MMS_G26_P1: | |
1436 | - case IDC_EDIT_MMS_G26_P2: | |
1437 | - case IDC_EDIT_MMS_G26_P3: | |
1438 | - case IDC_EDIT_MMS_G26_P4: | |
1439 | - mms_editor_set_param(26, mms_op_num, clid - IDC_EDIT_MMS_G26_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo3 | |
1440 | - if (clid == IDC_EDIT_MMS_G26_P3) | |
1441 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO3_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 2)); | |
1442 | - break; | |
1443 | - case IDC_EDIT_MMS_G27_P1: | |
1444 | - case IDC_EDIT_MMS_G27_P2: | |
1445 | - case IDC_EDIT_MMS_G27_P3: | |
1446 | - case IDC_EDIT_MMS_G27_P4: | |
1447 | - mms_editor_set_param(27, mms_op_num, clid - IDC_EDIT_MMS_G27_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo4 | |
1448 | - if (clid == IDC_EDIT_MMS_G27_P3) | |
1449 | - SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO4_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 3)); | |
1450 | - break; | |
1451 | - case IDC_EDIT_MMS_G28_P1: | |
1452 | - case IDC_EDIT_MMS_G28_P2: | |
1453 | - case IDC_EDIT_MMS_G28_P3: | |
1454 | - case IDC_EDIT_MMS_G28_P4: | |
1455 | - mms_editor_set_param(28, mms_op_num, clid - IDC_EDIT_MMS_G28_P1, (int) GetDlgItemInt(hwnd, clid, NULL, TRUE)); // loop | |
1456 | - break; | |
1457 | - case IDC_EDIT_MMS_WAVE_DATA_NAME: | |
1458 | - focus_clid = prv_focus_clid; | |
1459 | - break; | |
1460 | - case IDC_EDIT_MMS_FILTER_NAME: | |
1461 | - focus_clid = IDC_EDIT_MMS_G10_P1; | |
1462 | - break; | |
1463 | - case IDC_EDIT_MMS_LFO1_WAVE_NAME: | |
1464 | - focus_clid = IDC_EDIT_MMS_G24_P3; | |
1465 | - break; | |
1466 | - case IDC_EDIT_MMS_LFO2_WAVE_NAME: | |
1467 | - focus_clid = IDC_EDIT_MMS_G25_P3; | |
1468 | - break; | |
1469 | - case IDC_EDIT_MMS_LFO3_WAVE_NAME: | |
1470 | - focus_clid = IDC_EDIT_MMS_G26_P3; | |
1471 | - break; | |
1472 | - case IDC_EDIT_MMS_LFO4_WAVE_NAME: | |
1473 | - focus_clid = IDC_EDIT_MMS_G27_P3; | |
1474 | - break; | |
1475 | - } | |
1476 | - break; | |
1477 | - case WM_SIZE: | |
1478 | - return FALSE; | |
1479 | - case WM_DESTROY: | |
1480 | - break; | |
1481 | - default: | |
1482 | - break; | |
1483 | - } | |
1484 | - return FALSE; | |
607 | + switch (uMess) { | |
608 | + case WM_INITDIALOG: | |
609 | + SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_SETRANGEMAX, (WPARAM) 0, (LPARAM) MMS_SETTING_MAX - 1); | |
610 | + SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_SETRANGEMIN, (WPARAM) 0, (LPARAM) 0); | |
611 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_NUM, mms_preset_num, TRUE); | |
612 | + SetDlgItemText(hwnd,IDC_EDIT_MMS_NAME, mms_editor_load_name(mms_preset_num)); | |
613 | + case WM_ISE_RESTORE: | |
614 | + DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHK_MMS_OVERRIDE, mms_editor_override); | |
615 | + SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) mms_preset_num); | |
616 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_OP_NUM, mms_editor_get_param(0, 0, 0), TRUE); // op max | |
617 | + for(i = 0; i < MMS_OP_MAX; i++) | |
618 | + DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_BUTTON_MMS_OP0 + i, (i == mms_op_num) ? 1 : 0); | |
619 | + for(i = 0; i < MMS_OP_RANGE_MAX; i++) | |
620 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G1_P1 + i, mms_editor_get_param(1, mms_op_num, i), TRUE); // range | |
621 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G2_P1, mms_editor_get_param(2, mms_op_num, 0), TRUE); // param | |
622 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G2_P2, mms_editor_get_param(2, mms_op_num, 1), TRUE); // param | |
623 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G2_P3, mms_editor_get_param(2, mms_op_num, 2), TRUE); // param | |
624 | + for(i = 0; i < MMS_OP_CON_MAX; i++) | |
625 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G3_P1 + i, mms_editor_get_param(3, mms_op_num, i), TRUE); // con | |
626 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G4_P1, mms_editor_get_param(4, mms_op_num, 0), TRUE); // osc | |
627 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G4_P2, mms_editor_get_param(4, mms_op_num, 1), TRUE); // osc | |
628 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G4_P3, mms_editor_get_param(4, mms_op_num, 2), TRUE); // osc | |
629 | + for(i = 0; i < MMS_OP_WAVE_MAX; i++) | |
630 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G5_P1 + i, mms_editor_get_param(5, mms_op_num, i), TRUE); // wave | |
631 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_WAVE_DATA_NAME, mms_editor_load_wave_name(mms_op_num, -1)); | |
632 | + for(i = 0; i < MMS_OP_SUB_MAX; i++) | |
633 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G6_P1 + i, mms_editor_get_param(6, mms_op_num, i), TRUE); // sub | |
634 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G7_P1, mms_editor_get_param(7, mms_op_num, 0), TRUE); // amp | |
635 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G8_P1, mms_editor_get_param(8, mms_op_num, 0), TRUE); // pit | |
636 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G8_P2, mms_editor_get_param(8, mms_op_num, 1), TRUE); // pit | |
637 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G8_P3, mms_editor_get_param(8, mms_op_num, 2), TRUE); // pit | |
638 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G9_P1, mms_editor_get_param(9, mms_op_num, 0), TRUE); // wid | |
639 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G9_P2, mms_editor_get_param(9, mms_op_num, 1), TRUE); // wid | |
640 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G9_P3, mms_editor_get_param(9, mms_op_num, 2), TRUE); // wid | |
641 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G10_P1, mms_editor_get_param(10, mms_op_num, 0), TRUE); // flt | |
642 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_FILTER_NAME, mms_editor_load_filter_name(mms_op_num)); // flt type | |
643 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G10_P2, mms_editor_get_param(10, mms_op_num, 1), TRUE); // flt | |
644 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G10_P3, mms_editor_get_param(10, mms_op_num, 2), TRUE); // flt | |
645 | + for(i = 0; i < MMS_OP_CUT_PARAM; i++) | |
646 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G11_P1 + i, mms_editor_get_param(11, mms_op_num, i), TRUE); // cutoff | |
647 | + for(i = 0; i < MMS_OP_ENV_PARAM; i++){ | |
648 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G12_P1 + i, mms_editor_get_param(12, mms_op_num, i), TRUE); // ampenv | |
649 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G13_P1 + i, mms_editor_get_param(13, mms_op_num, i), TRUE); // pitenv | |
650 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G14_P1 + i, mms_editor_get_param(14, mms_op_num, i), TRUE); // widenv | |
651 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G15_P1 + i, mms_editor_get_param(15, mms_op_num, i), TRUE); // modenv | |
652 | + if(i >= 12) continue; | |
653 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G16_P1 + i, mms_editor_get_param(16, mms_op_num, i), TRUE); // ampenv_keyf | |
654 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G17_P1 + i, mms_editor_get_param(17, mms_op_num, i), TRUE); // pitenv_keyf | |
655 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G18_P1 + i, mms_editor_get_param(18, mms_op_num, i), TRUE); // widenv_keyf | |
656 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G19_P1 + i, mms_editor_get_param(19, mms_op_num, i), TRUE); // modenv_keyf | |
657 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G20_P1 + i, mms_editor_get_param(20, mms_op_num, i), TRUE); // ampenv_velf | |
658 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G21_P1 + i, mms_editor_get_param(21, mms_op_num, i), TRUE); // pitenv_velf | |
659 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G22_P1 + i, mms_editor_get_param(22, mms_op_num, i), TRUE); // widenv_velf | |
660 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G23_P1 + i, mms_editor_get_param(23, mms_op_num, i), TRUE); // modenv_velf | |
661 | + } | |
662 | + for(i = 0; i < MMS_OP_LFO_PARAM; i++){ | |
663 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G24_P1 + i, mms_editor_get_param(24, mms_op_num, i), TRUE); // lfo1 | |
664 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G25_P1 + i, mms_editor_get_param(25, mms_op_num, i), TRUE); // lfo2 | |
665 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G26_P1 + i, mms_editor_get_param(26, mms_op_num, i), TRUE); // lfo3 | |
666 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G27_P1 + i, mms_editor_get_param(27, mms_op_num, i), TRUE); // lfo4 | |
667 | + } | |
668 | + for(i = 0; i < MMS_OP_MODE_MAX; i++) | |
669 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_G28_P1 + i, mms_editor_get_param(28, mms_op_num, i), TRUE); // mode | |
670 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO1_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 0)); | |
671 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO2_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 1)); | |
672 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO3_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 2)); | |
673 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO4_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 3)); | |
674 | + break; | |
675 | + case WM_HSCROLL: | |
676 | + case WM_VSCROLL: | |
677 | + tmp = SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_GETPOS, (WPARAM) 0, (LPARAM)0); | |
678 | + if(tmp != mms_preset_num){ | |
679 | + mms_preset_num = tmp; | |
680 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_NUM, tmp, TRUE); | |
681 | + } | |
682 | + break; | |
683 | + case WM_MOUSEWHEEL: | |
684 | + if(focus_wnd != 3) | |
685 | + break; | |
686 | + wheel_speed = (int16)GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; // upper 16bit sined int // 1knoch = 120 | |
687 | + wheel_speed *= (LOWORD(wParam) & MK_SHIFT) ? 10 : 1; | |
688 | + switch (focus_clid) { | |
689 | + case IDC_EDIT_MMS_NUM: | |
690 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
691 | + if(tmp < 0) | |
692 | + tmp = 0; | |
693 | + else if(tmp > (MMS_SETTING_MAX - 1)) | |
694 | + tmp = MMS_SETTING_MAX - 1; | |
695 | + mms_preset_num = tmp; | |
696 | + SetDlgItemInt(hwnd, IDC_EDIT_MMS_NUM, mms_preset_num, TRUE); | |
697 | + SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) mms_preset_num); | |
698 | + break; | |
699 | + case IDC_EDIT_MMS_OP_NUM: | |
700 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
701 | + if(tmp < 0) | |
702 | + tmp = 0; | |
703 | + else if(tmp > MMS_OP_MAX) | |
704 | + tmp = MMS_OP_MAX; | |
705 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
706 | + mms_editor_set_param(0, 0, 0, tmp); // op max | |
707 | + break; | |
708 | + case IDC_EDIT_MMS_G1_P1: | |
709 | + case IDC_EDIT_MMS_G1_P2: | |
710 | + case IDC_EDIT_MMS_G1_P3: | |
711 | + case IDC_EDIT_MMS_G1_P4: | |
712 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
713 | + if(tmp < 0) tmp = 0; | |
714 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
715 | + mms_editor_set_param(1, mms_op_num, focus_clid - IDC_EDIT_MMS_G1_P1, tmp); // range | |
716 | + break; | |
717 | + case IDC_EDIT_MMS_G2_P1: | |
718 | + case IDC_EDIT_MMS_G2_P2: | |
719 | + case IDC_EDIT_MMS_G2_P3: | |
720 | + case IDC_EDIT_MMS_G2_P4: | |
721 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
722 | + if(tmp < 0) tmp = 0; | |
723 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
724 | + mms_editor_set_param(2, mms_op_num, focus_clid - IDC_EDIT_MMS_G2_P1, tmp); // param | |
725 | + break; | |
726 | + case IDC_EDIT_MMS_G3_P1: | |
727 | + case IDC_EDIT_MMS_G3_P2: | |
728 | + case IDC_EDIT_MMS_G3_P3: | |
729 | + case IDC_EDIT_MMS_G3_P4: | |
730 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
731 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
732 | + mms_editor_set_param(3, mms_op_num, focus_clid - IDC_EDIT_MMS_G3_P1, tmp); // connect | |
733 | + break; | |
734 | + case IDC_EDIT_MMS_G4_P1: | |
735 | + case IDC_EDIT_MMS_G4_P2: | |
736 | + case IDC_EDIT_MMS_G4_P3: | |
737 | + case IDC_EDIT_MMS_G4_P4: | |
738 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
739 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
740 | + mms_editor_set_param(4, mms_op_num, focus_clid - IDC_EDIT_MMS_G4_P1, tmp); // osc | |
741 | + break; | |
742 | + case IDC_EDIT_MMS_G5_P1: | |
743 | + case IDC_EDIT_MMS_G5_P2: | |
744 | + case IDC_EDIT_MMS_G5_P3: | |
745 | + case IDC_EDIT_MMS_G5_P4: | |
746 | + case IDC_EDIT_MMS_G5_P5: | |
747 | + case IDC_EDIT_MMS_G5_P6: | |
748 | + case IDC_EDIT_MMS_G5_P7: | |
749 | + case IDC_EDIT_MMS_G5_P8: | |
750 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
751 | + if(tmp < 0) tmp = 0; | |
752 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
753 | + mms_editor_set_param(5, mms_op_num, focus_clid - IDC_EDIT_MMS_G5_P1, tmp); // wave | |
754 | + if(focus_clid == IDC_EDIT_MMS_G5_P1 || focus_clid == IDC_EDIT_MMS_G5_P2) | |
755 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_WAVE_DATA_NAME, mms_editor_load_wave_name(mms_op_num, -1)); | |
756 | + break; | |
757 | + case IDC_EDIT_MMS_G6_P1: | |
758 | + case IDC_EDIT_MMS_G6_P2: | |
759 | + case IDC_EDIT_MMS_G6_P3: | |
760 | + case IDC_EDIT_MMS_G6_P4: | |
761 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
762 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
763 | + mms_editor_set_param(6, mms_op_num, focus_clid - IDC_EDIT_MMS_G6_P1, tmp); // sub | |
764 | + break; | |
765 | + case IDC_EDIT_MMS_G7_P1: | |
766 | + case IDC_EDIT_MMS_G7_P2: | |
767 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
768 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
769 | + mms_editor_set_param(7, mms_op_num, focus_clid - IDC_EDIT_MMS_G7_P1, tmp); // amp | |
770 | + break; | |
771 | + case IDC_EDIT_MMS_G8_P1: | |
772 | + case IDC_EDIT_MMS_G8_P2: | |
773 | + case IDC_EDIT_MMS_G8_P3: | |
774 | + case IDC_EDIT_MMS_G8_P4: | |
775 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
776 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
777 | + mms_editor_set_param(8, mms_op_num, focus_clid - IDC_EDIT_MMS_G8_P1, tmp); // pitch | |
778 | + break; | |
779 | + case IDC_EDIT_MMS_G9_P1: | |
780 | + case IDC_EDIT_MMS_G9_P2: | |
781 | + case IDC_EDIT_MMS_G9_P3: | |
782 | + case IDC_EDIT_MMS_G9_P4: | |
783 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
784 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
785 | + mms_editor_set_param(9, mms_op_num, focus_clid - IDC_EDIT_MMS_G9_P1, tmp); // width | |
786 | + break; | |
787 | + case IDC_EDIT_MMS_G10_P1: | |
788 | + case IDC_EDIT_MMS_G10_P2: | |
789 | + case IDC_EDIT_MMS_G10_P3: | |
790 | + case IDC_EDIT_MMS_G10_P4: | |
791 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
792 | + if(tmp < 0) tmp = 0; | |
793 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
794 | + mms_editor_set_param(10, mms_op_num, focus_clid - IDC_EDIT_MMS_G10_P1, tmp); // filter | |
795 | + if(focus_clid == IDC_EDIT_MMS_G10_P1) | |
796 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_FILTER_NAME, mms_editor_load_filter_name(mms_op_num)); | |
797 | + break; | |
798 | + case IDC_EDIT_MMS_G11_P1: | |
799 | + case IDC_EDIT_MMS_G11_P2: | |
800 | + case IDC_EDIT_MMS_G11_P3: | |
801 | + case IDC_EDIT_MMS_G11_P4: | |
802 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
803 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
804 | + mms_editor_set_param(11, mms_op_num, focus_clid - IDC_EDIT_MMS_G11_P1, tmp); // cutoff | |
805 | + break; | |
806 | + case IDC_EDIT_MMS_G12_P1: | |
807 | + case IDC_EDIT_MMS_G12_P2: | |
808 | + case IDC_EDIT_MMS_G12_P3: | |
809 | + case IDC_EDIT_MMS_G12_P4: | |
810 | + case IDC_EDIT_MMS_G12_P5: | |
811 | + case IDC_EDIT_MMS_G12_P6: | |
812 | + case IDC_EDIT_MMS_G12_P7: | |
813 | + case IDC_EDIT_MMS_G12_P8: | |
814 | + case IDC_EDIT_MMS_G12_P9: | |
815 | + case IDC_EDIT_MMS_G12_P10: | |
816 | + case IDC_EDIT_MMS_G12_P11: | |
817 | + case IDC_EDIT_MMS_G12_P12: | |
818 | + case IDC_EDIT_MMS_G12_P13: | |
819 | + case IDC_EDIT_MMS_G12_P14: | |
820 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
821 | + if(tmp < 0) tmp = 0; | |
822 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
823 | + mms_editor_set_param(12, mms_op_num, focus_clid - IDC_EDIT_MMS_G12_P1, tmp); // ampenv | |
824 | + break; | |
825 | + case IDC_EDIT_MMS_G13_P1: | |
826 | + case IDC_EDIT_MMS_G13_P2: | |
827 | + case IDC_EDIT_MMS_G13_P3: | |
828 | + case IDC_EDIT_MMS_G13_P4: | |
829 | + case IDC_EDIT_MMS_G13_P5: | |
830 | + case IDC_EDIT_MMS_G13_P6: | |
831 | + case IDC_EDIT_MMS_G13_P7: | |
832 | + case IDC_EDIT_MMS_G13_P8: | |
833 | + case IDC_EDIT_MMS_G13_P9: | |
834 | + case IDC_EDIT_MMS_G13_P10: | |
835 | + case IDC_EDIT_MMS_G13_P11: | |
836 | + case IDC_EDIT_MMS_G13_P12: | |
837 | + case IDC_EDIT_MMS_G13_P13: | |
838 | + case IDC_EDIT_MMS_G13_P14: | |
839 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
840 | + if(tmp < 0) tmp = 0; | |
841 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
842 | + mms_editor_set_param(13, mms_op_num, focus_clid - IDC_EDIT_MMS_G13_P1, tmp); // pitenv | |
843 | + break; | |
844 | + case IDC_EDIT_MMS_G14_P1: | |
845 | + case IDC_EDIT_MMS_G14_P2: | |
846 | + case IDC_EDIT_MMS_G14_P3: | |
847 | + case IDC_EDIT_MMS_G14_P4: | |
848 | + case IDC_EDIT_MMS_G14_P5: | |
849 | + case IDC_EDIT_MMS_G14_P6: | |
850 | + case IDC_EDIT_MMS_G14_P7: | |
851 | + case IDC_EDIT_MMS_G14_P8: | |
852 | + case IDC_EDIT_MMS_G14_P9: | |
853 | + case IDC_EDIT_MMS_G14_P10: | |
854 | + case IDC_EDIT_MMS_G14_P11: | |
855 | + case IDC_EDIT_MMS_G14_P12: | |
856 | + case IDC_EDIT_MMS_G14_P13: | |
857 | + case IDC_EDIT_MMS_G14_P14: | |
858 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
859 | + if(tmp < 0) tmp = 0; | |
860 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
861 | + mms_editor_set_param(14, mms_op_num, focus_clid - IDC_EDIT_MMS_G14_P1, tmp); // widenv | |
862 | + break; | |
863 | + case IDC_EDIT_MMS_G15_P1: | |
864 | + case IDC_EDIT_MMS_G15_P2: | |
865 | + case IDC_EDIT_MMS_G15_P3: | |
866 | + case IDC_EDIT_MMS_G15_P4: | |
867 | + case IDC_EDIT_MMS_G15_P5: | |
868 | + case IDC_EDIT_MMS_G15_P6: | |
869 | + case IDC_EDIT_MMS_G15_P7: | |
870 | + case IDC_EDIT_MMS_G15_P8: | |
871 | + case IDC_EDIT_MMS_G15_P9: | |
872 | + case IDC_EDIT_MMS_G15_P10: | |
873 | + case IDC_EDIT_MMS_G15_P11: | |
874 | + case IDC_EDIT_MMS_G15_P12: | |
875 | + case IDC_EDIT_MMS_G15_P13: | |
876 | + case IDC_EDIT_MMS_G15_P14: | |
877 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
878 | + if(tmp < 0) tmp = 0; | |
879 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
880 | + mms_editor_set_param(15, mms_op_num, focus_clid - IDC_EDIT_MMS_G15_P1, tmp); // modenv | |
881 | + break; | |
882 | + case IDC_EDIT_MMS_G16_P1: | |
883 | + case IDC_EDIT_MMS_G16_P2: | |
884 | + case IDC_EDIT_MMS_G16_P3: | |
885 | + case IDC_EDIT_MMS_G16_P4: | |
886 | + case IDC_EDIT_MMS_G16_P5: | |
887 | + case IDC_EDIT_MMS_G16_P6: | |
888 | + case IDC_EDIT_MMS_G16_P7: | |
889 | + case IDC_EDIT_MMS_G16_P8: | |
890 | + case IDC_EDIT_MMS_G16_P9: | |
891 | + case IDC_EDIT_MMS_G16_P10: | |
892 | + case IDC_EDIT_MMS_G16_P11: | |
893 | + case IDC_EDIT_MMS_G16_P12: | |
894 | + case IDC_EDIT_MMS_G16_P13: | |
895 | + case IDC_EDIT_MMS_G16_P14: | |
896 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
897 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
898 | + mms_editor_set_param(16, mms_op_num, focus_clid - IDC_EDIT_MMS_G16_P1, tmp); // ampenv_keyf | |
899 | + break; | |
900 | + case IDC_EDIT_MMS_G17_P1: | |
901 | + case IDC_EDIT_MMS_G17_P2: | |
902 | + case IDC_EDIT_MMS_G17_P3: | |
903 | + case IDC_EDIT_MMS_G17_P4: | |
904 | + case IDC_EDIT_MMS_G17_P5: | |
905 | + case IDC_EDIT_MMS_G17_P6: | |
906 | + case IDC_EDIT_MMS_G17_P7: | |
907 | + case IDC_EDIT_MMS_G17_P8: | |
908 | + case IDC_EDIT_MMS_G17_P9: | |
909 | + case IDC_EDIT_MMS_G17_P10: | |
910 | + case IDC_EDIT_MMS_G17_P11: | |
911 | + case IDC_EDIT_MMS_G17_P12: | |
912 | + case IDC_EDIT_MMS_G17_P13: | |
913 | + case IDC_EDIT_MMS_G17_P14: | |
914 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
915 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
916 | + mms_editor_set_param(17, mms_op_num, focus_clid - IDC_EDIT_MMS_G17_P1, tmp); // pitenv_keyf | |
917 | + break; | |
918 | + case IDC_EDIT_MMS_G18_P1: | |
919 | + case IDC_EDIT_MMS_G18_P2: | |
920 | + case IDC_EDIT_MMS_G18_P3: | |
921 | + case IDC_EDIT_MMS_G18_P4: | |
922 | + case IDC_EDIT_MMS_G18_P5: | |
923 | + case IDC_EDIT_MMS_G18_P6: | |
924 | + case IDC_EDIT_MMS_G18_P7: | |
925 | + case IDC_EDIT_MMS_G18_P8: | |
926 | + case IDC_EDIT_MMS_G18_P9: | |
927 | + case IDC_EDIT_MMS_G18_P10: | |
928 | + case IDC_EDIT_MMS_G18_P11: | |
929 | + case IDC_EDIT_MMS_G18_P12: | |
930 | + case IDC_EDIT_MMS_G18_P13: | |
931 | + case IDC_EDIT_MMS_G18_P14: | |
932 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
933 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
934 | + mms_editor_set_param(18, mms_op_num, focus_clid - IDC_EDIT_MMS_G18_P1, tmp); // widenv_keyf | |
935 | + break; | |
936 | + case IDC_EDIT_MMS_G19_P1: | |
937 | + case IDC_EDIT_MMS_G19_P2: | |
938 | + case IDC_EDIT_MMS_G19_P3: | |
939 | + case IDC_EDIT_MMS_G19_P4: | |
940 | + case IDC_EDIT_MMS_G19_P5: | |
941 | + case IDC_EDIT_MMS_G19_P6: | |
942 | + case IDC_EDIT_MMS_G19_P7: | |
943 | + case IDC_EDIT_MMS_G19_P8: | |
944 | + case IDC_EDIT_MMS_G19_P9: | |
945 | + case IDC_EDIT_MMS_G19_P10: | |
946 | + case IDC_EDIT_MMS_G19_P11: | |
947 | + case IDC_EDIT_MMS_G19_P12: | |
948 | + case IDC_EDIT_MMS_G19_P13: | |
949 | + case IDC_EDIT_MMS_G19_P14: | |
950 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
951 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
952 | + mms_editor_set_param(19, mms_op_num, focus_clid - IDC_EDIT_MMS_G19_P1, tmp); // modenv_keyf | |
953 | + break; | |
954 | + case IDC_EDIT_MMS_G20_P1: | |
955 | + case IDC_EDIT_MMS_G20_P2: | |
956 | + case IDC_EDIT_MMS_G20_P3: | |
957 | + case IDC_EDIT_MMS_G20_P4: | |
958 | + case IDC_EDIT_MMS_G20_P5: | |
959 | + case IDC_EDIT_MMS_G20_P6: | |
960 | + case IDC_EDIT_MMS_G20_P7: | |
961 | + case IDC_EDIT_MMS_G20_P8: | |
962 | + case IDC_EDIT_MMS_G20_P9: | |
963 | + case IDC_EDIT_MMS_G20_P10: | |
964 | + case IDC_EDIT_MMS_G20_P11: | |
965 | + case IDC_EDIT_MMS_G20_P12: | |
966 | + case IDC_EDIT_MMS_G20_P13: | |
967 | + case IDC_EDIT_MMS_G20_P14: | |
968 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
969 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
970 | + mms_editor_set_param(20, mms_op_num, focus_clid - IDC_EDIT_MMS_G20_P1, tmp); // ampenv_velf | |
971 | + break; | |
972 | + case IDC_EDIT_MMS_G21_P1: | |
973 | + case IDC_EDIT_MMS_G21_P2: | |
974 | + case IDC_EDIT_MMS_G21_P3: | |
975 | + case IDC_EDIT_MMS_G21_P4: | |
976 | + case IDC_EDIT_MMS_G21_P5: | |
977 | + case IDC_EDIT_MMS_G21_P6: | |
978 | + case IDC_EDIT_MMS_G21_P7: | |
979 | + case IDC_EDIT_MMS_G21_P8: | |
980 | + case IDC_EDIT_MMS_G21_P9: | |
981 | + case IDC_EDIT_MMS_G21_P10: | |
982 | + case IDC_EDIT_MMS_G21_P11: | |
983 | + case IDC_EDIT_MMS_G21_P12: | |
984 | + case IDC_EDIT_MMS_G21_P13: | |
985 | + case IDC_EDIT_MMS_G21_P14: | |
986 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
987 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
988 | + mms_editor_set_param(21, mms_op_num, focus_clid - IDC_EDIT_MMS_G21_P1, tmp); // pitenv_velf | |
989 | + break; | |
990 | + case IDC_EDIT_MMS_G22_P1: | |
991 | + case IDC_EDIT_MMS_G22_P2: | |
992 | + case IDC_EDIT_MMS_G22_P3: | |
993 | + case IDC_EDIT_MMS_G22_P4: | |
994 | + case IDC_EDIT_MMS_G22_P5: | |
995 | + case IDC_EDIT_MMS_G22_P6: | |
996 | + case IDC_EDIT_MMS_G22_P7: | |
997 | + case IDC_EDIT_MMS_G22_P8: | |
998 | + case IDC_EDIT_MMS_G22_P9: | |
999 | + case IDC_EDIT_MMS_G22_P10: | |
1000 | + case IDC_EDIT_MMS_G22_P11: | |
1001 | + case IDC_EDIT_MMS_G22_P12: | |
1002 | + case IDC_EDIT_MMS_G22_P13: | |
1003 | + case IDC_EDIT_MMS_G22_P14: | |
1004 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1005 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1006 | + mms_editor_set_param(22, mms_op_num, focus_clid - IDC_EDIT_MMS_G22_P1, tmp); // widenv_velf | |
1007 | + break; | |
1008 | + case IDC_EDIT_MMS_G23_P1: | |
1009 | + case IDC_EDIT_MMS_G23_P2: | |
1010 | + case IDC_EDIT_MMS_G23_P3: | |
1011 | + case IDC_EDIT_MMS_G23_P4: | |
1012 | + case IDC_EDIT_MMS_G23_P5: | |
1013 | + case IDC_EDIT_MMS_G23_P6: | |
1014 | + case IDC_EDIT_MMS_G23_P7: | |
1015 | + case IDC_EDIT_MMS_G23_P8: | |
1016 | + case IDC_EDIT_MMS_G23_P9: | |
1017 | + case IDC_EDIT_MMS_G23_P10: | |
1018 | + case IDC_EDIT_MMS_G23_P11: | |
1019 | + case IDC_EDIT_MMS_G23_P12: | |
1020 | + case IDC_EDIT_MMS_G23_P13: | |
1021 | + case IDC_EDIT_MMS_G23_P14: | |
1022 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1023 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1024 | + mms_editor_set_param(23, mms_op_num, focus_clid - IDC_EDIT_MMS_G23_P1, tmp); // modenv_velf | |
1025 | + break; | |
1026 | + case IDC_EDIT_MMS_G24_P1: | |
1027 | + case IDC_EDIT_MMS_G24_P2: | |
1028 | + case IDC_EDIT_MMS_G24_P3: | |
1029 | + case IDC_EDIT_MMS_G24_P4: | |
1030 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1031 | + if(tmp < 0) tmp = 0; | |
1032 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1033 | + mms_editor_set_param(24, mms_op_num, focus_clid - IDC_EDIT_MMS_G24_P1, tmp); // lfo1 | |
1034 | + if(focus_clid == IDC_EDIT_MMS_G24_P3) | |
1035 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO1_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 0)); | |
1036 | + break; | |
1037 | + case IDC_EDIT_MMS_G25_P1: | |
1038 | + case IDC_EDIT_MMS_G25_P2: | |
1039 | + case IDC_EDIT_MMS_G25_P3: | |
1040 | + case IDC_EDIT_MMS_G25_P4: | |
1041 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1042 | + if(tmp < 0) tmp = 0; | |
1043 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1044 | + mms_editor_set_param(25, mms_op_num, focus_clid - IDC_EDIT_MMS_G25_P1, tmp); // lfo2 | |
1045 | + if(focus_clid == IDC_EDIT_MMS_G25_P3) | |
1046 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO2_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 1)); | |
1047 | + break; | |
1048 | + case IDC_EDIT_MMS_G26_P1: | |
1049 | + case IDC_EDIT_MMS_G26_P2: | |
1050 | + case IDC_EDIT_MMS_G26_P3: | |
1051 | + case IDC_EDIT_MMS_G26_P4: | |
1052 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1053 | + if(tmp < 0) tmp = 0; | |
1054 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1055 | + mms_editor_set_param(26, mms_op_num, focus_clid - IDC_EDIT_MMS_G26_P1, tmp); // lfo3 | |
1056 | + if(focus_clid == IDC_EDIT_MMS_G26_P3) | |
1057 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO3_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 2)); | |
1058 | + break; | |
1059 | + case IDC_EDIT_MMS_G27_P1: | |
1060 | + case IDC_EDIT_MMS_G27_P2: | |
1061 | + case IDC_EDIT_MMS_G27_P3: | |
1062 | + case IDC_EDIT_MMS_G27_P4: | |
1063 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1064 | + if(tmp < 0) tmp = 0; | |
1065 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1066 | + mms_editor_set_param(27, mms_op_num, focus_clid - IDC_EDIT_MMS_G27_P1, tmp); // lfo4 | |
1067 | + if(focus_clid == IDC_EDIT_MMS_G27_P3) | |
1068 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO4_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 3)); | |
1069 | + break; | |
1070 | + case IDC_EDIT_MMS_G28_P1: | |
1071 | + case IDC_EDIT_MMS_G28_P2: | |
1072 | + case IDC_EDIT_MMS_G28_P3: | |
1073 | + case IDC_EDIT_MMS_G28_P4: | |
1074 | + tmp = (int)GetDlgItemInt(hwnd, focus_clid, NULL, TRUE) + wheel_speed; | |
1075 | + if(tmp < 0) tmp = 0; | |
1076 | + SetDlgItemInt(hwnd, focus_clid, tmp, TRUE); | |
1077 | + mms_editor_set_param(28, mms_op_num, focus_clid - IDC_EDIT_MMS_G28_P1, tmp); // mode | |
1078 | + break; | |
1079 | + } | |
1080 | + break; | |
1081 | + case WM_COMMAND: | |
1082 | + clid = LOWORD(wParam); | |
1083 | + prv_focus_clid = focus_clid; | |
1084 | + focus_clid = clid; | |
1085 | + focus_wnd = 3; | |
1086 | + switch (clid) { | |
1087 | + case IDC_CHK_MMS_OVERRIDE: | |
1088 | + DLG_CHECKBUTTON_TO_FLAG(hwnd, IDC_CHK_MMS_OVERRIDE, mms_editor_override); | |
1089 | + break; | |
1090 | + case IDC_BUTTON_MMS_DELETE_PRESET: | |
1091 | + mms_editor_delete_preset(mms_preset_num); | |
1092 | + break; | |
1093 | + case IDC_BUTTON_MMS_LOAD_PRESET: | |
1094 | + SetDlgItemText(hwnd,IDC_EDIT_MMS_NAME, mms_editor_load_name(mms_preset_num)); | |
1095 | + mms_editor_load_preset(mms_preset_num); | |
1096 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
1097 | + break; | |
1098 | + case IDC_BUTTON_MMS_SAVE_PRESET: | |
1099 | + { | |
1100 | + char buff[256]; | |
1101 | + GetDlgItemText(hwnd, IDC_EDIT_MMS_NAME, buff, (WPARAM)sizeof(buff)); | |
1102 | + mms_editor_store_name(mms_preset_num, (const char *)buff); | |
1103 | + mms_editor_store_preset(mms_preset_num); | |
1104 | + } | |
1105 | + break; | |
1106 | + case IDC_BUTTON_MMS_LOAD_TEMP: | |
1107 | + mms_editor_load_preset(-1); | |
1108 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
1109 | + break; | |
1110 | + case IDC_BUTTON_MMS_SAVE_TEMP: | |
1111 | + mms_editor_store_preset(-1); | |
1112 | + break; | |
1113 | + case IDC_BUTTON_MMS_MAGIC_PARAM: | |
1114 | + mms_editor_set_magic_param(); | |
1115 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
1116 | + break; | |
1117 | + case IDC_EDIT_MMS_NUM: | |
1118 | + tmp = (int)GetDlgItemInt(hwnd, IDC_EDIT_MMS_NUM, NULL, TRUE); | |
1119 | + if(tmp < 0) | |
1120 | + tmp = 0; | |
1121 | + else if(tmp > (MMS_SETTING_MAX - 1)) | |
1122 | + tmp = MMS_SETTING_MAX - 1; | |
1123 | + mms_preset_num = tmp; | |
1124 | + SendDlgItemMessage(hwnd, IDC_SLIDER_MMS_NUM, TBM_SETPOS, (WPARAM) 1, (LPARAM) mms_preset_num); | |
1125 | + break; | |
1126 | + case IDC_BUTTON_MMS_OP0: | |
1127 | + case IDC_BUTTON_MMS_OP1: | |
1128 | + case IDC_BUTTON_MMS_OP2: | |
1129 | + case IDC_BUTTON_MMS_OP3: | |
1130 | + case IDC_BUTTON_MMS_OP4: | |
1131 | + case IDC_BUTTON_MMS_OP5: | |
1132 | + case IDC_BUTTON_MMS_OP6: | |
1133 | + case IDC_BUTTON_MMS_OP7: | |
1134 | + case IDC_BUTTON_MMS_OP8: | |
1135 | + case IDC_BUTTON_MMS_OP9: | |
1136 | + case IDC_BUTTON_MMS_OP10: | |
1137 | + case IDC_BUTTON_MMS_OP11: | |
1138 | + case IDC_BUTTON_MMS_OP12: | |
1139 | + case IDC_BUTTON_MMS_OP13: | |
1140 | + case IDC_BUTTON_MMS_OP14: | |
1141 | + case IDC_BUTTON_MMS_OP15: | |
1142 | + tmp = clid - IDC_BUTTON_MMS_OP0; | |
1143 | + if(tmp != mms_op_num){ | |
1144 | + mms_op_num = tmp; // op change | |
1145 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
1146 | + } | |
1147 | + break; | |
1148 | + case IDC_EDIT_MMS_OP_NUM: | |
1149 | + mms_editor_set_param(0, 0, 0, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // op max | |
1150 | + break; | |
1151 | + case IDC_BUTTON_MMS_OP_ALL_CLEAR: | |
1152 | + mms_editor_set_default_param(-1, -1); | |
1153 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
1154 | + break; | |
1155 | + case IDC_BUTTON_MMS_OP_CLEAR: | |
1156 | + mms_editor_set_default_param(-1, mms_op_num); | |
1157 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
1158 | + break; | |
1159 | + case IDC_EDIT_MMS_G1_P1: | |
1160 | + case IDC_EDIT_MMS_G1_P2: | |
1161 | + case IDC_EDIT_MMS_G1_P3: | |
1162 | + case IDC_EDIT_MMS_G1_P4: | |
1163 | + mms_editor_set_param(1, mms_op_num, clid - IDC_EDIT_MMS_G1_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // range | |
1164 | + break; | |
1165 | + case IDC_EDIT_MMS_G2_P1: | |
1166 | + case IDC_EDIT_MMS_G2_P2: | |
1167 | + case IDC_EDIT_MMS_G2_P3: | |
1168 | + case IDC_EDIT_MMS_G2_P4: | |
1169 | + mms_editor_set_param(2, mms_op_num, clid - IDC_EDIT_MMS_G2_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // param | |
1170 | + break; | |
1171 | + case IDC_EDIT_MMS_G3_P1: | |
1172 | + case IDC_EDIT_MMS_G3_P2: | |
1173 | + case IDC_EDIT_MMS_G3_P3: | |
1174 | + case IDC_EDIT_MMS_G3_P4: | |
1175 | + mms_editor_set_param(3, mms_op_num, clid - IDC_EDIT_MMS_G3_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // connect | |
1176 | + break; | |
1177 | + case IDC_EDIT_MMS_G4_P1: | |
1178 | + case IDC_EDIT_MMS_G4_P2: | |
1179 | + case IDC_EDIT_MMS_G4_P3: | |
1180 | + case IDC_EDIT_MMS_G4_P4: | |
1181 | + mms_editor_set_param(4, mms_op_num, clid - IDC_EDIT_MMS_G4_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // osc | |
1182 | + break; | |
1183 | + case IDC_EDIT_MMS_G5_P1: | |
1184 | + case IDC_EDIT_MMS_G5_P2: | |
1185 | + case IDC_EDIT_MMS_G5_P3: | |
1186 | + case IDC_EDIT_MMS_G5_P4: | |
1187 | + case IDC_EDIT_MMS_G5_P5: | |
1188 | + case IDC_EDIT_MMS_G5_P6: | |
1189 | + case IDC_EDIT_MMS_G5_P7: | |
1190 | + case IDC_EDIT_MMS_G5_P8: | |
1191 | + mms_editor_set_param(5, mms_op_num, clid - IDC_EDIT_MMS_G5_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // wave | |
1192 | + if(clid == IDC_EDIT_MMS_G5_P1 || clid == IDC_EDIT_MMS_G5_P2) | |
1193 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_WAVE_DATA_NAME, mms_editor_load_wave_name(mms_op_num, -1)); | |
1194 | + break; | |
1195 | + case IDC_EDIT_MMS_G6_P1: | |
1196 | + case IDC_EDIT_MMS_G6_P2: | |
1197 | + case IDC_EDIT_MMS_G6_P3: | |
1198 | + case IDC_EDIT_MMS_G6_P4: | |
1199 | + mms_editor_set_param(6, mms_op_num, clid - IDC_EDIT_MMS_G6_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // sub | |
1200 | + break; | |
1201 | + case IDC_EDIT_MMS_G7_P1: | |
1202 | + case IDC_EDIT_MMS_G7_P2: | |
1203 | + mms_editor_set_param(7, mms_op_num, clid - IDC_EDIT_MMS_G7_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // amp | |
1204 | + break; | |
1205 | + case IDC_EDIT_MMS_G8_P1: | |
1206 | + case IDC_EDIT_MMS_G8_P2: | |
1207 | + case IDC_EDIT_MMS_G8_P3: | |
1208 | + case IDC_EDIT_MMS_G8_P4: | |
1209 | + mms_editor_set_param(8, mms_op_num, clid - IDC_EDIT_MMS_G8_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitch | |
1210 | + break; | |
1211 | + case IDC_EDIT_MMS_G9_P1: | |
1212 | + case IDC_EDIT_MMS_G9_P2: | |
1213 | + case IDC_EDIT_MMS_G9_P3: | |
1214 | + case IDC_EDIT_MMS_G9_P4: | |
1215 | + mms_editor_set_param(9, mms_op_num, clid - IDC_EDIT_MMS_G9_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // width | |
1216 | + break; | |
1217 | + case IDC_EDIT_MMS_G10_P1: | |
1218 | + case IDC_EDIT_MMS_G10_P2: | |
1219 | + case IDC_EDIT_MMS_G10_P3: | |
1220 | + case IDC_EDIT_MMS_G10_P4: | |
1221 | + mms_editor_set_param(10, mms_op_num, clid - IDC_EDIT_MMS_G10_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // filter | |
1222 | + if(clid == IDC_EDIT_MMS_G10_P1) | |
1223 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_FILTER_NAME, mms_editor_load_filter_name(mms_op_num)); | |
1224 | + break; | |
1225 | + case IDC_EDIT_MMS_G11_P1: | |
1226 | + case IDC_EDIT_MMS_G11_P2: | |
1227 | + case IDC_EDIT_MMS_G11_P3: | |
1228 | + case IDC_EDIT_MMS_G11_P4: | |
1229 | + mms_editor_set_param(11, mms_op_num, clid - IDC_EDIT_MMS_G11_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // cutoff | |
1230 | + break; | |
1231 | + case IDC_EDIT_MMS_G12_P1: | |
1232 | + case IDC_EDIT_MMS_G12_P2: | |
1233 | + case IDC_EDIT_MMS_G12_P3: | |
1234 | + case IDC_EDIT_MMS_G12_P4: | |
1235 | + case IDC_EDIT_MMS_G12_P5: | |
1236 | + case IDC_EDIT_MMS_G12_P6: | |
1237 | + case IDC_EDIT_MMS_G12_P7: | |
1238 | + case IDC_EDIT_MMS_G12_P8: | |
1239 | + case IDC_EDIT_MMS_G12_P9: | |
1240 | + case IDC_EDIT_MMS_G12_P10: | |
1241 | + case IDC_EDIT_MMS_G12_P11: | |
1242 | + case IDC_EDIT_MMS_G12_P12: | |
1243 | + case IDC_EDIT_MMS_G12_P13: | |
1244 | + case IDC_EDIT_MMS_G12_P14: | |
1245 | + mms_editor_set_param(12, mms_op_num, clid - IDC_EDIT_MMS_G12_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // ampenv | |
1246 | + break; | |
1247 | + case IDC_EDIT_MMS_G13_P1: | |
1248 | + case IDC_EDIT_MMS_G13_P2: | |
1249 | + case IDC_EDIT_MMS_G13_P3: | |
1250 | + case IDC_EDIT_MMS_G13_P4: | |
1251 | + case IDC_EDIT_MMS_G13_P5: | |
1252 | + case IDC_EDIT_MMS_G13_P6: | |
1253 | + case IDC_EDIT_MMS_G13_P7: | |
1254 | + case IDC_EDIT_MMS_G13_P8: | |
1255 | + case IDC_EDIT_MMS_G13_P9: | |
1256 | + case IDC_EDIT_MMS_G13_P10: | |
1257 | + case IDC_EDIT_MMS_G13_P11: | |
1258 | + case IDC_EDIT_MMS_G13_P12: | |
1259 | + case IDC_EDIT_MMS_G13_P13: | |
1260 | + case IDC_EDIT_MMS_G13_P14: | |
1261 | + mms_editor_set_param(13, mms_op_num, clid - IDC_EDIT_MMS_G13_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitenv | |
1262 | + break; | |
1263 | + case IDC_EDIT_MMS_G14_P1: | |
1264 | + case IDC_EDIT_MMS_G14_P2: | |
1265 | + case IDC_EDIT_MMS_G14_P3: | |
1266 | + case IDC_EDIT_MMS_G14_P4: | |
1267 | + case IDC_EDIT_MMS_G14_P5: | |
1268 | + case IDC_EDIT_MMS_G14_P6: | |
1269 | + case IDC_EDIT_MMS_G14_P7: | |
1270 | + case IDC_EDIT_MMS_G14_P8: | |
1271 | + case IDC_EDIT_MMS_G14_P9: | |
1272 | + case IDC_EDIT_MMS_G14_P10: | |
1273 | + case IDC_EDIT_MMS_G14_P11: | |
1274 | + case IDC_EDIT_MMS_G14_P12: | |
1275 | + case IDC_EDIT_MMS_G14_P13: | |
1276 | + case IDC_EDIT_MMS_G14_P14: | |
1277 | + mms_editor_set_param(14, mms_op_num, clid - IDC_EDIT_MMS_G14_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // widenv | |
1278 | + break; | |
1279 | + case IDC_EDIT_MMS_G15_P1: | |
1280 | + case IDC_EDIT_MMS_G15_P2: | |
1281 | + case IDC_EDIT_MMS_G15_P3: | |
1282 | + case IDC_EDIT_MMS_G15_P4: | |
1283 | + case IDC_EDIT_MMS_G15_P5: | |
1284 | + case IDC_EDIT_MMS_G15_P6: | |
1285 | + case IDC_EDIT_MMS_G15_P7: | |
1286 | + case IDC_EDIT_MMS_G15_P8: | |
1287 | + case IDC_EDIT_MMS_G15_P9: | |
1288 | + case IDC_EDIT_MMS_G15_P10: | |
1289 | + case IDC_EDIT_MMS_G15_P11: | |
1290 | + case IDC_EDIT_MMS_G15_P12: | |
1291 | + case IDC_EDIT_MMS_G15_P13: | |
1292 | + case IDC_EDIT_MMS_G15_P14: | |
1293 | + mms_editor_set_param(15, mms_op_num, clid - IDC_EDIT_MMS_G15_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // modenv | |
1294 | + break; | |
1295 | + case IDC_EDIT_MMS_G16_P1: | |
1296 | + case IDC_EDIT_MMS_G16_P2: | |
1297 | + case IDC_EDIT_MMS_G16_P3: | |
1298 | + case IDC_EDIT_MMS_G16_P4: | |
1299 | + case IDC_EDIT_MMS_G16_P5: | |
1300 | + case IDC_EDIT_MMS_G16_P6: | |
1301 | + case IDC_EDIT_MMS_G16_P7: | |
1302 | + case IDC_EDIT_MMS_G16_P8: | |
1303 | + case IDC_EDIT_MMS_G16_P9: | |
1304 | + case IDC_EDIT_MMS_G16_P10: | |
1305 | + case IDC_EDIT_MMS_G16_P11: | |
1306 | + case IDC_EDIT_MMS_G16_P12: | |
1307 | + case IDC_EDIT_MMS_G16_P13: | |
1308 | + case IDC_EDIT_MMS_G16_P14: | |
1309 | + mms_editor_set_param(16, mms_op_num, clid - IDC_EDIT_MMS_G16_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // ampenv_keyf | |
1310 | + break; | |
1311 | + case IDC_EDIT_MMS_G17_P1: | |
1312 | + case IDC_EDIT_MMS_G17_P2: | |
1313 | + case IDC_EDIT_MMS_G17_P3: | |
1314 | + case IDC_EDIT_MMS_G17_P4: | |
1315 | + case IDC_EDIT_MMS_G17_P5: | |
1316 | + case IDC_EDIT_MMS_G17_P6: | |
1317 | + case IDC_EDIT_MMS_G17_P7: | |
1318 | + case IDC_EDIT_MMS_G17_P8: | |
1319 | + case IDC_EDIT_MMS_G17_P9: | |
1320 | + case IDC_EDIT_MMS_G17_P10: | |
1321 | + case IDC_EDIT_MMS_G17_P11: | |
1322 | + case IDC_EDIT_MMS_G17_P12: | |
1323 | + case IDC_EDIT_MMS_G17_P13: | |
1324 | + case IDC_EDIT_MMS_G17_P14: | |
1325 | + mms_editor_set_param(17, mms_op_num, clid - IDC_EDIT_MMS_G17_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitenv_keyf | |
1326 | + break; | |
1327 | + case IDC_EDIT_MMS_G18_P1: | |
1328 | + case IDC_EDIT_MMS_G18_P2: | |
1329 | + case IDC_EDIT_MMS_G18_P3: | |
1330 | + case IDC_EDIT_MMS_G18_P4: | |
1331 | + case IDC_EDIT_MMS_G18_P5: | |
1332 | + case IDC_EDIT_MMS_G18_P6: | |
1333 | + case IDC_EDIT_MMS_G18_P7: | |
1334 | + case IDC_EDIT_MMS_G18_P8: | |
1335 | + case IDC_EDIT_MMS_G18_P9: | |
1336 | + case IDC_EDIT_MMS_G18_P10: | |
1337 | + case IDC_EDIT_MMS_G18_P11: | |
1338 | + case IDC_EDIT_MMS_G18_P12: | |
1339 | + case IDC_EDIT_MMS_G18_P13: | |
1340 | + case IDC_EDIT_MMS_G18_P14: | |
1341 | + mms_editor_set_param(18, mms_op_num, clid - IDC_EDIT_MMS_G18_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // widenv_keyf | |
1342 | + break; | |
1343 | + case IDC_EDIT_MMS_G19_P1: | |
1344 | + case IDC_EDIT_MMS_G19_P2: | |
1345 | + case IDC_EDIT_MMS_G19_P3: | |
1346 | + case IDC_EDIT_MMS_G19_P4: | |
1347 | + case IDC_EDIT_MMS_G19_P5: | |
1348 | + case IDC_EDIT_MMS_G19_P6: | |
1349 | + case IDC_EDIT_MMS_G19_P7: | |
1350 | + case IDC_EDIT_MMS_G19_P8: | |
1351 | + case IDC_EDIT_MMS_G19_P9: | |
1352 | + case IDC_EDIT_MMS_G19_P10: | |
1353 | + case IDC_EDIT_MMS_G19_P11: | |
1354 | + case IDC_EDIT_MMS_G19_P12: | |
1355 | + case IDC_EDIT_MMS_G19_P13: | |
1356 | + case IDC_EDIT_MMS_G19_P14: | |
1357 | + mms_editor_set_param(19, mms_op_num, clid - IDC_EDIT_MMS_G19_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // modenv_keyf | |
1358 | + break; | |
1359 | + case IDC_EDIT_MMS_G20_P1: | |
1360 | + case IDC_EDIT_MMS_G20_P2: | |
1361 | + case IDC_EDIT_MMS_G20_P3: | |
1362 | + case IDC_EDIT_MMS_G20_P4: | |
1363 | + case IDC_EDIT_MMS_G20_P5: | |
1364 | + case IDC_EDIT_MMS_G20_P6: | |
1365 | + case IDC_EDIT_MMS_G20_P7: | |
1366 | + case IDC_EDIT_MMS_G20_P8: | |
1367 | + case IDC_EDIT_MMS_G20_P9: | |
1368 | + case IDC_EDIT_MMS_G20_P10: | |
1369 | + case IDC_EDIT_MMS_G20_P11: | |
1370 | + case IDC_EDIT_MMS_G20_P12: | |
1371 | + case IDC_EDIT_MMS_G20_P13: | |
1372 | + case IDC_EDIT_MMS_G20_P14: | |
1373 | + mms_editor_set_param(20, mms_op_num, clid - IDC_EDIT_MMS_G20_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // ampenv_velf | |
1374 | + break; | |
1375 | + case IDC_EDIT_MMS_G21_P1: | |
1376 | + case IDC_EDIT_MMS_G21_P2: | |
1377 | + case IDC_EDIT_MMS_G21_P3: | |
1378 | + case IDC_EDIT_MMS_G21_P4: | |
1379 | + case IDC_EDIT_MMS_G21_P5: | |
1380 | + case IDC_EDIT_MMS_G21_P6: | |
1381 | + case IDC_EDIT_MMS_G21_P7: | |
1382 | + case IDC_EDIT_MMS_G21_P8: | |
1383 | + case IDC_EDIT_MMS_G21_P9: | |
1384 | + case IDC_EDIT_MMS_G21_P10: | |
1385 | + case IDC_EDIT_MMS_G21_P11: | |
1386 | + case IDC_EDIT_MMS_G21_P12: | |
1387 | + case IDC_EDIT_MMS_G21_P13: | |
1388 | + case IDC_EDIT_MMS_G21_P14: | |
1389 | + mms_editor_set_param(21, mms_op_num, clid - IDC_EDIT_MMS_G21_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // pitenv_velf | |
1390 | + break; | |
1391 | + case IDC_EDIT_MMS_G22_P1: | |
1392 | + case IDC_EDIT_MMS_G22_P2: | |
1393 | + case IDC_EDIT_MMS_G22_P3: | |
1394 | + case IDC_EDIT_MMS_G22_P4: | |
1395 | + case IDC_EDIT_MMS_G22_P5: | |
1396 | + case IDC_EDIT_MMS_G22_P6: | |
1397 | + case IDC_EDIT_MMS_G22_P7: | |
1398 | + case IDC_EDIT_MMS_G22_P8: | |
1399 | + case IDC_EDIT_MMS_G22_P9: | |
1400 | + case IDC_EDIT_MMS_G22_P10: | |
1401 | + case IDC_EDIT_MMS_G22_P11: | |
1402 | + case IDC_EDIT_MMS_G22_P12: | |
1403 | + case IDC_EDIT_MMS_G22_P13: | |
1404 | + case IDC_EDIT_MMS_G22_P14: | |
1405 | + mms_editor_set_param(22, mms_op_num, clid - IDC_EDIT_MMS_G22_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // widenv_velf | |
1406 | + break; | |
1407 | + case IDC_EDIT_MMS_G23_P1: | |
1408 | + case IDC_EDIT_MMS_G23_P2: | |
1409 | + case IDC_EDIT_MMS_G23_P3: | |
1410 | + case IDC_EDIT_MMS_G23_P4: | |
1411 | + case IDC_EDIT_MMS_G23_P5: | |
1412 | + case IDC_EDIT_MMS_G23_P6: | |
1413 | + case IDC_EDIT_MMS_G23_P7: | |
1414 | + case IDC_EDIT_MMS_G23_P8: | |
1415 | + case IDC_EDIT_MMS_G23_P9: | |
1416 | + case IDC_EDIT_MMS_G23_P10: | |
1417 | + case IDC_EDIT_MMS_G23_P11: | |
1418 | + case IDC_EDIT_MMS_G23_P12: | |
1419 | + case IDC_EDIT_MMS_G23_P13: | |
1420 | + case IDC_EDIT_MMS_G23_P14: | |
1421 | + mms_editor_set_param(23, mms_op_num, clid - IDC_EDIT_MMS_G23_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // modenv_velf | |
1422 | + break; | |
1423 | + case IDC_EDIT_MMS_G24_P1: | |
1424 | + case IDC_EDIT_MMS_G24_P2: | |
1425 | + case IDC_EDIT_MMS_G24_P3: | |
1426 | + case IDC_EDIT_MMS_G24_P4: | |
1427 | + mms_editor_set_param(24, mms_op_num, clid - IDC_EDIT_MMS_G24_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo1 | |
1428 | + if(clid == IDC_EDIT_MMS_G24_P3) | |
1429 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO1_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 0)); | |
1430 | + break; | |
1431 | + case IDC_EDIT_MMS_G25_P1: | |
1432 | + case IDC_EDIT_MMS_G25_P2: | |
1433 | + case IDC_EDIT_MMS_G25_P3: | |
1434 | + case IDC_EDIT_MMS_G25_P4: | |
1435 | + mms_editor_set_param(25, mms_op_num, clid - IDC_EDIT_MMS_G25_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo2 | |
1436 | + if(clid == IDC_EDIT_MMS_G25_P3) | |
1437 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO2_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 1)); | |
1438 | + break; | |
1439 | + case IDC_EDIT_MMS_G26_P1: | |
1440 | + case IDC_EDIT_MMS_G26_P2: | |
1441 | + case IDC_EDIT_MMS_G26_P3: | |
1442 | + case IDC_EDIT_MMS_G26_P4: | |
1443 | + mms_editor_set_param(26, mms_op_num, clid - IDC_EDIT_MMS_G26_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo3 | |
1444 | + if(clid == IDC_EDIT_MMS_G26_P3) | |
1445 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO3_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 2)); | |
1446 | + break; | |
1447 | + case IDC_EDIT_MMS_G27_P1: | |
1448 | + case IDC_EDIT_MMS_G27_P2: | |
1449 | + case IDC_EDIT_MMS_G27_P3: | |
1450 | + case IDC_EDIT_MMS_G27_P4: | |
1451 | + mms_editor_set_param(27, mms_op_num, clid - IDC_EDIT_MMS_G27_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // lfo4 | |
1452 | + if(clid == IDC_EDIT_MMS_G27_P3) | |
1453 | + SetDlgItemText(hwnd, IDC_EDIT_MMS_LFO4_WAVE_NAME, mms_editor_load_wave_name(mms_op_num, 3)); | |
1454 | + break; | |
1455 | + case IDC_EDIT_MMS_G28_P1: | |
1456 | + case IDC_EDIT_MMS_G28_P2: | |
1457 | + case IDC_EDIT_MMS_G28_P3: | |
1458 | + case IDC_EDIT_MMS_G28_P4: | |
1459 | + mms_editor_set_param(28, mms_op_num, clid - IDC_EDIT_MMS_G28_P1, (int)GetDlgItemInt(hwnd, clid, NULL, TRUE)); // mode | |
1460 | + break; | |
1461 | + case IDC_EDIT_MMS_WAVE_DATA_NAME: | |
1462 | + focus_clid = prv_focus_clid; | |
1463 | + break; | |
1464 | + case IDC_EDIT_MMS_FILTER_NAME: | |
1465 | + focus_clid = IDC_EDIT_MMS_G10_P1; | |
1466 | + break; | |
1467 | + case IDC_EDIT_MMS_LFO1_WAVE_NAME: | |
1468 | + focus_clid = IDC_EDIT_MMS_G24_P3; | |
1469 | + break; | |
1470 | + case IDC_EDIT_MMS_LFO2_WAVE_NAME: | |
1471 | + focus_clid = IDC_EDIT_MMS_G25_P3; | |
1472 | + break; | |
1473 | + case IDC_EDIT_MMS_LFO3_WAVE_NAME: | |
1474 | + focus_clid = IDC_EDIT_MMS_G26_P3; | |
1475 | + break; | |
1476 | + case IDC_EDIT_MMS_LFO4_WAVE_NAME: | |
1477 | + focus_clid = IDC_EDIT_MMS_G27_P3; | |
1478 | + break; | |
1479 | + } | |
1480 | + break; | |
1481 | + case WM_SIZE: | |
1482 | + return FALSE; | |
1483 | + case WM_DESTROY: | |
1484 | + break; | |
1485 | + default: | |
1486 | + break; | |
1487 | + } | |
1488 | + return FALSE; | |
1485 | 1489 | } |
1486 | 1490 | |
1487 | 1491 | typedef struct is_editor_page_t_ { |
1488 | - int index; | |
1489 | - TCHAR *title; | |
1490 | - HWND hwnd; | |
1491 | - UINT control; | |
1492 | - DLGPROC dlgproc; | |
1493 | - int opt; | |
1492 | + int index; | |
1493 | + TCHAR *title; | |
1494 | + HWND hwnd; | |
1495 | + UINT control; | |
1496 | + DLGPROC dlgproc; | |
1497 | + int opt; | |
1494 | 1498 | } is_editor_page_t; |
1495 | 1499 | |
1496 | 1500 | static is_editor_page_t is_editor_pages_ja[] = { |
1497 | - { 0, TEXT("SCC_DATA"), (HWND) NULL, IDD_ISEDITOR_SCC_DATA, (DLGPROC) ISEditorSCCDATAProc, 0 }, | |
1498 | - { 1, TEXT("SCC"), (HWND) NULL, IDD_ISEDITOR_SCC, (DLGPROC) ISEditorSCCProc, 0 }, | |
1499 | - { 2, TEXT("MMS"), (HWND) NULL, IDD_ISEDITOR_MMS, (DLGPROC) ISEditorMMSProc, 0 }, | |
1501 | + { 0, TEXT("SCC_DATA"), (HWND)NULL, IDD_ISEDITOR_SCC_DATA, (DLGPROC) ISEditorSCCDATAProc, 0 }, | |
1502 | + { 1, TEXT("SCC"), (HWND)NULL, IDD_ISEDITOR_SCC, (DLGPROC) ISEditorSCCProc, 0 }, | |
1503 | + { 2, TEXT("MMS"), (HWND)NULL, IDD_ISEDITOR_MMS, (DLGPROC) ISEditorMMSProc, 0 }, | |
1500 | 1504 | }; |
1501 | 1505 | |
1502 | 1506 | static is_editor_page_t is_editor_pages_en[] = { |
1503 | - { 0, TEXT("SCC_DATA"), (HWND) NULL, IDD_ISEDITOR_SCC_DATA_EN, (DLGPROC) ISEditorSCCDATAProc, 0 }, | |
1504 | - { 1, TEXT("SCC"), (HWND) NULL, IDD_ISEDITOR_SCC_EN, (DLGPROC) ISEditorSCCProc, 0 }, | |
1505 | - { 2, TEXT("MMS"), (HWND) NULL, IDD_ISEDITOR_MMS_EN, (DLGPROC) ISEditorMMSProc, 0 }, | |
1507 | + { 0, TEXT("SCC_DATA"), (HWND)NULL, IDD_ISEDITOR_SCC_DATA_EN, (DLGPROC) ISEditorSCCDATAProc, 0 }, | |
1508 | + { 1, TEXT("SCC"), (HWND)NULL, IDD_ISEDITOR_SCC_EN, (DLGPROC) ISEditorSCCProc, 0 }, | |
1509 | + { 2, TEXT("MMS"), (HWND)NULL, IDD_ISEDITOR_MMS_EN, (DLGPROC) ISEditorMMSProc, 0 }, | |
1506 | 1510 | }; |
1507 | 1511 | |
1508 | 1512 | #define ISEDITOR_PAGE_MAX 3 |
@@ -1527,23 +1531,23 @@ static void ISEditorWndCreateTabItems(HWND hwnd) | ||
1527 | 1531 | |
1528 | 1532 | switch (PlayerLanguage) { |
1529 | 1533 | case LANGUAGE_JAPANESE: |
1530 | - is_editor_pages = is_editor_pages_ja; | |
1531 | - break; | |
1534 | + is_editor_pages = is_editor_pages_ja; | |
1535 | + break; | |
1532 | 1536 | default: |
1533 | 1537 | case LANGUAGE_ENGLISH: |
1534 | - is_editor_pages = is_editor_pages_en; | |
1535 | - break; | |
1538 | + is_editor_pages = is_editor_pages_en; | |
1539 | + break; | |
1536 | 1540 | } |
1537 | 1541 | |
1538 | 1542 | hwnd_tab = GetDlgItem(hwnd, IDC_TAB_ISEDITOR); |
1539 | 1543 | for (i = 0; i < ISEDITOR_PAGE_MAX; i++) { |
1540 | - TC_ITEM tci; | |
1541 | - tci.mask = TCIF_TEXT; | |
1542 | - tci.pszText = is_editor_pages[i].title; | |
1543 | - tci.cchTextMax = strlen(is_editor_pages[i].title); | |
1544 | - SendMessage(hwnd_tab, TCM_INSERTITEM, (WPARAM) i, (LPARAM) &tci); | |
1544 | + TC_ITEM tci; | |
1545 | + tci.mask = TCIF_TEXT; | |
1546 | + tci.pszText = is_editor_pages[i].title; | |
1547 | + tci.cchTextMax = strlen(is_editor_pages[i].title); | |
1548 | + SendMessage(hwnd_tab, TCM_INSERTITEM, (WPARAM)i, (LPARAM)&tci); | |
1545 | 1549 | |
1546 | - is_editor_pages[i].hwnd = NULL; | |
1550 | + is_editor_pages[i].hwnd = NULL; | |
1547 | 1551 | } |
1548 | 1552 | } |
1549 | 1553 |
@@ -1557,226 +1561,226 @@ static void ISEditorWndCreatePage(HWND hwnd, UINT page) | ||
1557 | 1561 | BOOL theme_active = FALSE; |
1558 | 1562 | |
1559 | 1563 | if (page >= ISEDITOR_PAGE_MAX || is_editor_pages[page].hwnd) |
1560 | - return; | |
1564 | + return; | |
1561 | 1565 | switch (PlayerLanguage) { |
1562 | 1566 | case LANGUAGE_JAPANESE: |
1563 | - is_editor_pages = is_editor_pages_ja; | |
1564 | - break; | |
1567 | + is_editor_pages = is_editor_pages_ja; | |
1568 | + break; | |
1565 | 1569 | default: |
1566 | 1570 | case LANGUAGE_ENGLISH: |
1567 | - is_editor_pages = is_editor_pages_en; | |
1568 | - break; | |
1571 | + is_editor_pages = is_editor_pages_en; | |
1572 | + break; | |
1569 | 1573 | } |
1570 | 1574 | hwnd_tab = GetDlgItem(hwnd, IDC_TAB_ISEDITOR); |
1571 | 1575 | if (!hwnd_tab) |
1572 | - return; | |
1576 | + return; | |
1573 | 1577 | |
1574 | 1578 | GetClientRect(hwnd_tab, &rc); |
1575 | - SendDlgItemMessage(hwnd, IDC_TAB_ISEDITOR, TCM_ADJUSTRECT, (WPARAM) 0, (LPARAM) &rc); | |
1579 | + SendDlgItemMessage(hwnd, IDC_TAB_ISEDITOR, TCM_ADJUSTRECT, (WPARAM)0, (LPARAM)&rc); | |
1576 | 1580 | { |
1577 | - RECT rc_tab; | |
1578 | - POINT pt_wnd; | |
1579 | - GetWindowRect(hwnd_tab, &rc_tab); | |
1580 | - pt_wnd.x = rc_tab.left, pt_wnd.y = rc_tab.top; | |
1581 | - ScreenToClient(hwnd, &pt_wnd); | |
1582 | - rc.left += pt_wnd.x; | |
1583 | - rc.top += pt_wnd.y; | |
1584 | - rc.right += pt_wnd.x; | |
1585 | - rc.bottom += pt_wnd.y; | |
1581 | + RECT rc_tab; | |
1582 | + POINT pt_wnd; | |
1583 | + GetWindowRect(hwnd_tab, &rc_tab); | |
1584 | + pt_wnd.x = rc_tab.left, pt_wnd.y = rc_tab.top; | |
1585 | + ScreenToClient(hwnd, &pt_wnd); | |
1586 | + rc.left += pt_wnd.x; | |
1587 | + rc.top += pt_wnd.y; | |
1588 | + rc.right += pt_wnd.x; | |
1589 | + rc.bottom += pt_wnd.y; | |
1586 | 1590 | } |
1587 | 1591 | hUXTheme = GetModuleHandle(TEXT("UXTHEME")); //LoadLibrary(TEXT("UXTHEME")); |
1588 | 1592 | if (hUXTheme) { |
1589 | - pfnIsThemeActive = (IsThemeActiveFn) GetProcAddress(hUXTheme, "IsThemeActive"); | |
1590 | - pfnEnableThemeDialogTexture = (EnableThemeDialogTextureFn) GetProcAddress(hUXTheme, "EnableThemeDialogTexture"); | |
1591 | - if (pfnIsThemeActive && pfnEnableThemeDialogTexture && (*pfnIsThemeActive)() != FALSE) | |
1592 | - theme_active = TRUE; | |
1593 | + pfnIsThemeActive = (IsThemeActiveFn) GetProcAddress(hUXTheme, "IsThemeActive"); | |
1594 | + pfnEnableThemeDialogTexture = (EnableThemeDialogTextureFn) GetProcAddress(hUXTheme, "EnableThemeDialogTexture"); | |
1595 | + if (pfnIsThemeActive && pfnEnableThemeDialogTexture && (*pfnIsThemeActive)() != FALSE) | |
1596 | + theme_active = TRUE; | |
1593 | 1597 | } |
1594 | 1598 | is_editor_pages[page].hwnd = CreateDialog(hInst, MAKEINTRESOURCE(is_editor_pages[page].control), |
1595 | - hwnd, is_editor_pages[page].dlgproc); | |
1599 | + hwnd, is_editor_pages[page].dlgproc); | |
1596 | 1600 | ShowWindow(is_editor_pages[page].hwnd, SW_HIDE); |
1597 | 1601 | MoveWindow(is_editor_pages[page].hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE); |
1598 | 1602 | if (theme_active) |
1599 | - (*pfnEnableThemeDialogTexture)(is_editor_pages[page].hwnd, ETDT_ENABLETAB); | |
1603 | + (*pfnEnableThemeDialogTexture)(is_editor_pages[page].hwnd, ETDT_ENABLETAB); | |
1600 | 1604 | if (hUXTheme) { |
1601 | - hUXTheme = NULL; | |
1605 | + hUXTheme = NULL; | |
1602 | 1606 | } |
1603 | 1607 | } |
1604 | 1608 | |
1605 | 1609 | static int DlgOpenISIniFile(char *Filename, HWND hwnd) |
1606 | 1610 | { |
1607 | - OPENFILENAMEA ofn; | |
1608 | - char filename[FILEPATH_MAX]; | |
1609 | - static char dir[FILEPATH_MAX]; | |
1610 | - int res; | |
1611 | - const char *filter, | |
1612 | - *filter_en = "Ini file (*.ini)\0*.ini\0" | |
1613 | - "All files (*.*)\0*.*\0" | |
1614 | - "\0\0", | |
1615 | - *filter_jp = "Ini ファイル (*.ini)\0*.ini\0" | |
1616 | - "すべてのファイル (*.*)\0*.*\0" | |
1617 | - "\0\0"; | |
1618 | - const char *title, | |
1619 | - *title_en = "Open Ini File", | |
1620 | - *title_jp = "Iniファイルを開く"; | |
1611 | + OPENFILENAMEA ofn; | |
1612 | + char filename[FILEPATH_MAX]; | |
1613 | + static char dir[FILEPATH_MAX]; | |
1614 | + int res; | |
1615 | + const char *filter, | |
1616 | + *filter_en = "Ini file (*.ini)\0*.ini\0" | |
1617 | + "All files (*.*)\0*.*\0" | |
1618 | + "\0\0", | |
1619 | + *filter_jp = "Ini ファイル (*.ini)\0*.ini\0" | |
1620 | + "すべてのファイル (*.*)\0*.*\0" | |
1621 | + "\0\0"; | |
1622 | + const char *title, | |
1623 | + *title_en = "Open Ini File", | |
1624 | + *title_jp = "Iniファイルを開く"; | |
1621 | 1625 | |
1622 | - if (PlayerLanguage == LANGUAGE_JAPANESE) { | |
1623 | - filter = filter_jp; | |
1624 | - title = title_jp; | |
1625 | - } | |
1626 | - else { | |
1627 | - filter = filter_en; | |
1628 | - title = title_en; | |
1629 | - } | |
1630 | - if (ISIniFileOpenDir[0] == '\0') | |
1631 | - strncpy(ISIniFileOpenDir, ConfigFileOpenDir, FILEPATH_MAX); | |
1632 | - strncpy(dir, ISIniFileOpenDir, FILEPATH_MAX); | |
1633 | - dir[FILEPATH_MAX - 1] = '\0'; | |
1634 | - strncpy(filename, Filename, FILEPATH_MAX); | |
1635 | - filename[FILEPATH_MAX - 1] = '\0'; | |
1636 | - if (strlen(filename) > 0 && IS_PATH_SEP(filename[strlen(filename) - 1])) { | |
1637 | - strlcat(filename, "int_synth.ini", FILEPATH_MAX); | |
1638 | - } | |
1639 | - ZeroMemory(&ofn, sizeof(OPENFILENAMEA)); | |
1640 | - ofn.lStructSize = sizeof(OPENFILENAMEA); | |
1641 | - ofn.hwndOwner = hwnd; | |
1642 | - ofn.hInstance = hInst; | |
1643 | - ofn.lpstrFilter = filter; | |
1644 | - ofn.lpstrCustomFilter = NULL; | |
1645 | - ofn.nMaxCustFilter = 0; | |
1646 | - ofn.nFilterIndex = 1; | |
1647 | - ofn.lpstrFile = filename; | |
1648 | - ofn.nMaxFile = FILEPATH_MAX; | |
1649 | - ofn.lpstrFileTitle = NULL; | |
1650 | - ofn.nMaxFileTitle = 0; | |
1651 | - if (dir[0] != '\0') | |
1652 | - ofn.lpstrInitialDir = dir; | |
1653 | - else | |
1654 | - ofn.lpstrInitialDir = 0; | |
1655 | - ofn.lpstrTitle = title; | |
1656 | - ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_EXPLORER | |
1657 | - | OFN_READONLY | OFN_HIDEREADONLY; | |
1658 | - ofn.lpstrDefExt = 0; | |
1659 | - ofn.lCustData = 0; | |
1660 | - ofn.lpfnHook = 0; | |
1661 | - ofn.lpTemplateName = 0; | |
1626 | + if (PlayerLanguage == LANGUAGE_JAPANESE) { | |
1627 | + filter = filter_jp; | |
1628 | + title = title_jp; | |
1629 | + } | |
1630 | + else { | |
1631 | + filter = filter_en; | |
1632 | + title = title_en; | |
1633 | + } | |
1634 | + if(ISIniFileOpenDir[0] == '\0') | |
1635 | + strncpy(ISIniFileOpenDir, ConfigFileOpenDir, FILEPATH_MAX); | |
1636 | + strncpy(dir, ISIniFileOpenDir, FILEPATH_MAX); | |
1637 | + dir[FILEPATH_MAX - 1] = '\0'; | |
1638 | + strncpy(filename, Filename, FILEPATH_MAX); | |
1639 | + filename[FILEPATH_MAX - 1] = '\0'; | |
1640 | + if (strlen(filename) > 0 && IS_PATH_SEP(filename[strlen(filename) - 1])) { | |
1641 | + strlcat(filename, "int_synth.ini", FILEPATH_MAX); | |
1642 | + } | |
1643 | + ZeroMemory(&ofn, sizeof(OPENFILENAMEA)); | |
1644 | + ofn.lStructSize = sizeof(OPENFILENAMEA); | |
1645 | + ofn.hwndOwner = hwnd; | |
1646 | + ofn.hInstance = hInst; | |
1647 | + ofn.lpstrFilter = filter; | |
1648 | + ofn.lpstrCustomFilter = NULL; | |
1649 | + ofn.nMaxCustFilter = 0; | |
1650 | + ofn.nFilterIndex = 1; | |
1651 | + ofn.lpstrFile = filename; | |
1652 | + ofn.nMaxFile = FILEPATH_MAX; | |
1653 | + ofn.lpstrFileTitle = NULL; | |
1654 | + ofn.nMaxFileTitle = 0; | |
1655 | + if (dir[0] != '\0') | |
1656 | + ofn.lpstrInitialDir = dir; | |
1657 | + else | |
1658 | + ofn.lpstrInitialDir = 0; | |
1659 | + ofn.lpstrTitle = title; | |
1660 | + ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_EXPLORER | |
1661 | + | OFN_READONLY | OFN_HIDEREADONLY; | |
1662 | + ofn.lpstrDefExt = 0; | |
1663 | + ofn.lCustData = 0; | |
1664 | + ofn.lpfnHook = 0; | |
1665 | + ofn.lpTemplateName = 0; | |
1662 | 1666 | |
1663 | - res = SafeGetOpenFileName(&ofn); | |
1664 | - strncpy(ISIniFileOpenDir, dir, FILEPATH_MAX); | |
1665 | - ISIniFileOpenDir[FILEPATH_MAX - 1] = '\0'; | |
1666 | - if (res != FALSE) { | |
1667 | - strncpy(Filename, filename, FILEPATH_MAX); | |
1668 | - Filename[FILEPATH_MAX - 1] = '\0'; | |
1669 | - return 0; | |
1670 | - } | |
1671 | - else { | |
1672 | - Filename[0] = '\0'; | |
1673 | - return -1; | |
1674 | - } | |
1667 | + res = SafeGetOpenFileName(&ofn); | |
1668 | + strncpy(ISIniFileOpenDir, dir, FILEPATH_MAX); | |
1669 | + ISIniFileOpenDir[FILEPATH_MAX - 1] = '\0'; | |
1670 | + if (res != FALSE) { | |
1671 | + strncpy(Filename, filename, FILEPATH_MAX); | |
1672 | + Filename[FILEPATH_MAX - 1] = '\0'; | |
1673 | + return 0; | |
1674 | + } | |
1675 | + else { | |
1676 | + Filename[0] = '\0'; | |
1677 | + return -1; | |
1678 | + } | |
1675 | 1679 | } |
1676 | 1680 | |
1677 | -INT_PTR CALLBACK ISEditorWndDialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | |
1681 | +INT_PTR APIENTRY CALLBACK ISEditorWndDialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | |
1678 | 1682 | { |
1679 | - int i; | |
1680 | - WORD clid = 0; | |
1681 | - static WORD focus_clid = 0, prv_focus_clid = 0; | |
1682 | - int16 wheel_speed = 0; | |
1683 | - char filename[FILEPATH_MAX]; | |
1683 | + int i; | |
1684 | + WORD clid = 0; | |
1685 | + static WORD focus_clid = 0, prv_focus_clid = 0; | |
1686 | + int16 wheel_speed = 0; | |
1687 | + char filename[FILEPATH_MAX]; | |
1684 | 1688 | |
1685 | - switch (uMess) { | |
1686 | - case WM_INITDIALOG: | |
1687 | - { | |
1688 | - hISEditorWnd = hwnd; | |
1689 | - // main | |
1690 | - SetDlgItemText(hwnd, IDC_EDIT_IS_INI_FILE, is_editor_get_ini_path()); | |
1691 | - // table | |
1692 | - ISEditorWndCreateTabItems(hwnd); | |
1693 | - ISEditorWndCreatePage(hwnd, 0); | |
1694 | - SetForegroundWindow(hwnd); | |
1695 | - SendDlgItemMessage ( hwnd, IDC_TAB_ISEDITOR, TCM_SETCURSEL, (WPARAM) 0, (LPARAM) 0 ); | |
1696 | - ShowWindow ( is_editor_pages[0].hwnd, TRUE ); | |
1697 | - return TRUE; | |
1698 | - } | |
1699 | - case WM_MOUSEWHEEL: | |
1700 | - if (focus_wnd != 0) | |
1701 | - break; | |
1702 | - wheel_speed = (int16) GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; // upper 16bit sined int // 1knoch = 120 | |
1703 | - wheel_speed *= (LOWORD(wParam) & MK_SHIFT) ? 10 : 1; | |
1704 | - break; | |
1705 | - case WM_COMMAND: | |
1706 | - clid = LOWORD(wParam); | |
1707 | - prv_focus_clid = focus_clid; | |
1708 | - focus_clid = clid; | |
1709 | - focus_wnd = 0; | |
1710 | - switch (clid) { | |
1711 | - case IDC_BUTTON_IS_INI_FILE: | |
1712 | - { | |
1713 | - filename[0] = '\0'; | |
1714 | - GetDlgItemText(hwnd, IDC_EDIT_IS_INI_FILE, filename, (WPARAM) sizeof(filename)); | |
1715 | - if (!DlgOpenISIniFile(filename, hwnd)) | |
1716 | - if (filename[0] != '\0') { | |
1717 | - SetDlgItemText(hwnd, IDC_EDIT_IS_INI_FILE, TEXT(filename)); | |
1718 | - is_editor_set_ini_path((const char*) filename); | |
1719 | - is_editor_load_ini(); | |
1720 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
1721 | - } | |
1722 | - } | |
1723 | - break; | |
1724 | - case IDC_BUTTON_IS_LOAD_INI_FILE: | |
1725 | - { | |
1726 | - filename[0] = '\0'; | |
1727 | - GetDlgItemText(hwnd, IDC_EDIT_IS_INI_FILE, filename, (WPARAM) sizeof(filename)); | |
1728 | - is_editor_set_ini_path((const char*) filename); | |
1729 | - is_editor_load_ini(); | |
1730 | - SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM) 0, (LPARAM) 0 ); | |
1731 | - } | |
1732 | - break; | |
1733 | - } | |
1734 | - break; | |
1689 | + switch (uMess){ | |
1690 | + case WM_INITDIALOG: | |
1691 | + { | |
1692 | + hISEditorWnd = hwnd; | |
1693 | + // main | |
1694 | + SetDlgItemText(hwnd, IDC_EDIT_IS_INI_FILE, is_editor_get_ini_path()); | |
1695 | + // table | |
1696 | + ISEditorWndCreateTabItems(hwnd); | |
1697 | + ISEditorWndCreatePage(hwnd, 0); | |
1698 | + SetForegroundWindow(hwnd); | |
1699 | + SendDlgItemMessage ( hwnd, IDC_TAB_ISEDITOR, TCM_SETCURSEL, (WPARAM)0, (LPARAM)0 ); | |
1700 | + ShowWindow ( is_editor_pages[0].hwnd, TRUE ); | |
1701 | + return TRUE; | |
1702 | + } | |
1703 | + case WM_MOUSEWHEEL: | |
1704 | + if(focus_wnd != 0) | |
1705 | + break; | |
1706 | + wheel_speed = (int16)GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; // upper 16bit sined int // 1knoch = 120 | |
1707 | + wheel_speed *= (LOWORD(wParam) & MK_SHIFT) ? 10 : 1; | |
1708 | + break; | |
1709 | + case WM_COMMAND: | |
1710 | + clid = LOWORD(wParam); | |
1711 | + prv_focus_clid = focus_clid; | |
1712 | + focus_clid = clid; | |
1713 | + focus_wnd = 0; | |
1714 | + switch (clid) { | |
1715 | + case IDC_BUTTON_IS_INI_FILE: | |
1716 | + { | |
1717 | + filename[0] = '\0'; | |
1718 | + GetDlgItemText(hwnd, IDC_EDIT_IS_INI_FILE, filename, (WPARAM)sizeof(filename)); | |
1719 | + if(!DlgOpenISIniFile(filename, hwnd)) | |
1720 | + if(filename[0] != '\0'){ | |
1721 | + SetDlgItemText(hwnd, IDC_EDIT_IS_INI_FILE, TEXT(filename)); | |
1722 | + is_editor_set_ini_path((const char *)filename); | |
1723 | + is_editor_load_ini(); | |
1724 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
1725 | + } | |
1726 | + } | |
1727 | + break; | |
1728 | + case IDC_BUTTON_IS_LOAD_INI_FILE: | |
1729 | + { | |
1730 | + filename[0] = '\0'; | |
1731 | + GetDlgItemText(hwnd, IDC_EDIT_IS_INI_FILE, filename, (WPARAM)sizeof(filename)); | |
1732 | + is_editor_set_ini_path((const char *)filename); | |
1733 | + is_editor_load_ini(); | |
1734 | + SendMessage(hwnd, WM_ISE_RESTORE, (WPARAM)0, (LPARAM)0 ); | |
1735 | + } | |
1736 | + break; | |
1737 | + } | |
1738 | + break; | |
1735 | 1739 | |
1736 | - case WM_NOTIFY: | |
1740 | + case WM_NOTIFY: | |
1737 | 1741 | { |
1738 | - LPNMHDR pnmh = (LPNMHDR) lParam; | |
1739 | - if (pnmh->idFrom == IDC_TAB_ISEDITOR) { | |
1740 | - switch (pnmh->code) { | |
1741 | - case TCN_SELCHANGE: | |
1742 | - { | |
1743 | - int nIndex = SendDlgItemMessage(hwnd, IDC_TAB_ISEDITOR, TCM_GETCURSEL, (WPARAM) 0, (LPARAM) 0); | |
1744 | - for (i = 0; i < ISEDITOR_PAGE_MAX; i++) { | |
1745 | - if (is_editor_pages[i].hwnd) | |
1746 | - ShowWindow(is_editor_pages[i].hwnd, SW_HIDE); | |
1747 | - } | |
1748 | - ISEditorWndCreatePage(hwnd, nIndex); | |
1749 | - ShowWindow(is_editor_pages[nIndex].hwnd, SW_SHOWNORMAL); | |
1750 | - return TRUE; | |
1751 | - } | |
1742 | + LPNMHDR pnmh = (LPNMHDR) lParam; | |
1743 | + if (pnmh->idFrom == IDC_TAB_ISEDITOR) { | |
1744 | + switch (pnmh->code) { | |
1745 | + case TCN_SELCHANGE: | |
1746 | + { | |
1747 | + int nIndex = SendDlgItemMessage(hwnd, IDC_TAB_ISEDITOR, TCM_GETCURSEL, (WPARAM)0, (LPARAM)0); | |
1748 | + for (i = 0; i < ISEDITOR_PAGE_MAX; i++) { | |
1749 | + if (is_editor_pages[i].hwnd) | |
1750 | + ShowWindow(is_editor_pages[i].hwnd, SW_HIDE); | |
1751 | + } | |
1752 | + ISEditorWndCreatePage(hwnd, nIndex); | |
1753 | + ShowWindow(is_editor_pages[nIndex].hwnd, SW_SHOWNORMAL); | |
1754 | + return TRUE; | |
1755 | + } | |
1752 | 1756 | |
1753 | - default: | |
1754 | - break; | |
1755 | - } | |
1756 | - } | |
1757 | + default: | |
1758 | + break; | |
1759 | + } | |
1760 | + } | |
1757 | 1761 | } |
1758 | 1762 | break; |
1759 | 1763 | |
1760 | - case WM_SIZE: | |
1761 | - { | |
1762 | - RECT rc; | |
1763 | - HWND hwnd_tab = GetDlgItem ( hwnd, IDC_TAB_ISEDITOR ); | |
1764 | - GetClientRect ( hwnd_tab, &rc ); | |
1765 | - SendDlgItemMessage ( hwnd, IDC_TAB_ISEDITOR, TCM_ADJUSTRECT, (WPARAM) TRUE, (LPARAM) &rc ); | |
1766 | - for ( i = 0; i < ISEDITOR_PAGE_MAX; i++ ) { | |
1767 | - MoveWindow ( is_editor_pages[i].hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE ); | |
1768 | - } | |
1769 | - return TRUE; | |
1770 | - } | |
1771 | - case WM_DESTROY: | |
1772 | - case WM_CLOSE: | |
1773 | - EndDialog ( hwnd, FALSE ); | |
1774 | - uninit_is_editor_param(); | |
1775 | - break; | |
1776 | - default: | |
1777 | - break; | |
1778 | - } | |
1779 | - return FALSE; | |
1764 | + case WM_SIZE: | |
1765 | + { | |
1766 | + RECT rc; | |
1767 | + HWND hwnd_tab = GetDlgItem ( hwnd, IDC_TAB_ISEDITOR ); | |
1768 | + GetClientRect ( hwnd_tab, &rc ); | |
1769 | + SendDlgItemMessage ( hwnd, IDC_TAB_ISEDITOR, TCM_ADJUSTRECT, (WPARAM)TRUE, (LPARAM)&rc ); | |
1770 | + for ( i = 0; i < ISEDITOR_PAGE_MAX; i++ ) { | |
1771 | + MoveWindow ( is_editor_pages[i].hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE ); | |
1772 | + } | |
1773 | + return TRUE; | |
1774 | + } | |
1775 | + case WM_DESTROY: | |
1776 | + case WM_CLOSE: | |
1777 | + EndDialog ( hwnd, FALSE ); | |
1778 | + uninit_is_editor_param(); | |
1779 | + break; | |
1780 | + default: | |
1781 | + break; | |
1782 | + } | |
1783 | + return FALSE; | |
1780 | 1784 | } |
1781 | 1785 | |
1782 | 1786 | static UINT ISEditorSearchPageFromCID(UINT cid) |
@@ -1787,17 +1791,17 @@ static UINT ISEditorSearchPageFromCID(UINT cid) | ||
1787 | 1791 | |
1788 | 1792 | switch (PlayerLanguage) { |
1789 | 1793 | case LANGUAGE_JAPANESE: |
1790 | - page = is_editor_pages_ja; | |
1791 | - break; | |
1794 | + page = is_editor_pages_ja; | |
1795 | + break; | |
1792 | 1796 | default: |
1793 | - case LANGUAGE_ENGLISH: | |
1794 | - page = is_editor_pages_en; | |
1795 | - break; | |
1797 | + case LANGUAGE_ENGLISH: | |
1798 | + page = is_editor_pages_en; | |
1799 | + break; | |
1796 | 1800 | } |
1797 | 1801 | for (i = 0; i < ISEDITOR_PAGE_MAX; i++) { |
1798 | - if (page[i].control == cid) { | |
1799 | - num = i; | |
1800 | - } | |
1802 | + if (page[i].control == cid) { | |
1803 | + num = i; | |
1804 | + } | |
1801 | 1805 | } |
1802 | 1806 | return num; |
1803 | 1807 | } |
@@ -1805,39 +1809,39 @@ static UINT ISEditorSearchPageFromCID(UINT cid) | ||
1805 | 1809 | void ISEditorWndCreate(HWND hwnd) |
1806 | 1810 | { |
1807 | 1811 | UINT page = ISEditorSearchPageFromCID(0); |
1808 | - HICON hIcon; | |
1812 | + HICON hIcon; | |
1809 | 1813 | |
1810 | 1814 | VOLATILE_TOUCH(ISEditorWndDoing); |
1811 | 1815 | if (ISEditorWndDoing) |
1812 | - return; | |
1813 | - init_is_editor_param(); | |
1814 | - scc_data_num = 0; | |
1815 | - scc_preset_num = 0; | |
1816 | - mms_preset_num = 0; | |
1817 | - mms_op_num = 0; | |
1818 | - focus_wnd = 0; | |
1816 | + return; | |
1817 | + init_is_editor_param(); | |
1818 | + scc_data_num = 0; | |
1819 | + scc_preset_num = 0; | |
1820 | + mms_preset_num = 0; | |
1821 | + mms_op_num = 0; | |
1822 | + focus_wnd = 0; | |
1819 | 1823 | ISEditorWndDoing = 1; |
1820 | 1824 | ISEditorWndSetOK = 1; |
1821 | 1825 | ISEditorInitialPage = page; |
1822 | - switch (PlayerLanguage) { | |
1823 | - case LANGUAGE_JAPANESE: | |
1824 | - // DialogBox ( hInst, MAKEINTRESOURCE(IDD_DIALOG_ISEDITOR), hwnd, ISEditorWndDialogProc ); | |
1825 | - hISEditorWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DIALOG_ISEDITOR), hwnd, ISEditorWndDialogProc); | |
1826 | - break; | |
1827 | - default: | |
1828 | - case LANGUAGE_ENGLISH: | |
1829 | - // DialogBox ( hInst, MAKEINTRESOURCE(IDD_DIALOG_ISEDITOR_EN), hwnd, ISEditorWndDialogProc ); | |
1830 | - hISEditorWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DIALOG_ISEDITOR), hwnd, ISEditorWndDialogProc); | |
1831 | - break; | |
1832 | - } | |
1833 | - ISEditorWndSetOK = 0; | |
1834 | - ISEditorWndDoing = 0; | |
1835 | - ShowWindow(hISEditorWnd, SW_HIDE); | |
1836 | - hIcon = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON_TIMIDITY), IMAGE_ICON, 16, 16, 0); | |
1837 | - if (hIcon) SendMessage(hISEditorWnd, WM_SETICON, FALSE, (LPARAM) hIcon); | |
1838 | - UpdateWindow(hISEditorWnd); | |
1839 | - ShowWindow(hISEditorWnd, SW_SHOW); | |
1840 | - return; | |
1826 | + switch(PlayerLanguage) { | |
1827 | + case LANGUAGE_JAPANESE: | |
1828 | + // DialogBox ( hInst, MAKEINTRESOURCE(IDD_DIALOG_ISEDITOR), hwnd, ISEditorWndDialogProc ); | |
1829 | + hISEditorWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DIALOG_ISEDITOR), hwnd, ISEditorWndDialogProc); | |
1830 | + break; | |
1831 | + default: | |
1832 | + case LANGUAGE_ENGLISH: | |
1833 | + // DialogBox ( hInst, MAKEINTRESOURCE(IDD_DIALOG_ISEDITOR_EN), hwnd, ISEditorWndDialogProc ); | |
1834 | + hISEditorWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DIALOG_ISEDITOR), hwnd, ISEditorWndDialogProc); | |
1835 | + break; | |
1836 | + } | |
1837 | + ISEditorWndSetOK = 0; | |
1838 | + ISEditorWndDoing = 0; | |
1839 | + ShowWindow(hISEditorWnd, SW_HIDE); | |
1840 | + hIcon = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON_TIMIDITY), IMAGE_ICON, 16, 16, 0); | |
1841 | + if (hIcon) SendMessage(hISEditorWnd, WM_SETICON, FALSE, (LPARAM)hIcon); | |
1842 | + UpdateWindow(hISEditorWnd); | |
1843 | + ShowWindow(hISEditorWnd, SW_SHOW); | |
1844 | + return; | |
1841 | 1845 | } |
1842 | 1846 | |
1843 | 1847 |
@@ -1851,4 +1855,4 @@ void ISEditorWndCreate(HWND hwnd) | ||
1851 | 1855 | #undef DLG_FLAG_TO_CHECKBUTTON |
1852 | 1856 | #undef CHECKRANGE_ISEDITOR_PARAM |
1853 | 1857 | |
1854 | -#endif // INT_SYNTH | |
1858 | +#endif // INT_SYNTH | |
\ No newline at end of file |
@@ -459,6 +459,8 @@ public: | ||
459 | 459 | { |
460 | 460 | auto lock = m_Lock.LockUnique(); |
461 | 461 | m_Buffer.Clear(); |
462 | + m_SelStart.reset(); | |
463 | + m_SelEnd.reset(); | |
462 | 464 | } |
463 | 465 | |
464 | 466 | void Write(LPCTSTR pText) |
@@ -1648,14 +1648,14 @@ PrefPlayerDialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | ||
1648 | 1648 | case WM_DESTROY: |
1649 | 1649 | if (strcmp(sp_temp->ConfigFile, CurrentConfigFile) != 0) { |
1650 | 1650 | const TCHAR *msg, |
1651 | - msg_en[] = TEXT("Press the Reload button to apply instruments"), | |
1652 | - msg_jp[] = TEXT("音色情報は強制再読込ボタンを押すと反映されます"); | |
1651 | + msg_en[] = TEXT("Config file was changed. Do you want to reload it?"), | |
1652 | + msg_jp[] = TEXT("Config ファイルが変更されました。再読み込みしますか?"); | |
1653 | 1653 | switch (CurrentPlayerLanguage) { |
1654 | 1654 | case LANGUAGE_ENGLISH: msg = msg_en; break; |
1655 | 1655 | case LANGUAGE_JAPANESE: default: msg = msg_jp; break; |
1656 | 1656 | } |
1657 | - if (get_verbosity_level() >= VERB_NORMAL) | |
1658 | - MessageBox(hMainWnd, msg, TEXT("TiMidity"), MB_OK | MB_ICONWARNING); | |
1657 | + if (MessageBox(hMainWnd, msg, TEXT("TiMidity"), MB_YESNO | MB_ICONQUESTION) == IDYES) | |
1658 | + reload_cfg(); | |
1659 | 1659 | } |
1660 | 1660 | safe_free(CurrentConfigFile); |
1661 | 1661 | CurrentConfigFile = 0; |
@@ -2041,14 +2041,14 @@ PrefSyn1DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | ||
2041 | 2041 | case WM_DESTROY: |
2042 | 2042 | if (strcmp(sp_temp->ConfigFile, CurrentConfigFile) != 0) { |
2043 | 2043 | const TCHAR *msg, |
2044 | - msg_en[] = TEXT("Press the Reload button to apply instruments"), | |
2045 | - msg_jp[] = TEXT("音色情報は強制再読込ボタンを押すと反映されます"); | |
2044 | + msg_en[] = TEXT("Config file was changed. Do you want to reload it?"), | |
2045 | + msg_jp[] = TEXT("Config ファイルが変更されました。再読み込みしますか?"); | |
2046 | 2046 | switch (CurrentPlayerLanguage) { |
2047 | 2047 | case LANGUAGE_ENGLISH: msg = msg_en; break; |
2048 | 2048 | case LANGUAGE_JAPANESE: default: msg = msg_jp; break; |
2049 | 2049 | } |
2050 | - if (get_verbosity_level() >= VERB_NORMAL) | |
2051 | - MessageBox(hwnd, msg, TEXT(""), MB_OK | MB_ICONWARNING); | |
2050 | + if (MessageBox(hMainWnd, msg, TEXT("TiMidity"), MB_YESNO | MB_ICONQUESTION) == IDYES) | |
2051 | + reload_cfg(); | |
2052 | 2052 | } |
2053 | 2053 | safe_free(CurrentConfigFile); |
2054 | 2054 | CurrentConfigFile = 0; |
@@ -4452,6 +4452,7 @@ PrefTiMidity3DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | ||
4452 | 4452 | } else |
4453 | 4453 | SetDlgItemText(hwnd,IDC_EDIT_OUTPUT_FILE,st_temp->OutputDirName); |
4454 | 4454 | PostMessage(hwnd, WM_COMMAND, IDC_COMBO_OUTPUT_MODE, 0); // force updating IDC_BUTTON_OUTPUT_FILE text |
4455 | + PostMessage(hwnd, WM_COMMAND, IDC_COMBO_OUTPUT, 0); | |
4455 | 4456 | #endif |
4456 | 4457 | opt = st_temp->opt_playmode + 1; |
4457 | 4458 | if(strchr(opt, 'U')){ |
@@ -4792,6 +4793,24 @@ PrefTiMidity3DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | ||
4792 | 4793 | SendDlgItemMessage(hwnd,IDC_RADIO_MONO,BM_SETCHECK,0,0); |
4793 | 4794 | } |
4794 | 4795 | break; |
4796 | + case IDC_COMBO_OUTPUT: | |
4797 | + { | |
4798 | + BOOL is_file_output, enable_path_setting; | |
4799 | + int num = CB_GET(IDC_COMBO_OUTPUT); | |
4800 | + if (num < 0) { | |
4801 | + num = 0; | |
4802 | + } | |
4803 | + | |
4804 | + EnableWindow(GetDlgItem(hwnd, IDC_BUTTON_OUTPUT_OPTIONS), !!strchr("wdxkvgoPpWKLF", play_mode_list[num]->id_character)); | |
4805 | + | |
4806 | + is_file_output = !!(play_mode_list[num]->flag & PF_FILE_OUTPUT); | |
4807 | + enable_path_setting = is_file_output && st_temp->auto_output_mode != 1; | |
4808 | + EnableWindow(GetDlgItem(hwnd, IDC_COMBO_OUTPUT_MODE), is_file_output); | |
4809 | + EnableWindow(GetDlgItem(hwnd, IDC_BUTTON_OUTPUT_FILE), enable_path_setting); | |
4810 | + EnableWindow(GetDlgItem(hwnd, IDC_EDIT_OUTPUT_FILE), enable_path_setting); | |
4811 | + EnableWindow(GetDlgItem(hwnd, IDC_BUTTON_OUTPUT_FILE_DEL), is_file_output && st_temp->auto_output_mode == 0); | |
4812 | + } | |
4813 | + break; | |
4795 | 4814 | case IDC_BUTTON_OUTPUT_OPTIONS: |
4796 | 4815 | { |
4797 | 4816 | int num; |
@@ -8555,8 +8574,6 @@ int portaudioConfigDialog(void) | ||
8555 | 8574 | ///r |
8556 | 8575 | int asioConfigDialog(int deviceID) |
8557 | 8576 | { |
8558 | - extern HWND hMainWnd; | |
8559 | - | |
8560 | 8577 | PaHostApiTypeId HostApiTypeId; |
8561 | 8578 | const PaHostApiInfo *HostApiInfo; |
8562 | 8579 | PaDeviceIndex DeviceIndex; |
@@ -14,11 +14,11 @@ | ||
14 | 14 | #define IDD_DIALOG_SIMPLE_LIST 110 |
15 | 15 | #define IDD_DIALOG_WRD 111 |
16 | 16 | #define IDD_DIALOG_SOUNDSPEC_EN 112 |
17 | -#define IDD_DIALOG_SOUNDSPEC 112 | |
18 | -#define IDD_DIALOG_WAVEFORM 113 | |
19 | -#define IDD_DIALOG_PLAYLIST_EN 114 | |
20 | -#define IDD_DIALOG_PLAYLIST 115 | |
21 | -#define IDD_DIALOG_SEARCHBOX 116 | |
17 | +#define IDD_DIALOG_SOUNDSPEC 113 | |
18 | +#define IDD_DIALOG_WAVEFORM 114 | |
19 | +#define IDD_DIALOG_PLAYLIST_EN 115 | |
20 | +#define IDD_DIALOG_PLAYLIST 116 | |
21 | +#define IDD_DIALOG_SEARCHBOX 117 | |
22 | 22 | #define IDD_DIALOG_ONE_LINE_EN 118 |
23 | 23 | #define IDD_DIALOG_ONE_LINE 119 |
24 | 24 | #define IDD_DIALOG_PREF_EN 120 |
@@ -156,7 +156,7 @@ | ||
156 | 156 | //// player |
157 | 157 | // cfg |
158 | 158 | #define IDC_BUTTON_CONFIG_FILE 3000 |
159 | -#define IDC_EDIT_CONFIG_FILE 3001 | |
159 | +#define IDC_COMBO_CONFIG_FILE 3001 | |
160 | 160 | #define IDC_BUTTON_CFG_EDIT 3002 |
161 | 161 | #define IDC_BUTTON_CFG_RELOAD 3003 |
162 | 162 | // player |
@@ -711,7 +711,9 @@ | ||
711 | 711 | #define IDC_CHECKBOX_PA_WASAPI_POLLING 8109 |
712 | 712 | #define IDC_COMBO_PA_WASAPI_PRIORITY 8110 |
713 | 713 | #define IDC_COMBO_PA_WASAPI_STREAM_CATEGORY 8115 |
714 | -#define IDC_COMBO_PA_WASAPI_STREAM_OPTION 8120 | |
714 | +#define IDC_CHECKBOX_PA_WASAPI_STREAM_OPTIONS_RAW 8120 | |
715 | +#define IDC_CHECKBOX_PA_WASAPI_STREAM_OPTIONS_MATCH_FORMAT 8121 | |
716 | +#define IDC_CHECKBOX_PA_WASAPI_STREAM_OPTIONS_AMBISONICS 8122 | |
715 | 717 | |
716 | 718 | // lame |
717 | 719 | #define IDC_LAME_CBPRESET 8200 |
@@ -144,6 +144,10 @@ void InitConsoleWnd(HWND hParentWnd) | ||
144 | 144 | #ifdef TIMW32G_USE_NEW_CONSOLE |
145 | 145 | InitializeNewConsole(); |
146 | 146 | #endif |
147 | + | |
148 | +#ifdef TIMW32G_USE_NEW_CONSOLE | |
149 | + InitializeNewConsole(); | |
150 | +#endif | |
147 | 151 | |
148 | 152 | switch(PlayerLanguage){ |
149 | 153 | case LANGUAGE_ENGLISH: |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* |
2 | 2 | TiMidity++ -- MIDI to WAVE converter and player |
3 | - Copyright (C) 1999-2018 Masanao Izumo <iz@onicos.co.jp> | |
3 | + Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp> | |
4 | 4 | Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi> |
5 | 5 | |
6 | 6 | This program is free software; you can redistribute it and/or modify |
@@ -24,14 +24,14 @@ | ||
24 | 24 | #include "config.h" |
25 | 25 | #endif /* HAVE_CONFIG_H */ |
26 | 26 | #include <stdio.h> |
27 | -#ifdef HAVE_STDLIB_H | |
28 | 27 | #include <stdlib.h> |
29 | -#endif /* HAVE_STDLIB_H */ | |
30 | 28 | #include <process.h> |
31 | -#ifdef HAVE_STDDEF_H | |
32 | 29 | #include <stddef.h> |
33 | -#endif /* HAVE_STDDEF_H */ | |
34 | -#include "_string.h" | |
30 | +#ifndef NO_STRING_H | |
31 | +#include <string.h> | |
32 | +#else | |
33 | +#include <strings.h> | |
34 | +#endif | |
35 | 35 | |
36 | 36 | #include "timidity.h" |
37 | 37 | #include "common.h" |
@@ -66,22 +66,22 @@ | ||
66 | 66 | #include "w32g_wrd.h" |
67 | 67 | #include "w32g_mag.h" |
68 | 68 | |
69 | -extern int gdi_lock_ex(DWORD timeout); | |
69 | +extern int gdi_lock_ex ( DWORD timeout ); | |
70 | 70 | #if 0 |
71 | 71 | static int gdi_lock_result; |
72 | -#define GDI_LOCK_EX(timeout) (\ | |
73 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK_EX(%s: %d)", __FILE__, __LINE__), \ | |
74 | - gdi_lock_result = gdi_lock_ex(timeout), \ | |
75 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK_EX_RESULT(%d)", gdi_lock_result), \ | |
76 | - gdi_lock_result \ | |
72 | +#define GDI_LOCK_EX(timeout) ( \ | |
73 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK_EX(%s: %d)", __FILE__, __LINE__ ), \ | |
74 | + gdi_lock_result = gdi_lock_ex(timeout), \ | |
75 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK_EX_RESULT(%d)", gdi_lock_result ), \ | |
76 | + gdi_lock_result \ | |
77 | 77 | ) |
78 | 78 | #define GDI_LOCK() { \ |
79 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK(%s: %d)", __FILE__, __LINE__); \ | |
80 | - gdi_lock(); \ | |
79 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK(%s: %d)", __FILE__, __LINE__ ); \ | |
80 | + gdi_lock(); \ | |
81 | 81 | } |
82 | 82 | #define GDI_UNLOCK() { \ |
83 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_UNLOCK(%s: %d)", __FILE__, __LINE__); \ | |
84 | - gdi_unlock(); \ | |
83 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_UNLOCK(%s: %d)", __FILE__, __LINE__ ); \ | |
84 | + gdi_unlock(); \ | |
85 | 85 | } |
86 | 86 | #else |
87 | 87 | #define GDI_LOCK() { gdi_lock(); } |
@@ -91,7 +91,7 @@ static int gdi_lock_result; | ||
91 | 91 | |
92 | 92 | #if defined(__CYGWIN32__) || defined(__MINGW32__) |
93 | 93 | #ifndef TPM_TOPALIGN |
94 | -#define TPM_TOPALIGN 0x0000L | |
94 | +#define TPM_TOPALIGN 0x0000L | |
95 | 95 | #endif |
96 | 96 | #endif |
97 | 97 |
@@ -113,23 +113,23 @@ extern void ClearEditCtlWnd(HWND hwnd); | ||
113 | 113 | #ifndef _MBC_ILLEGAL |
114 | 114 | #define _MBC_ILLEGAL (-1) |
115 | 115 | #endif |
116 | -#define is_sjis_kanji1(x) ((((unsigned char)(x)) >= 0x81 && ((unsigned char)(x)) <= 0x9f) || (((unsigned char)(x)) >= 0xe0 && ((unsigned char)(x)) <= 0xfc)) | |
117 | -#define is_sjis_kanji2(x) ((((unsigned char)(x)) >= 0x40 && ((unsigned char)(x)) <= 0x7e) || (((unsigned char)(x)) >= 0x80 && ((unsigned char)(x)) <= 0xfc)) | |
116 | +#define is_sjis_kanji1(x) ((((unsigned char)(x))>=0x81 && ((unsigned char)(x))<=0x9f) || (((unsigned char)(x))>=0xe0 && ((unsigned char)(x))<=0xfc)) | |
117 | +#define is_sjis_kanji2(x) ((((unsigned char)(x))>=0x40 && ((unsigned char)(x))<=0x7e) || (((unsigned char)(x))>=0x80 && ((unsigned char)(x))<=0xfc)) | |
118 | 118 | static int ___sjis_mbbtype(unsigned char c, int mbtype) |
119 | 119 | { |
120 | - if (mbtype == _MBC_LEAD) { | |
121 | - if (is_sjis_kanji2(c)) return _MBC_TRAIL; else return _MBC_ILLEGAL; | |
122 | - } else { if (is_sjis_kanji1(c)) return _MBC_LEAD; else return _MBC_SINGLE; } | |
120 | + if(mbtype==_MBC_LEAD){ | |
121 | + if(is_sjis_kanji2(c)) return _MBC_TRAIL; else return _MBC_ILLEGAL; | |
122 | + } else { if(is_sjis_kanji1(c)) return _MBC_LEAD; else return _MBC_SINGLE; } | |
123 | 123 | } |
124 | 124 | static int _mbbtype(unsigned char c, int mbtype) |
125 | 125 | { |
126 | - return ___sjis_mbbtype(c, mbtype); | |
126 | + return ___sjis_mbbtype(c,mbtype); | |
127 | 127 | } |
128 | 128 | #endif |
129 | 129 | |
130 | 130 | |
131 | -static RGBQUAD RGBtoRGBQUAD(COLORREF color); | |
132 | -static COLORREF RGBQUADtoRGB(RGBQUAD rq); | |
131 | +static RGBQUAD RGBtoRGBQUAD ( COLORREF color ); | |
132 | +static COLORREF RGBQUADtoRGB ( RGBQUAD rq ); | |
133 | 133 | |
134 | 134 | // **************************************************************************** |
135 | 135 | // Wrd Window |
@@ -137,8 +137,8 @@ static COLORREF RGBQUADtoRGB(RGBQUAD rq); | ||
137 | 137 | #define MAG_WORK_WIDTH 800 |
138 | 138 | #define MAG_WORK_HEIGHT 640 |
139 | 139 | |
140 | -#define COLOR_MASK_WHITE RGB(0xFF, 0xFF, 0xFF) | |
141 | -#define COLOR_MASK_BLACK RGB(0x00, 0x00, 0x00) | |
140 | +#define COLOR_MASK_WHITE RGB(0xFF,0xFF,0xFF) | |
141 | +#define COLOR_MASK_BLACK RGB(0x00,0x00,0x00) | |
142 | 142 | |
143 | 143 | WRDWNDINFO WrdWndInfo; |
144 | 144 |
@@ -149,1834 +149,1832 @@ w32g_wrd_wnd_t w32g_wrd_wnd; | ||
149 | 149 | |
150 | 150 | BOOL SetWrdWndActive(void) |
151 | 151 | { |
152 | - if (IsWindowVisible(hWrdWnd)) { | |
153 | - w32g_wrd_wnd.active = TRUE; | |
154 | - } else { | |
155 | - w32g_wrd_wnd.active = FALSE; | |
156 | - } | |
157 | - return w32g_wrd_wnd.active; | |
158 | -} | |
159 | - | |
160 | -static void wrd_graphic_terminate(void); | |
161 | -static void wrd_graphic_init(HDC hdc); | |
162 | -static void wrd_graphic_tone_change(int index, int tone); | |
163 | -static void wrd_graphic_set_pal(int index, int pal_index, COLORREF color); | |
164 | -static void wrd_graphic_plane_change(int active, int display); | |
165 | -static void wrd_graphic_reset(int index); | |
166 | -static void wrd_graphic_reset_all(void); | |
167 | -static void wrd_graphic_apply(RECT *lprc, int index, int lockflag); | |
168 | -static void wrd_graphic_update(RECT *lprc, int lockflag); | |
169 | -static void wrd_text_update(int x_from, int y_from, int x_to, int y_to, int lockflag); | |
152 | + if ( IsWindowVisible(hWrdWnd) ) { | |
153 | + w32g_wrd_wnd.active = TRUE; | |
154 | + } else { | |
155 | + w32g_wrd_wnd.active = FALSE; | |
156 | + } | |
157 | + return w32g_wrd_wnd.active; | |
158 | +} | |
159 | + | |
160 | +static void wrd_graphic_terminate ( void ); | |
161 | +static void wrd_graphic_init ( HDC hdc ); | |
162 | +static void wrd_graphic_tone_change ( int index, int tone ); | |
163 | +static void wrd_graphic_set_pal ( int index, int pal_index, COLORREF color ); | |
164 | +static void wrd_graphic_plane_change ( int active, int display ); | |
165 | +static void wrd_graphic_reset ( int index ); | |
166 | +static void wrd_graphic_reset_all ( void ); | |
167 | +static void wrd_graphic_apply ( RECT *lprc, int index, int lockflag ); | |
168 | +static void wrd_graphic_update ( RECT *lprc, int lockflag ); | |
169 | +static void wrd_text_update ( int x_from, int y_from, int x_to, int y_to, int lockflag ); | |
170 | 170 | |
171 | 171 | static int volatile wrd_graphic_pal_init_flag = 0; |
172 | 172 | |
173 | 173 | static HANDLE volatile hMutexWrd = NULL; |
174 | -static BOOL wrd_wnd_lock_ex(DWORD timeout) | |
174 | +static BOOL wrd_wnd_lock_ex ( DWORD timeout ) | |
175 | 175 | { |
176 | - if (!hMutexWrd) { | |
177 | - hMutexWrd = CreateMutex(NULL, FALSE, NULL); | |
178 | - if (!hMutexWrd) | |
179 | - return FALSE; | |
180 | - } | |
181 | - if (WaitForSingleObject(hMutexWrd, timeout) == WAIT_FAILED) { | |
182 | - return FALSE; | |
183 | - } | |
184 | - return TRUE; | |
185 | -} | |
186 | -static BOOL wrd_wnd_lock(void) | |
176 | + if ( hMutexWrd == NULL ) { | |
177 | + hMutexWrd = CreateMutex ( NULL, FALSE, NULL ); | |
178 | + if ( hMutexWrd == NULL ) | |
179 | + return FALSE; | |
180 | + } | |
181 | + if ( WaitForSingleObject ( hMutexWrd, timeout )== WAIT_FAILED ) { | |
182 | + return FALSE; | |
183 | + } | |
184 | + return TRUE; | |
185 | +} | |
186 | +static BOOL wrd_wnd_lock (void) | |
187 | 187 | { |
188 | - return wrd_wnd_lock_ex(INFINITE); | |
188 | + return wrd_wnd_lock_ex ( INFINITE ); | |
189 | 189 | } |
190 | -static void wrd_wnd_unlock(void) | |
190 | +static void wrd_wnd_unlock (void) | |
191 | 191 | { |
192 | - ReleaseMutex(hMutexWrd); | |
192 | + ReleaseMutex ( hMutexWrd ); | |
193 | 193 | } |
194 | 194 | |
195 | 195 | |
196 | 196 | static INT_PTR CALLBACK WrdWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam); |
197 | 197 | static LRESULT CALLBACK WrdCanvasWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam); |
198 | 198 | static int volatile wrd_wnd_initflag = 1; |
199 | -void TerminateWrdWnd(void) | |
199 | +void TerminateWrdWnd ( void ) | |
200 | 200 | { |
201 | - wrd_wnd_lock(); | |
202 | - w32g_wrd_wnd.active = FALSE; | |
203 | - if (!wrd_wnd_initflag) { | |
204 | - DeleteDC(w32g_wrd_wnd.hmdc); | |
205 | - DeleteObject((HGDIOBJ) w32g_wrd_wnd.hbitmap); | |
206 | - DeleteObject((HGDIOBJ) w32g_wrd_wnd.hbmp_tmask); | |
207 | - DeleteObject((HGDIOBJ) w32g_wrd_wnd.hbmp_work); | |
208 | - DeleteObject((HGDIOBJ) w32g_wrd_wnd.hNullBrush); | |
209 | - DeleteObject((HGDIOBJ) w32g_wrd_wnd.hNullPen); | |
210 | - } | |
211 | - wrd_graphic_terminate(); | |
212 | - ZeroMemory(&w32g_wrd_wnd, sizeof(w32g_wrd_wnd_t)); | |
213 | - wrd_wnd_unlock(); | |
201 | + wrd_wnd_lock(); | |
202 | + w32g_wrd_wnd.active = FALSE; | |
203 | + if ( !wrd_wnd_initflag ) { | |
204 | + DeleteDC ( w32g_wrd_wnd.hmdc ); | |
205 | + DeleteObject ( (HGDIOBJ) w32g_wrd_wnd.hbitmap ); | |
206 | + DeleteObject ( (HGDIOBJ) w32g_wrd_wnd.hbmp_tmask ); | |
207 | + DeleteObject ( (HGDIOBJ) w32g_wrd_wnd.hbmp_work ); | |
208 | + DeleteObject ( (HGDIOBJ) w32g_wrd_wnd.hNullBrush ); | |
209 | + DeleteObject ( (HGDIOBJ) w32g_wrd_wnd.hNullPen ); | |
210 | + } | |
211 | + wrd_graphic_terminate (); | |
212 | + memset ( &w32g_wrd_wnd, 0, sizeof (w32g_wrd_wnd_t) ); | |
213 | + wrd_wnd_unlock(); | |
214 | 214 | } |
215 | 215 | void InitWrdWnd(HWND hParentWnd) |
216 | 216 | { |
217 | - WNDCLASS wndclass; | |
218 | - HICON hIcon; | |
219 | - | |
220 | - wrd_wnd_lock(); | |
221 | - if (wrd_wnd_initflag) { | |
222 | - ZeroMemory(&w32g_wrd_wnd, sizeof(w32g_wrd_wnd_t)); | |
223 | - wrd_wnd_initflag = 0; | |
224 | - } | |
225 | - if (hWrdWnd) { | |
226 | - DestroyWindow(hWrdWnd); | |
227 | - hWrdWnd = NULL; | |
228 | - } | |
229 | - TerminateWrdWnd(); | |
230 | - | |
231 | - INILoadWrdWnd(); | |
232 | - | |
233 | - w32g_wrd_wnd.hNullBrush = GetStockObject(NULL_BRUSH); | |
234 | - w32g_wrd_wnd.hNullPen = GetStockObject(NULL_PEN); | |
235 | - | |
236 | - hWrdWnd = CreateDialog | |
237 | - (hInst, MAKEINTRESOURCE(IDD_DIALOG_WRD), hParentWnd, WrdWndProc); | |
238 | - WrdWndInfoReset(hWrdWnd); | |
239 | - INILoadWrdWnd(); | |
240 | - ShowWindow(hWrdWnd, SW_HIDE); | |
241 | - w32g_wrd_wnd.draw_skip = 0; | |
242 | - w32g_wrd_wnd.font_height = 16; | |
243 | - w32g_wrd_wnd.font_width = 8; | |
244 | - w32g_wrd_wnd.row = 80; | |
245 | - w32g_wrd_wnd.col = 25; | |
246 | - w32g_wrd_wnd.width = w32g_wrd_wnd.font_width * w32g_wrd_wnd.row; | |
247 | - w32g_wrd_wnd.height = w32g_wrd_wnd.font_height * w32g_wrd_wnd.col; | |
248 | - w32g_wrd_wnd.pals[W32G_WRDWND_BLACK] = RGB(0x00, 0x00, 0x00); | |
249 | - w32g_wrd_wnd.pals[W32G_WRDWND_RED] = RGB(0xFF, 0x00, 0x00); | |
250 | - w32g_wrd_wnd.pals[W32G_WRDWND_BLUE] = RGB(0x00, 0x00, 0xFF); | |
251 | - w32g_wrd_wnd.pals[W32G_WRDWND_PURPLE] = RGB(0xFF, 0x00, 0xFF); | |
252 | - w32g_wrd_wnd.pals[W32G_WRDWND_GREEN] = RGB(0x00, 0xFF, 0x00); | |
253 | - w32g_wrd_wnd.pals[W32G_WRDWND_LIGHTBLUE] = RGB(0x00, 0xFF, 0xFF); | |
254 | - w32g_wrd_wnd.pals[W32G_WRDWND_YELLOW] = RGB(0xFF, 0xFF, 0xFF); | |
255 | - w32g_wrd_wnd.pals[W32G_WRDWND_WHITE] = RGB(0xFF, 0xFF, 0xFF); | |
256 | - w32g_wrd_wnd.flag = WRD_FLAG_DEFAULT; | |
257 | - | |
258 | - wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_CLASSDC; | |
259 | - wndclass.lpfnWndProc = WrdCanvasWndProc; | |
260 | - wndclass.cbClsExtra = 0; | |
261 | - wndclass.cbWndExtra = 0; | |
262 | - wndclass.hInstance = hInst; | |
263 | - wndclass.hIcon = NULL; | |
264 | - wndclass.hCursor = LoadCursor(0, IDC_ARROW); | |
265 | -// wndclass.hbrBackground = (HBRUSH)(COLOR_SCROLLBAR + 1); | |
266 | - wndclass.hbrBackground = w32g_wrd_wnd.hNullBrush; | |
267 | - wndclass.lpszMenuName = NULL; | |
268 | - wndclass.lpszClassName = "wrd canvas wnd"; | |
269 | - RegisterClass(&wndclass); | |
270 | - w32g_wrd_wnd.hwnd = CreateWindowEx(0, "wrd canvas wnd", 0, WS_CHILD, | |
271 | - CW_USEDEFAULT, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height, | |
272 | - hWrdWnd, 0, hInst, 0); | |
273 | - w32g_wrd_wnd.hdc = GetDC(w32g_wrd_wnd.hwnd); | |
274 | - | |
275 | - // 大元 | |
276 | - w32g_wrd_wnd.hbitmap = CreateCompatibleBitmap(w32g_wrd_wnd.hdc, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
277 | - w32g_wrd_wnd.hmdc = CreateCompatibleDC(w32g_wrd_wnd.hdc); | |
278 | - w32g_wrd_wnd.hgdiobj_hmdcprev = SelectObject(w32g_wrd_wnd.hmdc, w32g_wrd_wnd.hbitmap); | |
279 | - SelectObject(w32g_wrd_wnd.hmdc, w32g_wrd_wnd.hNullBrush); | |
280 | - SelectObject(w32g_wrd_wnd.hmdc, w32g_wrd_wnd.hNullPen); | |
281 | - | |
282 | - // ワーク | |
283 | - w32g_wrd_wnd.hbmp_work = CreateCompatibleBitmap(w32g_wrd_wnd.hdc, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
284 | - | |
285 | - // テキストマスク | |
286 | -// w32g_wrd_wnd.hbmp_tmask = CreateBitmap(w32g_wrd_wnd.width, w32g_wrd_wnd.height, 1, 1, NULL); | |
287 | - w32g_wrd_wnd.hbmp_tmask = CreateCompatibleBitmap(w32g_wrd_wnd.hdc, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
288 | - { | |
289 | - HDC hmdc; | |
290 | - RECT rc; | |
291 | - HBRUSH hbrush = CreateSolidBrush(COLOR_MASK_BLACK); | |
292 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
293 | - hmdc = CreateCompatibleDC(w32g_wrd_wnd.hmdc); | |
294 | - SelectObject(hmdc, w32g_wrd_wnd.hbmp_tmask); | |
295 | - FillRect(hmdc, &rc, hbrush); | |
296 | - SelectObject(hmdc, w32g_wrd_wnd.hbmp_work); | |
297 | - FillRect(hmdc, &rc, hbrush); | |
298 | - DeleteDC(hmdc); | |
299 | - DeleteObject(hbrush); | |
300 | - } | |
301 | - | |
302 | - // グラフィック | |
303 | - wrd_graphic_init(w32g_wrd_wnd.hdc); | |
304 | - | |
305 | - ReleaseDC(w32g_wrd_wnd.hwnd, w32g_wrd_wnd.hdc); | |
306 | - | |
307 | - { | |
308 | - char fontname[LF_FULLFACESIZE + 1]; | |
309 | - if (PlayerLanguage == LANGUAGE_JAPANESE) | |
310 | - strncpy(fontname, "MS 明朝", LF_FULLFACESIZE + 1); | |
311 | - else | |
312 | - strncpy(fontname, "Times New Roman", LF_FULLFACESIZE + 1); | |
313 | - w32g_wrd_wnd.hFont = CreateFont(w32g_wrd_wnd.font_height, w32g_wrd_wnd.font_width, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, | |
314 | - DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, | |
315 | - FIXED_PITCH | FF_MODERN, fontname); | |
316 | - } | |
317 | - hIcon = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON_TIMIDITY), IMAGE_ICON, 16, 16, 0); | |
318 | - if (hIcon) SendMessage(hWrdWnd, WM_SETICON, FALSE, (LPARAM) hIcon); | |
319 | - wrd_wnd_unlock(); | |
320 | - | |
321 | - WrdWndReset(); | |
322 | - w32g_wrd_wnd.active = FALSE; | |
323 | - MoveWindow(w32g_wrd_wnd.hwnd, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height, TRUE); | |
324 | - WrdWndClear(TRUE); | |
325 | - ShowWindow(w32g_wrd_wnd.hwnd, SW_SHOW); | |
326 | - UpdateWindow(w32g_wrd_wnd.hwnd); | |
327 | - UpdateWindow(hWrdWnd); | |
328 | - WrdWndInfoApply(); | |
329 | - ShowWindow(hWrdWnd, WrdWndStartFlag ? SW_SHOW : SW_HIDE); | |
330 | -} | |
331 | - | |
332 | -static void wrd_graphic_terminate(void) | |
217 | + WNDCLASS wndclass ; | |
218 | + HICON hIcon; | |
219 | + | |
220 | + wrd_wnd_lock(); | |
221 | + if ( wrd_wnd_initflag ) { | |
222 | + memset ( &w32g_wrd_wnd, 0, sizeof (w32g_wrd_wnd_t) ); | |
223 | + wrd_wnd_initflag = 0; | |
224 | + } | |
225 | + if (hWrdWnd != NULL) { | |
226 | + DestroyWindow(hWrdWnd); | |
227 | + hWrdWnd = NULL; | |
228 | + } | |
229 | + TerminateWrdWnd (); | |
230 | + | |
231 | + INILoadWrdWnd(); | |
232 | + | |
233 | + w32g_wrd_wnd.hNullBrush = GetStockObject ( NULL_BRUSH ); | |
234 | + w32g_wrd_wnd.hNullPen = GetStockObject ( NULL_PEN ); | |
235 | + | |
236 | + hWrdWnd = CreateDialog | |
237 | + (hInst,MAKEINTRESOURCE(IDD_DIALOG_WRD),hParentWnd,WrdWndProc); | |
238 | + WrdWndInfoReset(hWrdWnd); | |
239 | + INILoadWrdWnd(); | |
240 | + ShowWindow(hWrdWnd,WrdWndStartFlag ? SW_SHOW : SW_HIDE); | |
241 | + w32g_wrd_wnd.draw_skip = 0; | |
242 | + w32g_wrd_wnd.font_height = 16; | |
243 | + w32g_wrd_wnd.font_width = 8; | |
244 | + w32g_wrd_wnd.row = 80; | |
245 | + w32g_wrd_wnd.col = 25; | |
246 | + w32g_wrd_wnd.width = w32g_wrd_wnd.font_width * w32g_wrd_wnd.row; | |
247 | + w32g_wrd_wnd.height = w32g_wrd_wnd.font_height * w32g_wrd_wnd.col; | |
248 | + w32g_wrd_wnd.pals[W32G_WRDWND_BLACK] = RGB ( 0x00, 0x00, 0x00 ); | |
249 | + w32g_wrd_wnd.pals[W32G_WRDWND_RED] = RGB ( 0xFF, 0x00, 0x00 ); | |
250 | + w32g_wrd_wnd.pals[W32G_WRDWND_BLUE] = RGB ( 0x00, 0x00, 0xFF ); | |
251 | + w32g_wrd_wnd.pals[W32G_WRDWND_PURPLE] = RGB ( 0xFF, 0x00, 0xFF ); | |
252 | + w32g_wrd_wnd.pals[W32G_WRDWND_GREEN] = RGB ( 0x00, 0xFF, 0x00 ); | |
253 | + w32g_wrd_wnd.pals[W32G_WRDWND_LIGHTBLUE] = RGB ( 0x00, 0xFF, 0xFF ); | |
254 | + w32g_wrd_wnd.pals[W32G_WRDWND_YELLOW] = RGB ( 0xFF, 0xFF, 0xFF ); | |
255 | + w32g_wrd_wnd.pals[W32G_WRDWND_WHITE] = RGB ( 0xFF, 0xFF, 0xFF ); | |
256 | + w32g_wrd_wnd.flag = WRD_FLAG_DEFAULT; | |
257 | + | |
258 | + wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_CLASSDC; | |
259 | + wndclass.lpfnWndProc = WrdCanvasWndProc ; | |
260 | + wndclass.cbClsExtra = 0 ; | |
261 | + wndclass.cbWndExtra = 0 ; | |
262 | + wndclass.hInstance = hInst ; | |
263 | + wndclass.hIcon = NULL; | |
264 | + wndclass.hCursor = LoadCursor(0,IDC_ARROW) ; | |
265 | +// wndclass.hbrBackground = (HBRUSH)(COLOR_SCROLLBAR + 1); | |
266 | + wndclass.hbrBackground = w32g_wrd_wnd.hNullBrush; | |
267 | + wndclass.lpszMenuName = NULL; | |
268 | + wndclass.lpszClassName = "wrd canvas wnd"; | |
269 | + RegisterClass(&wndclass); | |
270 | + w32g_wrd_wnd.hwnd = CreateWindowEx(0,"wrd canvas wnd",0,WS_CHILD, | |
271 | + CW_USEDEFAULT,0,w32g_wrd_wnd.width,w32g_wrd_wnd.height, | |
272 | + hWrdWnd,0,hInst,0); | |
273 | + w32g_wrd_wnd.hdc = GetDC(w32g_wrd_wnd.hwnd); | |
274 | + | |
275 | + // 大元 | |
276 | + w32g_wrd_wnd.hbitmap = CreateCompatibleBitmap(w32g_wrd_wnd.hdc,w32g_wrd_wnd.width,w32g_wrd_wnd.height); | |
277 | + w32g_wrd_wnd.hmdc = CreateCompatibleDC(w32g_wrd_wnd.hdc); | |
278 | + w32g_wrd_wnd.hgdiobj_hmdcprev = SelectObject(w32g_wrd_wnd.hmdc,w32g_wrd_wnd.hbitmap); | |
279 | + SelectObject ( w32g_wrd_wnd.hmdc, w32g_wrd_wnd.hNullBrush ); | |
280 | + SelectObject ( w32g_wrd_wnd.hmdc, w32g_wrd_wnd.hNullPen ); | |
281 | + | |
282 | + // ワーク | |
283 | + w32g_wrd_wnd.hbmp_work = CreateCompatibleBitmap(w32g_wrd_wnd.hdc,w32g_wrd_wnd.width,w32g_wrd_wnd.height); | |
284 | + | |
285 | + // テキストマスク | |
286 | +// w32g_wrd_wnd.hbmp_tmask = CreateBitmap ( w32g_wrd_wnd.width, w32g_wrd_wnd.height, 1, 1, NULL); | |
287 | + w32g_wrd_wnd.hbmp_tmask = CreateCompatibleBitmap(w32g_wrd_wnd.hdc,w32g_wrd_wnd.width,w32g_wrd_wnd.height); | |
288 | + { | |
289 | + HDC hmdc; | |
290 | + RECT rc; | |
291 | + HBRUSH hbrush = CreateSolidBrush ( COLOR_MASK_BLACK ); | |
292 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
293 | + hmdc = CreateCompatibleDC ( w32g_wrd_wnd.hmdc ); | |
294 | + SelectObject ( hmdc, w32g_wrd_wnd.hbmp_tmask ); | |
295 | + FillRect ( hmdc, &rc, hbrush ); | |
296 | + SelectObject ( hmdc, w32g_wrd_wnd.hbmp_work ); | |
297 | + FillRect ( hmdc, &rc, hbrush ); | |
298 | + DeleteDC ( hmdc ); | |
299 | + DeleteObject ( hbrush ); | |
300 | + } | |
301 | + | |
302 | + // グラフィック | |
303 | + wrd_graphic_init ( w32g_wrd_wnd.hdc ); | |
304 | + | |
305 | + ReleaseDC(w32g_wrd_wnd.hwnd,w32g_wrd_wnd.hdc); | |
306 | + | |
307 | + { | |
308 | + char fontname[1024]; | |
309 | + if ( PlayerLanguage == LANGUAGE_JAPANESE ) | |
310 | + strcpy(fontname,"MS 明朝"); | |
311 | + else | |
312 | + strcpy(fontname,"Times New Roman"); | |
313 | + w32g_wrd_wnd.hFont = CreateFont(w32g_wrd_wnd.font_height,w32g_wrd_wnd.font_width,0,0,FW_DONTCARE,FALSE,FALSE,FALSE, | |
314 | + DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, | |
315 | + FIXED_PITCH | FF_MODERN ,fontname); | |
316 | + } | |
317 | + hIcon = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON_TIMIDITY), IMAGE_ICON, 16, 16, 0); | |
318 | + if (hIcon!=NULL) SendMessage(hWrdWnd,WM_SETICON,FALSE,(LPARAM)hIcon); | |
319 | + wrd_wnd_unlock(); | |
320 | + | |
321 | + WrdWndReset(); | |
322 | + w32g_wrd_wnd.active = FALSE; | |
323 | + MoveWindow(w32g_wrd_wnd.hwnd,0,0,w32g_wrd_wnd.width,w32g_wrd_wnd.height,TRUE); | |
324 | + WrdWndClear ( TRUE ); | |
325 | + ShowWindow(w32g_wrd_wnd.hwnd,SW_SHOW); | |
326 | + UpdateWindow(w32g_wrd_wnd.hwnd); | |
327 | + UpdateWindow(hWrdWnd); | |
328 | + WrdWndInfoApply(); | |
329 | +} | |
330 | + | |
331 | +static void wrd_graphic_terminate ( void ) | |
333 | 332 | { |
334 | - int index; | |
335 | - wrd_wnd_lock(); | |
336 | - GdiFlush(); | |
337 | - for (index = 0; index < W32G_WRDWND_GRAPHIC_PLANE_MAX; index++) { | |
338 | - if (w32g_wrd_wnd.graphic_dib[index]) { | |
339 | - dib_free(w32g_wrd_wnd.graphic_dib[index]); | |
340 | - w32g_wrd_wnd.graphic_dib[index] = NULL; | |
341 | - } | |
342 | - } | |
343 | - safe_free(w32g_wrd_wnd.bits_mag_work); | |
344 | - w32g_wrd_wnd.bits_mag_work = NULL; | |
345 | - wrd_wnd_unlock(); | |
333 | + int index; | |
334 | + wrd_wnd_lock(); | |
335 | + GdiFlush (); | |
336 | + for ( index = 0; index < W32G_WRDWND_GRAPHIC_PLANE_MAX; index++ ) { | |
337 | + if ( w32g_wrd_wnd.graphic_dib[index] != NULL ) { | |
338 | + dib_free ( w32g_wrd_wnd.graphic_dib[index] ); | |
339 | + w32g_wrd_wnd.graphic_dib[index] = NULL; | |
340 | + } | |
341 | + } | |
342 | + if ( w32g_wrd_wnd.bits_mag_work != NULL ) | |
343 | + free ( w32g_wrd_wnd.bits_mag_work ); | |
344 | + wrd_wnd_unlock(); | |
346 | 345 | } |
347 | 346 | |
348 | 347 | // プレーン index のグラフィックの初期化 |
349 | -static void wrd_graphic_init(HDC hdc) | |
348 | +static void wrd_graphic_init ( HDC hdc ) | |
350 | 349 | { |
351 | - int index; | |
350 | + int index; | |
352 | 351 | |
353 | - wrd_wnd_lock(); | |
354 | - wrd_graphic_terminate(); | |
355 | - for (index = 0; index < W32G_WRDWND_GRAPHIC_PLANE_MAX; index++) { | |
356 | - w32g_wrd_wnd.graphic_dib[index] = dib_create(w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
357 | - w32g_wrd_wnd.modified_graphic[index] = TRUE; | |
358 | - } | |
352 | + wrd_wnd_lock(); | |
353 | + wrd_graphic_terminate (); | |
354 | + for ( index = 0; index < W32G_WRDWND_GRAPHIC_PLANE_MAX; index++ ) { | |
355 | + w32g_wrd_wnd.graphic_dib[index] = dib_create ( w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
356 | + w32g_wrd_wnd.modified_graphic[index] = TRUE; | |
357 | + } | |
359 | 358 | |
360 | - w32g_wrd_wnd.bits_mag_work = (char*) safe_malloc(MAG_WORK_WIDTH * MAG_WORK_HEIGHT); | |
359 | + w32g_wrd_wnd.bits_mag_work = (char *) safe_malloc ( MAG_WORK_WIDTH * MAG_WORK_HEIGHT ); | |
361 | 360 | |
362 | - w32g_wrd_wnd.index_active = 0; | |
363 | - w32g_wrd_wnd.index_display = 0; | |
364 | - wrd_wnd_unlock(); | |
365 | - wrd_graphic_reset_all(); | |
361 | + w32g_wrd_wnd.index_active = 0; | |
362 | + w32g_wrd_wnd.index_display = 0; | |
363 | + wrd_wnd_unlock(); | |
364 | + wrd_graphic_reset_all (); | |
366 | 365 | } |
367 | 366 | |
368 | -static void wrd_graphic_plane_change(int active, int display) | |
367 | +static void wrd_graphic_plane_change ( int active, int display ) | |
369 | 368 | { |
370 | - wrd_wnd_lock(); | |
371 | - w32g_wrd_wnd.index_active = active; | |
372 | - w32g_wrd_wnd.index_display = display; | |
373 | - wrd_wnd_unlock(); | |
369 | + wrd_wnd_lock(); | |
370 | + w32g_wrd_wnd.index_active = active; | |
371 | + w32g_wrd_wnd.index_display = display; | |
372 | + wrd_wnd_unlock(); | |
374 | 373 | } |
375 | 374 | |
376 | -static void wrd_graphic_reset(int index) | |
375 | +static void wrd_graphic_reset ( int index ) | |
377 | 376 | { |
378 | - RECT rc; | |
379 | - if (!w32g_wrd_wnd.graphic_dib[index]) return; | |
377 | + RECT rc; | |
380 | 378 | |
381 | - wrd_wnd_lock(); | |
382 | - ZeroMemory(w32g_wrd_wnd.graphic_dib[index]->bits, w32g_wrd_wnd.graphic_dib[index]->width * w32g_wrd_wnd.graphic_dib[index]->height); | |
383 | - dib_set_pals(w32g_wrd_wnd.graphic_dib[index], w32g_wrd_wnd.default_gpal, W32G_WRDWND_GRAPHIC_PALLETE_MAX); | |
384 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
385 | - w32g_wrd_wnd.modified_graphic[index] = TRUE; | |
386 | - wrd_wnd_unlock(); | |
387 | - wrd_graphic_apply(&rc, index, TRUE); | |
379 | + wrd_wnd_lock(); | |
380 | + memset ( w32g_wrd_wnd.graphic_dib[index]->bits, 0, w32g_wrd_wnd.graphic_dib[index]->width * w32g_wrd_wnd.graphic_dib[index]->height ); | |
381 | + dib_set_pals ( w32g_wrd_wnd.graphic_dib[index], w32g_wrd_wnd.default_gpal, W32G_WRDWND_GRAPHIC_PALLETE_MAX ); | |
382 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
383 | + w32g_wrd_wnd.modified_graphic[index] = TRUE; | |
384 | + wrd_wnd_unlock(); | |
385 | + wrd_graphic_apply ( &rc, index, TRUE ); | |
388 | 386 | } |
389 | 387 | |
390 | -static void wrd_graphic_reset_all(void) | |
388 | +static void wrd_graphic_reset_all ( void ) | |
391 | 389 | { |
392 | - int i; | |
393 | - | |
394 | - wrd_wnd_lock(); | |
395 | - w32g_wrd_wnd.default_gpal[0] = RGBtoRGBQUAD(RGB(0x00, 0x00, 0x00)); | |
396 | - w32g_wrd_wnd.default_gpal[1] = RGBtoRGBQUAD(RGB(0x00, 0x00, 0x7F)); | |
397 | - w32g_wrd_wnd.default_gpal[2] = RGBtoRGBQUAD(RGB(0x7F, 0x00, 0x00)); | |
398 | - w32g_wrd_wnd.default_gpal[3] = RGBtoRGBQUAD(RGB(0x7F, 0x00, 0x7F)); | |
399 | - w32g_wrd_wnd.default_gpal[4] = RGBtoRGBQUAD(RGB(0x00, 0x7F, 0x00)); | |
400 | - w32g_wrd_wnd.default_gpal[5] = RGBtoRGBQUAD(RGB(0x00, 0x7F, 0x7F)); | |
401 | - w32g_wrd_wnd.default_gpal[6] = RGBtoRGBQUAD(RGB(0x7F, 0x7F, 0x00)); | |
402 | - w32g_wrd_wnd.default_gpal[7] = RGBtoRGBQUAD(RGB(0x7F, 0x7F, 0x7F)); | |
403 | - w32g_wrd_wnd.default_gpal[8] = RGBtoRGBQUAD(RGB(0x00, 0x00, 0x00)); | |
404 | - w32g_wrd_wnd.default_gpal[9] = RGBtoRGBQUAD(RGB(0x00, 0x00, 0xFF)); | |
405 | - w32g_wrd_wnd.default_gpal[10] = RGBtoRGBQUAD(RGB(0xFF, 0x00, 0x00)); | |
406 | - w32g_wrd_wnd.default_gpal[11] = RGBtoRGBQUAD(RGB(0xFF, 0x00, 0xFF)); | |
407 | - w32g_wrd_wnd.default_gpal[12] = RGBtoRGBQUAD(RGB(0x00, 0xFF, 0x00)); | |
408 | - w32g_wrd_wnd.default_gpal[13] = RGBtoRGBQUAD(RGB(0x00, 0xFF, 0xFF)); | |
409 | - w32g_wrd_wnd.default_gpal[14] = RGBtoRGBQUAD(RGB(0xFF, 0xFF, 0x00)); | |
410 | - w32g_wrd_wnd.default_gpal[15] = RGBtoRGBQUAD(RGB(0xFF, 0xFF, 0xFF)); | |
411 | - for (i = 16; i < W32G_WRDWND_GRAPHIC_PALLETE_MAX; i++) | |
412 | - w32g_wrd_wnd.default_gpal[i] = RGBtoRGBQUAD(RGB(0x00, 0x00, 0x00)); | |
413 | - wrd_wnd_unlock(); | |
414 | - | |
415 | - for (i = 0; i < W32G_WRDWND_GRAPHIC_PLANE_MAX; i++) { | |
416 | - wrd_graphic_reset(i); | |
417 | - } | |
418 | - wrd_wnd_lock(); | |
419 | - w32g_wrd_wnd.gmode = 0xFFFF; | |
420 | - w32g_wrd_wnd.fade_from = -1; | |
421 | - w32g_wrd_wnd.fade_to = -1; | |
422 | - wrd_wnd_unlock(); | |
390 | + int i; | |
391 | + | |
392 | + wrd_wnd_lock(); | |
393 | + w32g_wrd_wnd.default_gpal[0] = RGBtoRGBQUAD (RGB ( 0x00, 0x00, 0x00 )); | |
394 | + w32g_wrd_wnd.default_gpal[1] = RGBtoRGBQUAD (RGB ( 0x00, 0x00, 0x7F ) ); | |
395 | + w32g_wrd_wnd.default_gpal[2] = RGBtoRGBQUAD (RGB ( 0x7F, 0x00, 0x00 )); | |
396 | + w32g_wrd_wnd.default_gpal[3] = RGBtoRGBQUAD (RGB ( 0x7F, 0x00, 0x7F )); | |
397 | + w32g_wrd_wnd.default_gpal[4] = RGBtoRGBQUAD (RGB ( 0x00, 0x7F, 0x00 )); | |
398 | + w32g_wrd_wnd.default_gpal[5] = RGBtoRGBQUAD (RGB ( 0x00, 0x7F, 0x7F )); | |
399 | + w32g_wrd_wnd.default_gpal[6] = RGBtoRGBQUAD (RGB ( 0x7F, 0x7F, 0x00 )); | |
400 | + w32g_wrd_wnd.default_gpal[7] = RGBtoRGBQUAD (RGB ( 0x7F, 0x7F, 0x7F )); | |
401 | + w32g_wrd_wnd.default_gpal[8] = RGBtoRGBQUAD (RGB ( 0x00, 0x00, 0x00 )); | |
402 | + w32g_wrd_wnd.default_gpal[9] = RGBtoRGBQUAD (RGB ( 0x00, 0x00, 0xFF )); | |
403 | + w32g_wrd_wnd.default_gpal[10] = RGBtoRGBQUAD (RGB ( 0xFF, 0x00, 0x00 )); | |
404 | + w32g_wrd_wnd.default_gpal[11] = RGBtoRGBQUAD (RGB ( 0xFF, 0x00, 0xFF )); | |
405 | + w32g_wrd_wnd.default_gpal[12] = RGBtoRGBQUAD (RGB ( 0x00, 0xFF, 0x00 )); | |
406 | + w32g_wrd_wnd.default_gpal[13] = RGBtoRGBQUAD (RGB ( 0x00, 0xFF, 0xFF )); | |
407 | + w32g_wrd_wnd.default_gpal[14] = RGBtoRGBQUAD (RGB ( 0xFF, 0xFF, 0x00 )); | |
408 | + w32g_wrd_wnd.default_gpal[15] = RGBtoRGBQUAD (RGB ( 0xFF, 0xFF, 0xFF )); | |
409 | + for ( i = 16; i < W32G_WRDWND_GRAPHIC_PALLETE_MAX; i++ ) | |
410 | + w32g_wrd_wnd.default_gpal[i] = RGBtoRGBQUAD (RGB ( 0x00, 0x00, 0x00 )); | |
411 | + wrd_wnd_unlock(); | |
412 | + | |
413 | + for ( i = 0; i < W32G_WRDWND_GRAPHIC_PLANE_MAX; i ++ ) { | |
414 | + wrd_graphic_reset ( i ); | |
415 | + } | |
416 | + wrd_wnd_lock(); | |
417 | + w32g_wrd_wnd.gmode = 0xFFFF; | |
418 | + w32g_wrd_wnd.fade_from = -1; | |
419 | + w32g_wrd_wnd.fade_to = -1; | |
420 | + wrd_wnd_unlock(); | |
423 | 421 | } |
424 | 422 | |
425 | 423 | // プレーン index のグラフィックの lprc 領域を hmdc_graphic へ更新 |
426 | -static void wrd_graphic_apply(RECT *lprc, int index, int lockflag) | |
424 | +static void wrd_graphic_apply ( RECT *lprc, int index, int lockflag ) | |
427 | 425 | { |
428 | 426 | #if 0 |
429 | - if (WrdWndInfo.GraphicStop) return; | |
430 | -// if (!w32g_wrd_wnd.modified_graphic[index]) return; | |
427 | + if ( WrdWndInfo.GraphicStop ) return; | |
428 | +// if ( !w32g_wrd_wnd.modified_graphic[index] ) return; | |
431 | 429 | |
432 | - if (lockflag) wrd_wnd_lock(); | |
433 | - w32g_wrd_wnd.modified_graphic[index] = FALSE; | |
434 | - if (lockflag) wrd_wnd_unlock(); | |
430 | + if ( lockflag ) wrd_wnd_lock(); | |
431 | + w32g_wrd_wnd.modified_graphic[index] = FALSE; | |
432 | + if ( lockflag ) wrd_wnd_unlock(); | |
435 | 433 | #endif |
436 | 434 | } |
437 | 435 | |
438 | 436 | // lprc 領域のグラフィックを更新 |
439 | -static void wrd_graphic_update(RECT *lprc, int lockflag) | |
437 | +static void wrd_graphic_update ( RECT *lprc, int lockflag ) | |
440 | 438 | { |
441 | - if (WrdWndInfo.GraphicStop) return; | |
442 | - if (w32g_wrd_wnd.draw_skip) return; | |
443 | - wrd_wnd_lock(); | |
444 | - if (lockflag) GDI_LOCK(); | |
445 | - // 画像処理した関数で行う。 | |
446 | - if (w32g_wrd_wnd.flag & WRD_FLAG_GRAPHIC) { | |
447 | - if (w32g_wrd_wnd.flag & WRD_FLAG_TEXT) { | |
448 | - HDC hmdc_work, hmdc_tmask, hmdc_graphic; | |
449 | - GdiFlush(); | |
450 | - hmdc_work = CreateCompatibleDC(w32g_wrd_wnd.hmdc); | |
451 | - hmdc_tmask = CreateCompatibleDC(w32g_wrd_wnd.hmdc); | |
452 | - hmdc_graphic = CreateCompatibleDC(w32g_wrd_wnd.hmdc); | |
453 | - SelectObject(hmdc_work, w32g_wrd_wnd.hbmp_work); | |
454 | - SelectObject(hmdc_tmask, w32g_wrd_wnd.hbmp_tmask); | |
455 | - SelectObject(hmdc_graphic, w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display]->hbmp); | |
456 | - BitBlt(w32g_wrd_wnd.hmdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
457 | - hmdc_tmask, lprc->left, lprc->top, SRCAND); | |
458 | - BitBlt(hmdc_work, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
459 | - hmdc_tmask, lprc->left, lprc->top, NOTSRCCOPY); | |
460 | - BitBlt(hmdc_work, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
461 | - hmdc_graphic, lprc->left, lprc->top, SRCAND); | |
462 | - BitBlt(w32g_wrd_wnd.hmdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
463 | - hmdc_work, lprc->left, lprc->top, SRCPAINT); | |
464 | - DeleteDC(hmdc_work); | |
465 | - DeleteDC(hmdc_tmask); | |
466 | - DeleteDC(hmdc_graphic); | |
467 | - } else { | |
468 | - HDC hmdc_graphic; | |
469 | - hmdc_graphic = CreateCompatibleDC(w32g_wrd_wnd.hmdc); | |
470 | - SelectObject(hmdc_graphic, w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display]->hbmp); | |
471 | - BitBlt(w32g_wrd_wnd.hmdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
472 | - hmdc_graphic, lprc->left, lprc->top, SRCCOPY); | |
473 | - DeleteDC(hmdc_graphic); | |
474 | - } | |
475 | - } | |
476 | - if (lockflag) GDI_UNLOCK(); | |
477 | - wrd_wnd_unlock(); | |
439 | + if ( WrdWndInfo.GraphicStop ) return; | |
440 | + if ( w32g_wrd_wnd.draw_skip ) return; | |
441 | + wrd_wnd_lock(); | |
442 | + if ( lockflag ) GDI_LOCK(); | |
443 | + // 画像処理した関数で行う。 | |
444 | + if ( w32g_wrd_wnd.flag & WRD_FLAG_GRAPHIC ) { | |
445 | + if ( w32g_wrd_wnd.flag & WRD_FLAG_TEXT ) { | |
446 | + HDC hmdc_work, hmdc_tmask, hmdc_graphic; | |
447 | + GdiFlush (); | |
448 | + hmdc_work = CreateCompatibleDC ( w32g_wrd_wnd.hmdc ); | |
449 | + hmdc_tmask = CreateCompatibleDC ( w32g_wrd_wnd.hmdc ); | |
450 | + hmdc_graphic = CreateCompatibleDC ( w32g_wrd_wnd.hmdc ); | |
451 | + SelectObject ( hmdc_work, w32g_wrd_wnd.hbmp_work ); | |
452 | + SelectObject ( hmdc_tmask, w32g_wrd_wnd.hbmp_tmask ); | |
453 | + SelectObject ( hmdc_graphic, w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display]->hbmp ); | |
454 | + BitBlt ( w32g_wrd_wnd.hmdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
455 | + hmdc_tmask, lprc->left, lprc->top, SRCAND ); | |
456 | + BitBlt ( hmdc_work, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
457 | + hmdc_tmask, lprc->left, lprc->top, NOTSRCCOPY ); | |
458 | + BitBlt ( hmdc_work, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
459 | + hmdc_graphic, lprc->left, lprc->top, SRCAND ); | |
460 | + BitBlt ( w32g_wrd_wnd.hmdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
461 | + hmdc_work, lprc->left, lprc->top, SRCPAINT ); | |
462 | + DeleteDC ( hmdc_work ); | |
463 | + DeleteDC ( hmdc_tmask ); | |
464 | + DeleteDC ( hmdc_graphic ); | |
465 | + } else { | |
466 | + HDC hmdc_graphic; | |
467 | + hmdc_graphic = CreateCompatibleDC ( w32g_wrd_wnd.hmdc ); | |
468 | + SelectObject ( hmdc_graphic, w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display]->hbmp ); | |
469 | + BitBlt ( w32g_wrd_wnd.hmdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
470 | + hmdc_graphic, lprc->left, lprc->top, SRCCOPY ); | |
471 | + DeleteDC ( hmdc_graphic ); | |
472 | + } | |
473 | + } | |
474 | + if ( lockflag ) GDI_UNLOCK(); | |
475 | + wrd_wnd_unlock(); | |
478 | 476 | } |
479 | 477 | |
480 | 478 | // 領域のテキストを更新 |
481 | -static void wrd_text_update(int x_from, int y_from, int x_to, int y_to, int lockflag) | |
479 | +static void wrd_text_update ( int x_from, int y_from, int x_to, int y_to, int lockflag ) | |
482 | 480 | { |
483 | - RECT rc; | |
484 | - | |
485 | - if (w32g_wrd_wnd.draw_skip) return; | |
486 | - | |
487 | - if (x_from < 0) x_from = 0; | |
488 | - if (x_from >= w32g_wrd_wnd.row) x_from = w32g_wrd_wnd.row - 1; | |
489 | - if (x_to < 0) x_to = 0; | |
490 | - if (x_to >= w32g_wrd_wnd.row) x_to = w32g_wrd_wnd.row - 1; | |
491 | - if (y_from < 0) y_from = 0; | |
492 | - if (y_from >= w32g_wrd_wnd.row) y_from = w32g_wrd_wnd.col - 1; | |
493 | - if (y_to < 0) y_to = 0; | |
494 | - if (y_to >= w32g_wrd_wnd.row) y_to = w32g_wrd_wnd.col - 1; | |
495 | - | |
496 | - SetRect(&rc, x_from * w32g_wrd_wnd.font_width, y_from * w32g_wrd_wnd.font_height, | |
497 | - (x_to + 1) * w32g_wrd_wnd.font_width, (y_to + 1) * w32g_wrd_wnd.font_height); | |
498 | - | |
499 | - wrd_wnd_lock(); | |
500 | - if (lockflag) GDI_LOCK(); | |
501 | - if (w32g_wrd_wnd.flag & WRD_FLAG_TEXT) { | |
502 | - HDC hmdc_tmask; | |
503 | - COLORREF forecolor, backcolor, prevforecolor, prevbackcolor; | |
504 | - char attr; | |
505 | - HGDIOBJ hgdiobj; | |
506 | - int x, y; | |
507 | - forecolor = w32g_wrd_wnd.pals[w32g_wrd_wnd.curforecolor]; | |
508 | - backcolor = w32g_wrd_wnd.pals[w32g_wrd_wnd.curbackcolor]; | |
509 | - prevforecolor = SetTextColor(w32g_wrd_wnd.hmdc, forecolor); | |
510 | - prevbackcolor = SetBkColor(w32g_wrd_wnd.hmdc, backcolor); | |
511 | - hgdiobj = SelectObject(w32g_wrd_wnd.hmdc, w32g_wrd_wnd.hFont); | |
512 | - hmdc_tmask = CreateCompatibleDC(w32g_wrd_wnd.hmdc); | |
513 | - SelectObject(hmdc_tmask, w32g_wrd_wnd.hbmp_tmask); | |
514 | - SelectObject(hmdc_tmask, w32g_wrd_wnd.hFont); | |
515 | - SelectObject(hmdc_tmask, w32g_wrd_wnd.hNullBrush); | |
516 | - SelectObject(hmdc_tmask, w32g_wrd_wnd.hNullPen); | |
517 | - attr = 0; | |
518 | - SetTextColor(hmdc_tmask, COLOR_MASK_WHITE); | |
519 | - SetBkColor(hmdc_tmask, COLOR_MASK_BLACK); | |
520 | - for (y = y_from; y <= y_to; y++) { | |
521 | - for (x = x_from; x <= x_to; x++) { | |
522 | - char mbt = _MBC_SINGLE; | |
523 | - RECT rc_part; | |
524 | - if (forecolor != w32g_wrd_wnd.pals[w32g_wrd_wnd.forecolorbuf[y][x]]) { | |
525 | - forecolor = w32g_wrd_wnd.pals[w32g_wrd_wnd.forecolorbuf[y][x]]; | |
526 | - SetTextColor(w32g_wrd_wnd.hmdc, forecolor); | |
527 | - } | |
528 | - if (backcolor != w32g_wrd_wnd.pals[w32g_wrd_wnd.backcolorbuf[y][x]]) { | |
529 | - backcolor = w32g_wrd_wnd.pals[w32g_wrd_wnd.backcolorbuf[y][x]]; | |
530 | - SetBkColor(w32g_wrd_wnd.hmdc, backcolor); | |
531 | - } | |
532 | - if (attr != w32g_wrd_wnd.attrbuf[y][x]) { | |
533 | - if ((attr & W32G_WRDWND_ATTR_REVERSE) != (w32g_wrd_wnd.attrbuf[y][x] & W32G_WRDWND_ATTR_REVERSE)) { | |
534 | - if (w32g_wrd_wnd.attrbuf[y][x] & W32G_WRDWND_ATTR_REVERSE) { | |
535 | - SetTextColor(hmdc_tmask, COLOR_MASK_BLACK); | |
536 | - SetBkColor(hmdc_tmask, COLOR_MASK_WHITE); | |
537 | - } else { | |
538 | - SetTextColor(hmdc_tmask, COLOR_MASK_WHITE); | |
539 | - SetBkColor(hmdc_tmask, COLOR_MASK_BLACK); | |
540 | - } | |
541 | - } | |
542 | - attr = w32g_wrd_wnd.attrbuf[y][x]; | |
543 | - } | |
544 | - if (PlayerLanguage == LANGUAGE_JAPANESE && _mbbtype(w32g_wrd_wnd.textbuf[y][x], _MBC_SINGLE) == _MBC_LEAD) { | |
545 | - SetRect(&rc_part, x * w32g_wrd_wnd.font_width, y * w32g_wrd_wnd.font_height, | |
546 | - (x + 2) * w32g_wrd_wnd.font_width, (y + 1) * w32g_wrd_wnd.font_height); | |
547 | - if (w32g_wrd_wnd.flag & WRD_FLAG_TEXT) | |
548 | - ExtTextOut(w32g_wrd_wnd.hmdc, rc_part.left, rc_part.top, ETO_OPAQUE | ETO_CLIPPED, &rc_part, w32g_wrd_wnd.textbuf[y] + x, 2, NULL); | |
549 | - ExtTextOut(hmdc_tmask, rc_part.left, rc_part.top, ETO_OPAQUE | ETO_CLIPPED, &rc_part, w32g_wrd_wnd.textbuf[y] + x, 2, NULL); | |
550 | - x++; | |
551 | - } else { | |
552 | - SetRect(&rc_part, x * w32g_wrd_wnd.font_width, y * w32g_wrd_wnd.font_height, | |
553 | - (x + 1) * w32g_wrd_wnd.font_width, (y + 1) * w32g_wrd_wnd.font_height); | |
554 | - if (w32g_wrd_wnd.flag & WRD_FLAG_TEXT) | |
555 | - ExtTextOut(w32g_wrd_wnd.hmdc, rc_part.left, rc_part.top, ETO_OPAQUE | ETO_CLIPPED, &rc_part, w32g_wrd_wnd.textbuf[y] + x, 1, NULL); | |
556 | - ExtTextOut(hmdc_tmask, rc_part.left, rc_part.top, ETO_OPAQUE | ETO_CLIPPED, &rc_part, w32g_wrd_wnd.textbuf[y] + x, 1, NULL); | |
557 | - } | |
558 | - } | |
559 | - } | |
560 | - SetTextColor(w32g_wrd_wnd.hmdc, prevforecolor); | |
561 | - SetBkColor(w32g_wrd_wnd.hmdc, prevbackcolor); | |
562 | - SelectObject(w32g_wrd_wnd.hmdc, hgdiobj); | |
563 | - DeleteDC(hmdc_tmask); | |
564 | - } | |
565 | - if (lockflag) GDI_UNLOCK(); | |
566 | - wrd_wnd_unlock(); | |
567 | - if (!WrdWndInfo.GraphicStop) { | |
568 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
569 | - wrd_graphic_update(&rc, 0); | |
570 | - } | |
571 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
572 | -} | |
573 | - | |
574 | -extern void wrd_graphic_ginit(void); | |
575 | -extern void wrd_graphic_gcls(int sw); | |
576 | -extern void wrd_graphic_gscreen(int active, int display); | |
577 | -extern void wrd_graphic_gon(int sw); | |
578 | -extern void wrd_graphic_gline(int x1, int y1, int x2, int y2, int p1, int sw, int p2); | |
579 | -extern void wrd_graphic_gcircle(int x, int y, int r, int p1, int sw, int p2); | |
580 | -extern void wrd_graphic_pload(const char *path); | |
581 | -extern void wrd_graphic_pal_g4r4b4(int p, int *g4r4b4, int max); | |
582 | -extern void wrd_graphic_palrev(int p); | |
583 | -extern void wrd_graphic_apply_pal(int p); | |
584 | -extern void wrd_graphic_fade(int p1, int p2, int speed); | |
585 | -extern void wrd_graphic_fadestep(int v); | |
586 | -extern void wrd_graphic_gmode(int sw); | |
587 | -extern void wrd_graphic_gmove(int x1, int y1, int x2, int y2, int xd, int yd, int vs, int vd, int sw); | |
588 | -extern void wrd_graphic_mag(const char *path, int x, int y, int s, int p); | |
589 | -extern void wrd_text_scroll(int x1, int y1, int x2, int y2, int mode, int color, int c); | |
590 | -extern void wrd_start_skip(void); | |
591 | -extern void wrd_end_skip(void); | |
592 | -extern void wrd_graphic_xcopy(int sx1, int sy1, int sx2, int sy2, int tx, int ty, int ss, int ts, int method, | |
593 | - int opt1, int opt2, int opt3, int opt4, int opt5); | |
594 | - | |
595 | -void wrd_graphic_ginit(void) | |
481 | + RECT rc; | |
482 | + | |
483 | + if ( w32g_wrd_wnd.draw_skip ) return; | |
484 | + | |
485 | + if ( x_from < 0 ) x_from = 0; | |
486 | + if ( x_from >= w32g_wrd_wnd.row ) x_from = w32g_wrd_wnd.row - 1; | |
487 | + if ( x_to < 0 ) x_to = 0; | |
488 | + if ( x_to >= w32g_wrd_wnd.row ) x_to = w32g_wrd_wnd.row - 1; | |
489 | + if ( y_from < 0 ) y_from = 0; | |
490 | + if ( y_from >= w32g_wrd_wnd.row ) y_from = w32g_wrd_wnd.col - 1; | |
491 | + if ( y_to < 0 ) y_to = 0; | |
492 | + if ( y_to >= w32g_wrd_wnd.row ) y_to = w32g_wrd_wnd.col - 1; | |
493 | + | |
494 | + SetRect ( &rc, x_from * w32g_wrd_wnd.font_width, y_from * w32g_wrd_wnd.font_height, | |
495 | + (x_to+1) * w32g_wrd_wnd.font_width, (y_to+1) * w32g_wrd_wnd.font_height); | |
496 | + | |
497 | + wrd_wnd_lock(); | |
498 | + if ( lockflag ) GDI_LOCK(); | |
499 | + if ( w32g_wrd_wnd.flag & WRD_FLAG_TEXT ) { | |
500 | + HDC hmdc_tmask; | |
501 | + COLORREF forecolor, backcolor, prevforecolor, prevbackcolor; | |
502 | + char attr; | |
503 | + HGDIOBJ hgdiobj; | |
504 | + int x, y; | |
505 | + forecolor = w32g_wrd_wnd.pals[w32g_wrd_wnd.curforecolor]; | |
506 | + backcolor = w32g_wrd_wnd.pals[w32g_wrd_wnd.curbackcolor]; | |
507 | + prevforecolor = SetTextColor( w32g_wrd_wnd.hmdc, forecolor ); | |
508 | + prevbackcolor = SetBkColor( w32g_wrd_wnd.hmdc, backcolor ); | |
509 | + hgdiobj = SelectObject( w32g_wrd_wnd.hmdc, w32g_wrd_wnd.hFont ); | |
510 | + hmdc_tmask = CreateCompatibleDC ( w32g_wrd_wnd.hmdc ); | |
511 | + SelectObject( hmdc_tmask, w32g_wrd_wnd.hbmp_tmask ); | |
512 | + SelectObject( hmdc_tmask, w32g_wrd_wnd.hFont ); | |
513 | + SelectObject( hmdc_tmask, w32g_wrd_wnd.hNullBrush ); | |
514 | + SelectObject( hmdc_tmask, w32g_wrd_wnd.hNullPen ); | |
515 | + attr = 0; | |
516 | + SetTextColor( hmdc_tmask, COLOR_MASK_WHITE ); | |
517 | + SetBkColor( hmdc_tmask, COLOR_MASK_BLACK ); | |
518 | + for( y = y_from; y <= y_to; y++ ) { | |
519 | + for( x = x_from; x <= x_to; x++ ) { | |
520 | + RECT rc_part; | |
521 | + if ( forecolor != w32g_wrd_wnd.pals[w32g_wrd_wnd.forecolorbuf[y][x]] ) { | |
522 | + forecolor = w32g_wrd_wnd.pals[w32g_wrd_wnd.forecolorbuf[y][x]]; | |
523 | + SetTextColor( w32g_wrd_wnd.hmdc, forecolor ); | |
524 | + } | |
525 | + if ( backcolor != w32g_wrd_wnd.pals[w32g_wrd_wnd.backcolorbuf[y][x]] ) { | |
526 | + backcolor = w32g_wrd_wnd.pals[w32g_wrd_wnd.backcolorbuf[y][x]]; | |
527 | + SetBkColor( w32g_wrd_wnd.hmdc, backcolor ); | |
528 | + } | |
529 | + if ( attr != w32g_wrd_wnd.attrbuf[y][x] ) { | |
530 | + if ( ( attr & W32G_WRDWND_ATTR_REVERSE ) != ( w32g_wrd_wnd.attrbuf[y][x] & W32G_WRDWND_ATTR_REVERSE ) ) { | |
531 | + if ( w32g_wrd_wnd.attrbuf[y][x] & W32G_WRDWND_ATTR_REVERSE ) { | |
532 | + SetTextColor( hmdc_tmask, COLOR_MASK_BLACK ); | |
533 | + SetBkColor( hmdc_tmask, COLOR_MASK_WHITE ); | |
534 | + } else { | |
535 | + SetTextColor( hmdc_tmask, COLOR_MASK_WHITE ); | |
536 | + SetBkColor( hmdc_tmask, COLOR_MASK_BLACK ); | |
537 | + } | |
538 | + } | |
539 | + attr = w32g_wrd_wnd.attrbuf[y][x]; | |
540 | + } | |
541 | + if ( PlayerLanguage == LANGUAGE_JAPANESE && _mbbtype( w32g_wrd_wnd.textbuf[y][x], _MBC_SINGLE ) == _MBC_LEAD ) { | |
542 | + SetRect ( &rc_part, x * w32g_wrd_wnd.font_width, y * w32g_wrd_wnd.font_height, | |
543 | + (x + 2) * w32g_wrd_wnd.font_width, (y + 1) * w32g_wrd_wnd.font_height ); | |
544 | + if ( w32g_wrd_wnd.flag & WRD_FLAG_TEXT ) | |
545 | + ExtTextOut( w32g_wrd_wnd.hmdc, rc_part.left, rc_part.top, ETO_OPAQUE | ETO_CLIPPED, &rc_part, w32g_wrd_wnd.textbuf[y] + x, 2, NULL); | |
546 | + ExtTextOut( hmdc_tmask, rc_part.left, rc_part.top, ETO_OPAQUE | ETO_CLIPPED, &rc_part, w32g_wrd_wnd.textbuf[y] + x, 2, NULL); | |
547 | + x++; | |
548 | + } else { | |
549 | + SetRect ( &rc_part, x * w32g_wrd_wnd.font_width, y * w32g_wrd_wnd.font_height, | |
550 | + (x + 1) * w32g_wrd_wnd.font_width, (y + 1) * w32g_wrd_wnd.font_height ); | |
551 | + if ( w32g_wrd_wnd.flag & WRD_FLAG_TEXT ) | |
552 | + ExtTextOut( w32g_wrd_wnd.hmdc, rc_part.left, rc_part.top, ETO_OPAQUE | ETO_CLIPPED, &rc_part, w32g_wrd_wnd.textbuf[y] + x, 1, NULL); | |
553 | + ExtTextOut( hmdc_tmask, rc_part.left, rc_part.top, ETO_OPAQUE | ETO_CLIPPED, &rc_part, w32g_wrd_wnd.textbuf[y] + x, 1, NULL); | |
554 | + } | |
555 | + } | |
556 | + } | |
557 | + SetTextColor( w32g_wrd_wnd.hmdc, prevforecolor); | |
558 | + SetBkColor( w32g_wrd_wnd.hmdc, prevbackcolor); | |
559 | + SelectObject( w32g_wrd_wnd.hmdc, hgdiobj ); | |
560 | + DeleteDC ( hmdc_tmask ); | |
561 | + } | |
562 | + if ( lockflag ) GDI_UNLOCK(); | |
563 | + wrd_wnd_unlock(); | |
564 | + if ( ! WrdWndInfo.GraphicStop ) { | |
565 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
566 | + wrd_graphic_update ( &rc, 0 ); | |
567 | + } | |
568 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE); | |
569 | +} | |
570 | + | |
571 | +extern void wrd_graphic_ginit ( void ); | |
572 | +extern void wrd_graphic_gcls ( int sw ); | |
573 | +extern void wrd_graphic_gscreen ( int active, int display ); | |
574 | +extern void wrd_graphic_gon ( int sw ); | |
575 | +extern void wrd_graphic_gline ( int x1, int y1, int x2, int y2, int p1, int sw, int p2 ); | |
576 | +extern void wrd_graphic_gcircle ( int x, int y, int r, int p1, int sw, int p2 ); | |
577 | +extern void wrd_graphic_pload ( char *path ); | |
578 | +extern void wrd_graphic_pal_g4r4b4 ( int p, int *g4r4b4, int max ); | |
579 | +extern void wrd_graphic_palrev ( int p ); | |
580 | +extern void wrd_graphic_apply_pal ( int p ); | |
581 | +extern void wrd_graphic_fade ( int p1, int p2, int speed ); | |
582 | +extern void wrd_graphic_fadestep ( int v ); | |
583 | +extern void wrd_graphic_gmode ( int sw ); | |
584 | +extern void wrd_graphic_gmove ( int x1, int y1, int x2, int y2, int xd, int yd, int vs, int vd, int sw ); | |
585 | +extern void wrd_graphic_mag ( char *path, int x, int y, int s, int p ); | |
586 | +extern void wrd_text_scroll ( int x1, int y1, int x2, int y2, int mode, int color, int c ); | |
587 | +extern void wrd_start_skip ( void ); | |
588 | +extern void wrd_end_skip ( void ); | |
589 | +extern void wrd_graphic_xcopy ( int sx1, int sy1, int sx2, int sy2, int tx, int ty, int ss, int ts, int method, | |
590 | + int opt1, int opt2, int opt3, int opt4, int opt5 ); | |
591 | + | |
592 | +void wrd_graphic_ginit ( void ) | |
596 | 593 | { |
597 | - RECT rc; | |
598 | - int index_display_old = w32g_wrd_wnd.index_display; | |
599 | - if (WrdWndInfo.GraphicStop) return; | |
600 | - if (!w32g_wrd_wnd.active) return; | |
601 | - wrd_graphic_plane_change(0, 0); | |
602 | - wrd_graphic_reset_all(); | |
603 | - wrd_wnd_lock(); | |
604 | - mag_deletetab(); | |
605 | - wrd_wnd_unlock(); | |
606 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
607 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
608 | -} | |
609 | - | |
610 | -void wrd_graphic_gcls(int sw) | |
594 | + RECT rc; | |
595 | + | |
596 | + if ( WrdWndInfo.GraphicStop ) return; | |
597 | + if ( !w32g_wrd_wnd.active ) return; | |
598 | + wrd_graphic_plane_change ( 0, 0 ); | |
599 | + wrd_graphic_reset_all (); | |
600 | + wrd_wnd_lock(); | |
601 | + mag_deletetab(); | |
602 | + wrd_wnd_unlock(); | |
603 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
604 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
605 | +} | |
606 | + | |
607 | +void wrd_graphic_gcls ( int sw ) | |
611 | 608 | { |
612 | - RECT rc; | |
613 | - int i, size; | |
614 | - | |
615 | - if (WrdWndInfo.GraphicStop) return; | |
616 | - if (!w32g_wrd_wnd.active) return; | |
617 | - wrd_wnd_lock(); | |
618 | - GdiFlush(); | |
619 | - size = w32g_wrd_wnd.width * w32g_wrd_wnd.height; | |
620 | - if (sw == 0) | |
621 | - sw = 0xFF; | |
622 | - for (i = 0; i < size; i++) { | |
623 | - w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits[i] &= ~sw; | |
624 | - } | |
625 | - w32g_wrd_wnd.modified_graphic[w32g_wrd_wnd.index_active] = TRUE; | |
626 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
627 | - wrd_wnd_unlock(); | |
628 | - if (w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display) { | |
629 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
630 | - wrd_graphic_update(&rc, TRUE); | |
631 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
632 | - } | |
633 | -} | |
634 | - | |
635 | -void wrd_graphic_gscreen(int active, int display) | |
609 | + RECT rc; | |
610 | + int i, size; | |
611 | + | |
612 | + if ( WrdWndInfo.GraphicStop ) return; | |
613 | + if ( !w32g_wrd_wnd.active ) return; | |
614 | + wrd_wnd_lock(); | |
615 | + GdiFlush (); | |
616 | + size = w32g_wrd_wnd.width * w32g_wrd_wnd.height; | |
617 | + if ( sw == 0 ) | |
618 | + sw = 0xFF; | |
619 | + for ( i = 0; i < size; i ++ ) { | |
620 | + w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits[i] &= ~sw; | |
621 | + } | |
622 | + w32g_wrd_wnd.modified_graphic[w32g_wrd_wnd.index_active] = TRUE; | |
623 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
624 | + wrd_wnd_unlock(); | |
625 | + if ( w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display ) { | |
626 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
627 | + wrd_graphic_update ( &rc, TRUE ); | |
628 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
629 | + } | |
630 | +} | |
631 | + | |
632 | +void wrd_graphic_gscreen ( int active, int display ) | |
636 | 633 | { |
637 | - int display_old = w32g_wrd_wnd.index_display; | |
638 | - | |
639 | - if (WrdWndInfo.GraphicStop) return; | |
640 | - if (!w32g_wrd_wnd.active) return; | |
641 | - if (active < 0 || active >= 2 || display < 0 || display >= 2) | |
642 | - return; | |
643 | - wrd_wnd_lock(); | |
644 | - wrd_graphic_plane_change(active, display); | |
645 | - wrd_wnd_unlock(); | |
646 | - if (display_old != w32g_wrd_wnd.index_display) { | |
647 | - RECT rc; | |
648 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
649 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
650 | - wrd_graphic_update(&rc, TRUE); | |
651 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
652 | - } | |
653 | -} | |
654 | - | |
655 | -void wrd_graphic_gon(int sw) | |
634 | + int display_old = w32g_wrd_wnd.index_display; | |
635 | + | |
636 | + if ( WrdWndInfo.GraphicStop ) return; | |
637 | + if ( !w32g_wrd_wnd.active ) return; | |
638 | + if ( active < 0 || active >= 2 || display < 0 || display >= 2 ) | |
639 | + return; | |
640 | + wrd_wnd_lock(); | |
641 | + wrd_graphic_plane_change ( active, display ); | |
642 | + wrd_wnd_unlock(); | |
643 | + if ( display_old != w32g_wrd_wnd.index_display ) { | |
644 | + RECT rc; | |
645 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
646 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
647 | + wrd_graphic_update ( &rc, TRUE ); | |
648 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
649 | + } | |
650 | +} | |
651 | + | |
652 | +void wrd_graphic_gon ( int sw ) | |
656 | 653 | { |
657 | - int sw_old = w32g_wrd_wnd.flag & WRD_FLAG_GRAPHIC; | |
658 | - | |
659 | - if (WrdWndInfo.GraphicStop) return; | |
660 | - if (!w32g_wrd_wnd.active) return; | |
661 | - if (sw && !sw_old) { | |
662 | - w32g_wrd_wnd.flag |= WRD_FLAG_GRAPHIC; // 先に設定 | |
663 | - if (w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display) { | |
664 | - RECT rc; | |
665 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
666 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
667 | - wrd_graphic_update(&rc, TRUE); | |
668 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
669 | - } | |
670 | - } else if (!sw && sw_old) { | |
671 | - if (w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display) { | |
672 | - RECT rc; | |
673 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
674 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
675 | - wrd_graphic_update(&rc, TRUE); | |
676 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
677 | - } | |
678 | - } | |
679 | - if (sw) | |
680 | - w32g_wrd_wnd.flag |= WRD_FLAG_GRAPHIC; | |
681 | - else | |
682 | - w32g_wrd_wnd.flag &= ~WRD_FLAG_GRAPHIC; | |
683 | -} | |
684 | - | |
685 | -void wrd_graphic_gline(int x1, int y1, int x2, int y2, int p1, int sw, int p2) | |
654 | + int sw_old = w32g_wrd_wnd.flag & WRD_FLAG_GRAPHIC; | |
655 | + | |
656 | + if ( WrdWndInfo.GraphicStop ) return; | |
657 | + if ( !w32g_wrd_wnd.active ) return; | |
658 | + if ( sw && !sw_old ) { | |
659 | + w32g_wrd_wnd.flag |= WRD_FLAG_GRAPHIC; // 先に設定 | |
660 | + if ( w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display ) { | |
661 | + RECT rc; | |
662 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
663 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
664 | + wrd_graphic_update ( &rc, TRUE ); | |
665 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
666 | + } | |
667 | + } else if ( !sw && sw_old ) { | |
668 | + if ( w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display ) { | |
669 | + RECT rc; | |
670 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
671 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
672 | + wrd_graphic_update ( &rc, TRUE ); | |
673 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
674 | + } | |
675 | + } | |
676 | + if ( sw ) | |
677 | + w32g_wrd_wnd.flag |= WRD_FLAG_GRAPHIC; | |
678 | + else | |
679 | + w32g_wrd_wnd.flag &= ~WRD_FLAG_GRAPHIC; | |
680 | +} | |
681 | + | |
682 | +void wrd_graphic_gline ( int x1, int y1, int x2, int y2, int p1, int sw, int p2 ) | |
686 | 683 | { |
687 | - int x, y, i; | |
688 | - RECT rc[10]; | |
689 | - int rc_max = 0; | |
690 | - char *bits = w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits; | |
691 | - | |
692 | - if (WrdWndInfo.GraphicStop) return; | |
693 | - if (!w32g_wrd_wnd.active) return; | |
694 | - if (x1 > x2 || y1 > y2 || x1 < 0 || y1 < 0 || x2 >= w32g_wrd_wnd.width || y2 >= w32g_wrd_wnd.height) | |
695 | - return; | |
696 | - wrd_wnd_lock(); | |
697 | - GdiFlush(); | |
698 | - // w32g_wrd_wnd.gmode | |
699 | - if (sw >= 1) { | |
700 | - for (x = x1; x <= x2; x++) | |
701 | - bits[y1 * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p1; | |
702 | - SetRect(&rc[rc_max++], x1, y1, x2 + 1, y1 + 1); | |
703 | - for (y = y1 + 1; y <= y2 - 1; y++) { | |
704 | - bits[y * w32g_wrd_wnd.width + x1] = w32g_wrd_wnd.gmode & p1; | |
705 | - bits[y * w32g_wrd_wnd.width + x2] = w32g_wrd_wnd.gmode & p1; | |
706 | - } | |
707 | - SetRect(&rc[rc_max++], x1, y1, x1 + 1, y2 + 1); | |
708 | - SetRect(&rc[rc_max++], x2, y1, x2 + 1, y2 + 1); | |
709 | - for (x = x1; x <= x2; x++) | |
710 | - bits[y2 * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p1; | |
711 | - SetRect(&rc[rc_max++], x1, y2, x2 + 1, y2 + 1); | |
712 | - if (sw == 2) { | |
713 | - for (y = y1 + 1; y <= y2 - 1; y++) | |
714 | - for (x = x1 + 1; x <= x2 - 1; x++) | |
715 | - bits[y * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p2; | |
716 | - rc_max = 0; | |
717 | - SetRect(&rc[rc_max++], x1, y1, x2 + 1, y2 + 1); | |
718 | - } | |
719 | - } else if (sw == 0) { | |
720 | - if (x1 == x2) { | |
721 | - for (y = y1; y <= y2; y++) | |
722 | - bits[y * w32g_wrd_wnd.width + x1] = w32g_wrd_wnd.gmode & p1; | |
723 | - SetRect(&rc[rc_max++], x1, y1, x1 + 1, y2 + 1); | |
724 | - } else if (y1 == y2) { | |
725 | - for (x = x1; x <= x2; x++) | |
726 | - bits[y1 * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p2; | |
727 | - SetRect(&rc[rc_max++], x1, y1, x2 + 1, y1 + 1); | |
728 | - } else if (x2 - x1 == y2 - y1) { | |
729 | - for (y = y1; y <= y2; y++) | |
730 | - bits[y1 * w32g_wrd_wnd.width + (y - y1) + x1] = w32g_wrd_wnd.gmode & p2; | |
731 | - SetRect(&rc[rc_max++], x1, y1, x2 + 1, y2 + 1); | |
732 | - } else if (x2 - x1 > y2 - y1) { | |
733 | - double r = (y2 - y1) / (x2 - x1), r2; | |
734 | - int x_min = x1; | |
735 | - for (y = y1; y <= y2 - 1; y++) { | |
736 | - for (x = x_min; x <= x2; x++) { | |
737 | - r2 = r * (x - x1) - (y - y1); | |
738 | - if (r2 < 0.0 || r2 >= 1.0) { | |
739 | - break; | |
740 | - } else if (r2 <= 0.5) { | |
741 | - bits[y * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p1; | |
742 | - x_min = x + 1; | |
743 | - } else { | |
744 | - bits[(y + 1) * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p1; | |
745 | - x_min = x + 1; | |
746 | - } | |
747 | - } | |
748 | - } | |
749 | - SetRect(&rc[rc_max++], x1, y1, x2 + 1, y2 + 1); | |
750 | - } else if (x2 - x1 < y2 - y1) { | |
751 | - double r = (x2 - x1) / (y2 - y1), r2; | |
752 | - int y_min = y1; | |
753 | - for (x = x1; x <= x2 - 1; x++) { | |
754 | - for (y = y_min; y <= y2; y++) { | |
755 | - r2 = r * (y - y1) - (x - x1); | |
756 | - if (r2 < 0.0 || r2 >= 1.0) { | |
757 | - break; | |
758 | - } else if (r2 <= 0.5) { | |
759 | - bits[y * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p1; | |
760 | - y_min = y + 1; | |
761 | - } else { | |
762 | - bits[y * w32g_wrd_wnd.width + x + 1] = w32g_wrd_wnd.gmode & p1; | |
763 | - y_min = y + 1; | |
764 | - } | |
765 | - } | |
766 | - } | |
767 | - SetRect(&rc[rc_max++], x1, y1, x2 + 1, y2 + 1); | |
768 | - } | |
769 | - } | |
770 | - wrd_wnd_unlock(); | |
771 | - if (w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display) { | |
772 | - for (i = 0; i < rc_max; i++) { | |
773 | - wrd_graphic_apply(&rc[i], w32g_wrd_wnd.index_display, TRUE); | |
774 | - wrd_graphic_update(&rc[i], TRUE); | |
775 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc[i], FALSE); | |
776 | - } | |
777 | - } | |
778 | -} | |
779 | - | |
780 | -void wrd_graphic_gcircle(int x, int y, int r, int p1, int sw, int p2) | |
684 | + int x, y, i; | |
685 | + RECT rc[10]; | |
686 | + int rc_max = 0; | |
687 | + char *bits = w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits; | |
688 | + | |
689 | + if ( WrdWndInfo.GraphicStop ) return; | |
690 | + if ( !w32g_wrd_wnd.active ) return; | |
691 | + if ( x1 > x2 || y1 > y2 || x1 < 0 || y1 < 0 || x2 >= w32g_wrd_wnd.width || y2 >= w32g_wrd_wnd.height ) | |
692 | + return; | |
693 | + wrd_wnd_lock(); | |
694 | + GdiFlush (); | |
695 | + // w32g_wrd_wnd.gmode | |
696 | + if ( sw >= 1 ) { | |
697 | + for ( x = x1; x <= x2; x ++ ) | |
698 | + bits[ y1 * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p1; | |
699 | + SetRect ( &rc[rc_max++], x1, y1, x2+1, y1+1 ); | |
700 | + for ( y = y1 + 1; y <= y2 - 1; y ++ ) { | |
701 | + bits[ y * w32g_wrd_wnd.width + x1] = w32g_wrd_wnd.gmode & p1; | |
702 | + bits[ y * w32g_wrd_wnd.width + x2] = w32g_wrd_wnd.gmode & p1; | |
703 | + } | |
704 | + SetRect ( &rc[rc_max++], x1, y1, x1+1, y2+1 ); | |
705 | + SetRect ( &rc[rc_max++], x2, y1, x2+1, y2+1 ); | |
706 | + for ( x = x1; x <= x2; x ++ ) | |
707 | + bits[ y2 * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p1; | |
708 | + SetRect ( &rc[rc_max++], x1, y2, x2+1, y2+1 ); | |
709 | + if ( sw == 2 ) { | |
710 | + for ( y = y1 + 1; y <= y2 - 1; y ++ ) | |
711 | + for ( x = x1 + 1; x <= x2 - 1; x ++ ) | |
712 | + bits[ y * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p2; | |
713 | + rc_max = 0; | |
714 | + SetRect ( &rc[rc_max++], x1, y1, x2+1, y2+1 ); | |
715 | + } | |
716 | + } else if ( sw == 0 ) { | |
717 | + if ( x1 == x2 ) { | |
718 | + for ( y = y1 ; y <= y2 ; y ++ ) | |
719 | + bits[ y * w32g_wrd_wnd.width + x1] = w32g_wrd_wnd.gmode & p1; | |
720 | + SetRect ( &rc[rc_max++], x1, y1, x1+1, y2+1 ); | |
721 | + } else if ( y1 == y2 ) { | |
722 | + for ( x = x1; x <= x2; x ++ ) | |
723 | + bits[ y1 * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p2; | |
724 | + SetRect ( &rc[rc_max++], x1, y1, x2+1, y1+1 ); | |
725 | + } else if ( x2 - x1 == y2 - y1 ) { | |
726 | + for ( y = y1; y <= y2; y ++ ) | |
727 | + bits[ y1 * w32g_wrd_wnd.width + (y - y1) + x1] = w32g_wrd_wnd.gmode & p2; | |
728 | + SetRect ( &rc[rc_max++], x1, y1, x2+1, y2+1 ); | |
729 | + } else if ( x2 - x1 > y2 - y1 ) { | |
730 | + double r = (y2 - y1) / (x2 -x1), r2; | |
731 | + int x_min = x1; | |
732 | + for ( y = y1; y <= y2 - 1; y ++ ) { | |
733 | + for ( x = x_min; x <= x2; x ++ ) { | |
734 | + r2 = r * (x - x1) - (y - y1); | |
735 | + if ( r2 < 0.0 || r2 >= 1.0 ) { | |
736 | + break; | |
737 | + } else if ( r2 <= 0.5 ) { | |
738 | + bits[ y * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p1; | |
739 | + x_min = x + 1; | |
740 | + } else { | |
741 | + bits[ (y + 1) * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p1; | |
742 | + x_min = x + 1; | |
743 | + } | |
744 | + } | |
745 | + } | |
746 | + SetRect ( &rc[rc_max++], x1, y1, x2+1, y2+1 ); | |
747 | + } else if ( x2 - x1 < y2 - y1 ) { | |
748 | + double r = (x2 - x1) / (y2 -y1), r2; | |
749 | + int y_min = y1; | |
750 | + for ( x = x1; x <= x2 - 1; x ++ ) { | |
751 | + for ( y = y_min; y <= y2; y ++ ) { | |
752 | + r2 = r * (y - y1) - (x - x1); | |
753 | + if ( r2 < 0.0 || r2 >= 1.0 ) { | |
754 | + break; | |
755 | + } else if ( r2 <= 0.5 ) { | |
756 | + bits[ y * w32g_wrd_wnd.width + x] = w32g_wrd_wnd.gmode & p1; | |
757 | + y_min = y + 1; | |
758 | + } else { | |
759 | + bits[ y * w32g_wrd_wnd.width + x + 1] = w32g_wrd_wnd.gmode & p1; | |
760 | + y_min = y + 1; | |
761 | + } | |
762 | + } | |
763 | + } | |
764 | + SetRect ( &rc[rc_max++], x1, y1, x2+1, y2+1 ); | |
765 | + } | |
766 | + } | |
767 | + wrd_wnd_unlock(); | |
768 | + if ( w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display ) { | |
769 | + for ( i = 0; i < rc_max; i ++ ) { | |
770 | + wrd_graphic_apply ( &rc[i], w32g_wrd_wnd.index_display, TRUE ); | |
771 | + wrd_graphic_update ( &rc[i], TRUE ); | |
772 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc[i], FALSE ); | |
773 | + } | |
774 | + } | |
775 | +} | |
776 | + | |
777 | +void wrd_graphic_gcircle ( int x, int y, int r, int p1, int sw, int p2 ) | |
781 | 778 | { |
782 | - if (WrdWndInfo.GraphicStop) return; | |
783 | - if (!w32g_wrd_wnd.active) return; | |
784 | - wrd_wnd_lock(); | |
785 | - wrd_wnd_unlock(); | |
786 | - // w32g_wrd_wnd.gmode | |
779 | + if ( WrdWndInfo.GraphicStop ) return; | |
780 | + if ( !w32g_wrd_wnd.active ) return; | |
781 | + wrd_wnd_lock(); | |
782 | + wrd_wnd_unlock(); | |
783 | + // w32g_wrd_wnd.gmode | |
787 | 784 | } |
788 | 785 | |
789 | -void wrd_graphic_pload(const char *path) | |
786 | +void wrd_graphic_pload ( char *path ) | |
790 | 787 | { |
791 | - int res; | |
792 | - | |
793 | - if (WrdWndInfo.GraphicStop) return; | |
794 | - if (!w32g_wrd_wnd.active) return; | |
795 | - wrd_wnd_lock(); | |
796 | - GdiFlush(); | |
797 | - res = pho_load_pixel(w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits, w32g_wrd_wnd.width, w32g_wrd_wnd.height, path); | |
798 | - wrd_wnd_unlock(); | |
799 | - if (res && w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display) { | |
800 | - RECT rc; | |
801 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
802 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
803 | - wrd_graphic_update(&rc, TRUE); | |
804 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
805 | - } | |
806 | -} | |
807 | - | |
808 | -static COLORREF g4r4b4_to_rgb(int g4r4b4) | |
788 | + int res; | |
789 | + | |
790 | + if ( WrdWndInfo.GraphicStop ) return; | |
791 | + if ( !w32g_wrd_wnd.active ) return; | |
792 | + wrd_wnd_lock(); | |
793 | + GdiFlush (); | |
794 | + res = pho_load_pixel ( w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits, w32g_wrd_wnd.width, w32g_wrd_wnd.height, path ); | |
795 | + wrd_wnd_unlock(); | |
796 | + if ( res && w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display ) { | |
797 | + RECT rc; | |
798 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
799 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
800 | + wrd_graphic_update ( &rc, TRUE ); | |
801 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
802 | + } | |
803 | +} | |
804 | + | |
805 | +static COLORREF g4r4b4_to_rgb ( int g4r4b4 ) | |
809 | 806 | { |
810 | - return RGB(((g4r4b4 & 0x00F0) >> 4) << 4, | |
811 | - ((g4r4b4 & 0x0F00) >> 8) << 4, | |
812 | - ((g4r4b4 & 0x000F) >> 0) << 4); | |
807 | + return RGB ( ((g4r4b4 & 0x00F0) >> 4 ) << 4, | |
808 | + ((g4r4b4 & 0x0F00) >> 8 ) << 4, | |
809 | + ((g4r4b4 & 0x000F) >> 0 ) << 4 ); | |
813 | 810 | } |
814 | 811 | |
815 | -void wrd_graphic_pal_g4r4b4(int p, int *g4r4b4, int max) | |
812 | +void wrd_graphic_pal_g4r4b4 ( int p, int *g4r4b4, int max ) | |
816 | 813 | { |
817 | - int i; | |
818 | - | |
819 | - if (WrdWndInfo.GraphicStop) return; | |
820 | - if (!w32g_wrd_wnd.active) return; | |
821 | - if (p < 0) return; | |
822 | - if (p >= W32G_WRDWND_GRAPHIC_PALLETE_BUF_MAX) | |
823 | - return; | |
824 | - wrd_wnd_lock(); | |
825 | - if (max > W32G_WRDWND_GRAPHIC_PALLETE_MAX) { | |
826 | - max = W32G_WRDWND_GRAPHIC_PALLETE_MAX; | |
827 | - } | |
828 | - for (i = 0; i < max; i++) { | |
829 | - w32g_wrd_wnd.gpal_buff[p][i] = RGBtoRGBQUAD(g4r4b4_to_rgb(g4r4b4[i])); | |
830 | - } | |
831 | - wrd_wnd_unlock(); | |
832 | - if (p == 0) { | |
833 | - RECT rc; | |
814 | + int i; | |
815 | + | |
816 | + if ( WrdWndInfo.GraphicStop ) return; | |
817 | + if ( !w32g_wrd_wnd.active ) return; | |
818 | + if ( p < 0 ) return; | |
819 | + if ( p >= W32G_WRDWND_GRAPHIC_PALLETE_BUF_MAX ) | |
820 | + return; | |
821 | + wrd_wnd_lock(); | |
822 | + if ( max > W32G_WRDWND_GRAPHIC_PALLETE_MAX ) { | |
823 | + max = W32G_WRDWND_GRAPHIC_PALLETE_MAX; | |
824 | + } | |
825 | + for ( i = 0; i < max; i++ ) { | |
826 | + w32g_wrd_wnd.gpal_buff[p][i] = RGBtoRGBQUAD ( g4r4b4_to_rgb( g4r4b4[i] ) ); | |
827 | + } | |
828 | + wrd_wnd_unlock(); | |
829 | + if ( p == 0 ) { | |
830 | + RECT rc; | |
834 | 831 | #if 1 |
835 | - for (i = 0; i < W32G_WRDWND_GRAPHIC_PLANE_MAX; i++) { | |
836 | - dib_set_pals(w32g_wrd_wnd.graphic_dib[i], w32g_wrd_wnd.gpal_buff[p], max); | |
837 | - } | |
832 | + for ( i = 0; i < W32G_WRDWND_GRAPHIC_PLANE_MAX; i++ ) { | |
833 | + dib_set_pals ( w32g_wrd_wnd.graphic_dib[i], w32g_wrd_wnd.gpal_buff[p], max ); | |
834 | + } | |
838 | 835 | #else |
839 | - dib_set_pals(w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display], w32g_wrd_wnd.gpal_buff[p], max); | |
836 | + dib_set_pals ( w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display], w32g_wrd_wnd.gpal_buff[p], max ); | |
840 | 837 | #endif |
841 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
842 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
843 | - wrd_graphic_update(&rc, TRUE); | |
844 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
845 | - } | |
838 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
839 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
840 | + wrd_graphic_update ( &rc, TRUE ); | |
841 | + InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
842 | + } | |
846 | 843 | } |
847 | 844 | |
848 | 845 | extern DWORD volatile dwMainThreadId; |
849 | -void wrd_graphic_palrev(int p) | |
846 | +void wrd_graphic_palrev ( int p ) | |
850 | 847 | { |
851 | - int i; | |
852 | - | |
853 | - if (WrdWndInfo.GraphicStop) return; | |
854 | - if (!w32g_wrd_wnd.active) return; | |
855 | - if (p < 0) return; | |
856 | - if (p >= W32G_WRDWND_GRAPHIC_PALLETE_BUF_MAX) | |
857 | - return; | |
858 | - wrd_wnd_lock(); | |
859 | - for (i = 0; i <W32G_WRDWND_GRAPHIC_PALLETE_MAX; i++) { | |
860 | - w32g_wrd_wnd.gpal_buff[p][i].rgbBlue = 0xFF - w32g_wrd_wnd.gpal_buff[p][i].rgbBlue; | |
861 | - w32g_wrd_wnd.gpal_buff[p][i].rgbGreen = 0xFF - w32g_wrd_wnd.gpal_buff[p][i].rgbGreen; | |
862 | - w32g_wrd_wnd.gpal_buff[p][i].rgbRed = 0xFF - w32g_wrd_wnd.gpal_buff[p][i].rgbRed; | |
863 | - } | |
864 | - wrd_wnd_unlock(); | |
865 | - if (p == 0) { | |
866 | - RECT rc; | |
848 | + int i; | |
849 | + | |
850 | + if ( WrdWndInfo.GraphicStop ) return; | |
851 | + if ( !w32g_wrd_wnd.active ) return; | |
852 | + if ( p < 0 ) return; | |
853 | + if ( p >= W32G_WRDWND_GRAPHIC_PALLETE_BUF_MAX ) | |
854 | + return; | |
855 | + wrd_wnd_lock(); | |
856 | + for ( i = 0; i <W32G_WRDWND_GRAPHIC_PALLETE_MAX; i++ ) { | |
857 | + w32g_wrd_wnd.gpal_buff[p][i].rgbBlue = 0xFF - w32g_wrd_wnd.gpal_buff[p][i].rgbBlue; | |
858 | + w32g_wrd_wnd.gpal_buff[p][i].rgbGreen = 0xFF - w32g_wrd_wnd.gpal_buff[p][i].rgbGreen; | |
859 | + w32g_wrd_wnd.gpal_buff[p][i].rgbRed = 0xFF - w32g_wrd_wnd.gpal_buff[p][i].rgbRed; | |
860 | + } | |
861 | + wrd_wnd_unlock(); | |
862 | + if ( p == 0 ) { | |
863 | + RECT rc; | |
867 | 864 | #if 1 |
868 | - for (i = 0; i < W32G_WRDWND_GRAPHIC_PLANE_MAX; i++) { | |
869 | - dib_set_pals(w32g_wrd_wnd.graphic_dib[i], w32g_wrd_wnd.gpal_buff[p], W32G_WRDWND_GRAPHIC_PALLETE_MAX); | |
870 | - } | |
865 | + for ( i = 0; i < W32G_WRDWND_GRAPHIC_PLANE_MAX; i++ ) { | |
866 | + dib_set_pals ( w32g_wrd_wnd.graphic_dib[i], w32g_wrd_wnd.gpal_buff[p], W32G_WRDWND_GRAPHIC_PALLETE_MAX ); | |
867 | + } | |
871 | 868 | #else |
872 | - dib_set_pals(w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display], w32g_wrd_wnd.gpal_buff[p], W32G_WRDWND_GRAPHIC_PALLETE_MAX); | |
869 | + dib_set_pals ( w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display], w32g_wrd_wnd.gpal_buff[p], W32G_WRDWND_GRAPHIC_PALLETE_MAX ); | |
873 | 870 | #endif |
874 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
875 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
876 | - wrd_graphic_update(&rc, TRUE); | |
877 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
878 | - } | |
871 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
872 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
873 | + wrd_graphic_update ( &rc, TRUE ); | |
874 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
875 | + } | |
879 | 876 | } |
880 | 877 | |
881 | -void wrd_graphic_apply_pal(int p) | |
878 | +void wrd_graphic_apply_pal ( int p ) | |
882 | 879 | { |
883 | - int i; | |
884 | - RECT rc; | |
885 | - | |
886 | - if (WrdWndInfo.GraphicStop) return; | |
887 | - if (!w32g_wrd_wnd.active) return; | |
888 | - if (p < 0) return; | |
889 | - if (p >= W32G_WRDWND_GRAPHIC_PALLETE_BUF_MAX) | |
890 | - return; | |
891 | - wrd_wnd_lock(); | |
880 | + int i; | |
881 | + RECT rc; | |
882 | + | |
883 | + if ( WrdWndInfo.GraphicStop ) return; | |
884 | + if ( !w32g_wrd_wnd.active ) return; | |
885 | + if ( p < 0 ) return; | |
886 | + if ( p >= W32G_WRDWND_GRAPHIC_PALLETE_BUF_MAX ) | |
887 | + return; | |
888 | + wrd_wnd_lock(); | |
892 | 889 | #if 1 |
893 | - for (i = 0; i < W32G_WRDWND_GRAPHIC_PLANE_MAX; i++) { | |
894 | - dib_set_pals(w32g_wrd_wnd.graphic_dib[i], w32g_wrd_wnd.gpal_buff[p], W32G_WRDWND_GRAPHIC_PALLETE_MAX); | |
895 | - } | |
890 | + for ( i = 0; i < W32G_WRDWND_GRAPHIC_PLANE_MAX; i++ ) { | |
891 | + dib_set_pals ( w32g_wrd_wnd.graphic_dib[i], w32g_wrd_wnd.gpal_buff[p], W32G_WRDWND_GRAPHIC_PALLETE_MAX ); | |
892 | + } | |
896 | 893 | #else |
897 | - dib_set_pals(w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display], w32g_wrd_wnd.gpal_buff[p], W32G_WRDWND_GRAPHIC_PALLETE_MAX); | |
894 | + dib_set_pals ( w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display], w32g_wrd_wnd.gpal_buff[p], W32G_WRDWND_GRAPHIC_PALLETE_MAX ); | |
898 | 895 | #endif |
899 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
900 | - wrd_wnd_unlock(); | |
901 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
902 | - wrd_graphic_update(&rc, TRUE); | |
903 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
896 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
897 | + wrd_wnd_unlock(); | |
898 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
899 | + wrd_graphic_update ( &rc, TRUE ); | |
900 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
904 | 901 | } |
905 | 902 | |
906 | -void wrd_graphic_fade(int p1, int p2, int speed) | |
903 | +void wrd_graphic_fade ( int p1, int p2, int speed ) | |
907 | 904 | { |
908 | - if (WrdWndInfo.GraphicStop) return; | |
909 | - if (!w32g_wrd_wnd.active) return; | |
910 | - if (p1 < 0) return; | |
911 | - if (p1 >= W32G_WRDWND_GRAPHIC_PALLETE_BUF_MAX) return; | |
912 | - if (p2 < 0) return; | |
913 | - if (p2 >= W32G_WRDWND_GRAPHIC_PALLETE_BUF_MAX) return; | |
914 | - wrd_wnd_lock(); | |
915 | - w32g_wrd_wnd.fade_from = p1; | |
916 | - w32g_wrd_wnd.fade_to = p2; | |
917 | - wrd_wnd_unlock(); | |
918 | - if (speed == 0) { | |
919 | - wrd_graphic_apply_pal(p2); | |
920 | - } else { | |
921 | -// wrd_graphic_apply_pal(p1); | |
922 | - } | |
923 | -} | |
924 | - | |
925 | -void wrd_graphic_fadestep(int v) | |
905 | + | |
906 | + if ( WrdWndInfo.GraphicStop ) return; | |
907 | + if ( !w32g_wrd_wnd.active ) return; | |
908 | + if ( p1 < 0 ) return; | |
909 | + if ( p1 >= W32G_WRDWND_GRAPHIC_PALLETE_BUF_MAX ) return; | |
910 | + if ( p2 < 0 ) return; | |
911 | + if ( p2 >= W32G_WRDWND_GRAPHIC_PALLETE_BUF_MAX ) return; | |
912 | + wrd_wnd_lock(); | |
913 | + w32g_wrd_wnd.fade_from = p1; | |
914 | + w32g_wrd_wnd.fade_to = p2; | |
915 | + wrd_wnd_unlock(); | |
916 | + if ( speed == 0 ) { | |
917 | + wrd_graphic_apply_pal ( p2 ); | |
918 | + } else{ | |
919 | +// wrd_graphic_apply_pal ( p1 ); | |
920 | + } | |
921 | +} | |
922 | + | |
923 | +void wrd_graphic_fadestep ( int v ) | |
926 | 924 | { |
927 | - int i; | |
928 | - RECT rc; | |
929 | - RGBQUAD gpal[W32G_WRDWND_GRAPHIC_PALLETE_MAX]; | |
930 | - double v1, v2; | |
931 | - | |
932 | - if (WrdWndInfo.GraphicStop) return; | |
933 | - if (!w32g_wrd_wnd.active) return; | |
934 | - if (w32g_wrd_wnd.fade_from < 0 || w32g_wrd_wnd.fade_to < 0) | |
935 | - return; | |
936 | - wrd_wnd_lock(); | |
937 | - v2 = (double) v / WRD_MAXFADESTEP; | |
938 | - v1 = 1.0 - v2; | |
939 | - for (i = 0; i < W32G_WRDWND_GRAPHIC_PALLETE_MAX; i++) { | |
940 | - RGBQUAD *rq1 = &w32g_wrd_wnd.gpal_buff[w32g_wrd_wnd.fade_from][i]; | |
941 | - RGBQUAD *rq2 = &w32g_wrd_wnd.gpal_buff[w32g_wrd_wnd.fade_to][i]; | |
942 | - gpal[i].rgbBlue = (char)(v1 * rq1->rgbBlue + v2 * rq2->rgbBlue); | |
943 | - gpal[i].rgbGreen = (char)(v1 * rq1->rgbGreen + v2 * rq2->rgbGreen); | |
944 | - gpal[i].rgbRed = (char)(v1 * rq1->rgbRed + v2 * rq2->rgbRed); | |
945 | - gpal[i].rgbReserved = 0; | |
946 | - } | |
925 | + int i; | |
926 | + RECT rc; | |
927 | + RGBQUAD gpal[W32G_WRDWND_GRAPHIC_PALLETE_MAX]; | |
928 | + double v1, v2; | |
929 | + | |
930 | + if ( WrdWndInfo.GraphicStop ) return; | |
931 | + if ( !w32g_wrd_wnd.active ) return; | |
932 | + if ( w32g_wrd_wnd.fade_from < 0 || w32g_wrd_wnd.fade_to < 0 ) | |
933 | + return; | |
934 | + wrd_wnd_lock(); | |
935 | + v2 = (double) v / WRD_MAXFADESTEP; | |
936 | + v1 = 1.0 - v2; | |
937 | + for ( i = 0; i < W32G_WRDWND_GRAPHIC_PALLETE_MAX; i++ ) { | |
938 | + RGBQUAD *rq1 = &w32g_wrd_wnd.gpal_buff[w32g_wrd_wnd.fade_from][i]; | |
939 | + RGBQUAD *rq2 = &w32g_wrd_wnd.gpal_buff[w32g_wrd_wnd.fade_to][i]; | |
940 | + gpal[i].rgbBlue = (char) ( v1 * rq1->rgbBlue + v2 * rq2->rgbBlue ); | |
941 | + gpal[i].rgbGreen = (char) ( v1 * rq1->rgbGreen + v2 * rq2->rgbGreen ); | |
942 | + gpal[i].rgbRed = (char) ( v1 * rq1->rgbRed + v2 * rq2->rgbRed ); | |
943 | + gpal[i].rgbReserved = 0; | |
944 | + } | |
947 | 945 | #if 1 |
948 | - for (i = 0; i < W32G_WRDWND_GRAPHIC_PLANE_MAX; i++) { | |
949 | - dib_set_pals(w32g_wrd_wnd.graphic_dib[i], gpal, W32G_WRDWND_GRAPHIC_PALLETE_MAX); | |
950 | - } | |
946 | + for ( i = 0; i < W32G_WRDWND_GRAPHIC_PLANE_MAX; i++ ) { | |
947 | + dib_set_pals ( w32g_wrd_wnd.graphic_dib[i], gpal, W32G_WRDWND_GRAPHIC_PALLETE_MAX ); | |
948 | + } | |
951 | 949 | #else |
952 | - dib_set_pals(w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display], gpal, W32G_WRDWND_GRAPHIC_PALLETE_MAX); | |
950 | + dib_set_pals ( w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display], gpal, W32G_WRDWND_GRAPHIC_PALLETE_MAX ); | |
953 | 951 | #endif |
954 | - SetRect(&rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height); | |
955 | - wrd_wnd_unlock(); | |
956 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
957 | - wrd_graphic_update(&rc, TRUE); | |
952 | + SetRect ( &rc, 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height ); | |
953 | + wrd_wnd_unlock(); | |
954 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
955 | + wrd_graphic_update ( &rc, TRUE ); | |
958 | 956 | #if 1 |
959 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
957 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
960 | 958 | #else |
961 | - { // パレットの変化で全画面を更新しないで済むようにチェックしてみる。けど、重いので不採用。 | |
959 | + { // パレットの変化で全画面を更新しないで済むようにチェックしてみる。けど、重いので不採用。 | |
962 | 960 | #define BITS_DIV 10 |
963 | - int j; | |
964 | - char *bits; | |
965 | - int mod_pal[W32G_WRDWND_GRAPHIC_PALLETE_MAX]; | |
966 | - char bits_use_pal[BITS_DIV][BITS_DIV]; | |
967 | - for (i = 0; i < W32G_WRDWND_GRAPHIC_PALLETE_MAX; i++) { | |
968 | - if (memcmp(&w32g_wrd_wnd.gpal_buff[w32g_wrd_wnd.fade_from][i], | |
969 | - &w32g_wrd_wnd.gpal_buff[w32g_wrd_wnd.fade_to][i], sizeof(RGBQUAD)) != 0) | |
970 | - mod_pal[i] = 1; | |
971 | - else | |
972 | - mod_pal[i] = 0; | |
973 | - } | |
974 | - bits = w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display]->bits; | |
975 | - for (i = 0; i < BITS_DIV; i++) { | |
976 | - for (j = 0; j < BITS_DIV; j++) { | |
977 | - bits_use_pal[i][j] = 0; | |
978 | - } | |
979 | - } | |
980 | - for (i = 0; i < 640; i++) { | |
981 | - for (j = 0; j < 400; j++) { | |
982 | - char c = bits[j * w32g_wrd_wnd.width + i]; | |
983 | - if (c >= 0 && c <= 0x0F && mod_pal[c]) | |
984 | - bits_use_pal[BITS_DIV * i / 640][BITS_DIV * j / 400] = 1; | |
985 | - } | |
986 | - } | |
987 | - for (i = 0; i < BITS_DIV; i++) { | |
988 | - for (j = 0; j < BITS_DIV; j++) { | |
989 | - if (bits_use_pal[i][j]) | |
990 | - SetRect(&rc, i * 640/BITS_DIV, j * 400/BITS_DIV, (i + 1) * 640/BITS_DIV, (j + 1) * 400/BITS_DIV); | |
991 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
992 | - } | |
993 | - } | |
994 | - } | |
961 | + int j; | |
962 | + char *bits; | |
963 | + int mod_pal[W32G_WRDWND_GRAPHIC_PALLETE_MAX]; | |
964 | + char bits_use_pal[BITS_DIV][BITS_DIV]; | |
965 | + for ( i = 0; i < W32G_WRDWND_GRAPHIC_PALLETE_MAX; i++ ) { | |
966 | + if ( memcmp ( &w32g_wrd_wnd.gpal_buff[w32g_wrd_wnd.fade_from][i], | |
967 | + &w32g_wrd_wnd.gpal_buff[w32g_wrd_wnd.fade_to][i], sizeof (RGBQUAD) ) != 0 ) | |
968 | + mod_pal[i] = 1; | |
969 | + else | |
970 | + mod_pal[i] = 0; | |
971 | + } | |
972 | + bits = w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_display]->bits; | |
973 | + for ( i = 0; i < BITS_DIV; i ++ ) { | |
974 | + for ( j = 0; j < BITS_DIV; j ++ ) { | |
975 | + bits_use_pal[i][j] = 0; | |
976 | + } | |
977 | + } | |
978 | + for ( i = 0; i < 640; i ++ ) { | |
979 | + for ( j = 0; j < 400; j ++ ) { | |
980 | + char c = bits [ j * w32g_wrd_wnd.width + i ]; | |
981 | + if ( c >= 0 && c <= 0x0F && mod_pal[ c ] ) | |
982 | + bits_use_pal[BITS_DIV*i/640][BITS_DIV*j/400] = 1; | |
983 | + } | |
984 | + } | |
985 | + for ( i = 0; i < BITS_DIV; i ++ ) { | |
986 | + for ( j = 0; j < BITS_DIV; j ++ ) { | |
987 | + if ( bits_use_pal[i][j] ) | |
988 | + SetRect ( &rc, i * 640/BITS_DIV, j * 400/BITS_DIV, ( i + 1) * 640/BITS_DIV, ( j + 1) * 400/BITS_DIV ); | |
989 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
990 | + } | |
991 | + } | |
992 | + } | |
995 | 993 | #endif |
996 | 994 | } |
997 | 995 | |
998 | -void wrd_graphic_gmode(int sw) | |
996 | +void wrd_graphic_gmode ( int sw ) | |
999 | 997 | { |
1000 | - w32g_wrd_wnd.gmode = sw; | |
998 | + w32g_wrd_wnd.gmode = sw; | |
1001 | 999 | } |
1002 | 1000 | |
1003 | -void wrd_graphic_gmove(int x1, int y1, int x2, int y2, int xd, int yd, int vs, int vd, int sw) | |
1001 | +void wrd_graphic_gmove ( int x1, int y1, int x2, int y2, int xd, int yd, int vs, int vd, int sw ) | |
1004 | 1002 | { |
1005 | - int x, y; | |
1006 | - | |
1007 | - if (WrdWndInfo.GraphicStop) return; | |
1008 | - if (!w32g_wrd_wnd.active) return; | |
1009 | - if (vs < 0 || vs >= 2 || vd < 0 || vd >= 2) return; | |
1010 | - if (x1 < 0 || x1 >= w32g_wrd_wnd.width) return; | |
1011 | - if (y1 < 0 || y1 >= w32g_wrd_wnd.height) return; | |
1012 | - if (xd < 0 || xd >= w32g_wrd_wnd.width) return; | |
1013 | - if (yd < 0 || yd >= w32g_wrd_wnd.height) return; | |
1014 | - wrd_wnd_lock(); | |
1015 | - GdiFlush(); | |
1016 | - x1 = ((x1 + 7) / 8) * 8; | |
1017 | - x2 = ((x2 + 7) / 8) * 8; | |
1018 | - xd = ((xd + 7) / 8) * 8; | |
1019 | - if (xd + x2 - x1 >= w32g_wrd_wnd.width) { | |
1020 | - int d = w32g_wrd_wnd.width - 1 - xd; | |
1021 | - x2 = x1 + d; | |
1022 | - } | |
1023 | - if (yd + y2 - y1 >= w32g_wrd_wnd.height) { | |
1024 | - int d = w32g_wrd_wnd.height - 1 - yd; | |
1025 | - y2 = y1 + d; | |
1026 | - } | |
1027 | - switch (sw) { | |
1028 | - default: | |
1029 | - case 0: // COPY | |
1030 | - for (y = y1; y <= y2; y++) { | |
1031 | - int i_src = y * w32g_wrd_wnd.width; | |
1032 | - int i_dest = (yd + y - y1) * w32g_wrd_wnd.width; | |
1033 | - if (w32g_wrd_wnd.gmode >= 0x0F) { | |
1034 | - CopyMemory(&w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest + xd], | |
1035 | - &w32g_wrd_wnd.graphic_dib[vs]->bits[i_src + x1], x2 - x1 + 1); | |
1036 | - } else { | |
1037 | - for (x = x1; x <= x2; x++) { | |
1038 | - int i_dest_tmp = i_dest + xd + x - x1; | |
1039 | - int i_src_tmp = i_src + x; | |
1040 | - w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest_tmp] | |
1041 | - = w32g_wrd_wnd.graphic_dib[vs]->bits[i_src_tmp] & w32g_wrd_wnd.gmode; | |
1042 | - } | |
1043 | - } | |
1044 | - } | |
1045 | - break; | |
1046 | - case 1: // SWAP | |
1047 | - for (y = y1; y <= y2; y++) { | |
1048 | - int i_src = y * w32g_wrd_wnd.width; | |
1049 | - int i_dest = (yd + y - y1) * w32g_wrd_wnd.width; | |
1050 | - if (w32g_wrd_wnd.gmode >= 0x0F) { | |
1051 | - char buff[640 + 1]; | |
1052 | - int d = x2 - x1 + 1; | |
1053 | - CopyMemory(buff, &w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest + xd], d); | |
1054 | - CopyMemory(&w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest + xd], | |
1055 | - &w32g_wrd_wnd.graphic_dib[vs]->bits[i_src + x1], d); | |
1056 | - CopyMemory(&w32g_wrd_wnd.graphic_dib[vs]->bits[i_src + x1], buff, d); | |
1057 | - } else { | |
1058 | - for (x = x1; x <= x2; x++) { | |
1059 | - int i_dest_tmp = i_dest + xd + x - x1; | |
1060 | - int i_src_tmp = i_src + x; | |
1061 | - char t = w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest_tmp]; | |
1062 | - w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest_tmp] | |
1063 | - = (w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest_tmp] & ~w32g_wrd_wnd.gmode) | |
1064 | - | (w32g_wrd_wnd.graphic_dib[vs]->bits[i_src_tmp] & w32g_wrd_wnd.gmode); | |
1065 | - w32g_wrd_wnd.graphic_dib[vs]->bits[i_src_tmp] | |
1066 | - = (w32g_wrd_wnd.graphic_dib[vs]->bits[i_src_tmp] & ~w32g_wrd_wnd.gmode) | |
1067 | - | t & w32g_wrd_wnd.gmode; | |
1068 | - } | |
1069 | - } | |
1070 | - } | |
1071 | - break; | |
1072 | - } | |
1073 | - wrd_wnd_unlock(); | |
1074 | - if (w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display) { | |
1075 | - RECT rc; | |
1076 | - SetRect(&rc, xd, yd, xd + x2 - x1, yd + y2 - y1); | |
1077 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
1078 | - wrd_graphic_update(&rc, TRUE); | |
1079 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
1080 | - } | |
1081 | -} | |
1082 | - | |
1083 | -void wrd_graphic_mag(const char *path, int x, int y, int s, int p) | |
1003 | + int x, y; | |
1004 | + | |
1005 | + if ( WrdWndInfo.GraphicStop ) return; | |
1006 | + if ( !w32g_wrd_wnd.active ) return; | |
1007 | + if ( vs < 0 || vs >= 2 || vd < 0 || vd >= 2 ) return; | |
1008 | + if ( x1 < 0 || x1 >= w32g_wrd_wnd.width ) return; | |
1009 | + if ( y1 < 0 || y1 >= w32g_wrd_wnd.height ) return; | |
1010 | + if ( xd < 0 || xd >= w32g_wrd_wnd.width ) return; | |
1011 | + if ( yd < 0 || yd >= w32g_wrd_wnd.height ) return; | |
1012 | + wrd_wnd_lock(); | |
1013 | + GdiFlush (); | |
1014 | + x1 = ( ( x1 + 7 ) / 8 ) * 8; | |
1015 | + x2 = ( ( x2 + 7 ) / 8 ) * 8; | |
1016 | + xd = ( ( xd + 7 ) / 8 ) * 8; | |
1017 | + if ( xd + x2 - x1 >= w32g_wrd_wnd.width ) { | |
1018 | + int d = w32g_wrd_wnd.width - 1 - xd; | |
1019 | + x2 = x1 + d; | |
1020 | + } | |
1021 | + if ( yd + y2 - y1 >= w32g_wrd_wnd.height ) { | |
1022 | + int d = w32g_wrd_wnd.height - 1 - yd; | |
1023 | + y2 = y1 + d; | |
1024 | + } | |
1025 | + switch ( sw ) { | |
1026 | + default: | |
1027 | + case 0: // COPY | |
1028 | + for ( y = y1; y <= y2; y ++ ) { | |
1029 | + int i_src = y * w32g_wrd_wnd.width; | |
1030 | + int i_dest = (yd + y - y1) * w32g_wrd_wnd.width; | |
1031 | + if ( w32g_wrd_wnd.gmode >= 0x0F ) { | |
1032 | + memcpy ( &w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest + xd], | |
1033 | + &w32g_wrd_wnd.graphic_dib[vs]->bits[i_src + x1], x2 - x1 + 1 ); | |
1034 | + } else { | |
1035 | + for ( x = x1; x <= x2; x ++ ) { | |
1036 | + int i_dest_tmp = i_dest + xd + x - x1; | |
1037 | + int i_src_tmp = i_src + x; | |
1038 | + w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest_tmp] | |
1039 | + = w32g_wrd_wnd.graphic_dib[vs]->bits[i_src_tmp] & w32g_wrd_wnd.gmode; | |
1040 | + } | |
1041 | + } | |
1042 | + } | |
1043 | + break; | |
1044 | + case 1: // SWAP | |
1045 | + for ( y = y1; y <= y2; y ++ ) { | |
1046 | + int i_src = y * w32g_wrd_wnd.width; | |
1047 | + int i_dest = (yd + y - y1) * w32g_wrd_wnd.width; | |
1048 | + if ( w32g_wrd_wnd.gmode >= 0x0F ) { | |
1049 | + char buff[640+1]; | |
1050 | + int d = x2 - x1 + 1; | |
1051 | + memcpy ( buff, &w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest + xd], d ); | |
1052 | + memcpy ( &w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest + xd], | |
1053 | + &w32g_wrd_wnd.graphic_dib[vs]->bits[i_src + x1], d ); | |
1054 | + memcpy ( &w32g_wrd_wnd.graphic_dib[vs]->bits[i_src + x1], buff, d ); | |
1055 | + } else { | |
1056 | + for ( x = x1; x <= x2; x ++ ) { | |
1057 | + int i_dest_tmp = i_dest + xd + x - x1; | |
1058 | + int i_src_tmp = i_src + x; | |
1059 | + char t = w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest_tmp]; | |
1060 | + w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest_tmp] | |
1061 | + = ( w32g_wrd_wnd.graphic_dib[vd]->bits[i_dest_tmp] & ~w32g_wrd_wnd.gmode ) | |
1062 | + | ( w32g_wrd_wnd.graphic_dib[vs]->bits[i_src_tmp] & w32g_wrd_wnd.gmode ); | |
1063 | + w32g_wrd_wnd.graphic_dib[vs]->bits[i_src_tmp] | |
1064 | + = ( w32g_wrd_wnd.graphic_dib[vs]->bits[i_src_tmp] & ~w32g_wrd_wnd.gmode ) | |
1065 | + | t & w32g_wrd_wnd.gmode; | |
1066 | + } | |
1067 | + } | |
1068 | + } | |
1069 | + break; | |
1070 | + } | |
1071 | + wrd_wnd_unlock(); | |
1072 | + if ( w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display ) { | |
1073 | + RECT rc; | |
1074 | + SetRect ( &rc, xd, yd, xd + x2 - x1, yd + y2 - y1 ); | |
1075 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
1076 | + wrd_graphic_update ( &rc, TRUE ); | |
1077 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
1078 | + } | |
1079 | +} | |
1080 | + | |
1081 | +void wrd_graphic_mag ( char *path, int x, int y, int s, int p ) | |
1084 | 1082 | { |
1085 | - int x_orig = x, y_orig = y; | |
1086 | - magdata *mh; | |
1087 | - int width, height; | |
1088 | - | |
1089 | - if (WrdWndInfo.GraphicStop) return; | |
1090 | - if (!w32g_wrd_wnd.active) return; | |
1091 | - mh = mag_create(path); | |
1092 | - if (x_orig == WRD_NOARG) | |
1093 | - x_orig = 0; | |
1094 | - if (y_orig == WRD_NOARG) | |
1095 | - y_orig = 0; | |
1096 | - if (!mh) | |
1097 | - return; | |
1098 | - width = mh->xend - mh->xorig + 1; | |
1099 | - height = mh->yend - mh->yorig + 1; | |
1100 | - if (MAG_WORK_WIDTH < width) | |
1101 | - return; | |
1102 | - if (MAG_WORK_HEIGHT < height) | |
1103 | - return; | |
1104 | - if (s <= 0) | |
1105 | - return; | |
1106 | - wrd_wnd_lock(); | |
1107 | - GdiFlush(); | |
1108 | - if (wrd_graphic_pal_init_flag == 0) { /* MIMPI BUG ? */ | |
1109 | - if (p == 1) p = 0; | |
1110 | - wrd_graphic_pal_init_flag = 1; | |
1111 | - } | |
1112 | - if (p == 0 || p == 1) { | |
1113 | - if (s == 1 && x_orig == 0 && y_orig == 0 && width <= w32g_wrd_wnd.width && height <= w32g_wrd_wnd.height) { | |
1114 | - mag_load_pixel(w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits, | |
1115 | - w32g_wrd_wnd.width, w32g_wrd_wnd.height, mh); | |
1116 | - } else { | |
1083 | + int x_orig = x, y_orig = y; | |
1084 | + magdata *mh; | |
1085 | + int width, height; | |
1086 | + | |
1087 | + if ( WrdWndInfo.GraphicStop ) return; | |
1088 | + if ( !w32g_wrd_wnd.active ) return; | |
1089 | + mh = mag_create ( path ); | |
1090 | + if ( x_orig == WRD_NOARG ) | |
1091 | + x_orig = 0; | |
1092 | + if ( y_orig == WRD_NOARG ) | |
1093 | + y_orig = 0; | |
1094 | + if ( mh == NULL ) | |
1095 | + return; | |
1096 | + width = mh->xend - mh->xorig + 1; | |
1097 | + height = mh->yend - mh->yorig + 1; | |
1098 | + if (MAG_WORK_WIDTH < width ) | |
1099 | + return; | |
1100 | + if ( MAG_WORK_HEIGHT < height ) | |
1101 | + return; | |
1102 | + if ( s <= 0 ) | |
1103 | + return; | |
1104 | + wrd_wnd_lock(); | |
1105 | + GdiFlush (); | |
1106 | + if ( wrd_graphic_pal_init_flag == 0 ) { /* MIMPI BUG ? */ | |
1107 | + if ( p == 1 ) p = 0; | |
1108 | + wrd_graphic_pal_init_flag = 1; | |
1109 | + } | |
1110 | + if ( p == 0 || p == 1 ) { | |
1111 | + if ( s == 1 && x_orig == 0 && y_orig == 0 && width <= w32g_wrd_wnd.width && height <= w32g_wrd_wnd.height ) { | |
1112 | + mag_load_pixel ( w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits, | |
1113 | + w32g_wrd_wnd.width, w32g_wrd_wnd.height, mh ); | |
1114 | + } else { | |
1117 | 1115 | #if 1 |
1118 | - mag_load_pixel(w32g_wrd_wnd.bits_mag_work, | |
1119 | - MAG_WORK_WIDTH, MAG_WORK_HEIGHT, mh); | |
1120 | - for (y = 0; y < height; y++) { | |
1121 | - int dest_index = (y_orig + y/s) * w32g_wrd_wnd.width; | |
1122 | - int src_index = y * MAG_WORK_WIDTH; | |
1123 | - long v[MAG_WORK_WIDTH]; | |
1124 | - for (x = 0; x < width; x++) | |
1125 | - v[x] = 0; | |
1126 | - for (x = 0; x < width; x++) { | |
1127 | - v[x/s] += w32g_wrd_wnd.bits_mag_work[src_index + x]; | |
1128 | - } | |
1129 | - for (x = 0; x < width; x++) { | |
1130 | - if (v[x/s] >= 0) { | |
1131 | - int i_tmp = dest_index + x_orig + x/s; | |
1132 | - if (i_tmp < MAG_WORK_WIDTH * MAG_WORK_HEIGHT) | |
1133 | - w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits[i_tmp] = (v[x/s] / s / s) & 0x0F; | |
1134 | - v[x/s] = -1; | |
1135 | - } | |
1136 | - } | |
1137 | - } | |
1138 | - width /= s; | |
1139 | - height /= s; | |
1116 | + mag_load_pixel ( w32g_wrd_wnd.bits_mag_work, | |
1117 | + MAG_WORK_WIDTH, MAG_WORK_HEIGHT, mh ); | |
1118 | + for ( y = 0; y < height; y ++ ) { | |
1119 | + int dest_index = (y_orig + y/s) * w32g_wrd_wnd.width; | |
1120 | + int src_index = y * MAG_WORK_WIDTH; | |
1121 | + long v[MAG_WORK_WIDTH]; | |
1122 | + for ( x = 0; x < width; x ++ ) | |
1123 | + v[x] = 0; | |
1124 | + for ( x = 0; x < width; x ++ ) { | |
1125 | + v[x/s] += w32g_wrd_wnd.bits_mag_work[ src_index + x ]; | |
1126 | + } | |
1127 | + for ( x = 0; x < width; x ++ ) { | |
1128 | + if ( v[x/s] >= 0 ) { | |
1129 | + int i_tmp = dest_index + x_orig + x/s; | |
1130 | + if ( i_tmp < MAG_WORK_WIDTH * MAG_WORK_HEIGHT ) | |
1131 | + w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits[i_tmp] = ( v[x/s] / s / s ) & 0x0F; | |
1132 | + v[x/s] = -1; | |
1133 | + } | |
1134 | + } | |
1135 | + } | |
1136 | + width /= s; | |
1137 | + height /= s; | |
1140 | 1138 | #else |
1141 | - mag_load_pixel(w32g_wrd_wnd.bits_mag_work, | |
1142 | - MAG_WORK_WIDTH, MAG_WORK_HEIGHT, mh); | |
1143 | - for (y = 0; y < height; y++) { | |
1144 | - for (x = 0; x < width; x++) { | |
1145 | - w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits[(y_orig + y) * w32g_wrd_wnd.width + x_orig + x] | |
1146 | - = w32g_wrd_wnd.bits_mag_work[y * MAG_WORK_WIDTH + x]; | |
1147 | - } | |
1148 | - } | |
1139 | + mag_load_pixel ( w32g_wrd_wnd.bits_mag_work, | |
1140 | + MAG_WORK_WIDTH, MAG_WORK_HEIGHT, mh ); | |
1141 | + for ( y = 0; y < height; y ++ ) { | |
1142 | + for ( x = 0; x < width; x ++ ) { | |
1143 | + w32g_wrd_wnd.graphic_dib[w32g_wrd_wnd.index_active]->bits[(y_orig + y) * w32g_wrd_wnd.width + x_orig + x] | |
1144 | + = w32g_wrd_wnd.bits_mag_work[ y * MAG_WORK_WIDTH + x]; | |
1145 | + } | |
1146 | + } | |
1149 | 1147 | #endif |
1150 | - } | |
1151 | - } | |
1152 | - wrd_wnd_unlock(); | |
1153 | - wrd_graphic_pal_g4r4b4(17, mh->pal, 16); | |
1154 | - if (w32g_wrd_wnd.index_active == 0) | |
1155 | - wrd_graphic_pal_g4r4b4(18, mh->pal, 16); | |
1156 | - if (w32g_wrd_wnd.index_active == 1) | |
1157 | - wrd_graphic_pal_g4r4b4(19, mh->pal, 16); | |
1158 | - if (p == 0 || p == 2) { | |
1159 | - wrd_graphic_pal_g4r4b4(0, mh->pal, 16); | |
1160 | - } else { | |
1161 | - // wrd_graphic_pal_g4r4b4() を実行しないと領域が更新されない。 | |
1162 | - if (w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display) { | |
1163 | - RECT rc; | |
1164 | - SetRect(&rc, x_orig, y_orig, width, height); | |
1165 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
1166 | - wrd_graphic_update(&rc, TRUE); | |
1167 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
1168 | - } | |
1169 | - } | |
1170 | -} | |
1171 | - | |
1172 | -void wrd_text_ton(int sw) | |
1148 | + } | |
1149 | + } | |
1150 | + wrd_wnd_unlock(); | |
1151 | + wrd_graphic_pal_g4r4b4 ( 17, mh->pal, 16 ); | |
1152 | + if ( w32g_wrd_wnd.index_active == 0 ) | |
1153 | + wrd_graphic_pal_g4r4b4 ( 18, mh->pal, 16 ); | |
1154 | + if ( w32g_wrd_wnd.index_active == 1 ) | |
1155 | + wrd_graphic_pal_g4r4b4 ( 19, mh->pal, 16 ); | |
1156 | + if ( p == 0 || p == 2 ) { | |
1157 | + wrd_graphic_pal_g4r4b4 ( 0, mh->pal, 16 ); | |
1158 | + } else { | |
1159 | + // wrd_graphic_pal_g4r4b4() を実行しないと領域が更新されない。 | |
1160 | + if ( w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display ) { | |
1161 | + RECT rc; | |
1162 | + SetRect ( &rc, x_orig, y_orig, width, height ); | |
1163 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
1164 | + wrd_graphic_update ( &rc, TRUE ); | |
1165 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
1166 | + } | |
1167 | + } | |
1168 | +} | |
1169 | + | |
1170 | +void wrd_text_ton ( int sw ) | |
1173 | 1171 | { |
1174 | - int sw_old = w32g_wrd_wnd.flag & WRD_FLAG_TEXT; | |
1175 | - | |
1176 | - if (!w32g_wrd_wnd.active) return; | |
1177 | - if (sw && !sw_old) { | |
1178 | - w32g_wrd_wnd.flag |= WRD_FLAG_TEXT; // 先に設定 | |
1179 | - if (w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display) { | |
1180 | - wrd_text_update(0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height, TRUE); | |
1181 | - } | |
1182 | - } else if (!sw && sw_old) { | |
1183 | - if (w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display) { | |
1184 | - wrd_text_update(0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height, TRUE); | |
1185 | - } | |
1186 | - } | |
1187 | - if (sw) | |
1188 | - w32g_wrd_wnd.flag |= WRD_FLAG_TEXT; | |
1189 | - else | |
1190 | - w32g_wrd_wnd.flag &= ~WRD_FLAG_TEXT; | |
1191 | -} | |
1192 | - | |
1193 | -void wrd_text_scroll(int x1, int y1, int x2, int y2, int mode, int color, int c) | |
1172 | + int sw_old = w32g_wrd_wnd.flag & WRD_FLAG_TEXT; | |
1173 | + | |
1174 | + if ( !w32g_wrd_wnd.active ) return; | |
1175 | + if ( sw && !sw_old ) { | |
1176 | + w32g_wrd_wnd.flag |= WRD_FLAG_TEXT; // 先に設定 | |
1177 | + if ( w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display ) { | |
1178 | + wrd_text_update ( 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height, TRUE ); | |
1179 | + } | |
1180 | + } else if ( !sw && sw_old ) { | |
1181 | + if ( w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display ) { | |
1182 | + wrd_text_update ( 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height, TRUE ); | |
1183 | + } | |
1184 | + } | |
1185 | + if ( sw ) | |
1186 | + w32g_wrd_wnd.flag |= WRD_FLAG_TEXT; | |
1187 | + else | |
1188 | + w32g_wrd_wnd.flag &= ~WRD_FLAG_TEXT; | |
1189 | +} | |
1190 | + | |
1191 | +void wrd_text_scroll ( int x1, int y1, int x2, int y2, int mode, int color, int c ) | |
1194 | 1192 | { |
1195 | - int x, y; | |
1196 | - x1--; x2--; y1--; y2--; | |
1197 | - if (!w32g_wrd_wnd.active) return; | |
1198 | - if (x1 > x2) return; | |
1199 | - if (y1 > y2) return; | |
1200 | - if (x1 < 0) x1 = 0; if (x2 < 0) x2 = 0; | |
1201 | - if (x1 >= w32g_wrd_wnd.row) x1 = w32g_wrd_wnd.row - 1; | |
1202 | - if (x2 >= w32g_wrd_wnd.row) x2 = w32g_wrd_wnd.row - 1; | |
1203 | - if (y1 < 0) y1 = 0; if (y2 < 0) y2 = 0; | |
1204 | - if (y1 >= w32g_wrd_wnd.row) y1 = w32g_wrd_wnd.col - 1; | |
1205 | - if (y2 >= w32g_wrd_wnd.row) y2 = w32g_wrd_wnd.col - 1; | |
1206 | - wrd_wnd_lock(); | |
1207 | - if (mode == 0) { | |
1208 | - int dx = x2 - x1 + 1; | |
1209 | - for (y = y1 + 1; y <= y2; y++) { | |
1210 | - CopyMemory(&w32g_wrd_wnd.textbuf[y - 1][x1], | |
1211 | - &w32g_wrd_wnd.textbuf[y][x1], dx); | |
1212 | - CopyMemory(&w32g_wrd_wnd.forecolorbuf[y - 1][x1], | |
1213 | - &w32g_wrd_wnd.forecolorbuf[y][x1], dx); | |
1214 | - CopyMemory(&w32g_wrd_wnd.backcolorbuf[y - 1][x1], | |
1215 | - &w32g_wrd_wnd.backcolorbuf[y][x1], dx); | |
1216 | - CopyMemory(&w32g_wrd_wnd.attrbuf[y - 1][x1], | |
1217 | - &w32g_wrd_wnd.attrbuf[y][x1], dx); | |
1218 | - } | |
1219 | - WrdWndCurStateSaveAndRestore(1); | |
1220 | - WrdWndSetAttr98(color); | |
1221 | - for (x = x1; x <= x2; x++) { | |
1222 | - w32g_wrd_wnd.textbuf[y2][x] = c; | |
1223 | - w32g_wrd_wnd.forecolorbuf[y2][x] = w32g_wrd_wnd.curforecolor; | |
1224 | - w32g_wrd_wnd.backcolorbuf[y2][x] = w32g_wrd_wnd.curbackcolor; | |
1225 | - w32g_wrd_wnd.attrbuf[y2][x] = w32g_wrd_wnd.curattr; | |
1226 | - } | |
1227 | - WrdWndCurStateSaveAndRestore(0); | |
1228 | - } else if (mode == 1) { | |
1229 | - int dx = x2 - x1 + 1; | |
1230 | - for (y = y2 - 1; y >= y1; y--) { | |
1231 | - CopyMemory(&w32g_wrd_wnd.textbuf[y + 1][x1], | |
1232 | - &w32g_wrd_wnd.textbuf[y][x1], dx); | |
1233 | - CopyMemory(&w32g_wrd_wnd.forecolorbuf[y + 1][x1], | |
1234 | - &w32g_wrd_wnd.forecolorbuf[y], dx); | |
1235 | - CopyMemory(&w32g_wrd_wnd.backcolorbuf[y + 1][x1], | |
1236 | - &w32g_wrd_wnd.backcolorbuf[y][x1], dx); | |
1237 | - CopyMemory(&w32g_wrd_wnd.attrbuf[y + 1][x1], | |
1238 | - &w32g_wrd_wnd.attrbuf[y][x1], dx); | |
1239 | - } | |
1240 | - WrdWndCurStateSaveAndRestore(1); | |
1241 | - WrdWndSetAttr98(color); | |
1242 | - for (x = x1; x <= x2; x++) { | |
1243 | - w32g_wrd_wnd.textbuf[y1][x] = c; | |
1244 | - w32g_wrd_wnd.forecolorbuf[y1][x] = w32g_wrd_wnd.curforecolor; | |
1245 | - w32g_wrd_wnd.backcolorbuf[y1][x] = w32g_wrd_wnd.curbackcolor; | |
1246 | - w32g_wrd_wnd.attrbuf[y1][x] = w32g_wrd_wnd.curattr; | |
1247 | - } | |
1248 | - WrdWndCurStateSaveAndRestore(0); | |
1249 | - } else if (mode == 2) { | |
1250 | - for (y = y1; y <= y2; y++) { | |
1251 | - for (x = x1 + 1; x <= x2; x++) { | |
1252 | - w32g_wrd_wnd.textbuf[y][x] | |
1253 | - = w32g_wrd_wnd.textbuf[y][x - 1]; | |
1254 | - w32g_wrd_wnd.forecolorbuf[y][x] | |
1255 | - = w32g_wrd_wnd.forecolorbuf[y][x - 1]; | |
1256 | - w32g_wrd_wnd.backcolorbuf[y][x] | |
1257 | - = w32g_wrd_wnd.backcolorbuf[y][x - 1]; | |
1258 | - w32g_wrd_wnd.attrbuf[y][x] | |
1259 | - = w32g_wrd_wnd.attrbuf[y][x - 1]; | |
1260 | - } | |
1261 | - } | |
1262 | - WrdWndCurStateSaveAndRestore(1); | |
1263 | - WrdWndSetAttr98(color); | |
1264 | - for (y = y1; y <= y2; y++) { | |
1265 | - w32g_wrd_wnd.textbuf[y][x1] = c; | |
1266 | - w32g_wrd_wnd.forecolorbuf[y][x1] = w32g_wrd_wnd.curforecolor; | |
1267 | - w32g_wrd_wnd.backcolorbuf[y][x1] = w32g_wrd_wnd.curbackcolor; | |
1268 | - w32g_wrd_wnd.attrbuf[y][x1] = w32g_wrd_wnd.curattr; | |
1269 | - } | |
1270 | - WrdWndCurStateSaveAndRestore(0); | |
1271 | - } else if (mode == 3) { | |
1272 | - for (y = y1; y <= y2; y++) { | |
1273 | - for (x = x2 - 1; x >= x1; x--) { | |
1274 | - w32g_wrd_wnd.textbuf[y][x] | |
1275 | - = w32g_wrd_wnd.textbuf[y][x + 1]; | |
1276 | - w32g_wrd_wnd.forecolorbuf[y][x] | |
1277 | - = w32g_wrd_wnd.forecolorbuf[y][x + 1]; | |
1278 | - w32g_wrd_wnd.backcolorbuf[y][x] | |
1279 | - = w32g_wrd_wnd.backcolorbuf[y][x + 1]; | |
1280 | - w32g_wrd_wnd.attrbuf[y][x] | |
1281 | - = w32g_wrd_wnd.attrbuf[y][x + 1]; | |
1282 | - } | |
1283 | - } | |
1284 | - WrdWndCurStateSaveAndRestore(1); | |
1285 | - WrdWndSetAttr98(color); | |
1286 | - for (y = y1; y <= y2; y++) { | |
1287 | - w32g_wrd_wnd.textbuf[y][x2] = c; | |
1288 | - w32g_wrd_wnd.forecolorbuf[y][x2] = w32g_wrd_wnd.curforecolor; | |
1289 | - w32g_wrd_wnd.backcolorbuf[y][x2] = w32g_wrd_wnd.curbackcolor; | |
1290 | - w32g_wrd_wnd.attrbuf[y][x2] = w32g_wrd_wnd.curattr; | |
1291 | - } | |
1292 | - WrdWndCurStateSaveAndRestore(0); | |
1293 | - } | |
1294 | - wrd_wnd_unlock(); | |
1295 | - wrd_text_update(x1, y1, x2, y2, TRUE); | |
1296 | -} | |
1297 | - | |
1298 | -void wrd_start_skip(void) | |
1193 | + int x, y; | |
1194 | + x1--; x2--; y1--; y2--; | |
1195 | + if ( !w32g_wrd_wnd.active ) return; | |
1196 | + if ( x1 > x2 ) return; | |
1197 | + if ( y1 > y2 ) return; | |
1198 | + if ( x1 < 0 ) x1 = 0; if ( x2 < 0 ) x2 = 0; | |
1199 | + if ( x1 >= w32g_wrd_wnd.row ) x1 = w32g_wrd_wnd.row - 1; | |
1200 | + if ( x2 >= w32g_wrd_wnd.row ) x2 = w32g_wrd_wnd.row - 1; | |
1201 | + if ( y1 < 0 ) y1 = 0; if ( y2 < 0 ) y2 = 0; | |
1202 | + if ( y1 >= w32g_wrd_wnd.row ) y1 = w32g_wrd_wnd.col - 1; | |
1203 | + if ( y2 >= w32g_wrd_wnd.row ) y2 = w32g_wrd_wnd.col - 1; | |
1204 | + wrd_wnd_lock(); | |
1205 | + if ( mode == 0 ) { | |
1206 | + int dx = x2 - x1 + 1; | |
1207 | + for ( y = y1+1; y <= y2; y ++ ) { | |
1208 | + memcpy ( &w32g_wrd_wnd.textbuf [ y - 1 ][x1], | |
1209 | + &w32g_wrd_wnd.textbuf [ y ][x1], dx ); | |
1210 | + memcpy ( &w32g_wrd_wnd.forecolorbuf [ y - 1 ][x1], | |
1211 | + &w32g_wrd_wnd.forecolorbuf [ y ][x1], dx ); | |
1212 | + memcpy ( &w32g_wrd_wnd.backcolorbuf [ y - 1 ][x1], | |
1213 | + &w32g_wrd_wnd.backcolorbuf [ y ][x1], dx ); | |
1214 | + memcpy ( &w32g_wrd_wnd.attrbuf [ y - 1 ][x1], | |
1215 | + &w32g_wrd_wnd.attrbuf [ y ][x1], dx ); | |
1216 | + } | |
1217 | + WrdWndCurStateSaveAndRestore ( 1 ); | |
1218 | + WrdWndSetAttr98 ( color ); | |
1219 | + for ( x = x1; x <= x2; x ++ ) { | |
1220 | + w32g_wrd_wnd.textbuf [ y2][x] = c; | |
1221 | + w32g_wrd_wnd.forecolorbuf [ y2][x] = w32g_wrd_wnd.curforecolor; | |
1222 | + w32g_wrd_wnd.backcolorbuf [ y2][x] = w32g_wrd_wnd.curbackcolor; | |
1223 | + w32g_wrd_wnd.attrbuf [ y2][x] = w32g_wrd_wnd.curattr; | |
1224 | + } | |
1225 | + WrdWndCurStateSaveAndRestore ( 0 ); | |
1226 | + } else if ( mode == 1 ) { | |
1227 | + int dx = x2 - x1 + 1; | |
1228 | + for ( y = y2 - 1; y >= y1; y -- ) { | |
1229 | + memcpy ( &w32g_wrd_wnd.textbuf [ y + 1 ][x1], | |
1230 | + &w32g_wrd_wnd.textbuf [ y ][x1], dx ); | |
1231 | + memcpy ( &w32g_wrd_wnd.forecolorbuf [ y + 1 ][x1], | |
1232 | + &w32g_wrd_wnd.forecolorbuf [ y ], dx ); | |
1233 | + memcpy ( &w32g_wrd_wnd.backcolorbuf [ y + 1 ][x1], | |
1234 | + &w32g_wrd_wnd.backcolorbuf [ y ][x1], dx ); | |
1235 | + memcpy ( &w32g_wrd_wnd.attrbuf [ y + 1 ][x1], | |
1236 | + &w32g_wrd_wnd.attrbuf [ y ][x1], dx ); | |
1237 | + } | |
1238 | + WrdWndCurStateSaveAndRestore ( 1 ); | |
1239 | + WrdWndSetAttr98 ( color ); | |
1240 | + for ( x = x1; x <= x2; x ++ ) { | |
1241 | + w32g_wrd_wnd.textbuf [ y1][x] = c; | |
1242 | + w32g_wrd_wnd.forecolorbuf [ y1][x] = w32g_wrd_wnd.curforecolor; | |
1243 | + w32g_wrd_wnd.backcolorbuf [ y1][x] = w32g_wrd_wnd.curbackcolor; | |
1244 | + w32g_wrd_wnd.attrbuf [ y1][x] = w32g_wrd_wnd.curattr; | |
1245 | + } | |
1246 | + WrdWndCurStateSaveAndRestore ( 0 ); | |
1247 | + } else if ( mode == 2 ) { | |
1248 | + for ( y = y1; y <= y2; y ++ ) { | |
1249 | + for ( x = x1+1; x <= x2; x ++ ) { | |
1250 | + w32g_wrd_wnd.textbuf [ y ][ x ] | |
1251 | + = w32g_wrd_wnd.textbuf [ y ][ x - 1]; | |
1252 | + w32g_wrd_wnd.forecolorbuf[ y ][ x ] | |
1253 | + = w32g_wrd_wnd.forecolorbuf [ y ][ x - 1]; | |
1254 | + w32g_wrd_wnd.backcolorbuf [ y ][ x ] | |
1255 | + = w32g_wrd_wnd.backcolorbuf [ y ][ x - 1]; | |
1256 | + w32g_wrd_wnd.attrbuf [ y ][ x ] | |
1257 | + = w32g_wrd_wnd.attrbuf [ y ][ x - 1]; | |
1258 | + } | |
1259 | + } | |
1260 | + WrdWndCurStateSaveAndRestore ( 1 ); | |
1261 | + WrdWndSetAttr98 ( color ); | |
1262 | + for ( y = y1; y <= y2; y ++ ) { | |
1263 | + w32g_wrd_wnd.textbuf [ y ][ x1] = c; | |
1264 | + w32g_wrd_wnd.forecolorbuf [ y ][ x1] = w32g_wrd_wnd.curforecolor; | |
1265 | + w32g_wrd_wnd.backcolorbuf [ y ][ x1] = w32g_wrd_wnd.curbackcolor; | |
1266 | + w32g_wrd_wnd.attrbuf [ y ][ x1] = w32g_wrd_wnd.curattr; | |
1267 | + } | |
1268 | + WrdWndCurStateSaveAndRestore ( 0 ); | |
1269 | + } else if ( mode == 3 ) { | |
1270 | + for ( y = y1; y <= y2; y ++ ) { | |
1271 | + for ( x = x2 - 1; x >= x1; x -- ) { | |
1272 | + w32g_wrd_wnd.textbuf [ y ][ x ] | |
1273 | + = w32g_wrd_wnd.textbuf [ y ][ x + 1]; | |
1274 | + w32g_wrd_wnd.forecolorbuf[ y ][ x ] | |
1275 | + = w32g_wrd_wnd.forecolorbuf [ y ][ x + 1]; | |
1276 | + w32g_wrd_wnd.backcolorbuf [ y ][ x ] | |
1277 | + = w32g_wrd_wnd.backcolorbuf [ y ][ x + 1]; | |
1278 | + w32g_wrd_wnd.attrbuf [ y ][ x ] | |
1279 | + = w32g_wrd_wnd.attrbuf [ y ][ x + 1]; | |
1280 | + } | |
1281 | + } | |
1282 | + WrdWndCurStateSaveAndRestore ( 1 ); | |
1283 | + WrdWndSetAttr98 ( color ); | |
1284 | + for ( y = y1; y <= y2; y ++ ) { | |
1285 | + w32g_wrd_wnd.textbuf [ y ][ x2] = c; | |
1286 | + w32g_wrd_wnd.forecolorbuf [ y ][ x2] = w32g_wrd_wnd.curforecolor; | |
1287 | + w32g_wrd_wnd.backcolorbuf [ y ][ x2] = w32g_wrd_wnd.curbackcolor; | |
1288 | + w32g_wrd_wnd.attrbuf [ y ][ x2] = w32g_wrd_wnd.curattr; | |
1289 | + } | |
1290 | + WrdWndCurStateSaveAndRestore ( 0 ); | |
1291 | + } | |
1292 | + wrd_wnd_unlock(); | |
1293 | + wrd_text_update ( x1, y1, x2, y2, TRUE ); | |
1294 | +} | |
1295 | + | |
1296 | +void wrd_start_skip ( void ) | |
1299 | 1297 | { |
1300 | - wrd_wnd_lock(); | |
1301 | - w32g_wrd_wnd.draw_skip = 1; | |
1302 | - wrd_wnd_unlock(); | |
1298 | + wrd_wnd_lock(); | |
1299 | + w32g_wrd_wnd.draw_skip = 1; | |
1300 | + wrd_wnd_unlock(); | |
1303 | 1301 | } |
1304 | 1302 | |
1305 | -void wrd_end_skip(void) | |
1303 | +void wrd_end_skip ( void ) | |
1306 | 1304 | { |
1307 | - w32g_wrd_wnd.draw_skip = 0; | |
1308 | - wrd_text_update(0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height, TRUE); | |
1305 | + w32g_wrd_wnd.draw_skip = 0; | |
1306 | + wrd_text_update ( 0, 0, w32g_wrd_wnd.width, w32g_wrd_wnd.height, TRUE ); | |
1309 | 1307 | } |
1310 | 1308 | |
1311 | -void wrd_graphic_xcopy(int sx1, int sy1, int sx2, int sy2, int tx, int ty, int ss, int ts, int method, | |
1312 | - int opt1, int opt2, int opt3, int opt4, int opt5) | |
1309 | +void wrd_graphic_xcopy ( int sx1, int sy1, int sx2, int sy2, int tx, int ty, int ss, int ts, int method, | |
1310 | + int opt1, int opt2, int opt3, int opt4, int opt5 ) | |
1313 | 1311 | { |
1314 | 1312 | #if 0 |
1315 | - int x, y, d, size = w32g_wrd_wnd.width * w32g_wrd_wnd.height; | |
1316 | - | |
1317 | - if (WrdWndInfo.GraphicStop) return; | |
1318 | - if (!w32g_wrd_wnd.active) return; | |
1319 | - | |
1320 | - if (ss < 0 || ss >= 2 || ts < 0 || ts >= 2) return; | |
1321 | - if (sx1 < 0 || sx1 >= w32g_wrd_wnd.width) return; | |
1322 | - if (sy1 < 0 || sy1 >= w32g_wrd_wnd.height) return; | |
1323 | - if (tx < 0 || tx >= w32g_wrd_wnd.width) return; | |
1324 | - if (ty < 0 || ty >= w32g_wrd_wnd.height) return; | |
1325 | - wrd_wnd_lock(); | |
1326 | - GdiFlush(); | |
1327 | - if (tx + sx2 - sx1 >= w32g_wrd_wnd.width) { | |
1328 | - d = w32g_wrd_wnd.width - 1 - tx; | |
1329 | - sx2 = sx1 + d; | |
1330 | - } | |
1331 | - if (ty + sy2 - sy1 >= w32g_wrd_wnd.height) { | |
1332 | - d = w32g_wrd_wnd.height - 1 - ty; | |
1333 | - sy2 = sy1 + d; | |
1334 | - } | |
1335 | - switch (method) { | |
1336 | - case 0: // COPY | |
1337 | - d = sx2 - sx1 + 1; | |
1338 | - for (y = sy1; y <= sy2; y++) { | |
1339 | - int i_src = y * w32g_wrd_wnd.width; | |
1340 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1341 | - CopyMemory(&w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest + tx], | |
1342 | - &w32g_wrd_wnd.graphic_dib[ss]->bits[i_src + sx1], d); | |
1343 | - } | |
1344 | - break; | |
1345 | - case 1: // COPY EXCEPT 0 | |
1346 | - for (y = sy1; y <= sy2; y++) { | |
1347 | - int i_src = y * w32g_wrd_wnd.width; | |
1348 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1349 | - for (x = sx1; x <= sx2; x++) { | |
1350 | - int i_src_tmp = i_src + x; | |
1351 | - int i_dest_tmp = i_dest + tx + x - sx1; | |
1352 | - char c = w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1353 | - if (c != 0) | |
1354 | - w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] = c; | |
1355 | - } | |
1356 | - } | |
1357 | - break; | |
1358 | - case 2: // XOR | |
1359 | - for (y = sy1; y <= sy2; y++) { | |
1360 | - int i_src = y * w32g_wrd_wnd.width; | |
1361 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1362 | - for (x = sx1; x <= sx2; x++) { | |
1363 | - int i_src_tmp = i_src + x; | |
1364 | - int i_dest_tmp = i_dest + tx + x - sx1; | |
1365 | - w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] ^= w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1366 | - } | |
1367 | - } | |
1368 | - break; | |
1369 | - case 3: // AND | |
1370 | - for (y = sy1; y <= sy2; y++) { | |
1371 | - int i_src = y * w32g_wrd_wnd.width; | |
1372 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1373 | - for (x = sx1; x <= sx2; x++) { | |
1374 | - int i_src_tmp = i_src + x; | |
1375 | - int i_dest_tmp = i_dest + tx + x - sx1; | |
1376 | - w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] &= w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1377 | - } | |
1378 | - } | |
1379 | - break; | |
1380 | - case 4: // OR | |
1381 | - for (y = sy1; y <= sy2; y++) { | |
1382 | - int i_src = y * w32g_wrd_wnd.width; | |
1383 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1384 | - for (x = sx1; x <= sx2; x++) { | |
1385 | - int i_src_tmp = i_src + x; | |
1386 | - int i_dest_tmp = i_dest + tx + x - sx1; | |
1387 | - w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] |= w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1388 | - } | |
1389 | - } | |
1390 | - break; | |
1391 | - case 5: // X REVERSE | |
1392 | - for (y = sy1; y <= sy2; y++) { | |
1393 | - int i_src = y * w32g_wrd_wnd.width; | |
1394 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1395 | - for (x = sx1; x <= sx2; x++) { | |
1396 | - int i_src_tmp = i_src + x; | |
1397 | - int i_dest_tmp = i_dest + tx + sx2 - x; | |
1398 | - w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] |= w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1399 | - } | |
1400 | - } | |
1401 | - break; | |
1402 | - case 6: // Y REVERSE | |
1403 | - d = sx2 - sx1 + 1; | |
1404 | - for (y = sy1; y <= sy2; y++) { | |
1405 | - int i_src = (sy1 + sy2 - y) * w32g_wrd_wnd.width; | |
1406 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1407 | - CopyMemory(&w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest + tx], | |
1408 | - &w32g_wrd_wnd.graphic_dib[ss]->bits[i_src + sx1], d); | |
1409 | - } | |
1410 | - break; | |
1411 | - case 7: // X Y REVERSE | |
1412 | - for (y = sy1; y <= sy2; y++) { | |
1413 | - int i_src = (sy1 + sy2 - y) * w32g_wrd_wnd.width; | |
1414 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1415 | - for (x = sx1; x <= sx2; x++) { | |
1416 | - int i_src_tmp = i_src + x; | |
1417 | - int i_dest_tmp = i_dest + tx + sx2 - x; | |
1418 | - w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] |= w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1419 | - } | |
1420 | - } | |
1421 | - break; | |
1422 | - case 8: // COPY2 | |
1423 | - for (y = sy1; y <= sy2; y++) { | |
1424 | - int i_src = y * w32g_wrd_wnd.width; | |
1425 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1426 | - for (x = sx1; x <= sx2; x++) { | |
1427 | - int i_src_tmp = i_src + x; | |
1428 | - int i_dest_tmp = i_dest + tx + x - sx1; | |
1429 | - char c = w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1430 | - if (c != 0) | |
1431 | - w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] = c; | |
1432 | - else { | |
1433 | - i_src_tmp = (opt2 + y - sy1) * w32g_wrd_wnd.width + opt1 + x - sx1; | |
1434 | - if (0 <= i_src_tmp && i_src_tmp < size) | |
1435 | - w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] = w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1436 | - } | |
1437 | - } | |
1438 | - } | |
1439 | - break; | |
1440 | - case 9: // ちょっとわからなかった。 | |
1441 | - break; | |
1442 | - case 10: // COPY opt1, opt2 | |
1443 | - if (opt1 < 0 || opt2 < 0) | |
1444 | - break; | |
1445 | - d = sx2 - sx1 + 1; | |
1446 | - for (y = sy1; y <= sy2; y++) { | |
1447 | - int i_src, i_dest; | |
1448 | - if ((y - sy1) % (opt1 + opt2) >= opt2) | |
1449 | - continue; | |
1450 | - i_src = y * w32g_wrd_wnd.width; | |
1451 | - i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1452 | - CopyMemory(&w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest + tx], | |
1453 | - &w32g_wrd_wnd.graphic_dib[ss]->bits[i_src + sx1], d); | |
1454 | - } | |
1455 | - break; | |
1456 | - case 11: // Clipping Copy ふつうのコピーで代用。 | |
1457 | - d = sx2 - sx1 + 1; | |
1458 | - for (y = sy1; y <= sy2; y++) { | |
1459 | - int i_src = y * w32g_wrd_wnd.width; | |
1460 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1461 | - CopyMemory(&w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest + tx], | |
1462 | - &w32g_wrd_wnd.graphic_dib[ss]->bits[i_src + sx1], d); | |
1463 | - } | |
1464 | - break; | |
1465 | - case 12: // PLANE COPY | |
1466 | - if (opt1 < 0 || opt1 >= 4 || opt2 < 0 || opt2 >= 4) | |
1467 | - break; | |
1468 | - for (y = sy1; y <= sy2; y++) { | |
1469 | - int i_src = y * w32g_wrd_wnd.width; | |
1470 | - int i_dest = (ty + y - sy1) * w32g_wrd_wnd.width; | |
1471 | - for (x = sx1; x <= sx2; x++) { | |
1472 | - int i_src_tmp = i_src + x; | |
1473 | - int i_dest_tmp = i_dest + tx + x - sx1; | |
1474 | - char c = w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1475 | - c = ((c & (1L << opt1)) >> opt1) << opt2; | |
1476 | - w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] = c; | |
1477 | - } | |
1478 | - } | |
1479 | - break; | |
1480 | - default: | |
1481 | - break; | |
1482 | - } | |
1483 | - wrd_wnd_unlock(); | |
1484 | - if (w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display) { | |
1485 | - RECT rc; | |
1486 | - SetRect(&rc, tx, ty, tx + sx2 - sx1, ty + sy2 - sy1); | |
1487 | - wrd_graphic_apply(&rc, w32g_wrd_wnd.index_display, TRUE); | |
1488 | - wrd_graphic_update(&rc, TRUE); | |
1489 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
1490 | - } | |
1313 | + int x, y, d, size = w32g_wrd_wnd.width * w32g_wrd_wnd.height; | |
1314 | + | |
1315 | + if ( WrdWndInfo.GraphicStop ) return; | |
1316 | + if ( !w32g_wrd_wnd.active ) return; | |
1317 | + | |
1318 | + if ( ss < 0 || ss >= 2 || ts < 0 || ts >= 2 ) return; | |
1319 | + if ( sx1 < 0 || sx1 >= w32g_wrd_wnd.width ) return; | |
1320 | + if ( sy1 < 0 || sy1 >= w32g_wrd_wnd.height ) return; | |
1321 | + if ( tx < 0 || tx >= w32g_wrd_wnd.width ) return; | |
1322 | + if ( ty < 0 || ty >= w32g_wrd_wnd.height ) return; | |
1323 | + wrd_wnd_lock(); | |
1324 | + GdiFlush (); | |
1325 | + if ( tx + sx2 - sx1 >= w32g_wrd_wnd.width ) { | |
1326 | + d = w32g_wrd_wnd.width - 1 - tx; | |
1327 | + sx2 = sx1 + d; | |
1328 | + } | |
1329 | + if ( ty + sy2 - sy1 >= w32g_wrd_wnd.height ) { | |
1330 | + d = w32g_wrd_wnd.height - 1 - ty; | |
1331 | + sy2 = sy1 + d; | |
1332 | + } | |
1333 | + switch ( method ) { | |
1334 | + case 0: // COPY | |
1335 | + d = sx2 - sx1 + 1; | |
1336 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1337 | + int i_src = y * w32g_wrd_wnd.width; | |
1338 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1339 | + memcpy ( &w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest + tx], | |
1340 | + &w32g_wrd_wnd.graphic_dib[ss]->bits[i_src + sx1], d ); | |
1341 | + } | |
1342 | + break; | |
1343 | + case 1: // COPY EXCEPT 0 | |
1344 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1345 | + int i_src = y * w32g_wrd_wnd.width; | |
1346 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1347 | + for ( x = sx1; x <= sx2; x ++ ) { | |
1348 | + int i_src_tmp = i_src + x; | |
1349 | + int i_dest_tmp = i_dest + tx + x - sx1; | |
1350 | + char c = w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1351 | + if ( c != 0 ) | |
1352 | + w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] = c; | |
1353 | + } | |
1354 | + } | |
1355 | + break; | |
1356 | + case 2: // XOR | |
1357 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1358 | + int i_src = y * w32g_wrd_wnd.width; | |
1359 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1360 | + for ( x = sx1; x <= sx2; x ++ ) { | |
1361 | + int i_src_tmp = i_src + x; | |
1362 | + int i_dest_tmp = i_dest + tx + x - sx1; | |
1363 | + w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] ^= w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1364 | + } | |
1365 | + } | |
1366 | + break; | |
1367 | + case 3: // AND | |
1368 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1369 | + int i_src = y * w32g_wrd_wnd.width; | |
1370 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1371 | + for ( x = sx1; x <= sx2; x ++ ) { | |
1372 | + int i_src_tmp = i_src + x; | |
1373 | + int i_dest_tmp = i_dest + tx + x - sx1; | |
1374 | + w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] &= w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1375 | + } | |
1376 | + } | |
1377 | + break; | |
1378 | + case 4: // OR | |
1379 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1380 | + int i_src = y * w32g_wrd_wnd.width; | |
1381 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1382 | + for ( x = sx1; x <= sx2; x ++ ) { | |
1383 | + int i_src_tmp = i_src + x; | |
1384 | + int i_dest_tmp = i_dest + tx + x - sx1; | |
1385 | + w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] |= w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1386 | + } | |
1387 | + } | |
1388 | + break; | |
1389 | + case 5: // X REVERSE | |
1390 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1391 | + int i_src = y * w32g_wrd_wnd.width; | |
1392 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1393 | + for ( x = sx1; x <= sx2; x ++ ) { | |
1394 | + int i_src_tmp = i_src + x; | |
1395 | + int i_dest_tmp = i_dest + tx + sx2 - x; | |
1396 | + w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] |= w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1397 | + } | |
1398 | + } | |
1399 | + break; | |
1400 | + case 6: // Y REVERSE | |
1401 | + d = sx2 - sx1 + 1; | |
1402 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1403 | + int i_src = ( sy1 + sy2 - y ) * w32g_wrd_wnd.width; | |
1404 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1405 | + memcpy ( &w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest + tx], | |
1406 | + &w32g_wrd_wnd.graphic_dib[ss]->bits[i_src + sx1], d ); | |
1407 | + } | |
1408 | + break; | |
1409 | + case 7: // X Y REVERSE | |
1410 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1411 | + int i_src = ( sy1 + sy2 - y ) * w32g_wrd_wnd.width; | |
1412 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1413 | + for ( x = sx1; x <= sx2; x ++ ) { | |
1414 | + int i_src_tmp = i_src + x; | |
1415 | + int i_dest_tmp = i_dest + tx + sx2 - x; | |
1416 | + w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] |= w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1417 | + } | |
1418 | + } | |
1419 | + break; | |
1420 | + case 8: // COPY2 | |
1421 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1422 | + int i_src = y * w32g_wrd_wnd.width; | |
1423 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1424 | + for ( x = sx1; x <= sx2; x ++ ) { | |
1425 | + int i_src_tmp = i_src + x; | |
1426 | + int i_dest_tmp = i_dest + tx + x - sx1; | |
1427 | + char c = w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1428 | + if ( c != 0 ) | |
1429 | + w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] = c; | |
1430 | + else { | |
1431 | + i_src_tmp = ( opt2 + y - sy1) * w32g_wrd_wnd.width + opt1 + x - sx1; | |
1432 | + if ( 0 <= i_src_tmp && i_src_tmp < size ) | |
1433 | + w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] = w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1434 | + } | |
1435 | + } | |
1436 | + } | |
1437 | + break; | |
1438 | + case 9: // ちょっとわからなかった。 | |
1439 | + break; | |
1440 | + case 10: // COPY opt1, opt2 | |
1441 | + if ( opt1 < 0 || opt2 < 0 ) | |
1442 | + break; | |
1443 | + d = sx2 - sx1 + 1; | |
1444 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1445 | + int i_src, i_dest; | |
1446 | + if ( (y - sy1) % ( opt1 + opt2 ) >= opt2 ) | |
1447 | + continue; | |
1448 | + i_src = y * w32g_wrd_wnd.width; | |
1449 | + i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1450 | + memcpy ( &w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest + tx], | |
1451 | + &w32g_wrd_wnd.graphic_dib[ss]->bits[i_src + sx1], d ); | |
1452 | + } | |
1453 | + break; | |
1454 | + case 11: // Clipping Copy ふつうのコピーで代用。 | |
1455 | + d = sx2 - sx1 + 1; | |
1456 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1457 | + int i_src = y * w32g_wrd_wnd.width; | |
1458 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1459 | + memcpy ( &w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest + tx], | |
1460 | + &w32g_wrd_wnd.graphic_dib[ss]->bits[i_src + sx1], d ); | |
1461 | + } | |
1462 | + break; | |
1463 | + case 12: // PLANE COPY | |
1464 | + if ( opt1 < 0 || opt1 >= 4 || opt2 < 0 || opt2 >= 4 ) | |
1465 | + break; | |
1466 | + for ( y = sy1; y <= sy2; y ++ ) { | |
1467 | + int i_src = y * w32g_wrd_wnd.width; | |
1468 | + int i_dest = ( ty + y - sy1) * w32g_wrd_wnd.width; | |
1469 | + for ( x = sx1; x <= sx2; x ++ ) { | |
1470 | + int i_src_tmp = i_src + x; | |
1471 | + int i_dest_tmp = i_dest + tx + x - sx1; | |
1472 | + char c = w32g_wrd_wnd.graphic_dib[ss]->bits[i_src_tmp]; | |
1473 | + c = ( ( c & ( 1 << opt1) ) >> opt1 ) << opt2; | |
1474 | + w32g_wrd_wnd.graphic_dib[ts]->bits[i_dest_tmp] = c; | |
1475 | + } | |
1476 | + } | |
1477 | + break; | |
1478 | + default: | |
1479 | + break; | |
1480 | + } | |
1481 | + wrd_wnd_unlock(); | |
1482 | + if ( w32g_wrd_wnd.index_active == w32g_wrd_wnd.index_display ) { | |
1483 | + RECT rc; | |
1484 | + SetRect ( &rc, tx, ty, tx + sx2 - sx1, ty + sy2 - sy1 ); | |
1485 | + wrd_graphic_apply ( &rc, w32g_wrd_wnd.index_display, TRUE ); | |
1486 | + wrd_graphic_update ( &rc, TRUE ); | |
1487 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
1488 | + } | |
1491 | 1489 | #endif |
1492 | 1490 | } |
1493 | 1491 | |
1494 | 1492 | void WrdWndReset(void) |
1495 | 1493 | { |
1496 | - int i; | |
1497 | - wrd_wnd_lock(); | |
1498 | - w32g_wrd_wnd.curposx = 0; | |
1499 | - w32g_wrd_wnd.curposy = 0; | |
1500 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1501 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1502 | - w32g_wrd_wnd.curattr = 0; | |
1503 | - for (i = 0; i < w32g_wrd_wnd.col; i++) { | |
1504 | - FillMemory(w32g_wrd_wnd.textbuf[i], w32g_wrd_wnd.row, 0x20); | |
1505 | - FillMemory(w32g_wrd_wnd.forecolorbuf[i], w32g_wrd_wnd.row, w32g_wrd_wnd.curforecolor); | |
1506 | - FillMemory(w32g_wrd_wnd.backcolorbuf[i], w32g_wrd_wnd.row, w32g_wrd_wnd.curbackcolor); | |
1507 | - FillMemory(w32g_wrd_wnd.attrbuf[i], w32g_wrd_wnd.row, w32g_wrd_wnd.curattr); | |
1508 | - } | |
1509 | - wrd_graphic_pal_init_flag = 0; | |
1510 | - wrd_wnd_unlock(); | |
1511 | - wrd_text_update(0, 0, w32g_wrd_wnd.row - 1, w32g_wrd_wnd.col - 1, TRUE); | |
1512 | - wrd_graphic_ginit(); | |
1494 | + int i; | |
1495 | + wrd_wnd_lock(); | |
1496 | + w32g_wrd_wnd.curposx = 0; | |
1497 | + w32g_wrd_wnd.curposy = 0; | |
1498 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1499 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1500 | + w32g_wrd_wnd.curattr = 0; | |
1501 | + for ( i = 0; i < w32g_wrd_wnd.col; i++ ) { | |
1502 | + memset ( w32g_wrd_wnd.textbuf[i], 0x20, w32g_wrd_wnd.row ); | |
1503 | + memset ( w32g_wrd_wnd.forecolorbuf[i], w32g_wrd_wnd.curforecolor, w32g_wrd_wnd.row ); | |
1504 | + memset ( w32g_wrd_wnd.backcolorbuf[i], w32g_wrd_wnd.curbackcolor, w32g_wrd_wnd.row ); | |
1505 | + memset ( w32g_wrd_wnd.attrbuf[i], w32g_wrd_wnd.curattr, w32g_wrd_wnd.row); | |
1506 | + } | |
1507 | + wrd_graphic_pal_init_flag = 0; | |
1508 | + wrd_wnd_unlock(); | |
1509 | + wrd_text_update ( 0, 0, w32g_wrd_wnd.row - 1, w32g_wrd_wnd.col - 1, TRUE ); | |
1510 | + wrd_graphic_ginit (); | |
1513 | 1511 | } |
1514 | 1512 | |
1515 | 1513 | void WrdWndCurStateSaveAndRestore(int saveflag) |
1516 | 1514 | { |
1517 | - static int saved_curposx = 0; | |
1518 | - static int saved_curposy = 0; | |
1519 | - static int saved_curforecolor = W32G_WRDWND_WHITE; | |
1520 | - static int saved_curbackcolor = W32G_WRDWND_BLACK; | |
1521 | - static int saved_curattr = 0; | |
1522 | - if (saveflag) { | |
1523 | - saved_curforecolor = w32g_wrd_wnd.curforecolor; | |
1524 | - saved_curbackcolor = w32g_wrd_wnd.curbackcolor; | |
1525 | - saved_curattr = w32g_wrd_wnd.curattr; | |
1526 | - saved_curposx = w32g_wrd_wnd.curposx; | |
1527 | - saved_curposy = w32g_wrd_wnd.curposy; | |
1528 | - } else { | |
1529 | - w32g_wrd_wnd.curforecolor = saved_curforecolor; | |
1530 | - w32g_wrd_wnd.curbackcolor = saved_curbackcolor; | |
1531 | - w32g_wrd_wnd.curattr = saved_curattr; | |
1532 | - WrdWndGoto(saved_curposx, saved_curposy); | |
1533 | - } | |
1515 | + static int saved_curposx = 0; | |
1516 | + static int saved_curposy = 0; | |
1517 | + static int saved_curforecolor = W32G_WRDWND_WHITE; | |
1518 | + static int saved_curbackcolor = W32G_WRDWND_BLACK; | |
1519 | + static int saved_curattr = 0; | |
1520 | + if ( saveflag ) { | |
1521 | + saved_curforecolor = w32g_wrd_wnd.curforecolor; | |
1522 | + saved_curbackcolor = w32g_wrd_wnd.curbackcolor; | |
1523 | + saved_curattr = w32g_wrd_wnd.curattr; | |
1524 | + saved_curposx = w32g_wrd_wnd.curposx; | |
1525 | + saved_curposy = w32g_wrd_wnd.curposy; | |
1526 | + } else { | |
1527 | + w32g_wrd_wnd.curforecolor = saved_curforecolor; | |
1528 | + w32g_wrd_wnd.curbackcolor = saved_curbackcolor; | |
1529 | + w32g_wrd_wnd.curattr = saved_curattr; | |
1530 | + WrdWndGoto( saved_curposx, saved_curposy ); | |
1531 | + } | |
1534 | 1532 | } |
1535 | 1533 | |
1536 | 1534 | // from_from 行から from_to 行までを to_from 行を先頭にコピー。 |
1537 | -void WrdWndCopyLineS(int from_from, int from_to, int to_from, int lockflag) | |
1535 | +void WrdWndCopyLineS ( int from_from, int from_to, int to_from, int lockflag ) | |
1538 | 1536 | { |
1539 | - int y, to_to; | |
1540 | - if (!w32g_wrd_wnd.active) return; | |
1541 | - if (to_from >= w32g_wrd_wnd.col) return; | |
1542 | - if (to_from == from_from) return; | |
1543 | - if (from_to < from_from) return; | |
1544 | - if (to_from < 0) { | |
1545 | - from_from -= to_from; | |
1546 | - from_to -= to_from; | |
1547 | - to_from = 0; | |
1548 | - } | |
1549 | - to_to = to_from + from_to - from_from; | |
1550 | - if (to_to >= w32g_wrd_wnd.col) | |
1551 | - to_to = w32g_wrd_wnd.col - 1; | |
1552 | - if (lockflag) wrd_wnd_lock(); | |
1553 | - if (to_from < from_from) { | |
1554 | - for (y = to_from; y <= to_to; y++) { | |
1555 | - int y_from = from_from + y - to_from; | |
1556 | - if (y_from < 0 || y_from >= w32g_wrd_wnd.col) { | |
1557 | - FillMemory(w32g_wrd_wnd.textbuf[y], w32g_wrd_wnd.row, 0x20); | |
1558 | - FillMemory(w32g_wrd_wnd.forecolorbuf[y], w32g_wrd_wnd.row, W32G_WRDWND_BLACK); | |
1559 | - FillMemory(w32g_wrd_wnd.backcolorbuf[y], w32g_wrd_wnd.row, W32G_WRDWND_BLACK); | |
1560 | - ZeroMemory(w32g_wrd_wnd.attrbuf[y], w32g_wrd_wnd.row); | |
1561 | - } else { | |
1562 | - CopyMemory(w32g_wrd_wnd.textbuf[y], w32g_wrd_wnd.textbuf[y_from], w32g_wrd_wnd.row); | |
1563 | - CopyMemory(w32g_wrd_wnd.forecolorbuf[y], w32g_wrd_wnd.forecolorbuf[y_from], w32g_wrd_wnd.row); | |
1564 | - CopyMemory(w32g_wrd_wnd.backcolorbuf[y], w32g_wrd_wnd.backcolorbuf[y_from], w32g_wrd_wnd.row); | |
1565 | - CopyMemory(w32g_wrd_wnd.attrbuf[y], w32g_wrd_wnd.attrbuf[y_from], w32g_wrd_wnd.row); | |
1566 | - } | |
1567 | - } | |
1568 | - } else { | |
1569 | - for (y = to_to; y >= to_from; y--) { | |
1570 | - int y_from = from_from + y - to_from; | |
1571 | - if (y_from < 0 || y_from >= w32g_wrd_wnd.col) { | |
1572 | - FillMemory(w32g_wrd_wnd.textbuf[y], w32g_wrd_wnd.row, 0x20); | |
1573 | - FillMemory(w32g_wrd_wnd.forecolorbuf[y], w32g_wrd_wnd.row, W32G_WRDWND_BLACK); | |
1574 | - FillMemory(w32g_wrd_wnd.backcolorbuf[y], w32g_wrd_wnd.row, W32G_WRDWND_BLACK); | |
1575 | - ZeroMemory(w32g_wrd_wnd.attrbuf[y], w32g_wrd_wnd.row); | |
1576 | - } else { | |
1577 | - CopyMemory(w32g_wrd_wnd.textbuf[y], w32g_wrd_wnd.textbuf[y_from], w32g_wrd_wnd.row); | |
1578 | - CopyMemory(w32g_wrd_wnd.forecolorbuf[y], w32g_wrd_wnd.forecolorbuf[y_from], w32g_wrd_wnd.row); | |
1579 | - CopyMemory(w32g_wrd_wnd.backcolorbuf[y], w32g_wrd_wnd.backcolorbuf[y_from], w32g_wrd_wnd.row); | |
1580 | - CopyMemory(w32g_wrd_wnd.attrbuf[y], w32g_wrd_wnd.attrbuf[y_from], w32g_wrd_wnd.row); | |
1581 | - } | |
1582 | - } | |
1583 | - } | |
1584 | - if (lockflag) wrd_wnd_unlock(); | |
1585 | - wrd_text_update(0, to_from, w32g_wrd_wnd.row - 1, to_to, lockflag); | |
1537 | + int y, to_to; | |
1538 | + if ( !w32g_wrd_wnd.active ) return; | |
1539 | + if ( to_from >= w32g_wrd_wnd.col ) return; | |
1540 | + if ( to_from == from_from ) return; | |
1541 | + if ( from_to < from_from ) return; | |
1542 | + if ( to_from < 0 ) { | |
1543 | + from_from -= to_from; | |
1544 | + from_to -= to_from; | |
1545 | + to_from = 0; | |
1546 | + } | |
1547 | + to_to = to_from + from_to - from_from; | |
1548 | + if ( to_to >= w32g_wrd_wnd.col ) | |
1549 | + to_to = w32g_wrd_wnd.col - 1; | |
1550 | + if ( lockflag ) wrd_wnd_lock(); | |
1551 | + if ( to_from < from_from ) { | |
1552 | + for ( y = to_from; y <= to_to; y++ ) { | |
1553 | + int y_from = from_from + y - to_from; | |
1554 | + if ( y_from < 0 || y_from >= w32g_wrd_wnd.col ) { | |
1555 | + memset ( w32g_wrd_wnd.textbuf[y], 0x20, w32g_wrd_wnd.row ); | |
1556 | + memset ( w32g_wrd_wnd.forecolorbuf[y], W32G_WRDWND_BLACK, w32g_wrd_wnd.row ); | |
1557 | + memset ( w32g_wrd_wnd.backcolorbuf[y], W32G_WRDWND_BLACK, w32g_wrd_wnd.row ); | |
1558 | + memset ( w32g_wrd_wnd.attrbuf[y], 0, w32g_wrd_wnd.row); | |
1559 | + } else { | |
1560 | + memcpy ( w32g_wrd_wnd.textbuf[y], w32g_wrd_wnd.textbuf[y_from], w32g_wrd_wnd.row ); | |
1561 | + memcpy ( w32g_wrd_wnd.forecolorbuf[y], w32g_wrd_wnd.forecolorbuf[y_from], w32g_wrd_wnd.row ); | |
1562 | + memcpy ( w32g_wrd_wnd.backcolorbuf[y], w32g_wrd_wnd.backcolorbuf[y_from], w32g_wrd_wnd.row ); | |
1563 | + memcpy ( w32g_wrd_wnd.attrbuf[y], w32g_wrd_wnd.attrbuf[y_from], w32g_wrd_wnd.row ); | |
1564 | + } | |
1565 | + } | |
1566 | + } else { | |
1567 | + for ( y = to_to; y >= to_from; y-- ) { | |
1568 | + int y_from = from_from + y - to_from; | |
1569 | + if ( y_from < 0 || y_from >= w32g_wrd_wnd.col ) { | |
1570 | + memset ( w32g_wrd_wnd.textbuf[y], 0x20, w32g_wrd_wnd.row ); | |
1571 | + memset ( w32g_wrd_wnd.forecolorbuf[y], W32G_WRDWND_BLACK, w32g_wrd_wnd.row ); | |
1572 | + memset ( w32g_wrd_wnd.backcolorbuf[y], W32G_WRDWND_BLACK, w32g_wrd_wnd.row ); | |
1573 | + memset ( w32g_wrd_wnd.attrbuf[y], 0, w32g_wrd_wnd.row); | |
1574 | + } else { | |
1575 | + memcpy ( w32g_wrd_wnd.textbuf[y], w32g_wrd_wnd.textbuf[y_from], w32g_wrd_wnd.row ); | |
1576 | + memcpy ( w32g_wrd_wnd.forecolorbuf[y], w32g_wrd_wnd.forecolorbuf[y_from], w32g_wrd_wnd.row ); | |
1577 | + memcpy ( w32g_wrd_wnd.backcolorbuf[y], w32g_wrd_wnd.backcolorbuf[y_from], w32g_wrd_wnd.row ); | |
1578 | + memcpy ( w32g_wrd_wnd.attrbuf[y], w32g_wrd_wnd.attrbuf[y_from], w32g_wrd_wnd.row ); | |
1579 | + } | |
1580 | + } | |
1581 | + } | |
1582 | + if ( lockflag ) wrd_wnd_unlock(); | |
1583 | + wrd_text_update ( 0, to_from, w32g_wrd_wnd.row - 1, to_to, lockflag ); | |
1586 | 1584 | } |
1587 | 1585 | |
1588 | 1586 | // from 行を to 行にコピー。 |
1589 | -void WrdWndCopyLine(int from, int to, int lockflag) | |
1587 | +void WrdWndCopyLine ( int from, int to, int lockflag ) | |
1590 | 1588 | { |
1591 | - if (!w32g_wrd_wnd.active) return; | |
1592 | - WrdWndCopyLineS(from, from, to, lockflag); | |
1589 | + if ( !w32g_wrd_wnd.active ) return; | |
1590 | + WrdWndCopyLineS ( from, from, to, lockflag ); | |
1593 | 1591 | } |
1594 | 1592 | |
1595 | 1593 | // from行から to 行までクリア |
1596 | 1594 | void WrdWndClearLineFromTo(int from, int to, int lockflag) |
1597 | 1595 | { |
1598 | - int i; | |
1599 | - if (!w32g_wrd_wnd.active) return; | |
1600 | - if (from < 0) from = 0; | |
1601 | - if (from >= w32g_wrd_wnd.col) from = w32g_wrd_wnd.col - 1; | |
1602 | - if (to < 0) to = 0; | |
1603 | - if (to >= w32g_wrd_wnd.col) to = w32g_wrd_wnd.col - 1; | |
1604 | - if (to < from) return; | |
1605 | - if (lockflag) wrd_wnd_lock(); | |
1606 | - for (i = from; i <= to; i++) { | |
1607 | - FillMemory(w32g_wrd_wnd.textbuf[i], w32g_wrd_wnd.row, 0x20); | |
1608 | - FillMemory(w32g_wrd_wnd.forecolorbuf[i], w32g_wrd_wnd.row, W32G_WRDWND_BLACK); | |
1609 | - FillMemory(w32g_wrd_wnd.backcolorbuf[i], w32g_wrd_wnd.row, W32G_WRDWND_BLACK); | |
1610 | - ZeroMemory(w32g_wrd_wnd.attrbuf[i], w32g_wrd_wnd.row); | |
1611 | - } | |
1612 | - if (lockflag) wrd_wnd_unlock(); | |
1613 | - wrd_text_update(0, from, w32g_wrd_wnd.row - 1, to, lockflag); | |
1596 | + int i; | |
1597 | + if ( !w32g_wrd_wnd.active ) return; | |
1598 | + if ( from < 0 ) from = 0; | |
1599 | + if ( from >= w32g_wrd_wnd.col ) from = w32g_wrd_wnd.col - 1; | |
1600 | + if ( to < 0 ) to = 0; | |
1601 | + if ( to >= w32g_wrd_wnd.col ) to = w32g_wrd_wnd.col - 1; | |
1602 | + if ( to < from ) return; | |
1603 | + if ( lockflag ) wrd_wnd_lock(); | |
1604 | + for ( i = from; i <= to; i++ ) { | |
1605 | + memset(w32g_wrd_wnd.textbuf[i], 0x20, w32g_wrd_wnd.row); | |
1606 | + memset(w32g_wrd_wnd.forecolorbuf[i], W32G_WRDWND_BLACK, w32g_wrd_wnd.row); | |
1607 | + memset(w32g_wrd_wnd.backcolorbuf[i], W32G_WRDWND_BLACK, w32g_wrd_wnd.row); | |
1608 | + memset(w32g_wrd_wnd.attrbuf[i], 0, w32g_wrd_wnd.row); | |
1609 | + } | |
1610 | + if ( lockflag ) wrd_wnd_unlock(); | |
1611 | + wrd_text_update ( 0, from, w32g_wrd_wnd.row - 1, to, lockflag ); | |
1614 | 1612 | } |
1615 | 1613 | |
1616 | 1614 | // from 行を to 行に移動。 |
1617 | 1615 | void WrdWndMoveLine(int from, int to, int lockflag) |
1618 | 1616 | { |
1619 | - if (!w32g_wrd_wnd.active) return; | |
1620 | - if (from == to) return; | |
1621 | - if (from < 0 || from >= w32g_wrd_wnd.col) return; | |
1622 | - if (to < 0 || to >= w32g_wrd_wnd.col) return; | |
1623 | - WrdWndCopyLine(from, to, lockflag); | |
1624 | - WrdWndClearLineFromTo(from, from, lockflag); | |
1617 | + if ( !w32g_wrd_wnd.active ) return; | |
1618 | + if ( from == to ) return; | |
1619 | + if ( from < 0 || from >= w32g_wrd_wnd.col ) return; | |
1620 | + if ( to < 0 || to >= w32g_wrd_wnd.col ) return; | |
1621 | + WrdWndCopyLine ( from, to, lockflag ); | |
1622 | + WrdWndClearLineFromTo ( from,from, lockflag ); | |
1625 | 1623 | } |
1626 | 1624 | |
1627 | 1625 | // スクロールダウンする。 |
1628 | 1626 | void WrdWndScrollDown(int lockflag) |
1629 | 1627 | { |
1630 | - if (!w32g_wrd_wnd.active) return; | |
1631 | - WrdWndCopyLineS(0, w32g_wrd_wnd.col - 1, 1, lockflag); | |
1632 | - WrdWndClearLineFromTo(0, 0, lockflag); | |
1628 | + if ( !w32g_wrd_wnd.active ) return; | |
1629 | + WrdWndCopyLineS ( 0, w32g_wrd_wnd.col - 1, 1, lockflag ); | |
1630 | + WrdWndClearLineFromTo ( 0, 0, lockflag ); | |
1633 | 1631 | } |
1634 | 1632 | |
1635 | 1633 | // スクロールアップする。 |
1636 | 1634 | void WrdWndScrollUp(int lockflag) |
1637 | 1635 | { |
1638 | - if (!w32g_wrd_wnd.active) return; | |
1639 | - WrdWndCopyLineS(1, w32g_wrd_wnd.col - 1, 0, lockflag); | |
1640 | - WrdWndClearLineFromTo(w32g_wrd_wnd.col - 1, w32g_wrd_wnd.col - 1, lockflag); | |
1636 | + if ( !w32g_wrd_wnd.active ) return; | |
1637 | + WrdWndCopyLineS ( 1, w32g_wrd_wnd.col - 1, 0, lockflag ); | |
1638 | + WrdWndClearLineFromTo ( w32g_wrd_wnd.col - 1, w32g_wrd_wnd.col - 1, lockflag ); | |
1641 | 1639 | } |
1642 | 1640 | |
1643 | 1641 | // 画面消去 |
1644 | 1642 | void WrdWndClear(int lockflag) |
1645 | 1643 | { |
1646 | - if (!w32g_wrd_wnd.active) return; | |
1647 | - WrdWndClearLineFromTo(0, w32g_wrd_wnd.col - 1, lockflag); | |
1644 | + if ( !w32g_wrd_wnd.active ) return; | |
1645 | + WrdWndClearLineFromTo ( 0, w32g_wrd_wnd.col - 1, lockflag ); | |
1648 | 1646 | } |
1649 | 1647 | |
1650 | 1648 | // 文字出力 |
1651 | 1649 | void WrdWndPutString(char *str, int lockflag) |
1652 | 1650 | { |
1653 | - if (!w32g_wrd_wnd.active) return; | |
1654 | - WrdWndPutStringN(str, strlen(str), lockflag); | |
1651 | + if ( !w32g_wrd_wnd.active ) return; | |
1652 | + WrdWndPutStringN(str, strlen(str),lockflag); | |
1655 | 1653 | } |
1656 | 1654 | |
1657 | 1655 | // 文字出力(n文字) |
1658 | 1656 | void WrdWndPutStringN(char *str, int n, int lockflag) |
1659 | 1657 | { |
1660 | - int i; | |
1661 | - | |
1662 | - if (!w32g_wrd_wnd.active) return; | |
1663 | - if (lockflag) wrd_wnd_lock(); | |
1664 | - for (;;) { | |
1665 | - if (w32g_wrd_wnd.curposx + n <= w32g_wrd_wnd.row) { | |
1666 | - CopyMemory(&w32g_wrd_wnd.textbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], str, n); | |
1667 | - FillMemory(&w32g_wrd_wnd.forecolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1668 | - n, w32g_wrd_wnd.curforecolor); | |
1669 | - FillMemory(&w32g_wrd_wnd.backcolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1670 | - n, w32g_wrd_wnd.curbackcolor); | |
1671 | - FillMemory(&w32g_wrd_wnd.attrbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1672 | - n, w32g_wrd_wnd.curattr); | |
1673 | - if (lockflag) wrd_wnd_unlock(); | |
1674 | - wrd_text_update(w32g_wrd_wnd.curposx, w32g_wrd_wnd.curposy, | |
1675 | - w32g_wrd_wnd.curposx + n - 1, w32g_wrd_wnd.curposy, lockflag); | |
1676 | - if (lockflag) wrd_wnd_lock(); | |
1677 | - w32g_wrd_wnd.curposx += n; | |
1678 | - if (w32g_wrd_wnd.curposx >= w32g_wrd_wnd.row) { | |
1679 | - w32g_wrd_wnd.curposx = 0; | |
1680 | - w32g_wrd_wnd.curposy++; | |
1681 | - if (w32g_wrd_wnd.curposy >= w32g_wrd_wnd.col) { | |
1682 | - if (lockflag) wrd_wnd_unlock(); | |
1683 | - WrdWndScrollUp(lockflag); | |
1684 | - if (lockflag) wrd_wnd_lock(); | |
1685 | - w32g_wrd_wnd.curposy = w32g_wrd_wnd.col - 1; | |
1686 | - } | |
1687 | - } | |
1688 | - break; | |
1689 | - } else { | |
1690 | - int len = w32g_wrd_wnd.row - w32g_wrd_wnd.curposx; | |
1691 | - char mbt = _MBC_SINGLE; | |
1692 | - if (PlayerLanguage == LANGUAGE_JAPANESE) { | |
1693 | - for (i = 0; i < len; i++) { | |
1694 | - mbt = _mbbtype(str[i], mbt); | |
1695 | - } | |
1696 | - if (mbt == _MBC_LEAD) | |
1697 | - len -= 1; | |
1698 | - } | |
1699 | - CopyMemory(&w32g_wrd_wnd.textbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], str, len); | |
1700 | - FillMemory(&w32g_wrd_wnd.forecolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1701 | - len, w32g_wrd_wnd.curforecolor); | |
1702 | - FillMemory(&w32g_wrd_wnd.backcolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1703 | - len, w32g_wrd_wnd.curbackcolor); | |
1704 | - FillMemory(&w32g_wrd_wnd.attrbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1705 | - len, w32g_wrd_wnd.curattr); | |
1706 | - if (mbt == _MBC_LEAD) { | |
1707 | - w32g_wrd_wnd.textbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.row - 1] = 0x20; | |
1708 | - w32g_wrd_wnd.forecolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.row - 1] = w32g_wrd_wnd.curforecolor; | |
1709 | - w32g_wrd_wnd.backcolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.row - 1] = w32g_wrd_wnd.curbackcolor; | |
1710 | - w32g_wrd_wnd.attrbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.row - 1] = 0; | |
1711 | - } | |
1712 | - if (lockflag) wrd_wnd_unlock(); | |
1713 | - wrd_text_update(w32g_wrd_wnd.curposx, w32g_wrd_wnd.curposy, | |
1714 | - w32g_wrd_wnd.curposx + len - 1, w32g_wrd_wnd.curposy, lockflag); | |
1715 | - if (lockflag) wrd_wnd_lock(); | |
1716 | - n -= len; | |
1717 | - str += len; | |
1718 | - w32g_wrd_wnd.curposx = 0; | |
1719 | - w32g_wrd_wnd.curposy++; | |
1720 | - if (w32g_wrd_wnd.curposy >= w32g_wrd_wnd.col) { | |
1721 | - if (lockflag) wrd_wnd_unlock(); | |
1722 | - WrdWndScrollUp(lockflag); | |
1723 | - if (lockflag) wrd_wnd_lock(); | |
1724 | - w32g_wrd_wnd.curposy = w32g_wrd_wnd.col - 1; | |
1725 | - } | |
1726 | - } | |
1727 | - } | |
1728 | - if (lockflag) wrd_wnd_unlock(); | |
1658 | + int i; | |
1659 | + | |
1660 | + if ( !w32g_wrd_wnd.active ) return; | |
1661 | + if ( lockflag ) wrd_wnd_lock(); | |
1662 | + for(;;){ | |
1663 | + if ( w32g_wrd_wnd.curposx + n <= w32g_wrd_wnd.row ) { | |
1664 | + memcpy( &w32g_wrd_wnd.textbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], str, n ); | |
1665 | + memset( &w32g_wrd_wnd.forecolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1666 | + w32g_wrd_wnd.curforecolor, n ); | |
1667 | + memset( &w32g_wrd_wnd.backcolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1668 | + w32g_wrd_wnd.curbackcolor, n ); | |
1669 | + memset( &w32g_wrd_wnd.attrbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1670 | + w32g_wrd_wnd.curattr, n ); | |
1671 | + if ( lockflag ) wrd_wnd_unlock(); | |
1672 | + wrd_text_update ( w32g_wrd_wnd.curposx, w32g_wrd_wnd.curposy, | |
1673 | + w32g_wrd_wnd.curposx + n - 1, w32g_wrd_wnd.curposy, lockflag ); | |
1674 | + if ( lockflag ) wrd_wnd_lock(); | |
1675 | + w32g_wrd_wnd.curposx += n; | |
1676 | + if ( w32g_wrd_wnd.curposx >= w32g_wrd_wnd.row ) { | |
1677 | + w32g_wrd_wnd.curposx = 0; | |
1678 | + w32g_wrd_wnd.curposy++; | |
1679 | + if ( w32g_wrd_wnd.curposy >= w32g_wrd_wnd.col ) { | |
1680 | + if ( lockflag ) wrd_wnd_unlock(); | |
1681 | + WrdWndScrollUp ( lockflag ); | |
1682 | + if ( lockflag ) wrd_wnd_lock(); | |
1683 | + w32g_wrd_wnd.curposy = w32g_wrd_wnd.col - 1; | |
1684 | + } | |
1685 | + } | |
1686 | + break; | |
1687 | + } else { | |
1688 | + int len = w32g_wrd_wnd.row - w32g_wrd_wnd.curposx; | |
1689 | + char mbt = _MBC_SINGLE; | |
1690 | + if ( PlayerLanguage == LANGUAGE_JAPANESE ) { | |
1691 | + for ( i=0; i < len; i++ ) { | |
1692 | + mbt = _mbbtype ( str[i], mbt ); | |
1693 | + } | |
1694 | + if ( mbt == _MBC_LEAD ) | |
1695 | + len -= 1; | |
1696 | + } | |
1697 | + memcpy( &w32g_wrd_wnd.textbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], str, len ); | |
1698 | + memset( &w32g_wrd_wnd.forecolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1699 | + w32g_wrd_wnd.curforecolor, len ); | |
1700 | + memset( &w32g_wrd_wnd.backcolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1701 | + w32g_wrd_wnd.curbackcolor, len ); | |
1702 | + memset( &w32g_wrd_wnd.attrbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1703 | + w32g_wrd_wnd.curattr, len ); | |
1704 | + if ( mbt == _MBC_LEAD ) { | |
1705 | + w32g_wrd_wnd.textbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.row-1] = 0x20; | |
1706 | + w32g_wrd_wnd.forecolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.row-1] = w32g_wrd_wnd.curforecolor; | |
1707 | + w32g_wrd_wnd.backcolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.row-1] = w32g_wrd_wnd.curbackcolor; | |
1708 | + w32g_wrd_wnd.attrbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.row-1] = 0; | |
1709 | + } | |
1710 | + if ( lockflag ) wrd_wnd_unlock(); | |
1711 | + wrd_text_update ( w32g_wrd_wnd.curposx, w32g_wrd_wnd.curposy, | |
1712 | + w32g_wrd_wnd.curposx + len - 1, w32g_wrd_wnd.curposy, lockflag ); | |
1713 | + if ( lockflag ) wrd_wnd_lock(); | |
1714 | + n -= len; | |
1715 | + str += len; | |
1716 | + w32g_wrd_wnd.curposx = 0; | |
1717 | + w32g_wrd_wnd.curposy++; | |
1718 | + if ( w32g_wrd_wnd.curposy >= w32g_wrd_wnd.col ) { | |
1719 | + if ( lockflag ) wrd_wnd_unlock(); | |
1720 | + WrdWndScrollUp(lockflag); | |
1721 | + if ( lockflag ) wrd_wnd_lock(); | |
1722 | + w32g_wrd_wnd.curposy = w32g_wrd_wnd.col - 1; | |
1723 | + } | |
1724 | + } | |
1725 | + } | |
1726 | + if ( lockflag ) wrd_wnd_unlock(); | |
1729 | 1727 | } |
1730 | 1728 | |
1731 | 1729 | // left == TRUE : 行の左消去 |
1732 | 1730 | // left != TRUE : 行の右消去 |
1733 | 1731 | void WrdWndLineClearFrom(int left, int lockflag) |
1734 | 1732 | { |
1735 | - if (!w32g_wrd_wnd.active) return; | |
1736 | - if (lockflag) wrd_wnd_lock(); | |
1737 | - if (left) { | |
1738 | - FillMemory(w32g_wrd_wnd.textbuf[w32g_wrd_wnd.curposy], w32g_wrd_wnd.curposx + 1, 0x20); | |
1739 | - FillMemory(w32g_wrd_wnd.forecolorbuf[w32g_wrd_wnd.curposy], w32g_wrd_wnd.curposx + 1, W32G_WRDWND_BLACK); | |
1740 | - FillMemory(w32g_wrd_wnd.backcolorbuf[w32g_wrd_wnd.curposy], w32g_wrd_wnd.curposx + 1, W32G_WRDWND_BLACK); | |
1741 | - ZeroMemory(w32g_wrd_wnd.attrbuf[w32g_wrd_wnd.curposy], w32g_wrd_wnd.curposx + 1); | |
1742 | - if (lockflag) wrd_wnd_unlock(); | |
1743 | - wrd_text_update(0, w32g_wrd_wnd.curposy, | |
1744 | - w32g_wrd_wnd.curposx - 1, w32g_wrd_wnd.curposy, lockflag); | |
1745 | - } else { | |
1746 | - FillMemory(&w32g_wrd_wnd.textbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1747 | - w32g_wrd_wnd.row - w32g_wrd_wnd.curposx, 0x20); | |
1748 | - FillMemory(&w32g_wrd_wnd.forecolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1749 | - w32g_wrd_wnd.row - w32g_wrd_wnd.curposx, W32G_WRDWND_BLACK); | |
1750 | - FillMemory(&w32g_wrd_wnd.backcolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1751 | - w32g_wrd_wnd.row - w32g_wrd_wnd.curposx, W32G_WRDWND_BLACK); | |
1752 | - FillMemory(&w32g_wrd_wnd.attrbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1753 | - w32g_wrd_wnd.row - w32g_wrd_wnd.curposx, 0); | |
1754 | - if (lockflag) wrd_wnd_unlock(); | |
1755 | - wrd_text_update(w32g_wrd_wnd.curposx, w32g_wrd_wnd.curposy, | |
1756 | - w32g_wrd_wnd.row - 1, w32g_wrd_wnd.curposy, lockflag); | |
1757 | - } | |
1733 | + if ( !w32g_wrd_wnd.active ) return; | |
1734 | + if ( lockflag ) wrd_wnd_lock(); | |
1735 | + if ( left ) { | |
1736 | + memset( w32g_wrd_wnd.textbuf[w32g_wrd_wnd.curposy] , 0x20 , w32g_wrd_wnd.curposx + 1 ); | |
1737 | + memset( w32g_wrd_wnd.forecolorbuf[w32g_wrd_wnd.curposy], W32G_WRDWND_BLACK, w32g_wrd_wnd.curposx + 1 ); | |
1738 | + memset( w32g_wrd_wnd.backcolorbuf[w32g_wrd_wnd.curposy], W32G_WRDWND_BLACK, w32g_wrd_wnd.curposx + 1 ); | |
1739 | + memset( w32g_wrd_wnd.attrbuf[w32g_wrd_wnd.curposy], 0, w32g_wrd_wnd.curposx + 1 ); | |
1740 | + if ( lockflag ) wrd_wnd_unlock(); | |
1741 | + wrd_text_update ( 0, w32g_wrd_wnd.curposy, | |
1742 | + w32g_wrd_wnd.curposx - 1, w32g_wrd_wnd.curposy, lockflag ); | |
1743 | + } else { | |
1744 | + memset( &w32g_wrd_wnd.textbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1745 | + 0x20 , w32g_wrd_wnd.row - w32g_wrd_wnd.curposx ); | |
1746 | + memset( &w32g_wrd_wnd.forecolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1747 | + W32G_WRDWND_BLACK, w32g_wrd_wnd.row - w32g_wrd_wnd.curposx ); | |
1748 | + memset( &w32g_wrd_wnd.backcolorbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1749 | + W32G_WRDWND_BLACK, w32g_wrd_wnd.row - w32g_wrd_wnd.curposx ); | |
1750 | + memset( &w32g_wrd_wnd.attrbuf[w32g_wrd_wnd.curposy][w32g_wrd_wnd.curposx], | |
1751 | + 0, w32g_wrd_wnd.row - w32g_wrd_wnd.curposx ); | |
1752 | + if ( lockflag ) wrd_wnd_unlock(); | |
1753 | + wrd_text_update ( w32g_wrd_wnd.curposx, w32g_wrd_wnd.curposy, | |
1754 | + w32g_wrd_wnd.row - 1, w32g_wrd_wnd.curposy, lockflag ); | |
1755 | + } | |
1758 | 1756 | } |
1759 | 1757 | |
1760 | 1758 | // PC98 のアトリビュートで設定 |
1761 | 1759 | void WrdWndSetAttr98(int attr) |
1762 | 1760 | { |
1763 | - if (!w32g_wrd_wnd.active) return; | |
1764 | - switch (attr) { | |
1765 | - case 0: // 規定値 | |
1766 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1767 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1768 | - w32g_wrd_wnd.curattr = 0; | |
1769 | - break; | |
1770 | - case 1: // ハイライト | |
1771 | - w32g_wrd_wnd.curattr = 0; | |
1772 | - break; | |
1773 | - case 2: // バーティカルライン | |
1774 | - w32g_wrd_wnd.curattr = 0; | |
1775 | - break; | |
1776 | - case 4: // アンダーライン | |
1777 | - w32g_wrd_wnd.curattr = 0; | |
1778 | - break; | |
1779 | - case 5: // ブリンク | |
1780 | - w32g_wrd_wnd.curattr = 0; | |
1781 | - break; | |
1782 | - case 7: // リバース | |
1783 | - { | |
1784 | - char tmp = w32g_wrd_wnd.curbackcolor; | |
1785 | - w32g_wrd_wnd.curbackcolor = w32g_wrd_wnd.curforecolor; | |
1786 | - w32g_wrd_wnd.curforecolor = tmp; | |
1787 | - w32g_wrd_wnd.curattr = 0; | |
1788 | - w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1789 | - } | |
1790 | - break; | |
1791 | - case 8: // シークレット | |
1792 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1793 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1794 | - w32g_wrd_wnd.curattr = 0; | |
1795 | - break; | |
1796 | - case 16: // 黒 | |
1797 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1798 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1799 | - w32g_wrd_wnd.curattr = 0; | |
1800 | - break; | |
1801 | - case 17: // 赤 | |
1802 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_RED; | |
1803 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1804 | - w32g_wrd_wnd.curattr = 0; | |
1805 | - break; | |
1806 | - case 18: // 青 | |
1807 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLUE; | |
1808 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1809 | - w32g_wrd_wnd.curattr = 0; | |
1810 | - break; | |
1811 | - case 19: // 紫 | |
1812 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_PURPLE; | |
1813 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1814 | - w32g_wrd_wnd.curattr = 0; | |
1815 | - break; | |
1816 | - case 20: // 緑 | |
1817 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_GREEN; | |
1818 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1819 | - w32g_wrd_wnd.curattr = 0; | |
1820 | - break; | |
1821 | - case 21: // 黄色 | |
1822 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_YELLOW; | |
1823 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1824 | - w32g_wrd_wnd.curattr = 0; | |
1825 | - break; | |
1826 | - case 22: // 水色 | |
1827 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_LIGHTBLUE; | |
1828 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1829 | - w32g_wrd_wnd.curattr = 0; | |
1830 | - break; | |
1831 | - case 23: // 白 | |
1832 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1833 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1834 | - w32g_wrd_wnd.curattr = 0; | |
1835 | - break; | |
1836 | - case 30: // 黒 | |
1837 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1838 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1839 | - w32g_wrd_wnd.curattr = 0; | |
1840 | - break; | |
1841 | - case 31: // 赤 | |
1842 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_RED; | |
1843 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1844 | - w32g_wrd_wnd.curattr = 0; | |
1845 | - break; | |
1846 | - case 32: // 緑 | |
1847 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_GREEN; | |
1848 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1849 | - w32g_wrd_wnd.curattr = 0; | |
1850 | - break; | |
1851 | - case 33: // 黄色 | |
1852 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_YELLOW; | |
1853 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1854 | - w32g_wrd_wnd.curattr = 0; | |
1855 | - break; | |
1856 | - case 34: // 青 | |
1857 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLUE; | |
1858 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1859 | - w32g_wrd_wnd.curattr = 0; | |
1860 | - break; | |
1861 | - case 35: // 紫 | |
1862 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_PURPLE; | |
1863 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1864 | - w32g_wrd_wnd.curattr = 0; | |
1865 | - break; | |
1866 | - case 36: // 水色 | |
1867 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_LIGHTBLUE; | |
1868 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1869 | - w32g_wrd_wnd.curattr = 0; | |
1870 | - break; | |
1871 | - case 37: // 白 | |
1872 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1873 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1874 | - w32g_wrd_wnd.curattr = 0; | |
1875 | - break; | |
1876 | - case 40: // 黒反転 | |
1877 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1878 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1879 | - w32g_wrd_wnd.curattr = 0; | |
1880 | - w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1881 | - break; | |
1882 | - case 41: // 赤反転 | |
1883 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1884 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_RED; | |
1885 | - w32g_wrd_wnd.curattr = 0; | |
1886 | - w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1887 | - break; | |
1888 | - case 42: // 緑反転 | |
1889 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1890 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_GREEN; | |
1891 | - w32g_wrd_wnd.curattr = 0; | |
1892 | - w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1893 | - break; | |
1894 | - case 43: // 黄色反転 | |
1895 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1896 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_YELLOW; | |
1897 | - w32g_wrd_wnd.curattr = 0; | |
1898 | - w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1899 | - break; | |
1900 | - case 44: // 青反転 | |
1901 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1902 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLUE; | |
1903 | - w32g_wrd_wnd.curattr = 0; | |
1904 | - w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1905 | - break; | |
1906 | - case 45: // 紫反転 | |
1907 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1908 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_PURPLE; | |
1909 | - w32g_wrd_wnd.curattr = 0; | |
1910 | - w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1911 | - break; | |
1912 | - case 46: // 水色反転 | |
1913 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1914 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_LIGHTBLUE; | |
1915 | - w32g_wrd_wnd.curattr = 0; | |
1916 | - w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1917 | - break; | |
1918 | - case 47: // 白反転 | |
1919 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1920 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_WHITE; | |
1921 | - w32g_wrd_wnd.curattr = 0; | |
1922 | - w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1923 | - break; | |
1924 | - default: | |
1925 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1926 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1927 | - w32g_wrd_wnd.curattr = 0; | |
1928 | - break; | |
1929 | - } | |
1761 | + if ( !w32g_wrd_wnd.active ) return; | |
1762 | + switch ( attr ) { | |
1763 | + case 0: // 規定値 | |
1764 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1765 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1766 | + w32g_wrd_wnd.curattr = 0; | |
1767 | + break; | |
1768 | + case 1: // ハイライト | |
1769 | + w32g_wrd_wnd.curattr = 0; | |
1770 | + break; | |
1771 | + case 2: // バーティカルライン | |
1772 | + w32g_wrd_wnd.curattr = 0; | |
1773 | + break; | |
1774 | + case 4: // アンダーライン | |
1775 | + w32g_wrd_wnd.curattr = 0; | |
1776 | + break; | |
1777 | + case 5: // ブリンク | |
1778 | + w32g_wrd_wnd.curattr = 0; | |
1779 | + break; | |
1780 | + case 7: // リバース | |
1781 | + { | |
1782 | + char tmp = w32g_wrd_wnd.curbackcolor; | |
1783 | + w32g_wrd_wnd.curbackcolor = w32g_wrd_wnd.curforecolor; | |
1784 | + w32g_wrd_wnd.curforecolor = tmp; | |
1785 | + w32g_wrd_wnd.curattr = 0; | |
1786 | + w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1787 | + } | |
1788 | + break; | |
1789 | + case 8: // シークレット | |
1790 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1791 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1792 | + w32g_wrd_wnd.curattr = 0; | |
1793 | + break; | |
1794 | + case 16: // 黒 | |
1795 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1796 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1797 | + w32g_wrd_wnd.curattr = 0; | |
1798 | + break; | |
1799 | + case 17: // 赤 | |
1800 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_RED; | |
1801 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1802 | + w32g_wrd_wnd.curattr = 0; | |
1803 | + break; | |
1804 | + case 18: // 青 | |
1805 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLUE; | |
1806 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1807 | + w32g_wrd_wnd.curattr = 0; | |
1808 | + break; | |
1809 | + case 19: // 紫 | |
1810 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_PURPLE; | |
1811 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1812 | + w32g_wrd_wnd.curattr = 0; | |
1813 | + break; | |
1814 | + case 20: // 緑 | |
1815 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_GREEN; | |
1816 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1817 | + w32g_wrd_wnd.curattr = 0; | |
1818 | + break; | |
1819 | + case 21: // 黄色 | |
1820 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_YELLOW; | |
1821 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1822 | + w32g_wrd_wnd.curattr = 0; | |
1823 | + break; | |
1824 | + case 22: // 水色 | |
1825 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_LIGHTBLUE; | |
1826 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1827 | + w32g_wrd_wnd.curattr = 0; | |
1828 | + break; | |
1829 | + case 23: // 白 | |
1830 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1831 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1832 | + w32g_wrd_wnd.curattr = 0; | |
1833 | + break; | |
1834 | + case 30: // 黒 | |
1835 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1836 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1837 | + w32g_wrd_wnd.curattr = 0; | |
1838 | + break; | |
1839 | + case 31: // 赤 | |
1840 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_RED; | |
1841 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1842 | + w32g_wrd_wnd.curattr = 0; | |
1843 | + break; | |
1844 | + case 32: // 緑 | |
1845 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_GREEN; | |
1846 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1847 | + w32g_wrd_wnd.curattr = 0; | |
1848 | + break; | |
1849 | + case 33: // 黄色 | |
1850 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_YELLOW; | |
1851 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1852 | + w32g_wrd_wnd.curattr = 0; | |
1853 | + break; | |
1854 | + case 34: // 青 | |
1855 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLUE; | |
1856 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1857 | + w32g_wrd_wnd.curattr = 0; | |
1858 | + break; | |
1859 | + case 35: // 紫 | |
1860 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_PURPLE; | |
1861 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1862 | + w32g_wrd_wnd.curattr = 0; | |
1863 | + break; | |
1864 | + case 36: // 水色 | |
1865 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_LIGHTBLUE; | |
1866 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1867 | + w32g_wrd_wnd.curattr = 0; | |
1868 | + break; | |
1869 | + case 37: // 白 | |
1870 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1871 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1872 | + w32g_wrd_wnd.curattr = 0; | |
1873 | + break; | |
1874 | + case 40: // 黒反転 | |
1875 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1876 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1877 | + w32g_wrd_wnd.curattr = 0; | |
1878 | + w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1879 | + break; | |
1880 | + case 41: // 赤反転 | |
1881 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1882 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_RED; | |
1883 | + w32g_wrd_wnd.curattr = 0; | |
1884 | + w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1885 | + break; | |
1886 | + case 42: // 緑反転 | |
1887 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1888 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_GREEN; | |
1889 | + w32g_wrd_wnd.curattr = 0; | |
1890 | + w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1891 | + break; | |
1892 | + case 43: // 黄色反転 | |
1893 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1894 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_YELLOW; | |
1895 | + w32g_wrd_wnd.curattr = 0; | |
1896 | + w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1897 | + break; | |
1898 | + case 44: // 青反転 | |
1899 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1900 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLUE; | |
1901 | + w32g_wrd_wnd.curattr = 0; | |
1902 | + w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1903 | + break; | |
1904 | + case 45: // 紫反転 | |
1905 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1906 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_PURPLE; | |
1907 | + w32g_wrd_wnd.curattr = 0; | |
1908 | + w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1909 | + break; | |
1910 | + case 46: // 水色反転 | |
1911 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1912 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_LIGHTBLUE; | |
1913 | + w32g_wrd_wnd.curattr = 0; | |
1914 | + w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1915 | + break; | |
1916 | + case 47: // 白反転 | |
1917 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_BLACK; | |
1918 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_WHITE; | |
1919 | + w32g_wrd_wnd.curattr = 0; | |
1920 | + w32g_wrd_wnd.curattr |= W32G_WRDWND_ATTR_REVERSE; | |
1921 | + break; | |
1922 | + default: | |
1923 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1924 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1925 | + w32g_wrd_wnd.curattr = 0; | |
1926 | + break; | |
1927 | + } | |
1930 | 1928 | } |
1931 | 1929 | |
1932 | 1930 | // アトリビュートのリセット |
1933 | 1931 | void WrdWndSetAttrReset(void) |
1934 | 1932 | { |
1935 | - if (!w32g_wrd_wnd.active) return; | |
1936 | - w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1937 | - w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1938 | - w32g_wrd_wnd.curattr = 0; | |
1933 | + if ( !w32g_wrd_wnd.active ) return; | |
1934 | + w32g_wrd_wnd.curforecolor = W32G_WRDWND_WHITE; | |
1935 | + w32g_wrd_wnd.curbackcolor = W32G_WRDWND_BLACK; | |
1936 | + w32g_wrd_wnd.curattr = 0; | |
1939 | 1937 | } |
1940 | 1938 | |
1941 | 1939 | // カーソルポジションの移動 |
1942 | 1940 | void WrdWndGoto(int x, int y) |
1943 | 1941 | { |
1944 | - if (!w32g_wrd_wnd.active) return; | |
1945 | - if (x < 0) x = 0; | |
1946 | - if (x >= w32g_wrd_wnd.row) x = w32g_wrd_wnd.row - 1; | |
1947 | - if (y < 0) y = 0; | |
1948 | - if (y >= w32g_wrd_wnd.col) y = w32g_wrd_wnd.col - 1; | |
1949 | - w32g_wrd_wnd.curposx = x; | |
1950 | - w32g_wrd_wnd.curposy = y; | |
1942 | + if ( !w32g_wrd_wnd.active ) return; | |
1943 | + if ( x < 0 ) x = 0; | |
1944 | + if ( x >= w32g_wrd_wnd.row ) x = w32g_wrd_wnd.row - 1; | |
1945 | + if ( y < 0 ) y = 0; | |
1946 | + if ( y >= w32g_wrd_wnd.col ) y = w32g_wrd_wnd.col - 1; | |
1947 | + w32g_wrd_wnd.curposx = x; | |
1948 | + w32g_wrd_wnd.curposy = y; | |
1951 | 1949 | } |
1952 | 1950 | |
1953 | 1951 | void WrdWndPaintAll(int lockflag) |
1954 | 1952 | { |
1955 | - if (!w32g_wrd_wnd.active) return; | |
1956 | - wrd_text_update(0, 0, w32g_wrd_wnd.row - 1, w32g_wrd_wnd.col - 1, TRUE); | |
1953 | + if ( !w32g_wrd_wnd.active ) return; | |
1954 | + wrd_text_update ( 0, 0, w32g_wrd_wnd.row - 1, w32g_wrd_wnd.col - 1, TRUE ); | |
1957 | 1955 | } |
1958 | 1956 | |
1959 | 1957 | // SetInvalidateRect() は WM_PAINT を呼ぶ可能性がある。 |
1960 | 1958 | void WrdWndPaintDo(int flag) |
1961 | 1959 | { |
1962 | - RECT rc; | |
1963 | - if (flag) InvalidateRect(w32g_wrd_wnd.hwnd, NULL, FALSE); | |
1964 | - if (GetUpdateRect(w32g_wrd_wnd.hwnd, &rc, FALSE)) { | |
1965 | - PAINTSTRUCT ps; | |
1966 | - if (wrd_wnd_lock_ex(0) == TRUE) { | |
1967 | - if (GDI_LOCK_EX(0) == 0) { | |
1968 | - w32g_wrd_wnd.hdc = BeginPaint(w32g_wrd_wnd.hwnd, &ps); | |
1969 | - BitBlt(w32g_wrd_wnd.hdc, rc.left, rc.top, rc.right, rc.bottom, w32g_wrd_wnd.hmdc, rc.left, rc.top, SRCCOPY); | |
1970 | - EndPaint(w32g_wrd_wnd.hwnd, &ps); | |
1971 | - GDI_UNLOCK(); // gdi_lock | |
1972 | - } else { | |
1973 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
1974 | - } | |
1975 | - } else { | |
1976 | - InvalidateRect(w32g_wrd_wnd.hwnd, &rc, FALSE); | |
1977 | - } | |
1978 | - wrd_wnd_unlock(); | |
1979 | - } | |
1960 | + RECT rc; | |
1961 | + if ( flag ) InvalidateRect( w32g_wrd_wnd.hwnd,NULL, FALSE ); | |
1962 | + if ( GetUpdateRect(w32g_wrd_wnd.hwnd, &rc, FALSE) ) { | |
1963 | + PAINTSTRUCT ps; | |
1964 | + if ( wrd_wnd_lock_ex ( 0 ) == TRUE ) { | |
1965 | + if ( GDI_LOCK_EX(0) == 0 ) { | |
1966 | + w32g_wrd_wnd.hdc = BeginPaint(w32g_wrd_wnd.hwnd, &ps); | |
1967 | + BitBlt(w32g_wrd_wnd.hdc,rc.left,rc.top,rc.right,rc.bottom,w32g_wrd_wnd.hmdc,rc.left,rc.top,SRCCOPY); | |
1968 | + EndPaint(w32g_wrd_wnd.hwnd, &ps); | |
1969 | + GDI_UNLOCK(); // gdi_lock | |
1970 | + } else { | |
1971 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
1972 | + } | |
1973 | + } else { | |
1974 | + InvalidateRect ( w32g_wrd_wnd.hwnd, &rc, FALSE ); | |
1975 | + } | |
1976 | + wrd_wnd_unlock(); | |
1977 | + } | |
1980 | 1978 | } |
1981 | 1979 | |
1982 | 1980 | #define IDM_GRAPHIC_STOP 3531 |
@@ -1985,65 +1983,61 @@ void WrdWndPaintDo(int flag) | ||
1985 | 1983 | static LRESULT CALLBACK |
1986 | 1984 | WrdCanvasWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) |
1987 | 1985 | { |
1988 | - static HMENU hPopupMenu = NULL; | |
1989 | - switch (uMess) | |
1990 | - { | |
1991 | - case WM_CREATE: | |
1992 | - break; | |
1993 | - | |
1994 | - case WM_PAINT: | |
1995 | - WrdWndPaintDo(FALSE); | |
1996 | - return 0; | |
1997 | - | |
1998 | - case WM_DROPFILES: | |
1999 | - SendMessage(hMainWnd, WM_DROPFILES, wParam, lParam); | |
2000 | - return 0; | |
2001 | - | |
2002 | - case WM_DESTROY: | |
2003 | - if (hPopupMenu) | |
2004 | - DestroyMenu(hPopupMenu); | |
2005 | - hPopupMenu = NULL; | |
2006 | - break; | |
2007 | - | |
2008 | - case WM_COMMAND: | |
2009 | - switch (LOWORD(wParam)) { | |
2010 | - case IDM_GRAPHIC_STOP: | |
2011 | - WrdWndInfo.GraphicStop = 1; | |
2012 | - break; | |
2013 | - case IDM_GRAPHIC_START: | |
2014 | - WrdWndInfo.GraphicStop = 0; | |
2015 | - break; | |
2016 | - default: | |
2017 | - break; | |
2018 | - } | |
2019 | - break; | |
2020 | - | |
2021 | - case WM_RBUTTONDOWN: { | |
2022 | - if (LOWORD(lParam) != HTCAPTION) { | |
2023 | - POINT point; | |
2024 | - int res; | |
2025 | - if (hPopupMenu) | |
2026 | - DestroyMenu(hPopupMenu); | |
2027 | - hPopupMenu = CreatePopupMenu(); | |
2028 | - if (WrdWndInfo.GraphicStop) { | |
2029 | - AppendMenu(hPopupMenu, MF_STRING, IDM_GRAPHIC_START, "Graphic Start"); | |
2030 | - } else { | |
2031 | - AppendMenu(hPopupMenu, MF_STRING, IDM_GRAPHIC_STOP, "Graphic Stop"); | |
2032 | - } | |
2033 | - GetCursorPos(&point); | |
2034 | - SetForegroundWindow(hwnd); | |
2035 | - res = TrackPopupMenu(hPopupMenu, TPM_TOPALIGN | TPM_LEFTALIGN, | |
2036 | - point.x, point.y, 0, hwnd, NULL); | |
2037 | - PostMessage(hwnd, WM_NULL, 0, 0); | |
2038 | - DestroyMenu(hPopupMenu); | |
2039 | - hPopupMenu = NULL; | |
2040 | - } | |
2041 | - break; } | |
2042 | - | |
2043 | - default: | |
2044 | - return DefWindowProc(hwnd, uMess, wParam, lParam); | |
2045 | - } | |
2046 | - return 0L; | |
1986 | + static HMENU hPopupMenu = NULL; | |
1987 | + switch (uMess) | |
1988 | + { | |
1989 | + case WM_CREATE: | |
1990 | + break; | |
1991 | + case WM_PAINT: | |
1992 | + WrdWndPaintDo(FALSE); | |
1993 | + return 0; | |
1994 | + case WM_DROPFILES: | |
1995 | + SendMessage(hMainWnd,WM_DROPFILES,wParam,lParam); | |
1996 | + return 0; | |
1997 | + case WM_DESTROY: | |
1998 | + if ( hPopupMenu != NULL ) | |
1999 | + DestroyMenu ( hPopupMenu ); | |
2000 | + hPopupMenu = NULL; | |
2001 | + break; | |
2002 | + case WM_COMMAND: | |
2003 | + switch (LOWORD(wParam)) { | |
2004 | + case IDM_GRAPHIC_STOP: | |
2005 | + WrdWndInfo.GraphicStop = 1; | |
2006 | + break; | |
2007 | + case IDM_GRAPHIC_START: | |
2008 | + WrdWndInfo.GraphicStop = 0; | |
2009 | + break; | |
2010 | + default: | |
2011 | + break; | |
2012 | + } | |
2013 | + break; | |
2014 | + case WM_RBUTTONDOWN: | |
2015 | + { | |
2016 | + if ( LOWORD(lParam ) != HTCAPTION ){ | |
2017 | + POINT point; | |
2018 | + int res; | |
2019 | + if ( hPopupMenu != NULL ) | |
2020 | + DestroyMenu ( hPopupMenu ); | |
2021 | + hPopupMenu = CreatePopupMenu(); | |
2022 | + if ( WrdWndInfo.GraphicStop ) { | |
2023 | + AppendMenu(hPopupMenu,MF_STRING,IDM_GRAPHIC_START,"Graphic Start"); | |
2024 | + } else { | |
2025 | + AppendMenu(hPopupMenu,MF_STRING,IDM_GRAPHIC_STOP,"Graphic Stop"); | |
2026 | + } | |
2027 | + GetCursorPos(&point); | |
2028 | + SetForegroundWindow ( hwnd ); | |
2029 | + res = TrackPopupMenu ( hPopupMenu, TPM_TOPALIGN|TPM_LEFTALIGN, | |
2030 | + point.x, point.y, 0, hwnd, NULL ); | |
2031 | + PostMessage ( hwnd, WM_NULL, 0, 0 ); | |
2032 | + DestroyMenu ( hPopupMenu ); | |
2033 | + hPopupMenu = NULL; | |
2034 | + } | |
2035 | + } | |
2036 | + break; | |
2037 | + default: | |
2038 | + return DefWindowProc(hwnd,uMess,wParam,lParam) ; | |
2039 | + } | |
2040 | + return 0L; | |
2047 | 2041 | } |
2048 | 2042 | |
2049 | 2043 | extern void MainWndUpdateWrdButton(void); |
@@ -2051,79 +2045,73 @@ extern void MainWndUpdateWrdButton(void); | ||
2051 | 2045 | static INT_PTR CALLBACK |
2052 | 2046 | WrdWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) |
2053 | 2047 | { |
2054 | - switch (uMess) { | |
2055 | - case WM_INITDIALOG: | |
2056 | - SetWindowPosSize(GetDesktopWindow(), hwnd, WrdWndInfo.PosX, WrdWndInfo.PosY); | |
2057 | - return FALSE; | |
2058 | - | |
2059 | - case WM_DESTROY: | |
2060 | - TerminateWrdWnd(); | |
2061 | - INISaveWrdWnd(); | |
2062 | - break; | |
2063 | - | |
2064 | - case WM_COMMAND: | |
2065 | - switch (LOWORD(wParam)) { | |
2066 | - case IDCLOSE: | |
2067 | - ShowWindow(hwnd, SW_HIDE); | |
2068 | - MainWndUpdateWrdButton(); | |
2069 | - break; | |
2070 | - default: | |
2071 | - return FALSE; | |
2072 | - } | |
2073 | - | |
2074 | - case WM_MOVE: | |
2075 | - // WrdWndInfo.PosX = (int) LOWORD(lParam); | |
2076 | - // WrdWndInfo.PosY = (int) HIWORD(lParam); | |
2077 | - { | |
2078 | - RECT rc; | |
2079 | - GetWindowRect(hwnd, &rc); | |
2080 | - WrdWndInfo.PosX = rc.left; | |
2081 | - WrdWndInfo.PosY = rc.top; | |
2082 | - } | |
2083 | - break; | |
2084 | - | |
2085 | - case WM_CLOSE: | |
2086 | - ShowWindow(hWrdWnd, SW_HIDE); | |
2087 | - MainWndUpdateWrdButton(); | |
2088 | - break; | |
2089 | - | |
2090 | - case WM_DROPFILES: | |
2091 | - SendMessage(hMainWnd, WM_DROPFILES, wParam, lParam); | |
2092 | - return 0; | |
2093 | - | |
2094 | - default: | |
2095 | - return FALSE; | |
2096 | - } | |
2097 | - return FALSE; | |
2048 | + switch (uMess){ | |
2049 | + case WM_INITDIALOG: | |
2050 | + SetWindowPosSize(GetDesktopWindow(),hwnd,WrdWndInfo.PosX, WrdWndInfo.PosY ); | |
2051 | + return FALSE; | |
2052 | + case WM_DESTROY: | |
2053 | + TerminateWrdWnd (); | |
2054 | + INISaveWrdWnd(); | |
2055 | + break; | |
2056 | + case WM_COMMAND: | |
2057 | + switch (LOWORD(wParam)) { | |
2058 | + case IDCLOSE: | |
2059 | + ShowWindow(hwnd, SW_HIDE); | |
2060 | + MainWndUpdateWrdButton(); | |
2061 | + break; | |
2062 | + default: | |
2063 | + return FALSE; | |
2064 | + } | |
2065 | + case WM_MOVE: | |
2066 | + // WrdWndInfo.PosX = (int) LOWORD(lParam); | |
2067 | + // WrdWndInfo.PosY = (int) HIWORD(lParam); | |
2068 | + { | |
2069 | + RECT rc; | |
2070 | + GetWindowRect(hwnd,&rc); | |
2071 | + WrdWndInfo.PosX = rc.left; | |
2072 | + WrdWndInfo.PosY = rc.top; | |
2073 | + } | |
2074 | + break; | |
2075 | + case WM_CLOSE: | |
2076 | + ShowWindow(hWrdWnd, SW_HIDE); | |
2077 | + MainWndUpdateWrdButton(); | |
2078 | + break; | |
2079 | + case WM_DROPFILES: | |
2080 | + SendMessage(hMainWnd,WM_DROPFILES,wParam,lParam); | |
2081 | + return 0; | |
2082 | + default: | |
2083 | + return FALSE; | |
2084 | + } | |
2085 | + return FALSE; | |
2098 | 2086 | } |
2099 | 2087 | |
2100 | 2088 | static int WrdWndInfoReset(HWND hwnd) |
2101 | 2089 | { |
2102 | - ZeroMemory(&WrdWndInfo, sizeof(WRDWNDINFO)); | |
2103 | - WrdWndInfo.PosX = - 1; | |
2104 | - WrdWndInfo.PosY = - 1; | |
2105 | - WrdWndInfo.GraphicStop = 1; | |
2106 | - return 0; | |
2090 | + memset(&WrdWndInfo,0,sizeof(WRDWNDINFO)); | |
2091 | + WrdWndInfo.PosX = - 1; | |
2092 | + WrdWndInfo.PosY = - 1; | |
2093 | + WrdWndInfo.GraphicStop = 1; | |
2094 | + return 0; | |
2107 | 2095 | } |
2108 | 2096 | |
2109 | 2097 | static int WrdWndInfoApply(void) |
2110 | 2098 | { |
2111 | - return 0; | |
2099 | + return 0; | |
2112 | 2100 | } |
2113 | 2101 | |
2114 | -static RGBQUAD RGBtoRGBQUAD(COLORREF color) | |
2102 | +static RGBQUAD RGBtoRGBQUAD ( COLORREF color ) | |
2115 | 2103 | { |
2116 | - RGBQUAD rq; | |
2117 | - rq.rgbRed = (unsigned char)((color & 0x000000FFL) >> 0); | |
2118 | - rq.rgbGreen = (unsigned char)((color & 0x0000FF00L) >> 8); | |
2119 | - rq.rgbBlue = (unsigned char)((color & 0x00FF0000L) >> 16); | |
2120 | - rq.rgbReserved = 0; | |
2121 | - return rq; | |
2104 | + RGBQUAD rq; | |
2105 | + rq.rgbRed = (unsigned char) ( ( color & 0x000000FFL ) >> 0 ); | |
2106 | + rq.rgbGreen = (unsigned char) ( ( color & 0x0000FF00L ) >> 8 ); | |
2107 | + rq.rgbBlue = (unsigned char) ( ( color & 0x00FF0000L ) >> 16 ); | |
2108 | + rq.rgbReserved = 0; | |
2109 | + return rq; | |
2122 | 2110 | } |
2123 | 2111 | |
2124 | -static COLORREF RGBQUADtoRGB(RGBQUAD rq) | |
2112 | +static COLORREF RGBQUADtoRGB ( RGBQUAD rq ) | |
2125 | 2113 | { |
2126 | - return RGB(rq.rgbRed, rq.rgbGreen, rq.rgbBlue); | |
2114 | + return RGB ( rq.rgbRed, rq.rgbGreen, rq.rgbBlue ); | |
2127 | 2115 | } |
2128 | 2116 | |
2129 | 2117 | extern int PosSizeSave; |
@@ -2131,41 +2119,41 @@ extern int PosSizeSave; | ||
2131 | 2119 | #define SEC_WRDWND "WrdWnd" |
2132 | 2120 | int INISaveWrdWnd(void) |
2133 | 2121 | { |
2134 | - char *section = SEC_WRDWND; | |
2135 | - char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
2136 | - char buffer[256]; | |
2137 | - if (PosSizeSave) { | |
2138 | - if (WrdWndInfo.PosX >= 0 || WrdWndInfo.PosY >= 0) { | |
2139 | - if (WrdWndInfo.PosX < 0) | |
2140 | - WrdWndInfo.PosX = 0; | |
2141 | - if (WrdWndInfo.PosY < 0) | |
2142 | - WrdWndInfo.PosY = 0; | |
2143 | - } | |
2144 | - sprintf(buffer, "%d", WrdWndInfo.PosX); | |
2145 | - if (WrdWndInfo.PosX >= 0) | |
2146 | - WritePrivateProfileString(section, "PosX", buffer, inifile); | |
2147 | - sprintf(buffer, "%d", WrdWndInfo.PosY); | |
2148 | - if (WrdWndInfo.PosY >= 0) | |
2149 | - WritePrivateProfileString(section, "PosY", buffer, inifile); | |
2150 | - } | |
2151 | - sprintf(buffer, "%d", WrdWndInfo.GraphicStop); | |
2152 | - WritePrivateProfileString(section, "GraphicStop", buffer, inifile); | |
2153 | - WritePrivateProfileString(NULL, NULL, NULL, inifile); // Write Flush | |
2154 | - return 0; | |
2122 | + char *section = SEC_WRDWND; | |
2123 | + char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
2124 | + char buffer[256]; | |
2125 | + if ( PosSizeSave ) { | |
2126 | + if ( WrdWndInfo.PosX >= 0 || WrdWndInfo.PosY >= 0 ) { | |
2127 | + if ( WrdWndInfo.PosX < 0 ) | |
2128 | + WrdWndInfo.PosX = 0; | |
2129 | + if ( WrdWndInfo.PosY < 0 ) | |
2130 | + WrdWndInfo.PosY = 0; | |
2131 | + } | |
2132 | + sprintf(buffer,"%d",WrdWndInfo.PosX); | |
2133 | + if ( WrdWndInfo.PosX >= 0 ) | |
2134 | + WritePrivateProfileString(section,"PosX",buffer,inifile); | |
2135 | + sprintf(buffer,"%d",WrdWndInfo.PosY); | |
2136 | + if ( WrdWndInfo.PosY >= 0 ) | |
2137 | + WritePrivateProfileString(section,"PosY",buffer,inifile); | |
2138 | + } | |
2139 | + sprintf(buffer,"%d",WrdWndInfo.GraphicStop); | |
2140 | + WritePrivateProfileString(section,"GraphicStop",buffer,inifile); | |
2141 | + WritePrivateProfileString(NULL,NULL,NULL,inifile); // Write Flush | |
2142 | + return 0; | |
2155 | 2143 | } |
2156 | 2144 | |
2157 | 2145 | int INILoadWrdWnd(void) |
2158 | 2146 | { |
2159 | - char *section = SEC_WRDWND; | |
2160 | - char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
2161 | - int num; | |
2162 | - num = GetPrivateProfileInt(section, "PosX", -1, inifile); | |
2163 | - WrdWndInfo.PosX = num; | |
2164 | - num = GetPrivateProfileInt(section, "PosY", -1, inifile); | |
2165 | - WrdWndInfo.PosY = num; | |
2166 | - num = GetPrivateProfileInt(section, "GraphicStop", 1, inifile); | |
2167 | - WrdWndInfo.GraphicStop = num; | |
2168 | - return 0; | |
2147 | + char *section = SEC_WRDWND; | |
2148 | + char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
2149 | + int num; | |
2150 | + num = GetPrivateProfileInt(section,"PosX",-1,inifile); | |
2151 | + WrdWndInfo.PosX = num; | |
2152 | + num = GetPrivateProfileInt(section,"PosY",-1,inifile); | |
2153 | + WrdWndInfo.PosY = num; | |
2154 | + num = GetPrivateProfileInt(section,"GraphicStop",1,inifile); | |
2155 | + WrdWndInfo.GraphicStop = num; | |
2156 | + return 0; | |
2169 | 2157 | } |
2170 | 2158 | |
2171 | 2159 | void w32_wrd_ctl_event(CtlEvent *e) |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* |
2 | 2 | TiMidity++ -- MIDI to WAVE converter and player |
3 | - Copyright (C) 1999-2018 Masanao Izumo <iz@onicos.co.jp> | |
3 | + Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp> | |
4 | 4 | Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi> |
5 | 5 | |
6 | 6 | This program is free software; you can redistribute it and/or modify |
@@ -31,7 +31,11 @@ | ||
31 | 31 | #ifdef HAVE_STDDEF_H |
32 | 32 | #include <stddef.h> |
33 | 33 | #endif /* HAVE_STDDEF_H */ |
34 | -#include "_string.h" | |
34 | +#ifndef NO_STRING_H | |
35 | +#include <string.h> | |
36 | +#else | |
37 | +#include <strings.h> | |
38 | +#endif | |
35 | 39 | |
36 | 40 | #include "timidity.h" |
37 | 41 | #include "common.h" |
@@ -68,18 +72,18 @@ extern int gdi_lock_ex(DWORD timeout); | ||
68 | 72 | #if 0 |
69 | 73 | static int gdi_lock_result; |
70 | 74 | #define GDI_LOCK_EX(timeout)(\ |
71 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK_EX(%s: %d)", __FILE__, __LINE__), \ | |
72 | - gdi_lock_result = gdi_lock_ex(timeout), \ | |
73 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK_EX_RESULT(%d)", gdi_lock_result), \ | |
74 | - gdi_lock_result \ | |
75 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK_EX(%s: %d)", __FILE__, __LINE__), \ | |
76 | + gdi_lock_result = gdi_lock_ex(timeout), \ | |
77 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK_EX_RESULT(%d)", gdi_lock_result), \ | |
78 | + gdi_lock_result \ | |
75 | 79 | ) |
76 | 80 | #define GDI_LOCK() { \ |
77 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK(%s: %d)", __FILE__, __LINE__); \ | |
78 | - gdi_lock(); \ | |
81 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_LOCK(%s: %d)", __FILE__, __LINE__); \ | |
82 | + gdi_lock(); \ | |
79 | 83 | } |
80 | 84 | #define GDI_UNLOCK() { \ |
81 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_UNLOCK(%s: %d)", __FILE__, __LINE__); \ | |
82 | - gdi_unlock(); \ | |
85 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "GDI_UNLOCK(%s: %d)", __FILE__, __LINE__); \ | |
86 | + gdi_unlock(); \ | |
83 | 87 | } |
84 | 88 | #else |
85 | 89 | #define GDI_LOCK() { gdi_lock(); } |
@@ -89,7 +93,7 @@ static int gdi_lock_result; | ||
89 | 93 | |
90 | 94 | #if defined(__CYGWIN32__) || defined(__MINGW32__) |
91 | 95 | #ifndef TPM_TOPALIGN |
92 | -#define TPM_TOPALIGN 0x0000L | |
96 | +#define TPM_TOPALIGN 0x0000L | |
93 | 97 | #endif |
94 | 98 | #endif |
95 | 99 |
@@ -112,16 +116,16 @@ extern void ClearEditCtlWnd(HWND hwnd); | ||
112 | 116 | #define C_TEXT_BACK_INSERTION RGB(0xDF, 0x90, 0x20) |
113 | 117 | |
114 | 118 | #define CVV_TYPE_NONE 0 |
115 | -#define CVV_TYPE_LEFT 1 // 左から右 | |
116 | -#define CVV_TYPE_RIGHT 2 // 右から左 | |
117 | -#define CVV_TYPE_TOP 3 // 上から下 | |
118 | -#define CVV_TYPE_BOTTOM 4 // 下から上 | |
119 | +#define CVV_TYPE_LEFT 1 // 左から右 | |
120 | +#define CVV_TYPE_RIGHT 2 // 右から左 | |
121 | +#define CVV_TYPE_TOP 3 // 上から下 | |
122 | +#define CVV_TYPE_BOTTOM 4 // 下から上 | |
119 | 123 | |
120 | 124 | #define VEL_MAX 128 * 4 |
121 | 125 | |
122 | 126 | ///r |
123 | -#define TWI_MODE_16CH 16 | |
124 | -#define TWI_MODE_32CH 32 | |
127 | +#define TWI_MODE_16CH 16 | |
128 | +#define TWI_MODE_32CH 32 | |
125 | 129 | #define TWI_MODE_DEFAULT TWI_MODE_32CH |
126 | 130 | |
127 | 131 | #define ITEM_HEIGHT 19 |
@@ -135,52 +139,52 @@ extern void ClearEditCtlWnd(HWND hwnd); | ||
135 | 139 | #define TRACER_MINWIDTH (414) |
136 | 140 | #define TRACER_MAXWIDTH (1920) |
137 | 141 | #define TRACER_MAXHEIGHT (CANVAS_MARGIN + ITEM_SPACER + ITEM_HEIGHT + \ |
138 | - (ITEM_SPACER + ITEM_HEIGHT) * 32 + ITEM_SPACER + CANVAS_MARGIN) | |
142 | + (ITEM_SPACER + ITEM_HEIGHT) * 32 + ITEM_SPACER + CANVAS_MARGIN) | |
139 | 143 | |
140 | 144 | #define CTL_STATUS_UPDATE -98 |
141 | 145 | |
142 | 146 | extern ControlMode *ctl; |
143 | 147 | |
144 | -#define CSV_LEFT 0 | |
145 | -#define CSV_RIGHT 1 | |
148 | +#define CSV_LEFT 0 | |
149 | +#define CSV_RIGHT 1 | |
146 | 150 | #define CSV_CENTER 2 |
147 | 151 | |
148 | 152 | ///r |
149 | 153 | static struct tracer_bmp_ { |
150 | - HBITMAP hbmp; | |
151 | - HDC hmdc; | |
152 | - RECT rc_volume; | |
153 | - RECT rc_expression; | |
154 | - RECT rc_pan; | |
155 | - RECT rc_sustain; | |
156 | - RECT rc_pitch_bend; | |
157 | - RECT rc_mod_wheel; | |
158 | - RECT rc_chorus_effect; | |
159 | - RECT rc_reverb_effect; | |
160 | - RECT rc_velocity[2]; | |
161 | - RECT rc_notes; | |
162 | - RECT rc_notes_sustain; | |
163 | - RECT rc_notes_on; | |
164 | - RECT rc_notes_mask[12]; | |
165 | - RECT rc_note[12]; | |
166 | - RECT rc_note_sustain[12]; | |
167 | - RECT rc_note_on[12]; | |
168 | - RECT rc_gm_on; | |
169 | - RECT rc_gm_off; | |
170 | - RECT rc_gs_on; | |
171 | - RECT rc_gs_off; | |
172 | - RECT rc_xg_on; | |
173 | - RECT rc_xg_off; | |
174 | - RECT rc_gm2_on; | |
175 | - RECT rc_gm2_off; | |
176 | - RECT rc_sd_on; | |
177 | - RECT rc_sd_off; | |
178 | - RECT rc_kg_on; | |
179 | - RECT rc_kg_off; | |
180 | - RECT rc_cm_on; | |
181 | - RECT rc_cm_off; | |
182 | - RECT rc_temper_keysig[32]; | |
183 | - RECT rc_temper_type[8]; | |
154 | + HBITMAP hbmp; | |
155 | + HDC hmdc; | |
156 | + RECT rc_volume; | |
157 | + RECT rc_expression; | |
158 | + RECT rc_pan; | |
159 | + RECT rc_sustain; | |
160 | + RECT rc_pitch_bend; | |
161 | + RECT rc_mod_wheel; | |
162 | + RECT rc_chorus_effect; | |
163 | + RECT rc_reverb_effect; | |
164 | + RECT rc_velocity[2]; | |
165 | + RECT rc_notes; | |
166 | + RECT rc_notes_sustain; | |
167 | + RECT rc_notes_on; | |
168 | + RECT rc_notes_mask[12]; | |
169 | + RECT rc_note[12]; | |
170 | + RECT rc_note_sustain[12]; | |
171 | + RECT rc_note_on[12]; | |
172 | + RECT rc_gm_on; | |
173 | + RECT rc_gm_off; | |
174 | + RECT rc_gs_on; | |
175 | + RECT rc_gs_off; | |
176 | + RECT rc_xg_on; | |
177 | + RECT rc_xg_off; | |
178 | + RECT rc_gm2_on; | |
179 | + RECT rc_gm2_off; | |
180 | + RECT rc_sd_on; | |
181 | + RECT rc_sd_off; | |
182 | + RECT rc_kg_on; | |
183 | + RECT rc_kg_off; | |
184 | + RECT rc_cm_on; | |
185 | + RECT rc_cm_off; | |
186 | + RECT rc_temper_keysig[32]; | |
187 | + RECT rc_temper_type[8]; | |
184 | 188 | } tracer_bmp; |
185 | 189 | |
186 | 190 | static void recalc_tracer_rc(void); |
@@ -198,7 +202,7 @@ static int change_tracer_wnd_mode(int mode); | ||
198 | 202 | static int init_tracer_bmp(HDC hdc); |
199 | 203 | |
200 | 204 | static int tracer_ch_number_draw(int ch, int mute, int lockflag); |
201 | -static int tracer_ch_program_draw(int ch, int bank, int program, const char *instrument, int mapID, int lockflag); | |
205 | +static int tracer_ch_program_draw(int ch, int bank, int program, char *instrument, int mapID, int lockflag); | |
202 | 206 | static int tracer_velocity_draw(RECT *lprc, int vol, int max, int lockflag); |
203 | 207 | static int tracer_velocity_draw_ex(RECT *lprc, int vol, int vol_old, int max, int lockflag); |
204 | 208 | static int tracer_volume_draw(RECT *lprc, int vol, int max, int lockflag); |
@@ -228,18 +232,18 @@ static int notes_view_generate(int lockflag); | ||
228 | 232 | #if 0 |
229 | 233 | static int tracer_lock_result; |
230 | 234 | #define TRACER_LOCK_EX(timeout)(\ |
231 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "TRACER_LOCK_EX(%s: %d)", __FILE__, __LINE__), \ | |
232 | - tracer_lock_result = tracer_lock_ex(timeout), \ | |
233 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "TRACER_LOCK_EX_RESULT(%d)", tracer_lock_result), \ | |
234 | - tracer_wnd_lock_result \ | |
235 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "TRACER_LOCK_EX(%s: %d)", __FILE__, __LINE__), \ | |
236 | + tracer_lock_result = tracer_lock_ex(timeout), \ | |
237 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "TRACER_LOCK_EX_RESULT(%d)", tracer_lock_result), \ | |
238 | + tracer_wnd_lock_result \ | |
235 | 239 | ) |
236 | 240 | #define TRACER_LOCK() { \ |
237 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "TRACER_LOCK(%s: %d)", __FILE__, __LINE__); \ | |
238 | - tracer_wnd_lock(); \ | |
241 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "TRACER_LOCK(%s: %d)", __FILE__, __LINE__); \ | |
242 | + tracer_wnd_lock(); \ | |
239 | 243 | } |
240 | 244 | #define TRACER_UNLOCK() { \ |
241 | - ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "TRACER_UNLOCK(%s: %d)", __FILE__, __LINE__); \ | |
242 | - tracer_wnd_unlock(); \ | |
245 | + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "TRACER_UNLOCK(%s: %d)", __FILE__, __LINE__); \ | |
246 | + tracer_wnd_unlock(); \ | |
243 | 247 | } |
244 | 248 | #else |
245 | 249 | #define TRACER_LOCK() { tracer_wnd_lock(); } |
@@ -250,23 +254,23 @@ static int tracer_lock_result; | ||
250 | 254 | static HANDLE volatile hMutexWrd = NULL; |
251 | 255 | static BOOL tracer_wnd_lock_ex(DWORD timeout) |
252 | 256 | { |
253 | - if (!hMutexWrd) { | |
254 | - hMutexWrd = CreateMutex(NULL, FALSE, NULL); | |
255 | - if (!hMutexWrd) | |
256 | - return FALSE; | |
257 | - } | |
258 | - if (WaitForSingleObject(hMutexWrd, timeout) == WAIT_FAILED) { | |
259 | - return FALSE; | |
260 | - } | |
261 | - return TRUE; | |
257 | + if (!hMutexWrd) { | |
258 | + hMutexWrd = CreateMutex(NULL, FALSE, NULL); | |
259 | + if (!hMutexWrd) | |
260 | + return FALSE; | |
261 | + } | |
262 | + if (WaitForSingleObject(hMutexWrd, timeout) == WAIT_FAILED) { | |
263 | + return FALSE; | |
264 | + } | |
265 | + return TRUE; | |
262 | 266 | } |
263 | 267 | static BOOL tracer_wnd_lock(void) |
264 | 268 | { |
265 | - return tracer_wnd_lock_ex(INFINITE); | |
269 | + return tracer_wnd_lock_ex(INFINITE); | |
266 | 270 | } |
267 | 271 | static void tracer_wnd_unlock(void) |
268 | 272 | { |
269 | - ReleaseMutex(hMutexWrd); | |
273 | + ReleaseMutex(hMutexWrd); | |
270 | 274 | } |
271 | 275 | |
272 | 276 | // **************************************************************************** |
@@ -286,209 +290,207 @@ w32g_tracer_wnd_t w32g_tracer_wnd; | ||
286 | 290 | |
287 | 291 | BOOL SetTracerWndActive(void) |
288 | 292 | { |
289 | - if (IsWindowVisible(hTracerWnd)) { | |
290 | - w32g_tracer_wnd.active = TRUE; | |
291 | - } else { | |
292 | - w32g_tracer_wnd.active = FALSE; | |
293 | - } | |
294 | - return w32g_tracer_wnd.active; | |
293 | + if (IsWindowVisible(hTracerWnd)) { | |
294 | + w32g_tracer_wnd.active = TRUE; | |
295 | + } else { | |
296 | + w32g_tracer_wnd.active = FALSE; | |
297 | + } | |
298 | + return w32g_tracer_wnd.active; | |
295 | 299 | } |
296 | 300 | |
297 | -INT_PTR CALLBACK TracerWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam); | |
301 | +LRESULT CALLBACK TracerWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam); | |
298 | 302 | LRESULT CALLBACK TracerCanvasWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam); |
299 | 303 | void InitTracerWnd(HWND hParentWnd) |
300 | 304 | { |
301 | - WNDCLASS wndclass; | |
302 | - int add_w, height, space; | |
303 | - RECT rc, rc2; | |
304 | - HICON hIcon; | |
305 | - static int init = 1; | |
306 | - | |
307 | - if (init) { | |
308 | - w32g_tracer_wnd.hNullBrush = GetStockObject(NULL_BRUSH); | |
309 | - w32g_tracer_wnd.hNullPen = GetStockObject(NULL_PEN); | |
310 | - init = 0; | |
311 | - } | |
312 | - | |
313 | - if (hTracerWnd) { | |
314 | - TRACER_LOCK(); | |
315 | - DestroyWindow(hTracerWnd); | |
316 | - hTracerWnd = NULL; | |
317 | - DeleteObject((HGDIOBJ) w32g_tracer_wnd.hFontCommon); | |
318 | - DeleteObject((HGDIOBJ) w32g_tracer_wnd.hFontHalf); | |
319 | - DeleteDC(w32g_tracer_wnd.hmdc); | |
320 | - TRACER_UNLOCK(); | |
321 | - } | |
322 | - | |
323 | - w32g_tracer_wnd.active = FALSE; | |
324 | - INILoadTracerWnd(); | |
325 | - hTracerWnd = CreateDialog | |
326 | - (hInst, MAKEINTRESOURCE(IDD_DIALOG_TRACER), hParentWnd, TracerWndProc); | |
327 | - TracerWndInfoReset(hTracerWnd); | |
328 | - ShowWindow(hTracerWnd, SW_HIDE); | |
329 | - hIcon = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON_TIMIDITY), IMAGE_ICON, 16, 16, 0); | |
330 | - if (hIcon) SendMessage(hTracerWnd, WM_SETICON, FALSE, (LPARAM) hIcon); | |
331 | - INILoadTracerWnd(); | |
332 | - | |
333 | - w32g_tracer_wnd.font_common_height = 14; | |
334 | - w32g_tracer_wnd.font_common_width = 0; | |
335 | - SetRect(&w32g_tracer_wnd.rc_head, 1, CANVAS_MARGIN + ITEM_SPACER, 0, 0); | |
336 | - SetRect(&w32g_tracer_wnd.rc_all_channels, 1, CANVAS_MARGIN + ITEM_SPACER + ITEM_SPACER + ITEM_HEIGHT, 0, 0); | |
337 | - w32g_tracer_wnd.width = TracerWndInfo.Width; | |
338 | - RANGE(w32g_tracer_wnd.width, TRACER_MINWIDTH, TRACER_MAXWIDTH); | |
339 | - | |
340 | - w32g_tracer_wnd.ch_height = ITEM_HEIGHT; | |
341 | - w32g_tracer_wnd.ch_space = ITEM_SPACER; | |
342 | - add_w = w32g_tracer_wnd.width - TRACER_MINWTHRESHOLD; | |
343 | - RANGE(add_w, 0, TRACER_MAXWTHRESHOLD - TRACER_MINWTHRESHOLD); | |
344 | - height = w32g_tracer_wnd.ch_height; | |
345 | - space = w32g_tracer_wnd.ch_space; | |
305 | + WNDCLASS wndclass; | |
306 | + int add_w, height, space; | |
307 | + RECT rc, rc2; | |
308 | + HICON hIcon; | |
309 | + static int init = 1; | |
310 | + | |
311 | + if (init) { | |
312 | + w32g_tracer_wnd.hNullBrush = GetStockObject(NULL_BRUSH); | |
313 | + w32g_tracer_wnd.hNullPen = GetStockObject(NULL_PEN); | |
314 | + init = 0; | |
315 | + } | |
316 | + | |
317 | + if (hTracerWnd) { | |
318 | + TRACER_LOCK(); | |
319 | + DestroyWindow(hTracerWnd); | |
320 | + hTracerWnd = NULL; | |
321 | + DeleteObject((HGDIOBJ)w32g_tracer_wnd.hFontCommon); | |
322 | + DeleteObject((HGDIOBJ)w32g_tracer_wnd.hFontHalf); | |
323 | + DeleteDC(w32g_tracer_wnd.hmdc); | |
324 | + TRACER_UNLOCK(); | |
325 | + } | |
326 | + | |
327 | + w32g_tracer_wnd.active = FALSE; | |
328 | + INILoadTracerWnd(); | |
329 | + hTracerWnd = CreateDialog | |
330 | + (hInst, MAKEINTRESOURCE(IDD_DIALOG_TRACER), hParentWnd, TracerWndProc); | |
331 | + TracerWndInfoReset(hTracerWnd); | |
332 | + ShowWindow(hTracerWnd, SW_HIDE); | |
333 | + hIcon = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON_TIMIDITY), IMAGE_ICON, 16, 16, 0); | |
334 | + if (hIcon) SendMessage(hTracerWnd, WM_SETICON, FALSE, (LPARAM)hIcon); | |
335 | + INILoadTracerWnd(); | |
336 | + | |
337 | + w32g_tracer_wnd.font_common_height = 14; | |
338 | + w32g_tracer_wnd.font_common_width = 0; | |
339 | + SetRect(&w32g_tracer_wnd.rc_head, 1, CANVAS_MARGIN + ITEM_SPACER, 0, 0); | |
340 | + SetRect(&w32g_tracer_wnd.rc_all_channels, 1, CANVAS_MARGIN + ITEM_SPACER + ITEM_SPACER + ITEM_HEIGHT, 0, 0); | |
341 | + w32g_tracer_wnd.width = TracerWndInfo.Width; | |
342 | + RANGE(w32g_tracer_wnd.width, TRACER_MINWIDTH, TRACER_MAXWIDTH); | |
343 | + | |
344 | + w32g_tracer_wnd.ch_height = ITEM_HEIGHT; | |
345 | + w32g_tracer_wnd.ch_space = ITEM_SPACER; | |
346 | + add_w = w32g_tracer_wnd.width - TRACER_MINWTHRESHOLD; | |
347 | + RANGE(add_w, 0, TRACER_MAXWTHRESHOLD - TRACER_MINWTHRESHOLD); | |
348 | + height = w32g_tracer_wnd.ch_height; | |
349 | + space = w32g_tracer_wnd.ch_space; | |
346 | 350 | ///r |
347 | - TracerWndViewCh = 0; | |
351 | + TracerWndViewCh = 0; | |
348 | 352 | |
349 | 353 | #if 0 |
350 | - SetRect(&w32g_tracer_wnd.rc_current_time, 2, 1, 80, height); | |
351 | - SetRect(&w32g_tracer_wnd.rc_tempo, 82, 1, 160, height); | |
352 | - SetRect(&w32g_tracer_wnd.rc_master_volume, 162, 1, 200, height / 2 - 1); | |
353 | - SetRect(&w32g_tracer_wnd.rc_maxvoices, 162, height / 2 + 1, 200, height); | |
354 | + SetRect(&w32g_tracer_wnd.rc_current_time, 2, 1, 80, height); | |
355 | + SetRect(&w32g_tracer_wnd.rc_tempo, 82, 1, 160, height); | |
356 | + SetRect(&w32g_tracer_wnd.rc_master_volume, 162, 1, 200, height / 2 - 1); | |
357 | + SetRect(&w32g_tracer_wnd.rc_maxvoices, 162, height / 2 + 1, 200, height); | |
354 | 358 | #endif |
355 | 359 | |
356 | - ZeroMemory(&wndclass, sizeof(wndclass)); | |
357 | - wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_CLASSDC; | |
358 | - wndclass.lpfnWndProc = TracerCanvasWndProc; | |
359 | - wndclass.cbClsExtra = 0; | |
360 | - wndclass.cbWndExtra = 0; | |
361 | - wndclass.hInstance = hInst; | |
362 | - wndclass.hIcon = NULL; | |
363 | - wndclass.hCursor = LoadCursor(0, IDC_ARROW); | |
364 | - wndclass.hbrBackground = w32g_tracer_wnd.hNullBrush; | |
365 | - wndclass.lpszMenuName = NULL; | |
366 | - wndclass.lpszClassName = TEXT("tracer canvas wnd"); | |
367 | - RegisterClass(&wndclass); | |
368 | - w32g_tracer_wnd.hwnd = CreateWindowEx(0, TEXT("tracer canvas wnd"), NULL, WS_CHILD, | |
369 | - TRACER_MAXWIDTH, TRACER_MAXHEIGHT, CW_USEDEFAULT, CW_USEDEFAULT, | |
370 | - hTracerWnd, 0, hInst, 0); | |
371 | - | |
372 | - w32g_tracer_wnd.hdc = GetDC(w32g_tracer_wnd.hwnd); | |
373 | - | |
374 | - TRACER_LOCK(); | |
375 | - SelectObject(w32g_tracer_wnd.hdc, w32g_tracer_wnd.hNullBrush); | |
376 | - SelectObject(w32g_tracer_wnd.hdc, w32g_tracer_wnd.hNullPen); | |
377 | - | |
378 | - w32g_tracer_wnd.hbitmap = CreateCompatibleBitmap(w32g_tracer_wnd.hdc, TRACER_MAXWIDTH, TRACER_MAXHEIGHT); | |
379 | - w32g_tracer_wnd.hmdc = CreateCompatibleDC(w32g_tracer_wnd.hdc); | |
380 | - w32g_tracer_wnd.hgdiobj_hmdcprev = SelectObject(w32g_tracer_wnd.hmdc, w32g_tracer_wnd.hbitmap); | |
381 | - SelectObject(w32g_tracer_wnd.hmdc, w32g_tracer_wnd.hNullBrush); | |
382 | - SelectObject(w32g_tracer_wnd.hmdc, w32g_tracer_wnd.hNullPen); | |
383 | - TRACER_UNLOCK(); | |
384 | - init_tracer_bmp(w32g_tracer_wnd.hdc); | |
385 | - | |
386 | - ReleaseDC(w32g_tracer_wnd.hwnd, w32g_tracer_wnd.hdc); | |
387 | - | |
388 | - { | |
389 | - char fontname[LF_FULLFACESIZE + 1]; | |
390 | - if (PlayerLanguage == LANGUAGE_JAPANESE) { | |
391 | - strncpy(fontname, "MS P明朝", LF_FULLFACESIZE + 1); | |
392 | -// strncpy(fontname, "MS Pゴシック", LF_FULLFACESIZE + 1); | |
393 | -// w32g_tracer_wnd.font_common_height = -13; | |
394 | -// w32g_tracer_wnd.font_common_width = 0; | |
395 | - } else { | |
396 | - strncpy(fontname, "Arial", LF_FULLFACESIZE + 1); | |
397 | - w32g_tracer_wnd.font_common_height = 16; | |
398 | - } | |
399 | - // ToDo: トレーサーのフォントをiniから読めるようにしたい | |
400 | - w32g_tracer_wnd.hFontCommon = CreateFontA(w32g_tracer_wnd.font_common_height, w32g_tracer_wnd.font_common_width, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, | |
401 | - DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, | |
402 | - DEFAULT_PITCH | FF_MODERN, fontname); | |
403 | - w32g_tracer_wnd.hFontHalf = CreateFontA(-10, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, | |
404 | - DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, | |
405 | - DEFAULT_PITCH | FF_MODERN, "Courier"); | |
406 | - } | |
407 | - TracerWndReset(); | |
408 | - | |
409 | - SetRect(&w32g_tracer_wnd.rc_channel_top, 1, 0, 1 + ITEM_HEIGHT, height); | |
360 | + wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_CLASSDC; | |
361 | + wndclass.lpfnWndProc = TracerCanvasWndProc; | |
362 | + wndclass.cbClsExtra = 0; | |
363 | + wndclass.cbWndExtra = 0; | |
364 | + wndclass.hInstance = hInst; | |
365 | + wndclass.hIcon = NULL; | |
366 | + wndclass.hCursor = LoadCursor(0, IDC_ARROW); | |
367 | + wndclass.hbrBackground = w32g_tracer_wnd.hNullBrush; | |
368 | + wndclass.lpszMenuName = NULL; | |
369 | + wndclass.lpszClassName = TEXT("tracer canvas wnd"); | |
370 | + RegisterClass(&wndclass); | |
371 | + w32g_tracer_wnd.hwnd = CreateWindowEx(0, TEXT("tracer canvas wnd"), NULL, WS_CHILD, | |
372 | + TRACER_MAXWIDTH, TRACER_MAXHEIGHT, CW_USEDEFAULT, CW_USEDEFAULT, | |
373 | + hTracerWnd, 0, hInst, 0); | |
374 | + | |
375 | + w32g_tracer_wnd.hdc = GetDC(w32g_tracer_wnd.hwnd); | |
376 | + | |
377 | + TRACER_LOCK(); | |
378 | + SelectObject(w32g_tracer_wnd.hdc, w32g_tracer_wnd.hNullBrush); | |
379 | + SelectObject(w32g_tracer_wnd.hdc, w32g_tracer_wnd.hNullPen); | |
380 | + | |
381 | + w32g_tracer_wnd.hbitmap = CreateCompatibleBitmap(w32g_tracer_wnd.hdc, TRACER_MAXWIDTH, TRACER_MAXHEIGHT); | |
382 | + w32g_tracer_wnd.hmdc = CreateCompatibleDC(w32g_tracer_wnd.hdc); | |
383 | + w32g_tracer_wnd.hgdiobj_hmdcprev = SelectObject(w32g_tracer_wnd.hmdc, w32g_tracer_wnd.hbitmap); | |
384 | + SelectObject(w32g_tracer_wnd.hmdc, w32g_tracer_wnd.hNullBrush); | |
385 | + SelectObject(w32g_tracer_wnd.hmdc, w32g_tracer_wnd.hNullPen); | |
386 | + TRACER_UNLOCK(); | |
387 | + init_tracer_bmp(w32g_tracer_wnd.hdc); | |
388 | + | |
389 | + ReleaseDC(w32g_tracer_wnd.hwnd, w32g_tracer_wnd.hdc); | |
390 | + | |
391 | + { | |
392 | + char fontname[LF_FULLFACESIZE + 1]; | |
393 | + if (PlayerLanguage == LANGUAGE_JAPANESE) { | |
394 | + strncpy(fontname, "MS P明朝", LF_FULLFACESIZE + 1); | |
395 | +// strncpy(fontname, "MS Pゴシック", LF_FULLFACESIZE + 1); | |
396 | +// w32g_tracer_wnd.font_common_height = -13; | |
397 | +// w32g_tracer_wnd.font_common_width = 0; | |
398 | + } else { | |
399 | + strncpy(fontname, "Arial", LF_FULLFACESIZE + 1); | |
400 | + w32g_tracer_wnd.font_common_height = 16; | |
401 | + } | |
402 | + w32g_tracer_wnd.hFontCommon = CreateFont(w32g_tracer_wnd.font_common_height, w32g_tracer_wnd.font_common_width, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, | |
403 | + DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, | |
404 | + DEFAULT_PITCH | FF_MODERN, fontname); | |
405 | + w32g_tracer_wnd.hFontHalf = CreateFont(-10, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, | |
406 | + DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, | |
407 | + DEFAULT_PITCH | FF_MODERN, "Courier"); | |
408 | + } | |
409 | + TracerWndReset(); | |
410 | + | |
411 | + SetRect(&w32g_tracer_wnd.rc_channel_top, 1, 0, 1 + ITEM_HEIGHT, height); | |
410 | 412 | #if 0 |
411 | - SetRect(&w32g_tracer_wnd.rc_instrument, 21, 0, 179, height); | |
412 | - SetRect(&w32g_tracer_wnd.rc_inst_map, 180, 0, 233, height); | |
413 | - SetRect(&w32g_tracer_wnd.rc_bank, 234, 0, 264, height); | |
414 | - SetRect(&w32g_tracer_wnd.rc_program, 265, 0, 295, height); | |
415 | - SetRect(&w32g_tracer_wnd.rc_velocity, 296, 0, 326, height); | |
416 | - SetRect(&w32g_tracer_wnd.rc_volume, 327, 0, 347, height / 2); | |
417 | - SetRect(&w32g_tracer_wnd.rc_expression, 327, height / 2 + 1, 347, height); | |
418 | - SetRect(&w32g_tracer_wnd.rc_panning, 348, 0, 368, height / 2); | |
419 | - SetRect(&w32g_tracer_wnd.rc_sustain, 348, height / 2 + 1, 368, height); | |
420 | - SetRect(&w32g_tracer_wnd.rc_pitch_bend, 369, 0, 389, height / 2); | |
421 | - SetRect(&w32g_tracer_wnd.rc_mod_wheel, 369, height / 2 + 1, 389, height); | |
422 | - SetRect(&w32g_tracer_wnd.rc_chorus_effect, 390, 0, 410, height / 2); | |
423 | - SetRect(&w32g_tracer_wnd.rc_reverb_effect, 390, height / 2 + 1, 410, height); | |
424 | - SetRect(&w32g_tracer_wnd.rc_temper_keysig, 411, 0, 444, height); | |
425 | - SetRect(&w32g_tracer_wnd.rc_gm, 445, 0, 469, height); | |
426 | - SetRect(&w32g_tracer_wnd.rc_gs, 470, 0, 494, height); | |
427 | - SetRect(&w32g_tracer_wnd.rc_xg, 495, 0, 519, height); | |
413 | + SetRect(&w32g_tracer_wnd.rc_instrument, 21, 0, 179, height); | |
414 | + SetRect(&w32g_tracer_wnd.rc_inst_map, 180, 0, 233, height); | |
415 | + SetRect(&w32g_tracer_wnd.rc_bank, 234, 0, 264, height); | |
416 | + SetRect(&w32g_tracer_wnd.rc_program, 265, 0, 295, height); | |
417 | + SetRect(&w32g_tracer_wnd.rc_velocity, 296, 0, 326, height); | |
418 | + SetRect(&w32g_tracer_wnd.rc_volume, 327, 0, 347, height / 2); | |
419 | + SetRect(&w32g_tracer_wnd.rc_expression, 327, height / 2 + 1, 347, height); | |
420 | + SetRect(&w32g_tracer_wnd.rc_panning, 348, 0, 368, height / 2); | |
421 | + SetRect(&w32g_tracer_wnd.rc_sustain, 348, height / 2 + 1, 368, height); | |
422 | + SetRect(&w32g_tracer_wnd.rc_pitch_bend, 369, 0, 389, height / 2); | |
423 | + SetRect(&w32g_tracer_wnd.rc_mod_wheel, 369, height / 2 + 1, 389, height); | |
424 | + SetRect(&w32g_tracer_wnd.rc_chorus_effect, 390, 0, 410, height / 2); | |
425 | + SetRect(&w32g_tracer_wnd.rc_reverb_effect, 390, height / 2 + 1, 410, height); | |
426 | + SetRect(&w32g_tracer_wnd.rc_temper_keysig, 411, 0, 444, height); | |
427 | + SetRect(&w32g_tracer_wnd.rc_gm, 445, 0, 469, height); | |
428 | + SetRect(&w32g_tracer_wnd.rc_gs, 470, 0, 494, height); | |
429 | + SetRect(&w32g_tracer_wnd.rc_xg, 495, 0, 519, height); | |
428 | 430 | ///r |
429 | - SetRect(&w32g_tracer_wnd.rc_gm2, 520, 0, 544, height); | |
430 | - SetRect(&w32g_tracer_wnd.rc_sd, 545, 0, 569, height); | |
431 | - SetRect(&w32g_tracer_wnd.rc_kg, 570, 0, 594, height); | |
432 | - SetRect(&w32g_tracer_wnd.rc_cm, 595, 0, 619, height); | |
433 | - SetRect(&w32g_tracer_wnd.rc_head_rest, 620, 0, 894, height); | |
434 | - | |
435 | - SetRect(&w32g_tracer_wnd.rc_temper_type, 411, 0, 430, height); | |
436 | - SetRect(&w32g_tracer_wnd.rc_notes, 431, 0, 894, height); | |
431 | + SetRect(&w32g_tracer_wnd.rc_gm2, 520, 0, 544, height); | |
432 | + SetRect(&w32g_tracer_wnd.rc_sd, 545, 0, 569, height); | |
433 | + SetRect(&w32g_tracer_wnd.rc_kg, 570, 0, 594, height); | |
434 | + SetRect(&w32g_tracer_wnd.rc_cm, 595, 0, 619, height); | |
435 | + SetRect(&w32g_tracer_wnd.rc_head_rest, 620, 0, 894, height); | |
436 | + | |
437 | + SetRect(&w32g_tracer_wnd.rc_temper_type, 411, 0, 430, height); | |
438 | + SetRect(&w32g_tracer_wnd.rc_notes, 431, 0, 894, height); | |
437 | 439 | #else |
438 | - recalc_tracer_rc(); | |
440 | + recalc_tracer_rc(); | |
439 | 441 | #endif |
440 | 442 | |
441 | - GetWindowRect(hTracerWnd, &rc); | |
442 | - GetClientRect(hTracerWnd, &rc2); | |
443 | - /* | |
444 | - rc.left = rc.left; | |
445 | - rc.top = rc.top; | |
446 | - rc.right = (rc.right - rc.left) - (rc2.right - rc2.left) + w32g_tracer_wnd.width; | |
447 | - rc.bottom = (rc.bottom - rc.top) - (rc2.bottom - rc2.top) + w32g_tracer_wnd.height; | |
448 | - */ | |
449 | - rc2.right = w32g_tracer_wnd.width + rc2.left; | |
450 | - rc2.bottom = w32g_tracer_wnd.height + rc2.top; | |
451 | - rc2.left = 0, rc2.top = 0; | |
452 | - AdjustWindowRectEx(&rc2, GetWindowLong(hTracerWnd, GWL_STYLE), FALSE, GetWindowLong(hTracerWnd, GWL_EXSTYLE)); | |
453 | - rc.left = TracerWndInfo.PosX; | |
454 | - rc.top = TracerWndInfo.PosY; | |
455 | - rc.right = rc.left + rc2.right - rc2.left; | |
456 | - rc.bottom = rc.top + rc2.bottom - rc2.top; | |
457 | - MoveWindow(hTracerWnd, rc.left, rc.top, rc.right, rc.bottom, TRUE); | |
458 | - //MoveWindow(w32g_tracer_wnd.hwnd, 0, 0, w32g_tracer_wnd.width, w32g_tracer_wnd.height, TRUE); | |
459 | - MoveWindow(w32g_tracer_wnd.hwnd, 0, 0, TRACER_MAXWIDTH, TRACER_MAXHEIGHT, FALSE); | |
460 | - ShowWindow(w32g_tracer_wnd.hwnd, SW_SHOW); | |
461 | - UpdateWindow(w32g_tracer_wnd.hwnd); | |
462 | - UpdateWindow(hTracerWnd); | |
463 | - change_tracer_wnd_mode(TracerWndInfo.mode); | |
464 | - | |
465 | - INILoadTracerWnd(); | |
466 | - TracerWndInfoApply(); | |
467 | - ShowWindow(hTracerWnd, TracerWndStartFlag ? SW_SHOW : SW_HIDE); | |
443 | + GetWindowRect(hTracerWnd, &rc); | |
444 | + GetClientRect(hTracerWnd, &rc2); | |
445 | + /* | |
446 | + rc.left = rc.left; | |
447 | + rc.top = rc.top; | |
448 | + rc.right = (rc.right - rc.left) - (rc2.right - rc2.left) + w32g_tracer_wnd.width; | |
449 | + rc.bottom = (rc.bottom - rc.top) - (rc2.bottom - rc2.top) + w32g_tracer_wnd.height; | |
450 | + */ | |
451 | + rc2.right = w32g_tracer_wnd.width + rc2.left; | |
452 | + rc2.bottom = w32g_tracer_wnd.height + rc2.top; | |
453 | + rc2.left = 0, rc2.top = 0; | |
454 | + AdjustWindowRectEx(&rc2, GetWindowLong(hTracerWnd, GWL_STYLE), FALSE, GetWindowLong(hTracerWnd, GWL_EXSTYLE)); | |
455 | + rc.left = TracerWndInfo.PosX; | |
456 | + rc.top = TracerWndInfo.PosY; | |
457 | + rc.right = rc.left + rc2.right - rc2.left; | |
458 | + rc.bottom = rc.top + rc2.bottom - rc2.top; | |
459 | + MoveWindow(hTracerWnd, rc.left, rc.top, rc.right, rc.bottom, TRUE); | |
460 | + //MoveWindow(w32g_tracer_wnd.hwnd, 0, 0, w32g_tracer_wnd.width, w32g_tracer_wnd.height, TRUE); | |
461 | + MoveWindow(w32g_tracer_wnd.hwnd, 0, 0, TRACER_MAXWIDTH, TRACER_MAXHEIGHT, FALSE); | |
462 | + ShowWindow(w32g_tracer_wnd.hwnd, SW_SHOW); | |
463 | + UpdateWindow(w32g_tracer_wnd.hwnd); | |
464 | + UpdateWindow(hTracerWnd); | |
465 | + change_tracer_wnd_mode(TracerWndInfo.mode); | |
466 | + | |
467 | + INILoadTracerWnd(); | |
468 | + TracerWndInfoApply(); | |
469 | + ShowWindow(hTracerWnd, TracerWndStartFlag ? SW_SHOW : SW_HIDE); | |
468 | 470 | } |
469 | 471 | |
470 | 472 | static int notes_view_generate(int lockflag) |
471 | 473 | { |
472 | - int i; | |
473 | - | |
474 | - if (lockflag) TRACER_LOCK(); | |
475 | - for (i = 0; i < 12; i++) { | |
476 | - BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note[i].left, tracer_bmp.rc_note[i].top, tracer_bmp.rc_note[i].right - tracer_bmp.rc_note[i].left, tracer_bmp.rc_note[i].bottom - tracer_bmp.rc_note[i].top, | |
477 | - tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[i].left, tracer_bmp.rc_notes_mask[i].top, SRCINVERT); | |
478 | - BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note[i].left, tracer_bmp.rc_note[i].top, tracer_bmp.rc_note[i].right - tracer_bmp.rc_note[i].left, tracer_bmp.rc_note[i].bottom - tracer_bmp.rc_note[i].top, | |
479 | - tracer_bmp.hmdc, tracer_bmp.rc_notes.left, tracer_bmp.rc_notes.top, SRCPAINT); | |
480 | - BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note_on[i].left, tracer_bmp.rc_note_on[i].top, tracer_bmp.rc_note_on[i].right - tracer_bmp.rc_note_on[i].left, tracer_bmp.rc_note_on[i].bottom - tracer_bmp.rc_note_on[i].top, | |
481 | - tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[i].left, tracer_bmp.rc_notes_mask[i].top, SRCINVERT); | |
482 | - BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note_on[i].left, tracer_bmp.rc_note_on[i].top, tracer_bmp.rc_note_on[i].right - tracer_bmp.rc_note_on[i].left, tracer_bmp.rc_note_on[i].bottom - tracer_bmp.rc_note_on[i].top, | |
483 | - tracer_bmp.hmdc, tracer_bmp.rc_notes_on.left, tracer_bmp.rc_notes_on.top, SRCPAINT); | |
484 | - BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note_sustain[i].left, tracer_bmp.rc_note_sustain[i].top, tracer_bmp.rc_note_sustain[i].right - tracer_bmp.rc_note_sustain[i].left, tracer_bmp.rc_note_sustain[i].bottom - tracer_bmp.rc_note_sustain[i].top, | |
485 | - tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[i].left, tracer_bmp.rc_notes_mask[i].top, SRCINVERT); | |
486 | - BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note_sustain[i].left, tracer_bmp.rc_note_sustain[i].top, tracer_bmp.rc_note_sustain[i].right - tracer_bmp.rc_note_sustain[i].left, tracer_bmp.rc_note_sustain[i].bottom - tracer_bmp.rc_note_sustain[i].top, | |
487 | - tracer_bmp.hmdc, tracer_bmp.rc_notes_sustain.left, tracer_bmp.rc_notes_sustain.top, SRCPAINT); | |
488 | - } | |
489 | - if (lockflag) TRACER_UNLOCK(); | |
490 | - | |
491 | - return 0; | |
474 | + int i; | |
475 | + | |
476 | + if (lockflag) TRACER_LOCK(); | |
477 | + for (i = 0; i < 12; i++) { | |
478 | + BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note[i].left, tracer_bmp.rc_note[i].top, tracer_bmp.rc_note[i].right - tracer_bmp.rc_note[i].left, tracer_bmp.rc_note[i].bottom - tracer_bmp.rc_note[i].top, | |
479 | + tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[i].left, tracer_bmp.rc_notes_mask[i].top, SRCINVERT); | |
480 | + BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note[i].left, tracer_bmp.rc_note[i].top, tracer_bmp.rc_note[i].right - tracer_bmp.rc_note[i].left, tracer_bmp.rc_note[i].bottom - tracer_bmp.rc_note[i].top, | |
481 | + tracer_bmp.hmdc, tracer_bmp.rc_notes.left, tracer_bmp.rc_notes.top, SRCPAINT); | |
482 | + BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note_on[i].left, tracer_bmp.rc_note_on[i].top, tracer_bmp.rc_note_on[i].right - tracer_bmp.rc_note_on[i].left, tracer_bmp.rc_note_on[i].bottom - tracer_bmp.rc_note_on[i].top, | |
483 | + tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[i].left, tracer_bmp.rc_notes_mask[i].top, SRCINVERT); | |
484 | + BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note_on[i].left, tracer_bmp.rc_note_on[i].top, tracer_bmp.rc_note_on[i].right - tracer_bmp.rc_note_on[i].left, tracer_bmp.rc_note_on[i].bottom - tracer_bmp.rc_note_on[i].top, | |
485 | + tracer_bmp.hmdc, tracer_bmp.rc_notes_on.left, tracer_bmp.rc_notes_on.top, SRCPAINT); | |
486 | + BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note_sustain[i].left, tracer_bmp.rc_note_sustain[i].top, tracer_bmp.rc_note_sustain[i].right - tracer_bmp.rc_note_sustain[i].left, tracer_bmp.rc_note_sustain[i].bottom - tracer_bmp.rc_note_sustain[i].top, | |
487 | + tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[i].left, tracer_bmp.rc_notes_mask[i].top, SRCINVERT); | |
488 | + BitBlt(tracer_bmp.hmdc, tracer_bmp.rc_note_sustain[i].left, tracer_bmp.rc_note_sustain[i].top, tracer_bmp.rc_note_sustain[i].right - tracer_bmp.rc_note_sustain[i].left, tracer_bmp.rc_note_sustain[i].bottom - tracer_bmp.rc_note_sustain[i].top, | |
489 | + tracer_bmp.hmdc, tracer_bmp.rc_notes_sustain.left, tracer_bmp.rc_notes_sustain.top, SRCPAINT); | |
490 | + } | |
491 | + if (lockflag) TRACER_UNLOCK(); | |
492 | + | |
493 | + return 0; | |
492 | 494 | } |
493 | 495 | |
494 | 496 | ///r |
@@ -499,151 +501,151 @@ static int notes_view_generate(int lockflag) | ||
499 | 501 | |
500 | 502 | static int init_tracer_bmp(HDC hdc) |
501 | 503 | { |
502 | - int i, j; | |
503 | - static int init = 1; | |
504 | - HBITMAP hbmp; | |
505 | - HDC hmdc; | |
506 | - | |
507 | - if (init) { | |
508 | - tracer_bmp.hbmp = NULL; | |
509 | - tracer_bmp.hmdc = NULL; | |
510 | - init = 0; | |
511 | - } | |
512 | - TRACER_LOCK(); | |
513 | - if (tracer_bmp.hmdc) | |
514 | - DeleteDC(tracer_bmp.hmdc); | |
515 | - if (tracer_bmp.hbmp) | |
516 | - DeleteObject((HGDIOBJ) tracer_bmp.hbmp); | |
517 | - tracer_bmp.hbmp = CreateCompatibleBitmap(hdc, TRACER_CANVAS_SIZE_X, TRACER_CANVAS_SIZE_Y); | |
518 | - tracer_bmp.hmdc = CreateCompatibleDC(hdc); | |
519 | - SelectObject(tracer_bmp.hmdc, w32g_tracer_wnd.hNullBrush); /* 必要ないかもしれないが */ | |
520 | - SelectObject(tracer_bmp.hmdc, w32g_tracer_wnd.hNullPen); /* 必要ないかもしれないが */ | |
521 | - SelectObject(tracer_bmp.hmdc, tracer_bmp.hbmp); | |
522 | - | |
523 | - hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP_TRACER)); | |
524 | - hmdc = CreateCompatibleDC(hdc); | |
525 | - SelectObject(hmdc, hbmp); | |
526 | - BitBlt(tracer_bmp.hmdc, 0, 0, TRACER_CANVAS_SIZE_X, TRACER_CANVAS_SIZE_Y, hmdc, 0, 0, WHITENESS); | |
527 | - BitBlt(tracer_bmp.hmdc, 0, 0, TRACER_BMP_SIZE_X, TRACER_BMP_SIZE_Y, hmdc, 0, 0, SRCCOPY); | |
528 | - DeleteDC(hmdc); | |
529 | - DeleteObject(hbmp); | |
530 | - | |
531 | - TRACER_UNLOCK(); | |
532 | - | |
533 | - SetRect(&tracer_bmp.rc_volume, 8, 16, 28, 195); | |
534 | - SetRect(&tracer_bmp.rc_expression, 32, 16, 52, 195); | |
535 | - SetRect(&tracer_bmp.rc_pan, 56, 16, 76, 195); | |
536 | - SetRect(&tracer_bmp.rc_sustain, 80, 16, 100, 195); | |
537 | - SetRect(&tracer_bmp.rc_pitch_bend, 104, 16, 124, 195); | |
538 | - SetRect(&tracer_bmp.rc_mod_wheel, 128, 16, 148, 195); | |
539 | - SetRect(&tracer_bmp.rc_chorus_effect, 152, 16, 172, 195); | |
540 | - SetRect(&tracer_bmp.rc_reverb_effect, 176, 16, 196, 195); | |
541 | - SetRect(&tracer_bmp.rc_velocity[0], 200, 16, 230, 215); | |
542 | - SetRect(&tracer_bmp.rc_velocity[1], 231, 16, 261, 215); | |
543 | - SetRect(&tracer_bmp.rc_notes, 16, 59, 58, 78); | |
504 | + int i, j; | |
505 | + static int init = 1; | |
506 | + HBITMAP hbmp; | |
507 | + HDC hmdc; | |
508 | + | |
509 | + if (init) { | |
510 | + tracer_bmp.hbmp = NULL; | |
511 | + tracer_bmp.hmdc = NULL; | |
512 | + init = 0; | |
513 | + } | |
514 | + TRACER_LOCK(); | |
515 | + if (tracer_bmp.hmdc) | |
516 | + DeleteDC(tracer_bmp.hmdc); | |
517 | + if (tracer_bmp.hbmp) | |
518 | + DeleteObject((HGDIOBJ) tracer_bmp.hbmp); | |
519 | + tracer_bmp.hbmp = CreateCompatibleBitmap(hdc, TRACER_CANVAS_SIZE_X, TRACER_CANVAS_SIZE_Y); | |
520 | + tracer_bmp.hmdc = CreateCompatibleDC(hdc); | |
521 | + SelectObject(tracer_bmp.hmdc, w32g_tracer_wnd.hNullBrush); /* 必要ないかもしれないが */ | |
522 | + SelectObject(tracer_bmp.hmdc, w32g_tracer_wnd.hNullPen); /* 必要ないかもしれないが */ | |
523 | + SelectObject(tracer_bmp.hmdc, tracer_bmp.hbmp); | |
524 | + | |
525 | + hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP_TRACER)); | |
526 | + hmdc = CreateCompatibleDC(hdc); | |
527 | + SelectObject(hmdc, hbmp); | |
528 | + BitBlt(tracer_bmp.hmdc, 0, 0, TRACER_CANVAS_SIZE_X, TRACER_CANVAS_SIZE_Y, hmdc, 0, 0, WHITENESS); | |
529 | + BitBlt(tracer_bmp.hmdc, 0, 0, TRACER_BMP_SIZE_X, TRACER_BMP_SIZE_Y, hmdc, 0, 0, SRCCOPY); | |
530 | + DeleteDC(hmdc); | |
531 | + DeleteObject(hbmp); | |
532 | + | |
533 | + TRACER_UNLOCK(); | |
534 | + | |
535 | + SetRect(&tracer_bmp.rc_volume, 8, 16, 28, 195); | |
536 | + SetRect(&tracer_bmp.rc_expression, 32, 16, 52, 195); | |
537 | + SetRect(&tracer_bmp.rc_pan, 56, 16, 76, 195); | |
538 | + SetRect(&tracer_bmp.rc_sustain, 80, 16, 100, 195); | |
539 | + SetRect(&tracer_bmp.rc_pitch_bend, 104, 16, 124, 195); | |
540 | + SetRect(&tracer_bmp.rc_mod_wheel, 128, 16, 148, 195); | |
541 | + SetRect(&tracer_bmp.rc_chorus_effect, 152, 16, 172, 195); | |
542 | + SetRect(&tracer_bmp.rc_reverb_effect, 176, 16, 196, 195); | |
543 | + SetRect(&tracer_bmp.rc_velocity[0], 200, 16, 230, 215); | |
544 | + SetRect(&tracer_bmp.rc_velocity[1], 231, 16, 261, 215); | |
545 | + SetRect(&tracer_bmp.rc_notes, 16, 59, 58, 78); | |
544 | 546 | ///r |
545 | - SetRect(&tracer_bmp.rc_notes_on, 298, 59, 340, 78); | |
546 | - SetRect(&tracer_bmp.rc_notes_sustain, 298, 83, 340, 102); | |
547 | - for (i = 0; i < 6; i++) { | |
548 | - SetRect(&tracer_bmp.rc_notes_mask[i], 16 + i * 46, 107, 58 + i * 46, 126); | |
549 | - SetRect(&tracer_bmp.rc_note[i], 16 + i * 46, 271, 58 + i * 46, 290); | |
550 | - SetRect(&tracer_bmp.rc_note_on[i], 16 + i * 46, 319, 58 + i * 46, 338); | |
551 | - SetRect(&tracer_bmp.rc_note_sustain[i], 16 + i * 46, 367, 58 + i * 46, 386); | |
552 | - } | |
553 | - for (i = 0; i < 6; i++) { | |
554 | - SetRect(&tracer_bmp.rc_notes_mask[i + 6], 16 + i * 46, 131, 58 + i * 46, 150); | |
555 | - SetRect(&tracer_bmp.rc_note[i + 6], 16 + i * 46, 295, 58 + i * 46, 314); | |
556 | - SetRect(&tracer_bmp.rc_note_on[i + 6], 16 + i * 46, 343, 58 + i * 46, 362); | |
557 | - SetRect(&tracer_bmp.rc_note_sustain[i + 6], 16 + i * 46, 391, 58 + i * 46, 410); | |
558 | - } | |
559 | - notes_view_generate(TRUE); | |
560 | - SetRect(&tracer_bmp.rc_gm_on, 64, 59, 88, 78); | |
561 | - SetRect(&tracer_bmp.rc_gm_off, 64, 83, 88, 102); | |
562 | - SetRect(&tracer_bmp.rc_gs_on, 96, 59, 120, 78); | |
563 | - SetRect(&tracer_bmp.rc_gs_off, 96, 83, 120, 102); | |
564 | - SetRect(&tracer_bmp.rc_xg_on, 128, 59, 152, 78); | |
565 | - SetRect(&tracer_bmp.rc_xg_off, 128, 83, 152, 102); | |
547 | + SetRect(&tracer_bmp.rc_notes_on, 298, 59, 340, 78); | |
548 | + SetRect(&tracer_bmp.rc_notes_sustain, 298, 83, 340, 102); | |
549 | + for (i = 0; i < 6; i++) { | |
550 | + SetRect(&tracer_bmp.rc_notes_mask[i], 16 + i * 46, 107, 58 + i * 46, 126); | |
551 | + SetRect(&tracer_bmp.rc_note[i], 16 + i * 46, 271, 58 + i * 46, 290); | |
552 | + SetRect(&tracer_bmp.rc_note_on[i], 16 + i * 46, 319, 58 + i * 46, 338); | |
553 | + SetRect(&tracer_bmp.rc_note_sustain[i], 16 + i * 46, 367, 58 + i * 46, 386); | |
554 | + } | |
555 | + for (i = 0; i < 6; i++) { | |
556 | + SetRect(&tracer_bmp.rc_notes_mask[i + 6], 16 + i * 46, 131, 58 + i * 46, 150); | |
557 | + SetRect(&tracer_bmp.rc_note[i + 6], 16 + i * 46, 295, 58 + i * 46, 314); | |
558 | + SetRect(&tracer_bmp.rc_note_on[i + 6], 16 + i * 46, 343, 58 + i * 46, 362); | |
559 | + SetRect(&tracer_bmp.rc_note_sustain[i + 6], 16 + i * 46, 391, 58 + i * 46, 410); | |
560 | + } | |
561 | + notes_view_generate(TRUE); | |
562 | + SetRect(&tracer_bmp.rc_gm_on, 64, 59, 88, 78); | |
563 | + SetRect(&tracer_bmp.rc_gm_off, 64, 83, 88, 102); | |
564 | + SetRect(&tracer_bmp.rc_gs_on, 96, 59, 120, 78); | |
565 | + SetRect(&tracer_bmp.rc_gs_off, 96, 83, 120, 102); | |
566 | + SetRect(&tracer_bmp.rc_xg_on, 128, 59, 152, 78); | |
567 | + SetRect(&tracer_bmp.rc_xg_off, 128, 83, 152, 102); | |
566 | 568 | ///r |
567 | - SetRect(&tracer_bmp.rc_gm2_on, 160, 59, 184, 78); | |
568 | - SetRect(&tracer_bmp.rc_gm2_off, 160, 83, 184, 102); | |
569 | - SetRect(&tracer_bmp.rc_sd_on, 192, 59, 216, 78); | |
570 | - SetRect(&tracer_bmp.rc_sd_off, 192, 83, 216, 102); | |
571 | - SetRect(&tracer_bmp.rc_kg_on, 224, 59, 248, 78); | |
572 | - SetRect(&tracer_bmp.rc_kg_off, 224, 83, 248, 102); | |
573 | - SetRect(&tracer_bmp.rc_cm_on, 256, 59, 280, 78); | |
574 | - SetRect(&tracer_bmp.rc_cm_off, 256, 83, 280, 102); | |
575 | - for (i = 0; i < 4; i++) | |
576 | - for (j = 0; j < 8; j++) | |
577 | - SetRect(&tracer_bmp.rc_temper_keysig[i * 8 + j], | |
578 | - 16 + j * 37, 155 + i * 23, 49 + j * 37, 174 + i * 23); | |
579 | - for (i = 0; i < 8; i++) | |
580 | - SetRect(&tracer_bmp.rc_temper_type[i], | |
581 | - 16 + i * 23, 247, 35 + i * 23, 266); | |
582 | - | |
583 | - return 0; | |
569 | + SetRect(&tracer_bmp.rc_gm2_on, 160, 59, 184, 78); | |
570 | + SetRect(&tracer_bmp.rc_gm2_off, 160, 83, 184, 102); | |
571 | + SetRect(&tracer_bmp.rc_sd_on, 192, 59, 216, 78); | |
572 | + SetRect(&tracer_bmp.rc_sd_off, 192, 83, 216, 102); | |
573 | + SetRect(&tracer_bmp.rc_kg_on, 224, 59, 248, 78); | |
574 | + SetRect(&tracer_bmp.rc_kg_off, 224, 83, 248, 102); | |
575 | + SetRect(&tracer_bmp.rc_cm_on, 256, 59, 280, 78); | |
576 | + SetRect(&tracer_bmp.rc_cm_off, 256, 83, 280, 102); | |
577 | + for (i = 0; i < 4; i++) | |
578 | + for (j = 0; j < 8; j++) | |
579 | + SetRect(&tracer_bmp.rc_temper_keysig[i * 8 + j], | |
580 | + 16 + j * 37, 155 + i * 23, 49 + j * 37, 174 + i * 23); | |
581 | + for (i = 0; i < 8; i++) | |
582 | + SetRect(&tracer_bmp.rc_temper_type[i], | |
583 | + 16 + i * 23, 247, 35 + i * 23, 266); | |
584 | + | |
585 | + return 0; | |
584 | 586 | } |
585 | 587 | |
586 | 588 | void TracerWndReset(void) |
587 | 589 | { |
588 | - int i, j; | |
589 | - | |
590 | - TracerWndDrawSkip = 0; | |
591 | - strcpy(w32g_tracer_wnd.titlename, ""); | |
592 | - strcpy(w32g_tracer_wnd.filename, ""); | |
590 | + int i, j; | |
591 | + | |
592 | + TracerWndDrawSkip = 0; | |
593 | + strcpy(w32g_tracer_wnd.titlename, ""); | |
594 | + strcpy(w32g_tracer_wnd.filename, ""); | |
593 | 595 | #if 0 |
594 | - sprintf(w32g_tracer_wnd.current_time, "00:00:00"); | |
595 | - w32g_tracer_wnd.current_time_sec = 0; | |
596 | - w32g_tracer_wnd.tempo = 0; | |
597 | - w32g_tracer_wnd.master_volume = 0; | |
598 | - w32g_tracer_wnd.maxvoices = 0; | |
596 | + sprintf(w32g_tracer_wnd.current_time, "00:00:00"); | |
597 | + w32g_tracer_wnd.current_time_sec = 0; | |
598 | + w32g_tracer_wnd.tempo = 0; | |
599 | + w32g_tracer_wnd.master_volume = 0; | |
600 | + w32g_tracer_wnd.maxvoices = 0; | |
599 | 601 | #endif |
600 | - for (i = 0; i < TRACER_CHANNELS; i++) { | |
601 | - strcpy(w32g_tracer_wnd.instrument[i], " ----"); | |
602 | - w32g_tracer_wnd.mapID[i] = INST_NO_MAP; | |
603 | - w32g_tracer_wnd.bank[i] = 0; | |
604 | - w32g_tracer_wnd.program[i] = 0; | |
605 | - w32g_tracer_wnd.velocity[i] = 0; | |
606 | - w32g_tracer_wnd.volume[i] = 0; | |
607 | - w32g_tracer_wnd.expression[i] = 0; | |
608 | - w32g_tracer_wnd.panning[i] = 64; | |
609 | - w32g_tracer_wnd.sustain[i] = 0; | |
610 | - w32g_tracer_wnd.pitch_bend[i] = 0x2000; | |
611 | - w32g_tracer_wnd.mod_wheel[i] = 0; | |
612 | - w32g_tracer_wnd.chorus_effect[i] = 0; | |
613 | - w32g_tracer_wnd.reverb_effect[i] = 0; | |
614 | - w32g_tracer_wnd.tt[i] = 0; | |
615 | - w32g_tracer_wnd.insertion_effect[i] = 0; | |
616 | - for (j = 0; j < 256; j++) { | |
617 | - w32g_tracer_wnd.note_voice[i][j] = 0; | |
618 | - w32g_tracer_wnd.note_vel[i][j] = -1; | |
619 | - } | |
620 | - } | |
621 | - w32g_tracer_wnd.play_system_mode = play_system_mode; | |
622 | - w32g_tracer_wnd.quietchannels = quietchannels; | |
623 | - w32g_tracer_wnd.channel_mute = channel_mute; | |
624 | - | |
625 | - InvalidateRect(w32g_tracer_wnd.hwnd, NULL, FALSE); | |
602 | + for (i = 0; i < TRACER_CHANNELS; i++) { | |
603 | + strcpy(w32g_tracer_wnd.instrument[i], " ----"); | |
604 | + w32g_tracer_wnd.mapID[i] = INST_NO_MAP; | |
605 | + w32g_tracer_wnd.bank[i] = 0; | |
606 | + w32g_tracer_wnd.program[i] = 0; | |
607 | + w32g_tracer_wnd.velocity[i] = 0; | |
608 | + w32g_tracer_wnd.volume[i] = 0; | |
609 | + w32g_tracer_wnd.expression[i] = 0; | |
610 | + w32g_tracer_wnd.panning[i] = 64; | |
611 | + w32g_tracer_wnd.sustain[i] = 0; | |
612 | + w32g_tracer_wnd.pitch_bend[i] = 0x2000; | |
613 | + w32g_tracer_wnd.mod_wheel[i] = 0; | |
614 | + w32g_tracer_wnd.chorus_effect[i] = 0; | |
615 | + w32g_tracer_wnd.reverb_effect[i] = 0; | |
616 | + w32g_tracer_wnd.tt[i] = 0; | |
617 | + w32g_tracer_wnd.insertion_effect[i] = 0; | |
618 | + for (j = 0; j < 256; j++) { | |
619 | + w32g_tracer_wnd.note_voice[i][j] = 0; | |
620 | + w32g_tracer_wnd.note_vel[i][j] = -1; | |
621 | + } | |
622 | + } | |
623 | + w32g_tracer_wnd.play_system_mode = play_system_mode; | |
624 | + w32g_tracer_wnd.quietchannels = quietchannels; | |
625 | + w32g_tracer_wnd.channel_mute = channel_mute; | |
626 | + | |
627 | + InvalidateRect(w32g_tracer_wnd.hwnd, NULL, FALSE); | |
626 | 628 | } |
627 | 629 | |
628 | 630 | void TracerWndReset2(void) |
629 | 631 | { |
630 | - int i, j; | |
631 | - for (i = 0; i < TRACER_CHANNELS; i++) { | |
632 | - w32g_tracer_wnd.velocity[i] = 0; | |
633 | - for (j = 0; j < 128; j++) { | |
634 | - w32g_tracer_wnd.note_voice[i][j] = 0; | |
635 | - w32g_tracer_wnd.note_vel[i][j] = -1; | |
636 | - } | |
637 | - } | |
638 | - TRACER_LOCK(); | |
639 | - for (i = 0; i < TRACER_CHANNELS; i++) { | |
640 | - for (j = 0; j < 128; j++) { | |
641 | - RECT rc; | |
642 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_notes) == 0) | |
643 | - notes_view_draw(&rc, j, w32g_tracer_wnd.note_voice[i][j], w32g_tracer_wnd.note_vel[i][j], TRUE, FALSE); | |
644 | - } | |
645 | - } | |
646 | - TRACER_UNLOCK(); | |
632 | + int i, j; | |
633 | + for (i = 0; i < TRACER_CHANNELS; i++) { | |
634 | + w32g_tracer_wnd.velocity[i] = 0; | |
635 | + for (j = 0; j < 128; j++) { | |
636 | + w32g_tracer_wnd.note_voice[i][j] = 0; | |
637 | + w32g_tracer_wnd.note_vel[i][j] = -1; | |
638 | + } | |
639 | + } | |
640 | + TRACER_LOCK(); | |
641 | + for (i = 0; i < TRACER_CHANNELS; i++) { | |
642 | + for (j = 0; j < 128; j++) { | |
643 | + RECT rc; | |
644 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_notes) == 0) | |
645 | + notes_view_draw(&rc, j, w32g_tracer_wnd.note_voice[i][j], w32g_tracer_wnd.note_vel[i][j], TRUE, FALSE); | |
646 | + } | |
647 | + } | |
648 | + TRACER_UNLOCK(); | |
647 | 649 | } |
648 | 650 | |
649 | 651 |
@@ -671,2203 +673,2283 @@ void TracerWndClear(int lockflag) | ||
671 | 673 | if (lockflag) TRACER_UNLOCK(); |
672 | 674 | } |
673 | 675 | |
676 | +void TracerWndRecalcLayout(int lockflag) | |
677 | +{ | |
678 | + TTTOOLINFO ti = {0}; | |
679 | + int i = 0; | |
680 | + | |
681 | + if (lockflag) TRACER_LOCK(); | |
682 | + | |
683 | + ti.cbSize = sizeof(ti); | |
684 | + ti.uFlags = TTF_SUBCLASS; | |
685 | + ti.hwnd = w32g_tracer_wnd.hwnd; | |
686 | + ti.lpszText = LPSTR_TEXTCALLBACK; | |
687 | + | |
688 | + // title | |
689 | + ti.uId = TRACER_CHANNELS; | |
690 | + if (get_head_rc(&ti.rect, &w32g_tracer_wnd.rc_head_rest) != 0) | |
691 | + memset(&ti.rect, 0, sizeof(ti.rect)); | |
692 | + SendMessage(w32g_tracer_wnd.hTool, TTM_NEWTOOLRECT, 0, (LPARAM)&ti); | |
693 | + | |
694 | + // instruments | |
695 | + for (i = 0; i < TRACER_CHANNELS; i++) { | |
696 | + ti.uId = i; | |
697 | + if (get_ch_rc(i, &ti.rect, &w32g_tracer_wnd.rc_instrument) != 0) | |
698 | + memset(&ti.rect, 0, sizeof(ti.rect)); | |
699 | + SendMessage(w32g_tracer_wnd.hTool, TTM_NEWTOOLRECT, 0, (LPARAM)&ti); | |
700 | + } | |
701 | + | |
702 | + if (lockflag) TRACER_UNLOCK(); | |
703 | +} | |
704 | + | |
674 | 705 | #define TRACER_VOICE_OFF -1 |
675 | 706 | #define TRACER_VOICE_SUSTAINED -2 |
676 | 707 | |
677 | 708 | void w32_tracer_ctl_event(CtlEvent *e) |
678 | 709 | { |
679 | - RECT rc; | |
680 | - int v1, v2; | |
681 | - | |
682 | - if (e->type >= CTLE_CURRENT_TIME && w32g_play_active && TracerWndDrawSkip) | |
683 | - return; | |
710 | + RECT rc; | |
711 | + int v1, v2; | |
712 | + | |
713 | + if(e->type >= CTLE_CURRENT_TIME && w32g_play_active && TracerWndDrawSkip) | |
714 | + return; | |
684 | 715 | switch (e->type) { |
685 | - case CTLE_NOW_LOADING: { | |
686 | - char *title; | |
687 | - TracerWndReset(); | |
688 | - TracerWndPaintAll(TRUE); | |
689 | - strncpy(w32g_tracer_wnd.filename, (char*) e->v1, FILEPATH_MAX); | |
690 | - w32g_tracer_wnd.filename[FILEPATH_MAX - 1] = '\0'; | |
691 | - title = get_midi_title(w32g_tracer_wnd.filename); | |
692 | - if (!title) title = w32g_tracer_wnd.filename; | |
693 | - strcpy(w32g_tracer_wnd.titlename, " "); | |
694 | - strlcat(w32g_tracer_wnd.titlename, title, FILEPATH_MAX); | |
695 | - w32g_tracer_wnd.titlename[FILEPATH_MAX - 1] = '\0'; | |
696 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_head_rest); | |
697 | - cheap_string_view_draw(&rc, w32g_tracer_wnd.titlename, C_TEXT_FORE, C_TEXT_BACK, CSV_LEFT, TRUE); | |
698 | - break; } | |
699 | - case CTLE_LOADING_DONE: | |
700 | - break; | |
701 | - case CTLE_PLAY_START: { | |
716 | + case CTLE_NOW_LOADING: | |
717 | + { | |
718 | + char *title; | |
719 | + TracerWndReset(); | |
720 | + TracerWndPaintAll(TRUE); | |
721 | + strncpy(w32g_tracer_wnd.filename, (char*)e->v1, FILEPATH_MAX); | |
722 | + w32g_tracer_wnd.filename[FILEPATH_MAX - 1] = '\0'; | |
723 | + title = get_midi_title(w32g_tracer_wnd.filename); | |
724 | + if (!title) title = w32g_tracer_wnd.filename; | |
725 | + strcpy(w32g_tracer_wnd.titlename, " "); | |
726 | + strlcat(w32g_tracer_wnd.titlename, title, FILEPATH_MAX); | |
727 | + w32g_tracer_wnd.titlename[FILEPATH_MAX - 1] = '\0'; | |
728 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_head_rest); | |
729 | + cheap_string_view_draw(&rc, w32g_tracer_wnd.titlename, C_TEXT_FORE, C_TEXT_BACK, CSV_LEFT, TRUE); | |
730 | + } | |
731 | + break; | |
732 | + case CTLE_LOADING_DONE: | |
733 | + break; | |
734 | + case CTLE_PLAY_START: | |
702 | 735 | #if 0 |
703 | - int i; | |
704 | - for (i = 0; i < TRACER_CHANNELS; i++) { | |
705 | -// tracer_ch_program_draw(i, -1, -1, (char*) -1, -1); | |
706 | - w32g_tracer_wnd.volume[i] = channel[i].volume; | |
707 | - w32g_tracer_wnd.expression[i] = channel[i].expression; | |
708 | - w32g_tracer_wnd.panning[i] = channel[i].panning; | |
709 | - w32g_tracer_wnd.sustain[i] = channel[i].sustain; | |
710 | - w32g_tracer_wnd.pitch_bend[i] = channel[i].pitchbend; | |
711 | - w32g_tracer_wnd.mod_wheel[i] = channel[i].mod.val; | |
712 | - w32g_tracer_wnd.chorus_effect[i] = channel[i].chorus_level; | |
713 | - w32g_tracer_wnd.reverb_effect[i] = channel[i].reverb_level; | |
714 | - } | |
736 | + { | |
737 | + int i; | |
738 | + for (i = 0; i < TRACER_CHANNELS; i++) { | |
739 | +// tracer_ch_program_draw(i, -1, -1, (char*)-1, -1); | |
740 | + w32g_tracer_wnd.volume[i] = channel[i].volume; | |
741 | + w32g_tracer_wnd.expression[i] = channel[i].expression; | |
742 | + w32g_tracer_wnd.panning[i] = channel[i].panning; | |
743 | + w32g_tracer_wnd.sustain[i] = channel[i].sustain; | |
744 | + w32g_tracer_wnd.pitch_bend[i] = channel[i].pitchbend; | |
745 | + w32g_tracer_wnd.mod_wheel[i] = channel[i].mod.val; | |
746 | + w32g_tracer_wnd.chorus_effect[i] = channel[i].chorus_level; | |
747 | + w32g_tracer_wnd.reverb_effect[i] = channel[i].reverb_level; | |
748 | + } | |
715 | 749 | #endif |
716 | - break; } | |
717 | - case CTLE_PLAY_END: | |
718 | - break; | |
719 | - case CTLE_CUEPOINT: | |
720 | - break; | |
721 | - case CTLE_TEMPO: { | |
750 | + break; | |
751 | + case CTLE_PLAY_END: | |
752 | + break; | |
753 | + case CTLE_CUEPOINT: | |
754 | + break; | |
755 | + case CTLE_TEMPO: | |
722 | 756 | #if 0 |
723 | - char buff[64]; | |
724 | - w32g_tracer_wnd.tempo = (int) e->v1; | |
725 | - sprintf(buff, "%08ld", w32g_tracer_wnd.current_time); | |
726 | - cheap_string_view_draw(&w32g_tracer_wnd.rc_tempo, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, TRUE); | |
757 | + { | |
758 | + char buff[64]; | |
759 | + w32g_tracer_wnd.tempo = (int)e->v1; | |
760 | + sprintf(buff, "%08ld", w32g_tracer_wnd.current_time); | |
761 | + cheap_string_view_draw(&w32g_tracer_wnd.rc_tempo, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, TRUE); | |
762 | + } | |
727 | 763 | #endif |
728 | - break; } | |
729 | - case CTLE_METRONOME: | |
730 | - break; | |
731 | - case CTLE_CURRENT_TIME: { | |
764 | + break; | |
765 | + case CTLE_METRONOME: | |
766 | + break; | |
767 | + case CTLE_CURRENT_TIME: | |
732 | 768 | #if 0 |
733 | - int sec, min, hour; | |
734 | - if (midi_trace.flush_flag) | |
735 | - return; | |
736 | - if (ctl->trace_playing) | |
737 | - sec = (int) e->v1; | |
738 | - else { | |
739 | - sec = current_trace_samples(); | |
740 | - if (sec < 0) | |
741 | - sec = (int) e->v1; | |
742 | - else | |
743 | - sec = sec / play_mode->rate; | |
744 | - } | |
745 | - min = sec / 60; sec %= 60; | |
746 | - hour = min / 60; min %= 60; | |
747 | - sprintf(w32g_tracer_wnd.current_time, "%02d:%02d:%02d", hour, min, sec); | |
748 | - w32g_tracer_wnd.current_time_sec = sec; | |
749 | - cheap_string_view_draw(&w32g_tracer_wnd.rc_current_time, w32g_tracer_wnd.current_time, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, TRUE); | |
750 | - cheap_volume_view_draw(&w32g_tracer_wnd.rc_maxvoices, (int) e->v2, voices, C_BAR_FORE, C_BAR_BACK, CVV_TYPE_LEFT, TRUE); | |
769 | + { | |
770 | + int sec, min, hour; | |
771 | + if (midi_trace.flush_flag) | |
772 | + return; | |
773 | + if (ctl->trace_playing) | |
774 | + sec = (int)e->v1; | |
775 | + else { | |
776 | + sec = current_trace_samples(); | |
777 | + if (sec < 0) | |
778 | + sec = (int)e->v1; | |
779 | + else | |
780 | + sec = sec / play_mode->rate; | |
781 | + } | |
782 | + min = sec / 60; sec %= 60; | |
783 | + hour = min / 60; min %= 60; | |
784 | + sprintf(w32g_tracer_wnd.current_time, "%02d:%02d:%02d", hour, min, sec); | |
785 | + w32g_tracer_wnd.current_time_sec = sec; | |
786 | + cheap_string_view_draw(&w32g_tracer_wnd.rc_current_time, w32g_tracer_wnd.current_time, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, TRUE); | |
787 | + cheap_volume_view_draw(&w32g_tracer_wnd.rc_maxvoices, (int)e->v2, voices, C_BAR_FORE, C_BAR_BACK, CVV_TYPE_LEFT, TRUE); | |
788 | + } | |
751 | 789 | #endif |
752 | - break; } | |
753 | - case CTLE_NOTE: { | |
754 | - int vel = 0, vel_old = w32g_tracer_wnd.velocity[(int) e->v2]; | |
755 | - switch ((int) e->v1) { | |
756 | - case VOICE_ON: | |
757 | - w32g_tracer_wnd.velocity[(int) e->v2] += (int) e->v4; | |
758 | - w32g_tracer_wnd.note_voice[(int) e->v2][(int) e->v3]++; | |
759 | - break; | |
760 | - case VOICE_SUSTAINED: | |
761 | - vel = TRACER_VOICE_SUSTAINED; | |
762 | - break; | |
763 | - case VOICE_DIE: | |
764 | - case VOICE_FREE: | |
765 | - case VOICE_OFF: | |
766 | - w32g_tracer_wnd.velocity[(int) e->v2] -= (int) e->v4; | |
767 | - w32g_tracer_wnd.note_voice[(int) e->v2][(int) e->v3]--; | |
768 | - if (w32g_tracer_wnd.note_voice[(int) e->v2][(int) e->v3] <= 0) { | |
769 | - vel = TRACER_VOICE_OFF; | |
770 | - w32g_tracer_wnd.note_voice[(int) e->v2][(int) e->v3] = 0; | |
771 | - } | |
772 | - break; | |
773 | - } | |
774 | - if (w32g_tracer_wnd.velocity[(int) e->v2] < 0) | |
775 | - w32g_tracer_wnd.velocity[(int) e->v2] = 0; | |
776 | - if (get_ch_rc((int) e->v2, &rc, &w32g_tracer_wnd.rc_notes) == 0) | |
777 | - notes_view_draw(&rc, (int) e->v3, w32g_tracer_wnd.note_voice[(int) e->v2][(int) e->v3], vel, FALSE, TRUE); | |
778 | - w32g_tracer_wnd.note_vel[(int) e->v2][(int) e->v3] = vel; | |
779 | - | |
780 | - if (get_ch_rc((int) e->v2, &rc, &w32g_tracer_wnd.rc_velocity) == 0) | |
781 | - tracer_velocity_draw_ex(&rc, w32g_tracer_wnd.velocity[(int) e->v2], vel_old, VEL_MAX, TRUE); | |
782 | - break; } | |
783 | - case CTLE_MASTER_VOLUME: | |
784 | -// ctl_master_volume((int) e->v1); | |
790 | + break; | |
791 | + case CTLE_NOTE: | |
792 | + { | |
793 | + int vel = 0, vel_old = w32g_tracer_wnd.velocity[(int)e->v2]; | |
794 | + switch ((int)e->v1) { | |
795 | + case VOICE_ON: | |
796 | + w32g_tracer_wnd.velocity[(int)e->v2] += (int)e->v4; | |
797 | + w32g_tracer_wnd.note_voice[(int)e->v2][(int)e->v3]++; | |
798 | + break; | |
799 | + case VOICE_SUSTAINED: | |
800 | + vel = TRACER_VOICE_SUSTAINED; | |
801 | + break; | |
802 | + case VOICE_DIE: | |
803 | + case VOICE_FREE: | |
804 | + case VOICE_OFF: | |
805 | + w32g_tracer_wnd.velocity[(int)e->v2] -= (int)e->v4; | |
806 | + w32g_tracer_wnd.note_voice[(int)e->v2][(int)e->v3]--; | |
807 | + if (w32g_tracer_wnd.note_voice[(int)e->v2][(int)e->v3] <= 0) { | |
808 | + vel = TRACER_VOICE_OFF; | |
809 | + w32g_tracer_wnd.note_voice[(int)e->v2][(int)e->v3] = 0; | |
810 | + } | |
811 | + break; | |
812 | + } | |
813 | + if (w32g_tracer_wnd.velocity[(int)e->v2] < 0) | |
814 | + w32g_tracer_wnd.velocity[(int)e->v2] = 0; | |
815 | + if (get_ch_rc((int)e->v2, &rc, &w32g_tracer_wnd.rc_notes) == 0) | |
816 | + notes_view_draw(&rc, (int)e->v3, w32g_tracer_wnd.note_voice[(int)e->v2][(int)e->v3], vel, FALSE, TRUE); | |
817 | + w32g_tracer_wnd.note_vel[(int)e->v2][(int)e->v3] = vel; | |
818 | + | |
819 | + if (get_ch_rc((int)e->v2, &rc, &w32g_tracer_wnd.rc_velocity) == 0) | |
820 | + tracer_velocity_draw_ex(&rc, w32g_tracer_wnd.velocity[(int)e->v2], vel_old, VEL_MAX, TRUE); | |
821 | + } | |
822 | + break; | |
823 | + case CTLE_MASTER_VOLUME: | |
824 | +// ctl_master_volume((int)e->v1); | |
785 | 825 | #if 0 |
786 | - w32g_tracer_wnd.master_volume = (int) e->v1; | |
787 | - cheap_volume_view_draw(&w32g_tracer_wnd.rc_master_volume, w32g_tracer_wnd.master_volume, 256, C_BAR_FORE, C_BAR_BACK, CVV_TYPE_LEFT, TRUE); | |
826 | + w32g_tracer_wnd.master_volume = (int)e->v1; | |
827 | + cheap_volume_view_draw(&w32g_tracer_wnd.rc_master_volume, w32g_tracer_wnd.master_volume, 256, C_BAR_FORE, C_BAR_BACK, CVV_TYPE_LEFT, TRUE); | |
788 | 828 | #endif |
789 | - break; | |
790 | - case CTLE_MUTE: | |
791 | - tracer_ch_number_draw((int) e->v1, (int) e->v2, TRUE); | |
792 | - break; | |
793 | - case CTLE_PROGRAM: | |
794 | - v1 = (int) e->v1; v2 = (int) e->v2; | |
795 | - tracer_ch_program_draw(v1, -1, v2, (char*) e->v3, -1, TRUE); | |
796 | - break; | |
797 | - case CTLE_DRUMPART: | |
798 | - break; | |
799 | - case CTLE_VOLUME: | |
800 | - v1 = (int) e->v1; v2 = (int) e->v2; | |
801 | - if (w32g_tracer_wnd.volume[v1] != v2) | |
802 | - if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_volume) == 0) | |
803 | - tracer_volume_draw(&rc, v2, 128, TRUE); | |
804 | - w32g_tracer_wnd.volume[v1] = v2; | |
805 | - break; | |
806 | - case CTLE_EXPRESSION: | |
807 | - v1 = (int) e->v1; v2 = (int) e->v2; | |
808 | - if (w32g_tracer_wnd.expression[v1] != v2) | |
809 | - if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_expression) == 0) | |
810 | - tracer_expression_draw(&rc, v2, 128, TRUE); | |
811 | - w32g_tracer_wnd.expression[v1] = v2; | |
812 | - break; | |
813 | - case CTLE_PANNING: | |
814 | - v1 = (int) e->v1; v2 = (int) e->v2; | |
815 | - if (w32g_tracer_wnd.panning[v1] != v2) | |
816 | - if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_panning) == 0) | |
817 | - tracer_pan_draw(&rc, v2, 128, TRUE); | |
818 | - w32g_tracer_wnd.panning[v1] = v2; | |
819 | - break; | |
820 | - case CTLE_SUSTAIN: | |
821 | - v1 = (int) e->v1; v2 = (int) e->v2; | |
822 | - if (w32g_tracer_wnd.sustain[v1] != v2) | |
823 | - if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_sustain) == 0) | |
824 | - tracer_sustain_draw(&rc, v2, TRUE); | |
825 | - w32g_tracer_wnd.sustain[v1] = v2; | |
826 | - break; | |
827 | - case CTLE_PITCH_BEND: | |
828 | - v1 = (int) e->v1; v2 = (int) e->v2; | |
829 | - if (w32g_tracer_wnd.pitch_bend[v1] != v2) | |
830 | - if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_pitch_bend) == 0) | |
831 | - tracer_pitch_bend_draw(&rc, v2, 0x4000, TRUE); | |
832 | - w32g_tracer_wnd.pitch_bend[v1] = v2; | |
833 | - break; | |
834 | - case CTLE_MOD_WHEEL: | |
835 | - v1 = (int) e->v1; v2 = (int) e->v2; | |
836 | - if (w32g_tracer_wnd.mod_wheel[v1] != v2) | |
837 | - if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_mod_wheel) == 0) | |
838 | - tracer_mod_wheel_draw(&rc, v2, 32, TRUE); | |
839 | - w32g_tracer_wnd.mod_wheel[v1] = v2; | |
840 | - break; | |
841 | - case CTLE_CHORUS_EFFECT: | |
842 | - v1 = (int) e->v1; v2 = (int) e->v2; | |
843 | - if (w32g_tracer_wnd.chorus_effect[v1] != v2) | |
844 | - if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_chorus_effect) == 0) | |
845 | - tracer_chorus_effect_draw(&rc, v2, 128, TRUE); | |
846 | - w32g_tracer_wnd.chorus_effect[v1] = v2; | |
847 | - break; | |
848 | - case CTLE_REVERB_EFFECT: | |
849 | - v1 = (int) e->v1; v2 = (int) e->v2; | |
850 | - if (w32g_tracer_wnd.reverb_effect[v1] != v2) | |
851 | - if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_reverb_effect) == 0) | |
852 | - tracer_reverb_effect_draw(&rc, v2, 128, TRUE); | |
853 | - w32g_tracer_wnd.reverb_effect[v1] = v2; | |
854 | - break; | |
855 | - case CTLE_KEY_OFFSET: | |
856 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_temper_keysig); | |
857 | - tracer_temper_keysig_draw(&rc, CTL_STATUS_UPDATE, (int) e->v1, TRUE); | |
858 | - break; | |
859 | - case CTLE_TEMPER_KEYSIG: | |
860 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_temper_keysig); | |
861 | - tracer_temper_keysig_draw(&rc, (int8) e->v1, CTL_STATUS_UPDATE, TRUE); | |
862 | - break; | |
863 | - case CTLE_TEMPER_TYPE: | |
864 | - if (!get_ch_rc((int) e->v1, &rc, &w32g_tracer_wnd.rc_temper_type)) | |
865 | - tracer_temper_type_draw(&rc, (int) e->v1, (int8) e->v2, TRUE); | |
866 | - break; | |
867 | - case CTLE_LYRIC: | |
868 | - break; | |
869 | - case CTLE_REFRESH: | |
870 | - break; | |
871 | - case CTLE_RESET: | |
872 | - TracerWndReset2(); | |
829 | + break; | |
830 | + case CTLE_MUTE: | |
831 | + tracer_ch_number_draw((int) e->v1, (int) e->v2, TRUE); | |
832 | + break; | |
833 | + case CTLE_PROGRAM: | |
834 | + v1 = (int)e->v1; v2 = (int)e->v2; | |
835 | + tracer_ch_program_draw(v1, -1, v2, (char*)e->v3, -1, TRUE); | |
836 | + break; | |
837 | + case CTLE_DRUMPART: | |
838 | + break; | |
839 | + case CTLE_VOLUME: | |
840 | + v1 = (int)e->v1; v2 = (int)e->v2; | |
841 | + if (w32g_tracer_wnd.volume[v1] != v2) | |
842 | + if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_volume) == 0) | |
843 | + tracer_volume_draw(&rc, v2, 128, TRUE); | |
844 | + w32g_tracer_wnd.volume[v1] = v2; | |
845 | + break; | |
846 | + case CTLE_EXPRESSION: | |
847 | + v1 = (int)e->v1; v2 = (int)e->v2; | |
848 | + if (w32g_tracer_wnd.expression[v1] != v2) | |
849 | + if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_expression) == 0) | |
850 | + tracer_expression_draw(&rc, v2, 128, TRUE); | |
851 | + w32g_tracer_wnd.expression[v1] = v2; | |
852 | + break; | |
853 | + case CTLE_PANNING: | |
854 | + v1 = (int)e->v1; v2 = (int)e->v2; | |
855 | + if (w32g_tracer_wnd.panning[v1] != v2) | |
856 | + if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_panning) == 0) | |
857 | + tracer_pan_draw(&rc, v2, 128, TRUE); | |
858 | + w32g_tracer_wnd.panning[v1] = v2; | |
859 | + break; | |
860 | + case CTLE_SUSTAIN: | |
861 | + v1 = (int)e->v1; v2 = (int)e->v2; | |
862 | + if (w32g_tracer_wnd.sustain[v1] != v2) | |
863 | + if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_sustain) == 0) | |
864 | + tracer_sustain_draw(&rc, v2, TRUE); | |
865 | + w32g_tracer_wnd.sustain[v1] = v2; | |
866 | + break; | |
867 | + case CTLE_PITCH_BEND: | |
868 | + v1 = (int)e->v1; v2 = (int)e->v2; | |
869 | + if (w32g_tracer_wnd.pitch_bend[v1] != v2) | |
870 | + if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_pitch_bend) == 0) | |
871 | + tracer_pitch_bend_draw(&rc, v2, 0x4000, TRUE); | |
872 | + w32g_tracer_wnd.pitch_bend[v1] = v2; | |
873 | + break; | |
874 | + case CTLE_MOD_WHEEL: | |
875 | + v1 = (int)e->v1; v2 = (int)e->v2; | |
876 | + if (w32g_tracer_wnd.mod_wheel[v1] != v2) | |
877 | + if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_mod_wheel) == 0) | |
878 | + tracer_mod_wheel_draw(&rc, v2, 32, TRUE); | |
879 | + w32g_tracer_wnd.mod_wheel[v1] = v2; | |
880 | + break; | |
881 | + case CTLE_CHORUS_EFFECT: | |
882 | + v1 = (int)e->v1; v2 = (int)e->v2; | |
883 | + if (w32g_tracer_wnd.chorus_effect[v1] != v2) | |
884 | + if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_chorus_effect) == 0) | |
885 | + tracer_chorus_effect_draw(&rc, v2, 128, TRUE); | |
886 | + w32g_tracer_wnd.chorus_effect[v1] = v2; | |
887 | + break; | |
888 | + case CTLE_REVERB_EFFECT: | |
889 | + v1 = (int)e->v1; v2 = (int)e->v2; | |
890 | + if (w32g_tracer_wnd.reverb_effect[v1] != v2) | |
891 | + if (get_ch_rc(v1, &rc, &w32g_tracer_wnd.rc_reverb_effect) == 0) | |
892 | + tracer_reverb_effect_draw(&rc, v2, 128, TRUE); | |
893 | + w32g_tracer_wnd.reverb_effect[v1] = v2; | |
894 | + break; | |
895 | + case CTLE_KEY_OFFSET: | |
896 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_temper_keysig); | |
897 | + tracer_temper_keysig_draw(&rc, CTL_STATUS_UPDATE, (int) e->v1, TRUE); | |
898 | + break; | |
899 | + case CTLE_TEMPER_KEYSIG: | |
900 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_temper_keysig); | |
901 | + tracer_temper_keysig_draw(&rc, (int8) e->v1, CTL_STATUS_UPDATE, TRUE); | |
902 | + break; | |
903 | + case CTLE_TEMPER_TYPE: | |
904 | + if (!get_ch_rc((int) e->v1, &rc, &w32g_tracer_wnd.rc_temper_type)) | |
905 | + tracer_temper_type_draw(&rc, (int) e->v1, (int8) e->v2, TRUE); | |
906 | + break; | |
907 | + case CTLE_LYRIC: | |
908 | + break; | |
909 | + case CTLE_REFRESH: | |
910 | + break; | |
911 | + case CTLE_RESET: | |
912 | + TracerWndReset2(); | |
873 | 913 | #if 0 |
874 | - if (w32g_tracer_wnd.play_system_mode != play_system_mode) { | |
914 | + if (w32g_tracer_wnd.play_system_mode != play_system_mode) { | |
875 | 915 | #endif |
876 | - if (TracerWndViewCh == 0) { | |
877 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_gm); | |
878 | - tracer_gm_draw(&rc, play_system_mode == GM_SYSTEM_MODE ? 1 : 0, TRUE); | |
879 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_gs); | |
880 | - tracer_gs_draw(&rc, play_system_mode == GS_SYSTEM_MODE ? 1 : 0, TRUE); | |
881 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_xg); | |
882 | - tracer_xg_draw(&rc, play_system_mode == XG_SYSTEM_MODE ? 1 : 0, TRUE); | |
916 | + if (TracerWndViewCh == 0) { | |
917 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_gm); | |
918 | + tracer_gm_draw(&rc, play_system_mode == GM_SYSTEM_MODE ? 1 : 0, TRUE); | |
919 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_gs); | |
920 | + tracer_gs_draw(&rc, play_system_mode == GS_SYSTEM_MODE ? 1 : 0, TRUE); | |
921 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_xg); | |
922 | + tracer_xg_draw(&rc, play_system_mode == XG_SYSTEM_MODE ? 1 : 0, TRUE); | |
883 | 923 | ///r |
884 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_gm2); | |
885 | - tracer_gm2_draw(&rc, play_system_mode == GM2_SYSTEM_MODE ? 1 : 0, TRUE); | |
886 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_sd); | |
887 | - tracer_sd_draw(&rc, play_system_mode == SD_SYSTEM_MODE ? 1 : 0, TRUE); | |
888 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_kg); | |
889 | - tracer_kg_draw(&rc, play_system_mode == KG_SYSTEM_MODE ? 1 : 0, TRUE); | |
890 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_cm); | |
891 | - tracer_cm_draw(&rc, play_system_mode == CM_SYSTEM_MODE ? 1 : 0, TRUE); | |
892 | - } | |
924 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_gm2); | |
925 | + tracer_gm2_draw(&rc, play_system_mode == GM2_SYSTEM_MODE ? 1 : 0, TRUE); | |
926 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_sd); | |
927 | + tracer_sd_draw(&rc, play_system_mode == SD_SYSTEM_MODE ? 1 : 0, TRUE); | |
928 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_kg); | |
929 | + tracer_kg_draw(&rc, play_system_mode == KG_SYSTEM_MODE ? 1 : 0, TRUE); | |
930 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_cm); | |
931 | + tracer_cm_draw(&rc, play_system_mode == CM_SYSTEM_MODE ? 1 : 0, TRUE); | |
932 | + } | |
893 | 933 | #if 0 |
894 | - } | |
934 | + } | |
895 | 935 | #endif |
896 | - w32g_tracer_wnd.play_system_mode = play_system_mode; | |
897 | - break; | |
898 | - case CTLE_SPEANA: | |
899 | - break; | |
900 | - case CTLE_PAUSE: | |
901 | - break; | |
902 | - case CTLE_MAXVOICES: | |
936 | + w32g_tracer_wnd.play_system_mode = play_system_mode; | |
937 | + break; | |
938 | + case CTLE_SPEANA: | |
939 | + break; | |
940 | + case CTLE_PAUSE: | |
941 | + break; | |
942 | + case CTLE_MAXVOICES: | |
903 | 943 | #if 0 |
904 | - w32g_tracer_wnd.maxvoices = (int) e->v1; | |
944 | + w32g_tracer_wnd.maxvoices = (int)e->v1; | |
905 | 945 | #endif |
906 | - break; | |
907 | - case CTLE_GSLCD: | |
908 | - break; | |
909 | - case CTLE_INSERTION_EFFECT: | |
910 | - v1 = (int) e->v1; v2 = (int) e->v2; | |
911 | - w32g_tracer_wnd.insertion_effect[v1] = v2; | |
912 | - //tracer_ch_program_draw(v1, w32g_tracer_wnd.bank[v1], w32g_tracer_wnd.program[v1], w32g_tracer_wnd.instrument[v1], w32g_tracer_wnd.mapID[v1], FALSE); | |
913 | - tracer_ch_number_draw(v1, CTL_STATUS_UPDATE, FALSE); | |
914 | - break; | |
946 | + break; | |
947 | + case CTLE_GSLCD: | |
948 | + break; | |
949 | + case CTLE_INSERTION_EFFECT: | |
950 | + v1 = (int)e->v1; v2 = (int)e->v2; | |
951 | + w32g_tracer_wnd.insertion_effect[v1] = v2; | |
952 | + //tracer_ch_program_draw(v1, w32g_tracer_wnd.bank[v1], w32g_tracer_wnd.program[v1], w32g_tracer_wnd.instrument[v1], w32g_tracer_wnd.mapID[v1], FALSE); | |
953 | + tracer_ch_number_draw(v1, CTL_STATUS_UPDATE, FALSE); | |
954 | + break; | |
915 | 955 | } |
916 | 956 | } |
917 | 957 | |
918 | 958 | static void recalc_tracer_rc(void) |
919 | 959 | { |
920 | - int x, width, temper_x; | |
921 | - int add_w, height; | |
922 | - add_w = w32g_tracer_wnd.width - TRACER_MINWIDTH; | |
923 | - add_w = w32g_tracer_wnd.width - TRACER_MINWTHRESHOLD; | |
924 | - RANGE(add_w, 0, TRACER_MAXWTHRESHOLD - TRACER_MINWTHRESHOLD); | |
925 | - height = w32g_tracer_wnd.ch_height; | |
926 | - | |
927 | - x = 21; | |
928 | - width = 154 + add_w; SetRect(&w32g_tracer_wnd.rc_instrument, x, 0, x + width, height); x += width + 1; | |
929 | - width = 53; SetRect(&w32g_tracer_wnd.rc_inst_map, x, 0, x + width, height); x += width + 1; | |
930 | - width = 34; SetRect(&w32g_tracer_wnd.rc_bank, x, 0, x + width, height); x += width + 1; | |
931 | - width = 30; SetRect(&w32g_tracer_wnd.rc_program, x, 0, x + width, height); x += width + 1; | |
932 | - width = 30; SetRect(&w32g_tracer_wnd.rc_velocity, x, 0, x + width, height); x += width + 1; | |
933 | - width = 20; SetRect(&w32g_tracer_wnd.rc_volume, x, 0, x + width, divi_2(height)); | |
934 | - width = 20; SetRect(&w32g_tracer_wnd.rc_expression, x, divi_2(height) + 1, x + width, height); x += width + 1; | |
935 | - width = 20; SetRect(&w32g_tracer_wnd.rc_panning, x, 0, x + width, divi_2(height)); | |
936 | - SetRect(&w32g_tracer_wnd.rc_sustain, x, divi_2(height) + 1, x + width, height); x += width + 1; | |
937 | - width = 20; SetRect(&w32g_tracer_wnd.rc_pitch_bend, x, 0, x + width, divi_2(height)); | |
938 | - SetRect(&w32g_tracer_wnd.rc_mod_wheel, x, divi_2(height) + 1, x + width, height); x += width + 1; | |
939 | - width = 20; SetRect(&w32g_tracer_wnd.rc_chorus_effect, x, 0, x + width, divi_2(height)); | |
940 | - SetRect(&w32g_tracer_wnd.rc_reverb_effect, x, divi_2(height) + 1, x + width, height); x += width + 1; | |
941 | - temper_x = x; width = 33; SetRect(&w32g_tracer_wnd.rc_temper_keysig, x, 0, x + width, height); x += width + 1; | |
942 | - width = 24; SetRect(&w32g_tracer_wnd.rc_gm, x, 0, x + width, height); x += width + 1; | |
943 | - width = 24; SetRect(&w32g_tracer_wnd.rc_gs, x, 0, x + width, height); x += width + 1; | |
944 | - width = 24; SetRect(&w32g_tracer_wnd.rc_xg, x, 0, x + width, height); x += width + 1; | |
945 | - width = 24; SetRect(&w32g_tracer_wnd.rc_gm2, x, 0, x + width, height); x += width + 1; | |
946 | - width = 24; SetRect(&w32g_tracer_wnd.rc_sd, x, 0, x + width, height); x += width + 1; | |
947 | - width = 24; SetRect(&w32g_tracer_wnd.rc_kg, x, 0, x + width, height); x += width + 1; | |
948 | - width = 24; SetRect(&w32g_tracer_wnd.rc_cm, x, 0, x + width, height); x += width + 1; | |
949 | - width = w32g_tracer_wnd.width - x - 2; SetRect(&w32g_tracer_wnd.rc_head_rest, x, 0, x + width, height); x += width + 1; | |
950 | - | |
951 | - x = temper_x; | |
952 | - width = 19; SetRect(&w32g_tracer_wnd.rc_temper_type, x, 0, x + width, height); x += width + 1; | |
953 | - width = 463; SetRect(&w32g_tracer_wnd.rc_notes, x, 0, x + width, height); x += width + 1; | |
960 | + int x, width, temper_x; | |
961 | + int add_w, height; | |
962 | + add_w = w32g_tracer_wnd.width - TRACER_MINWIDTH; | |
963 | + add_w = w32g_tracer_wnd.width - TRACER_MINWTHRESHOLD; | |
964 | + RANGE(add_w, 0, TRACER_MAXWTHRESHOLD - TRACER_MINWTHRESHOLD); | |
965 | + height = w32g_tracer_wnd.ch_height; | |
966 | + | |
967 | + x = 21; | |
968 | + width = 154 + add_w; SetRect(&w32g_tracer_wnd.rc_instrument, x, 0, x + width, height); x += width + 1; | |
969 | + width = 53; SetRect(&w32g_tracer_wnd.rc_inst_map, x, 0, x + width, height); x += width + 1; | |
970 | + width = 34; SetRect(&w32g_tracer_wnd.rc_bank, x, 0, x + width, height); x += width + 1; | |
971 | + width = 30; SetRect(&w32g_tracer_wnd.rc_program, x, 0, x + width, height); x += width + 1; | |
972 | + width = 30; SetRect(&w32g_tracer_wnd.rc_velocity, x, 0, x + width, height); x += width + 1; | |
973 | + width = 20; SetRect(&w32g_tracer_wnd.rc_volume, x, 0, x + width, divi_2(height)); | |
974 | + width = 20; SetRect(&w32g_tracer_wnd.rc_expression, x, divi_2(height) + 1, x + width, height); x += width + 1; | |
975 | + width = 20; SetRect(&w32g_tracer_wnd.rc_panning, x, 0, x + width, divi_2(height)); | |
976 | + SetRect(&w32g_tracer_wnd.rc_sustain, x, divi_2(height) + 1, x + width, height); x += width + 1; | |
977 | + width = 20; SetRect(&w32g_tracer_wnd.rc_pitch_bend, x, 0, x + width, divi_2(height)); | |
978 | + SetRect(&w32g_tracer_wnd.rc_mod_wheel, x, divi_2(height) + 1, x + width, height); x += width + 1; | |
979 | + width = 20; SetRect(&w32g_tracer_wnd.rc_chorus_effect, x, 0, x + width, divi_2(height)); | |
980 | + SetRect(&w32g_tracer_wnd.rc_reverb_effect, x, divi_2(height) + 1, x + width, height); x += width + 1; | |
981 | + temper_x = x; width = 33; SetRect(&w32g_tracer_wnd.rc_temper_keysig, x, 0, x + width, height); x += width + 1; | |
982 | + width = 24; SetRect(&w32g_tracer_wnd.rc_gm, x, 0, x + width, height); x += width + 1; | |
983 | + width = 24; SetRect(&w32g_tracer_wnd.rc_gs, x, 0, x + width, height); x += width + 1; | |
984 | + width = 24; SetRect(&w32g_tracer_wnd.rc_xg, x, 0, x + width, height); x += width + 1; | |
985 | + width = 24; SetRect(&w32g_tracer_wnd.rc_gm2, x, 0, x + width, height); x += width + 1; | |
986 | + width = 24; SetRect(&w32g_tracer_wnd.rc_sd, x, 0, x + width, height); x += width + 1; | |
987 | + width = 24; SetRect(&w32g_tracer_wnd.rc_kg, x, 0, x + width, height); x += width + 1; | |
988 | + width = 24; SetRect(&w32g_tracer_wnd.rc_cm, x, 0, x + width, height); x += width + 1; | |
989 | + width = w32g_tracer_wnd.width - x - 2; SetRect(&w32g_tracer_wnd.rc_head_rest, x, 0, x + width, height); x += width + 1; | |
990 | + | |
991 | + x = temper_x; | |
992 | + width = 19; SetRect(&w32g_tracer_wnd.rc_temper_type, x, 0, x + width, height); x += width + 1; | |
993 | + width = 463; SetRect(&w32g_tracer_wnd.rc_notes, x, 0, x + width, height); x += width + 1; | |
954 | 994 | } |
955 | 995 | |
956 | 996 | static int get_head_rc(RECT *rc, RECT *rc_base) |
957 | 997 | { |
958 | - int ch; | |
959 | - ch = 0 - TracerWndViewCh; | |
960 | - if (ch < -1) { | |
961 | - rc->top = -(rc_base->bottom - rc_base->top); | |
962 | - rc->bottom = 0; | |
963 | - rc->left = w32g_tracer_wnd.rc_head.left + rc_base->left; | |
964 | - rc->right = w32g_tracer_wnd.rc_head.left + rc_base->right; | |
965 | - return 0; | |
966 | - } | |
967 | - rc->top = w32g_tracer_wnd.rc_head.top + rc_base->top + | |
968 | - (w32g_tracer_wnd.ch_height + w32g_tracer_wnd.ch_space) * (ch - 0); | |
969 | - rc->bottom = w32g_tracer_wnd.rc_head.top + rc_base->bottom + | |
970 | - (w32g_tracer_wnd.ch_height + w32g_tracer_wnd.ch_space) * (ch - 0); | |
971 | - rc->left = w32g_tracer_wnd.rc_head.left + rc_base->left; | |
972 | - rc->right = w32g_tracer_wnd.rc_head.left + rc_base->right; | |
973 | - return 0; | |
998 | + int ch; | |
999 | + ch = 0 - TracerWndViewCh; | |
1000 | + if (ch < -1) { | |
1001 | + rc->top = -(rc_base->bottom - rc_base->top); | |
1002 | + rc->bottom = 0; | |
1003 | + rc->left = w32g_tracer_wnd.rc_head.left + rc_base->left; | |
1004 | + rc->right = w32g_tracer_wnd.rc_head.left + rc_base->right; | |
1005 | + return 0; | |
1006 | + } | |
1007 | + rc->top = w32g_tracer_wnd.rc_head.top + rc_base->top + | |
1008 | + (w32g_tracer_wnd.ch_height + w32g_tracer_wnd.ch_space) * (ch - 0); | |
1009 | + rc->bottom = w32g_tracer_wnd.rc_head.top + rc_base->bottom + | |
1010 | + (w32g_tracer_wnd.ch_height + w32g_tracer_wnd.ch_space) * (ch - 0); | |
1011 | + rc->left = w32g_tracer_wnd.rc_head.left + rc_base->left; | |
1012 | + rc->right = w32g_tracer_wnd.rc_head.left + rc_base->right; | |
1013 | + return 0; | |
974 | 1014 | } |
975 | 1015 | ///r |
976 | 1016 | static int get_ch_rc(int ch, RECT *rc, RECT *rc_base) |
977 | 1017 | { |
978 | - RANGE(TracerWndViewCh, 0, TRACER_CHANNELS - TracerWndInfo.mode); | |
979 | - if (ch < TracerWndViewCh && (TracerWndViewCh + TracerWndInfo.mode) <= ch) | |
980 | - return -1; | |
981 | - ch = ch - TracerWndViewCh; | |
982 | - | |
983 | - rc->top = w32g_tracer_wnd.rc_all_channels.top + | |
984 | - rc_base->top + (w32g_tracer_wnd.ch_height + w32g_tracer_wnd.ch_space) * (ch - 0); | |
985 | - rc->bottom = w32g_tracer_wnd.rc_all_channels.top + | |
986 | - rc_base->bottom + (w32g_tracer_wnd.ch_height + w32g_tracer_wnd.ch_space) * (ch - 0); | |
987 | - rc->left = w32g_tracer_wnd.rc_all_channels.left + rc_base->left; | |
988 | - rc->right = w32g_tracer_wnd.rc_all_channels.left + rc_base->right; | |
989 | - return 0; | |
1018 | + RANGE(TracerWndViewCh, 0, TRACER_CHANNELS - TracerWndInfo.mode); | |
1019 | + if (ch < TracerWndViewCh && (TracerWndViewCh + TracerWndInfo.mode) <= ch) | |
1020 | + return -1; | |
1021 | + ch = ch - TracerWndViewCh; | |
1022 | + | |
1023 | + rc->top = w32g_tracer_wnd.rc_all_channels.top + | |
1024 | + rc_base->top + (w32g_tracer_wnd.ch_height + w32g_tracer_wnd.ch_space) * (ch - 0); | |
1025 | + rc->bottom = w32g_tracer_wnd.rc_all_channels.top + | |
1026 | + rc_base->bottom + (w32g_tracer_wnd.ch_height + w32g_tracer_wnd.ch_space) * (ch - 0); | |
1027 | + rc->left = w32g_tracer_wnd.rc_all_channels.left + rc_base->left; | |
1028 | + rc->right = w32g_tracer_wnd.rc_all_channels.left + rc_base->right; | |
1029 | + return 0; | |
990 | 1030 | } |
991 | 1031 | |
992 | 1032 | static int notes_view_draw(RECT *lprc, int note, int voice, int vel, int back_draw, int lockflag) |
993 | 1033 | { |
994 | - HDC hdc = w32g_tracer_wnd.hmdc; | |
995 | - RECT rc1; | |
996 | - int note1, left, top; | |
997 | - | |
998 | - if (!w32g_tracer_wnd.active) | |
999 | - return 0; | |
1000 | - note1 = note / 12; | |
1001 | - left = rc1.left = lprc->left + 6 * 7 * note1 + 0; | |
1002 | - top = rc1.top = lprc->top + 0; | |
1003 | - rc1.right = lprc->left + 6 * 7 * (note1 + 1) - 0; | |
1004 | - rc1.bottom = lprc->top + 1 + 18 + 1; | |
1005 | - | |
1006 | - if (back_draw) { | |
1007 | - if (lockflag) TRACER_LOCK(); | |
1008 | - BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1009 | - tracer_bmp.hmdc, tracer_bmp.rc_notes.left, tracer_bmp.rc_notes.top, SRCCOPY); | |
1010 | - if (lockflag) TRACER_UNLOCK(); | |
1011 | - InvalidateRect(w32g_tracer_wnd.hwnd, &rc1, FALSE); | |
1012 | - } | |
1013 | - | |
1014 | - note = note % 12; | |
1015 | - | |
1016 | - switch (note) { | |
1017 | - // white keys | |
1018 | - case 0: left = 0; | |
1019 | - rc1.right = rc1.left + 7; | |
1020 | - break; | |
1021 | - case 2: rc1.left += left = 6; | |
1022 | - rc1.right = rc1.left + 7; | |
1023 | - break; | |
1024 | - case 4: rc1.left += left = 12; | |
1025 | - rc1.right = rc1.left + 7; | |
1026 | - break; | |
1027 | - case 5: rc1.left += left = 18; | |
1028 | - rc1.right = rc1.left + 7; | |
1029 | - break; | |
1030 | - case 7: rc1.left += left = 24; | |
1031 | - rc1.right = rc1.left + 7; | |
1032 | - break; | |
1033 | - case 9: rc1.left += left = 30; | |
1034 | - rc1.right = rc1.left + 7; | |
1035 | - break; | |
1036 | - case 11: rc1.left += left = 36; | |
1037 | - rc1.right = rc1.left + 6; | |
1038 | - break; | |
1039 | - // black keys | |
1040 | - case 1: rc1.left += left = 4; | |
1041 | - rc1.right = rc1.left + 5; | |
1042 | - break; | |
1043 | - case 3: rc1.left += left = 10; | |
1044 | - rc1.right = rc1.left + 5; | |
1045 | - break; | |
1046 | - case 6: rc1.left += left = 22; | |
1047 | - rc1.right = rc1.left + 5; | |
1048 | - break; | |
1049 | - case 8: rc1.left += left = 28; | |
1050 | - rc1.right = rc1.left + 5; | |
1051 | - break; | |
1052 | - case 10: rc1.left += left = 34; | |
1053 | - rc1.right = rc1.left + 5; | |
1054 | - break; | |
1055 | - default: break; | |
1056 | - } | |
1057 | - | |
1058 | - if (lockflag) TRACER_LOCK(); | |
1059 | - if (vel == TRACER_VOICE_SUSTAINED) { | |
1060 | - BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1061 | - tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[note].left + left, tracer_bmp.rc_notes_mask[note].top, SRCPAINT); | |
1062 | - BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1063 | - tracer_bmp.hmdc, tracer_bmp.rc_note_sustain[note].left + left, tracer_bmp.rc_note_sustain[note].top, SRCAND); | |
1064 | - } else if (voice > 0) { | |
1065 | - BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1066 | - tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[note].left + left, tracer_bmp.rc_notes_mask[note].top, SRCPAINT); | |
1067 | - BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1068 | - tracer_bmp.hmdc, tracer_bmp.rc_note_on[note].left + left, tracer_bmp.rc_note_on[note].top, SRCAND); | |
1069 | - } else { | |
1070 | - BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1071 | - tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[note].left + left, tracer_bmp.rc_notes_mask[note].top, SRCPAINT); | |
1072 | - BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1073 | - tracer_bmp.hmdc, tracer_bmp.rc_note[note].left + left, tracer_bmp.rc_note[note].top, SRCAND); | |
1074 | - | |
1075 | - } | |
1076 | - if (lockflag) TRACER_UNLOCK(); | |
1077 | - | |
1078 | - InvalidateRect(w32g_tracer_wnd.hwnd, &rc1, FALSE); | |
1079 | - | |
1080 | - return 0; | |
1034 | + HDC hdc = w32g_tracer_wnd.hmdc; | |
1035 | + RECT rc1; | |
1036 | + int note1, left, top; | |
1037 | + | |
1038 | + if (!w32g_tracer_wnd.active) | |
1039 | + return 0; | |
1040 | + note1 = note / 12; | |
1041 | + left = rc1.left = lprc->left + 6 * 7 * note1 + 0; | |
1042 | + top = rc1.top = lprc->top + 0; | |
1043 | + rc1.right = lprc->left + 6 * 7 * (note1 + 1) - 0; | |
1044 | + rc1.bottom = lprc->top + 1 + 18 + 1; | |
1045 | + | |
1046 | + if (back_draw) { | |
1047 | + if (lockflag) TRACER_LOCK(); | |
1048 | + BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1049 | + tracer_bmp.hmdc, tracer_bmp.rc_notes.left, tracer_bmp.rc_notes.top, SRCCOPY); | |
1050 | + if (lockflag) TRACER_UNLOCK(); | |
1051 | + InvalidateRect(w32g_tracer_wnd.hwnd, &rc1, FALSE); | |
1052 | + } | |
1053 | + | |
1054 | + note = note % 12; | |
1055 | + | |
1056 | + switch (note) { | |
1057 | + // white keys | |
1058 | + case 0: left = 0; | |
1059 | + rc1.right = rc1.left + 7; | |
1060 | + break; | |
1061 | + case 2: rc1.left += left = 6; | |
1062 | + rc1.right = rc1.left + 7; | |
1063 | + break; | |
1064 | + case 4: rc1.left += left = 12; | |
1065 | + rc1.right = rc1.left + 7; | |
1066 | + break; | |
1067 | + case 5: rc1.left += left = 18; | |
1068 | + rc1.right = rc1.left + 7; | |
1069 | + break; | |
1070 | + case 7: rc1.left += left = 24; | |
1071 | + rc1.right = rc1.left + 7; | |
1072 | + break; | |
1073 | + case 9: rc1.left += left = 30; | |
1074 | + rc1.right = rc1.left + 7; | |
1075 | + break; | |
1076 | + case 11: rc1.left += left = 36; | |
1077 | + rc1.right = rc1.left + 6; | |
1078 | + break; | |
1079 | + // black keys | |
1080 | + case 1: rc1.left += left = 4; | |
1081 | + rc1.right = rc1.left + 5; | |
1082 | + break; | |
1083 | + case 3: rc1.left += left = 10; | |
1084 | + rc1.right = rc1.left + 5; | |
1085 | + break; | |
1086 | + case 6: rc1.left += left = 22; | |
1087 | + rc1.right = rc1.left + 5; | |
1088 | + break; | |
1089 | + case 8: rc1.left += left = 28; | |
1090 | + rc1.right = rc1.left + 5; | |
1091 | + break; | |
1092 | + case 10: rc1.left += left = 34; | |
1093 | + rc1.right = rc1.left + 5; | |
1094 | + break; | |
1095 | + default: break; | |
1096 | + } | |
1097 | + | |
1098 | + if (lockflag) TRACER_LOCK(); | |
1099 | + if (vel == TRACER_VOICE_SUSTAINED) { | |
1100 | + BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1101 | + tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[note].left + left, tracer_bmp.rc_notes_mask[note].top, SRCPAINT); | |
1102 | + BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1103 | + tracer_bmp.hmdc, tracer_bmp.rc_note_sustain[note].left + left, tracer_bmp.rc_note_sustain[note].top, SRCAND); | |
1104 | + } else if (voice > 0) { | |
1105 | + BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1106 | + tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[note].left + left, tracer_bmp.rc_notes_mask[note].top, SRCPAINT); | |
1107 | + BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1108 | + tracer_bmp.hmdc, tracer_bmp.rc_note_on[note].left + left, tracer_bmp.rc_note_on[note].top, SRCAND); | |
1109 | + } else { | |
1110 | + BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1111 | + tracer_bmp.hmdc, tracer_bmp.rc_notes_mask[note].left + left, tracer_bmp.rc_notes_mask[note].top, SRCPAINT); | |
1112 | + BitBlt(hdc, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, | |
1113 | + tracer_bmp.hmdc, tracer_bmp.rc_note[note].left + left, tracer_bmp.rc_note[note].top, SRCAND); | |
1114 | + | |
1115 | + } | |
1116 | + if (lockflag) TRACER_UNLOCK(); | |
1117 | + | |
1118 | + InvalidateRect(w32g_tracer_wnd.hwnd, &rc1, FALSE); | |
1119 | + | |
1120 | + return 0; | |
1081 | 1121 | } |
1082 | 1122 | |
1083 | 1123 | static int tracer_ch_number_draw(int ch, int mute, int lockflag) |
1084 | 1124 | { |
1085 | - RECT rc; | |
1086 | - char buff[4]; | |
1087 | - int quiet, inst; | |
1088 | - | |
1089 | - if (mute != CTL_STATUS_UPDATE) { | |
1090 | - if (((IS_SET_CHANNELMASK( | |
1091 | - w32g_tracer_wnd.channel_mute, ch)) ? 1 : 0) == mute) | |
1092 | - return 0; | |
1093 | - if (mute) | |
1094 | - SET_CHANNELMASK(w32g_tracer_wnd.channel_mute, ch); | |
1095 | - else | |
1096 | - UNSET_CHANNELMASK(w32g_tracer_wnd.channel_mute, ch); | |
1097 | - } else { | |
1098 | - mute = (IS_SET_CHANNELMASK( | |
1099 | - w32g_tracer_wnd.channel_mute, ch)) ? 1 : 0; | |
1100 | - } | |
1101 | - quiet = (IS_SET_CHANNELMASK( | |
1102 | - w32g_tracer_wnd.quietchannels, ch)) ? 1 : 0; | |
1103 | - inst = (w32g_tracer_wnd.insertion_effect[ch] > 0) ? 1 : 0; | |
1104 | - if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_channel_top) == 0) { | |
1105 | - sprintf(buff, "%02d", ch + 1); | |
1106 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, | |
1107 | - (quiet) ? C_TEXT_BACK_VERY_DARK : | |
1108 | - (mute) ? C_TEXT_BACK_DARK : | |
1109 | - (inst) ? C_TEXT_BACK_INSERTION : C_TEXT_BACK, | |
1110 | - CSV_CENTER, lockflag); | |
1111 | - } | |
1112 | - return 0; | |
1125 | + RECT rc; | |
1126 | + char buff[4]; | |
1127 | + int quiet, inst; | |
1128 | + | |
1129 | + if (mute != CTL_STATUS_UPDATE) { | |
1130 | + if (((IS_SET_CHANNELMASK( | |
1131 | + w32g_tracer_wnd.channel_mute, ch)) ? 1 : 0) == mute) | |
1132 | + return 0; | |
1133 | + if (mute) | |
1134 | + SET_CHANNELMASK(w32g_tracer_wnd.channel_mute, ch); | |
1135 | + else | |
1136 | + UNSET_CHANNELMASK(w32g_tracer_wnd.channel_mute, ch); | |
1137 | + } else { | |
1138 | + mute = (IS_SET_CHANNELMASK( | |
1139 | + w32g_tracer_wnd.channel_mute, ch)) ? 1 : 0; | |
1140 | + } | |
1141 | + quiet = (IS_SET_CHANNELMASK( | |
1142 | + w32g_tracer_wnd.quietchannels, ch)) ? 1 : 0; | |
1143 | + inst = (w32g_tracer_wnd.insertion_effect[ch] > 0) ? 1 : 0; | |
1144 | + if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_channel_top) == 0) { | |
1145 | + sprintf(buff, "%02d", ch + 1); | |
1146 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, | |
1147 | + (quiet) ? C_TEXT_BACK_VERY_DARK : | |
1148 | + (mute) ? C_TEXT_BACK_DARK : | |
1149 | + (inst) ? C_TEXT_BACK_INSERTION : C_TEXT_BACK, | |
1150 | + CSV_CENTER, lockflag); | |
1151 | + } | |
1152 | + return 0; | |
1113 | 1153 | } |
1114 | 1154 | |
1115 | -static int tracer_ch_program_draw(int ch, int bank, int program, const char *instrument, int mapID, int lockflag) | |
1155 | +static int tracer_ch_program_draw(int ch, int bank, int program, char *instrument, int mapID, int lockflag) | |
1116 | 1156 | { |
1117 | - RECT rc; | |
1118 | - char buff[64]; | |
1119 | - char *p_buff; | |
1120 | - if (bank >= 0) { | |
1121 | - w32g_tracer_wnd.bank[ch] = bank; | |
1122 | - } else { | |
1123 | - if (ISDRUMCHANNEL(ch)) | |
1124 | - bank = w32g_tracer_wnd.bank[ch] = 128; | |
1125 | - else | |
1126 | - bank = w32g_tracer_wnd.bank[ch] = channel[ch].bank; | |
1127 | - } | |
1128 | - if (bank == 128) { | |
1129 | - if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_bank) == 0) { | |
1130 | - sprintf(buff, "drum"); | |
1131 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, lockflag); | |
1132 | - } | |
1133 | - } else { | |
1134 | - if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_bank) == 0) { | |
1135 | - sprintf(buff, "%03d", bank); | |
1136 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, lockflag); | |
1137 | - } | |
1138 | - } | |
1139 | - if (program >= 0) { | |
1140 | - w32g_tracer_wnd.program[ch] = program; | |
1141 | - } else { | |
1142 | - program = w32g_tracer_wnd.program[ch] = channel[ch].program; | |
1143 | - } | |
1144 | - if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_program) == 0) { | |
1145 | - sprintf(buff, "%03d", program); | |
1146 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, lockflag); | |
1147 | - } | |
1148 | - | |
1149 | - if (!instrument) { instrument = " ----"; } | |
1150 | - strncpy(w32g_tracer_wnd.instrument[ch], (char*) instrument, 250); | |
1151 | - w32g_tracer_wnd.instrument[ch][250] = '\0'; | |
1152 | - if (w32g_tracer_wnd.instrument[ch][0] != ' ') { | |
1153 | - char instbuff[255] = ""; | |
1154 | - strncpy(instbuff, w32g_tracer_wnd.instrument[ch], 250); | |
1155 | - instbuff[250] = '\0'; | |
1156 | - w32g_tracer_wnd.instrument[ch][0] = ' '; | |
1157 | - w32g_tracer_wnd.instrument[ch][1] = '\0'; | |
1158 | - strlcat(w32g_tracer_wnd.instrument[ch], instbuff, 250); | |
1159 | - } | |
1160 | - | |
1161 | - if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_instrument) == 0) | |
1162 | - cheap_string_view_draw(&rc, w32g_tracer_wnd.instrument[ch], C_TEXT_FORE, C_TEXT_BACK, CSV_LEFT, lockflag); | |
1163 | - | |
1164 | - if (mapID >= 0) { | |
1165 | - w32g_tracer_wnd.mapID[ch] = mapID; | |
1166 | - } else { | |
1167 | - mapID = w32g_tracer_wnd.mapID[ch] = channel[ch].mapID; | |
1168 | - } | |
1169 | - switch (mapID) { | |
1170 | - default: | |
1157 | + RECT rc; | |
1158 | + char buff[64]; | |
1159 | + char *p_buff; | |
1160 | + if (bank >= 0) { | |
1161 | + w32g_tracer_wnd.bank[ch] = bank; | |
1162 | + } else { | |
1163 | + if (ISDRUMCHANNEL(ch)) | |
1164 | + bank = w32g_tracer_wnd.bank[ch] = 128; | |
1165 | + else | |
1166 | + bank = w32g_tracer_wnd.bank[ch] = channel[ch].bank; | |
1167 | + } | |
1168 | + if (bank == 128) { | |
1169 | + if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_bank) == 0) { | |
1170 | + sprintf(buff, "drum"); | |
1171 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, lockflag); | |
1172 | + } | |
1173 | + } else { | |
1174 | + if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_bank) == 0) { | |
1175 | + sprintf(buff, "%03d", bank); | |
1176 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, lockflag); | |
1177 | + } | |
1178 | + } | |
1179 | + if (program >= 0) { | |
1180 | + w32g_tracer_wnd.program[ch] = program; | |
1181 | + } else { | |
1182 | + program = w32g_tracer_wnd.program[ch] = channel[ch].program; | |
1183 | + } | |
1184 | + if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_program) == 0) { | |
1185 | + sprintf(buff, "%03d", program); | |
1186 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, lockflag); | |
1187 | + } | |
1188 | + | |
1189 | + if (!instrument) { instrument = " ----"; } | |
1190 | + strncpy(w32g_tracer_wnd.instrument[ch], (char*)instrument, 250); | |
1191 | + w32g_tracer_wnd.instrument[ch][250] = '\0'; | |
1192 | + if (w32g_tracer_wnd.instrument[ch][0] != ' ') { | |
1193 | + char instbuff[255] = ""; | |
1194 | + strncpy(instbuff, w32g_tracer_wnd.instrument[ch], 250); | |
1195 | + instbuff[250] = '\0'; | |
1196 | + w32g_tracer_wnd.instrument[ch][0] = ' '; | |
1197 | + w32g_tracer_wnd.instrument[ch][1] = '\0'; | |
1198 | + strlcat(w32g_tracer_wnd.instrument[ch], instbuff, 250); | |
1199 | + } | |
1200 | + | |
1201 | + if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_instrument) == 0) | |
1202 | + cheap_string_view_draw(&rc, w32g_tracer_wnd.instrument[ch], C_TEXT_FORE, C_TEXT_BACK, CSV_LEFT, lockflag); | |
1203 | + | |
1204 | + if (mapID >= 0) { | |
1205 | + w32g_tracer_wnd.mapID[ch] = mapID; | |
1206 | + } else { | |
1207 | + mapID = w32g_tracer_wnd.mapID[ch] = channel[ch].mapID; | |
1208 | + } | |
1209 | + switch (mapID) { | |
1210 | + default: | |
1171 | 1211 | case INST_NO_MAP: |
1172 | 1212 | case NUM_INST_MAP: |
1173 | - p_buff = "----"; | |
1174 | - break; | |
1213 | + p_buff = "----"; | |
1214 | + break; | |
1175 | 1215 | case SC_55_TONE_MAP: |
1176 | - p_buff = "55 T"; | |
1177 | - break; | |
1216 | + p_buff = "55 T"; | |
1217 | + break; | |
1178 | 1218 | case SC_55_DRUM_MAP: |
1179 | - p_buff = "55 D"; | |
1180 | - break; | |
1219 | + p_buff = "55 D"; | |
1220 | + break; | |
1181 | 1221 | case SC_88_TONE_MAP: |
1182 | - p_buff = "88 T"; | |
1183 | - break; | |
1222 | + p_buff = "88 T"; | |
1223 | + break; | |
1184 | 1224 | case SC_88_DRUM_MAP: |
1185 | - p_buff = "88 D"; | |
1186 | - break; | |
1225 | + p_buff = "88 D"; | |
1226 | + break; | |
1187 | 1227 | case SC_88PRO_TONE_MAP: |
1188 | - p_buff = "88Pro T"; | |
1189 | - break; | |
1228 | + p_buff = "88Pro T"; | |
1229 | + break; | |
1190 | 1230 | case SC_88PRO_DRUM_MAP: |
1191 | - p_buff = "88Pro D"; | |
1192 | - break; | |
1231 | + p_buff = "88Pro D"; | |
1232 | + break; | |
1193 | 1233 | case SC_8850_TONE_MAP: |
1194 | - p_buff = "8850 T"; | |
1195 | - break; | |
1234 | + p_buff = "8850 T"; | |
1235 | + break; | |
1196 | 1236 | case SC_8850_DRUM_MAP: |
1197 | - p_buff = "8850 D"; | |
1198 | - break; | |
1237 | + p_buff = "8850 D"; | |
1238 | + break; | |
1199 | 1239 | case XG_NORMAL_MAP: |
1200 | - p_buff = "XG T"; | |
1201 | - break; | |
1240 | + p_buff = "XG T"; | |
1241 | + break; | |
1202 | 1242 | ///r |
1203 | 1243 | case XG_SFX_KIT_MAP: |
1204 | - p_buff = "XG Sfk"; | |
1205 | - break; | |
1244 | + p_buff = "XG Sfk"; | |
1245 | + break; | |
1206 | 1246 | case XG_DRUM_KIT_MAP: |
1207 | - p_buff = "XG D"; | |
1208 | - break; | |
1247 | + p_buff = "XG D"; | |
1248 | + break; | |
1209 | 1249 | case XG_FREE_MAP: |
1210 | - p_buff = "XG Fre"; | |
1211 | - break; | |
1250 | + p_buff = "XG Fre"; | |
1251 | + break; | |
1212 | 1252 | case XG_SAMPLING126_MAP: |
1213 | - p_buff = "XG Sak"; | |
1214 | - break; | |
1253 | + p_buff = "XG Sak"; | |
1254 | + break; | |
1215 | 1255 | case XG_SAMPLING16_MAP: |
1216 | - p_buff = "XG Sav"; | |
1217 | - break; | |
1256 | + p_buff = "XG Sav"; | |
1257 | + break; | |
1218 | 1258 | case XG_MU100EXC_MAP: |
1219 | - p_buff = "XG Exv"; | |
1220 | - break; | |
1259 | + p_buff = "XG Exv"; | |
1260 | + break; | |
1221 | 1261 | case XG_PCM_USER_MAP: |
1222 | - p_buff = "XG PCu"; | |
1223 | - break; | |
1262 | + p_buff = "XG PCu"; | |
1263 | + break; | |
1224 | 1264 | case XG_PCM_SFX_MAP: |
1225 | - p_buff = "XG PCs"; | |
1226 | - break; | |
1265 | + p_buff = "XG PCs"; | |
1266 | + break; | |
1227 | 1267 | case XG_PCM_A_MAP: |
1228 | - p_buff = "XG PCa"; | |
1229 | - break; | |
1268 | + p_buff = "XG PCa"; | |
1269 | + break; | |
1230 | 1270 | case XG_PCM_B_MAP: |
1231 | - p_buff = "XG PCb"; | |
1232 | - break; | |
1271 | + p_buff = "XG PCb"; | |
1272 | + break; | |
1233 | 1273 | case XG_VA_USER_MAP: |
1234 | - p_buff = "XG VAu"; | |
1235 | - break; | |
1274 | + p_buff = "XG VAu"; | |
1275 | + break; | |
1236 | 1276 | case XG_VA_SFX_MAP: |
1237 | - p_buff = "XG VAs"; | |
1238 | - break; | |
1277 | + p_buff = "XG VAs"; | |
1278 | + break; | |
1239 | 1279 | case XG_VA_A_MAP: |
1240 | - p_buff = "XG VAa"; | |
1241 | - break; | |
1280 | + p_buff = "XG VAa"; | |
1281 | + break; | |
1242 | 1282 | case XG_VA_B_MAP: |
1243 | - p_buff = "XG VAb"; | |
1244 | - break; | |
1283 | + p_buff = "XG VAb"; | |
1284 | + break; | |
1245 | 1285 | case XG_SG_USER_MAP: |
1246 | - p_buff = "XG SGu"; | |
1247 | - break; | |
1286 | + p_buff = "XG SGu"; | |
1287 | + break; | |
1248 | 1288 | case XG_SG_SFX_MAP: |
1249 | - p_buff = "XG SGs"; | |
1250 | - break; | |
1289 | + p_buff = "XG SGs"; | |
1290 | + break; | |
1251 | 1291 | case XG_SG_A_MAP: |
1252 | - p_buff = "XG SGa"; | |
1253 | - break; | |
1292 | + p_buff = "XG SGa"; | |
1293 | + break; | |
1254 | 1294 | case XG_SG_B_MAP: |
1255 | - p_buff = "XG SGb"; | |
1256 | - break; | |
1295 | + p_buff = "XG SGb"; | |
1296 | + break; | |
1257 | 1297 | case XG_FM_USER_MAP: |
1258 | - p_buff = "XG FMu"; | |
1259 | - break; | |
1298 | + p_buff = "XG FMu"; | |
1299 | + break; | |
1260 | 1300 | case XG_FM_SFX_MAP: |
1261 | - p_buff = "XG FMs"; | |
1262 | - break; | |
1301 | + p_buff = "XG FMs"; | |
1302 | + break; | |
1263 | 1303 | case XG_FM_A_MAP: |
1264 | - p_buff = "XG FMa"; | |
1265 | - break; | |
1304 | + p_buff = "XG FMa"; | |
1305 | + break; | |
1266 | 1306 | case XG_FM_B_MAP: |
1267 | - p_buff = "XG FMb"; | |
1268 | - break; | |
1307 | + p_buff = "XG FMb"; | |
1308 | + break; | |
1269 | 1309 | case GM2_TONE_MAP: |
1270 | - p_buff = "GM2 T"; | |
1271 | - break; | |
1310 | + p_buff = "GM2 T"; | |
1311 | + break; | |
1272 | 1312 | case GM2_DRUM_MAP: |
1273 | - p_buff = "GM2 D"; | |
1274 | - break; | |
1275 | - case SDXX_TONE80_MAP: | |
1276 | - p_buff = "SD S1T"; | |
1277 | - break; | |
1278 | - case SDXX_TONE81_MAP: | |
1279 | - p_buff = "SD S2T"; | |
1280 | - break; | |
1281 | - case SDXX_TONE87_MAP: | |
1282 | - p_buff = "SD UsT"; | |
1283 | - break; | |
1284 | - case SDXX_TONE89_MAP: | |
1285 | - p_buff = "SD5SoT"; | |
1286 | - break; | |
1287 | - case SDXX_TONE96_MAP: | |
1288 | - p_buff = "SD ClT"; | |
1289 | - break; | |
1290 | - case SDXX_TONE97_MAP: | |
1291 | - p_buff = "SD CoT"; | |
1292 | - break; | |
1293 | - case SDXX_TONE98_MAP: | |
1294 | - p_buff = "SD SoT"; | |
1295 | - break; | |
1296 | - case SDXX_TONE99_MAP: | |
1297 | - p_buff = "SD EnT"; | |
1298 | - break; | |
1299 | - case SDXX_DRUM86_MAP: | |
1300 | - p_buff = "SD UsD"; | |
1301 | - break; | |
1302 | - case SDXX_DRUM104_MAP: | |
1303 | - p_buff = "SD ClD"; | |
1304 | - break; | |
1305 | - case SDXX_DRUM105_MAP: | |
1306 | - p_buff = "SD CoD"; | |
1307 | - break; | |
1308 | - case SDXX_DRUM106_MAP: | |
1309 | - p_buff = "SD SoD"; | |
1310 | - break; | |
1311 | - case SDXX_DRUM107_MAP: | |
1312 | - p_buff = "SD EnD"; | |
1313 | - break; | |
1313 | + p_buff = "GM2 D"; | |
1314 | + break; | |
1315 | + case SDXX_TONE80_MAP: | |
1316 | + p_buff = "SD S1T"; | |
1317 | + break; | |
1318 | + case SDXX_TONE81_MAP: | |
1319 | + p_buff = "SD S2T"; | |
1320 | + break; | |
1321 | + case SDXX_TONE87_MAP: | |
1322 | + p_buff = "SD UsT"; | |
1323 | + break; | |
1324 | + case SDXX_TONE89_MAP: | |
1325 | + p_buff = "SD5SoT"; | |
1326 | + break; | |
1327 | + case SDXX_TONE96_MAP: | |
1328 | + p_buff = "SD ClT"; | |
1329 | + break; | |
1330 | + case SDXX_TONE97_MAP: | |
1331 | + p_buff = "SD CoT"; | |
1332 | + break; | |
1333 | + case SDXX_TONE98_MAP: | |
1334 | + p_buff = "SD SoT"; | |
1335 | + break; | |
1336 | + case SDXX_TONE99_MAP: | |
1337 | + p_buff = "SD EnT"; | |
1338 | + break; | |
1339 | + case SDXX_DRUM86_MAP: | |
1340 | + p_buff = "SD UsD"; | |
1341 | + break; | |
1342 | + case SDXX_DRUM104_MAP: | |
1343 | + p_buff = "SD ClD"; | |
1344 | + break; | |
1345 | + case SDXX_DRUM105_MAP: | |
1346 | + p_buff = "SD CoD"; | |
1347 | + break; | |
1348 | + case SDXX_DRUM106_MAP: | |
1349 | + p_buff = "SD SoD"; | |
1350 | + break; | |
1351 | + case SDXX_DRUM107_MAP: | |
1352 | + p_buff = "SD EnD"; | |
1353 | + break; | |
1314 | 1354 | case K05RW_TONE0_MAP: |
1315 | - p_buff = "05 A"; | |
1316 | - break; | |
1355 | + p_buff = "05 A"; | |
1356 | + break; | |
1317 | 1357 | case K05RW_TONE56_MAP: |
1318 | - p_buff = "05 G"; | |
1319 | - break; | |
1358 | + p_buff = "05 G"; | |
1359 | + break; | |
1320 | 1360 | case K05RW_TONE57_MAP: |
1321 | - p_buff = "05 G"; | |
1322 | - break; | |
1361 | + p_buff = "05 G"; | |
1362 | + break; | |
1323 | 1363 | case K05RW_DRUM62_MAP: |
1324 | - p_buff = "05 kDr"; | |
1325 | - break; | |
1364 | + p_buff = "05 kDr"; | |
1365 | + break; | |
1326 | 1366 | case NX5R_TONE0_MAP: |
1327 | - p_buff = "NX GMa"; | |
1328 | - break; | |
1367 | + p_buff = "NX GMa"; | |
1368 | + break; | |
1329 | 1369 | case NX5R_TONE1_MAP: |
1330 | - p_buff = "NX r1"; | |
1331 | - break; | |
1370 | + p_buff = "NX r1"; | |
1371 | + break; | |
1332 | 1372 | case NX5R_TONE2_MAP: |
1333 | - p_buff = "NX r2"; | |
1334 | - break; | |
1373 | + p_buff = "NX r2"; | |
1374 | + break; | |
1335 | 1375 | case NX5R_TONE3_MAP: |
1336 | - p_buff = "NX r3"; | |
1337 | - break; | |
1376 | + p_buff = "NX r3"; | |
1377 | + break; | |
1338 | 1378 | case NX5R_TONE4_MAP: |
1339 | - p_buff = "NX r4"; | |
1340 | - break; | |
1379 | + p_buff = "NX r4"; | |
1380 | + break; | |
1341 | 1381 | case NX5R_TONE5_MAP: |
1342 | - p_buff = "NX r5"; | |
1343 | - break; | |
1382 | + p_buff = "NX r5"; | |
1383 | + break; | |
1344 | 1384 | case NX5R_TONE6_MAP: |
1345 | - p_buff = "NX r6"; | |
1346 | - break; | |
1385 | + p_buff = "NX r6"; | |
1386 | + break; | |
1347 | 1387 | case NX5R_TONE7_MAP: |
1348 | - p_buff = "NX r7"; | |
1349 | - break; | |
1388 | + p_buff = "NX r7"; | |
1389 | + break; | |
1350 | 1390 | case NX5R_TONE8_MAP: |
1351 | - p_buff = "NX r8"; | |
1352 | - break; | |
1391 | + p_buff = "NX r8"; | |
1392 | + break; | |
1353 | 1393 | case NX5R_TONE9_MAP: |
1354 | - p_buff = "NX r9"; | |
1355 | - break; | |
1394 | + p_buff = "NX r9"; | |
1395 | + break; | |
1356 | 1396 | case NX5R_TONE10_MAP: |
1357 | - p_buff = "NX r10"; | |
1358 | - break; | |
1397 | + p_buff = "NX r10"; | |
1398 | + break; | |
1359 | 1399 | case NX5R_TONE11_MAP: |
1360 | - p_buff = "NX r11"; | |
1361 | - break; | |
1400 | + p_buff = "NX r11"; | |
1401 | + break; | |
1362 | 1402 | case NX5R_TONE16_MAP: |
1363 | - p_buff = "NX r16"; | |
1364 | - break; | |
1403 | + p_buff = "NX r16"; | |
1404 | + break; | |
1365 | 1405 | case NX5R_TONE17_MAP: |
1366 | - p_buff = "NX r17"; | |
1367 | - break; | |
1406 | + p_buff = "NX r17"; | |
1407 | + break; | |
1368 | 1408 | case NX5R_TONE18_MAP: |
1369 | - p_buff = "NX r18"; | |
1370 | - break; | |
1409 | + p_buff = "NX r18"; | |
1410 | + break; | |
1371 | 1411 | case NX5R_TONE19_MAP: |
1372 | - p_buff = "NX r19"; | |
1373 | - break; | |
1412 | + p_buff = "NX r19"; | |
1413 | + break; | |
1374 | 1414 | case NX5R_TONE24_MAP: |
1375 | - p_buff = "NX r24"; | |
1376 | - break; | |
1415 | + p_buff = "NX r24"; | |
1416 | + break; | |
1377 | 1417 | case NX5R_TONE25_MAP: |
1378 | - p_buff = "NX r25"; | |
1379 | - break; | |
1418 | + p_buff = "NX r25"; | |
1419 | + break; | |
1380 | 1420 | case NX5R_TONE26_MAP: |
1381 | - p_buff = "NX r26"; | |
1382 | - break; | |
1421 | + p_buff = "NX r26"; | |
1422 | + break; | |
1383 | 1423 | case NX5R_TONE32_MAP: |
1384 | - p_buff = "NX r32"; | |
1385 | - break; | |
1424 | + p_buff = "NX r32"; | |
1425 | + break; | |
1386 | 1426 | case NX5R_TONE33_MAP: |
1387 | - p_buff = "NX r33"; | |
1388 | - break; | |
1427 | + p_buff = "NX r33"; | |
1428 | + break; | |
1389 | 1429 | case NX5R_TONE40_MAP: |
1390 | - p_buff = "NX r34"; | |
1391 | - break; | |
1430 | + p_buff = "NX r34"; | |
1431 | + break; | |
1392 | 1432 | case NX5R_TONE56_MAP: |
1393 | - p_buff = "NX GMb"; | |
1394 | - break; | |
1433 | + p_buff = "NX GMb"; | |
1434 | + break; | |
1395 | 1435 | case NX5R_TONE57_MAP: |
1396 | - p_buff = "NX GMb"; | |
1397 | - break; | |
1436 | + p_buff = "NX GMb"; | |
1437 | + break; | |
1398 | 1438 | case NX5R_TONE64_MAP: |
1399 | - p_buff = "NX yS"; | |
1400 | - break; | |
1439 | + p_buff = "NX yS"; | |
1440 | + break; | |
1401 | 1441 | case NX5R_TONE80_MAP: |
1402 | - p_buff = "NX PrU"; | |
1403 | - break; | |
1442 | + p_buff = "NX PrU"; | |
1443 | + break; | |
1404 | 1444 | case NX5R_TONE81_MAP: |
1405 | - p_buff = "NX PrA"; | |
1406 | - break; | |
1445 | + p_buff = "NX PrA"; | |
1446 | + break; | |
1407 | 1447 | case NX5R_TONE82_MAP: |
1408 | - p_buff = "NX PrB"; | |
1409 | - break; | |
1448 | + p_buff = "NX PrB"; | |
1449 | + break; | |
1410 | 1450 | case NX5R_TONE83_MAP: |
1411 | - p_buff = "NX PrC"; | |
1412 | - break; | |
1451 | + p_buff = "NX PrC"; | |
1452 | + break; | |
1413 | 1453 | case NX5R_TONE88_MAP: |
1414 | - p_buff = "NX CmU"; | |
1415 | - break; | |
1454 | + p_buff = "NX CmU"; | |
1455 | + break; | |
1416 | 1456 | case NX5R_TONE89_MAP: |
1417 | - p_buff = "NX CmA"; | |
1418 | - break; | |
1457 | + p_buff = "NX CmA"; | |
1458 | + break; | |
1419 | 1459 | case NX5R_TONE90_MAP: |
1420 | - p_buff = "NX CmB"; | |
1421 | - break; | |
1460 | + p_buff = "NX CmB"; | |
1461 | + break; | |
1422 | 1462 | case NX5R_TONE91_MAP: |
1423 | - p_buff = "NX CmC"; | |
1424 | - break; | |
1463 | + p_buff = "NX CmC"; | |
1464 | + break; | |
1425 | 1465 | case NX5R_TONE125_MAP: |
1426 | - p_buff = "NX CM"; | |
1427 | - break; | |
1466 | + p_buff = "NX CM"; | |
1467 | + break; | |
1428 | 1468 | case NX5R_DRUM61_MAP: |
1429 | - p_buff = "NX rD"; | |
1430 | - break; | |
1469 | + p_buff = "NX rD"; | |
1470 | + break; | |
1431 | 1471 | case NX5R_DRUM62_MAP: |
1432 | - p_buff = "NX kD"; | |
1433 | - break; | |
1472 | + p_buff = "NX kD"; | |
1473 | + break; | |
1434 | 1474 | case NX5R_DRUM126_MAP: |
1435 | - p_buff = "NX yD1"; | |
1436 | - break; | |
1475 | + p_buff = "NX yD1"; | |
1476 | + break; | |
1437 | 1477 | case NX5R_DRUM127_MAP: |
1438 | - p_buff = "NX yD2"; | |
1439 | - break; | |
1478 | + p_buff = "NX yD2"; | |
1479 | + break; | |
1440 | 1480 | case MT32_TONE_MAP: |
1441 | - p_buff = "MT L"; | |
1442 | - break; | |
1481 | + p_buff = "MT L"; | |
1482 | + break; | |
1443 | 1483 | case MT32_DRUM_MAP: |
1444 | - p_buff = "MT D"; | |
1445 | - break; | |
1484 | + p_buff = "MT D"; | |
1485 | + break; | |
1446 | 1486 | case CM32L_TONE_MAP: |
1447 | - p_buff = "CM L"; | |
1448 | - break; | |
1487 | + p_buff = "CM L"; | |
1488 | + break; | |
1449 | 1489 | case CM32P_TONE_MAP: |
1450 | - p_buff = "CM P"; | |
1451 | - break; | |
1490 | + p_buff = "CM P"; | |
1491 | + break; | |
1452 | 1492 | case CM32_DRUM_MAP: |
1453 | - p_buff = "CM D"; | |
1454 | - break; | |
1493 | + p_buff = "CM D"; | |
1494 | + break; | |
1455 | 1495 | case SN01_TONE_MAP: |
1456 | - p_buff = "SN01 T"; | |
1457 | - break; | |
1496 | + p_buff = "SN01 T"; | |
1497 | + break; | |
1458 | 1498 | case SN02_TONE_MAP: |
1459 | - p_buff = "SN02 T"; | |
1460 | - break; | |
1499 | + p_buff = "SN02 T"; | |
1500 | + break; | |
1461 | 1501 | case SN03_TONE_MAP: |
1462 | - p_buff = "SN03 T"; | |
1463 | - break; | |
1502 | + p_buff = "SN03 T"; | |
1503 | + break; | |
1464 | 1504 | case SN04_TONE_MAP: |
1465 | - p_buff = "SN04 T"; | |
1466 | - break; | |
1505 | + p_buff = "SN04 T"; | |
1506 | + break; | |
1467 | 1507 | case SN05_TONE_MAP: |
1468 | - p_buff = "SN05 T"; | |
1469 | - break; | |
1508 | + p_buff = "SN05 T"; | |
1509 | + break; | |
1470 | 1510 | case SN06_TONE_MAP: |
1471 | - p_buff = "SN06 T"; | |
1472 | - break; | |
1511 | + p_buff = "SN06 T"; | |
1512 | + break; | |
1473 | 1513 | case SN07_TONE_MAP: |
1474 | - p_buff = "SN07 T"; | |
1475 | - break; | |
1514 | + p_buff = "SN07 T"; | |
1515 | + break; | |
1476 | 1516 | case SN08_TONE_MAP: |
1477 | - p_buff = "SN08 T"; | |
1478 | - break; | |
1517 | + p_buff = "SN08 T"; | |
1518 | + break; | |
1479 | 1519 | case SN09_TONE_MAP: |
1480 | - p_buff = "SN09 T"; | |
1481 | - break; | |
1520 | + p_buff = "SN09 T"; | |
1521 | + break; | |
1482 | 1522 | case SN11_TONE_MAP: |
1483 | - p_buff = "SN11 T"; | |
1484 | - break; | |
1523 | + p_buff = "SN11 T"; | |
1524 | + break; | |
1485 | 1525 | case SN12_TONE_MAP: |
1486 | - p_buff = "SN12 T"; | |
1487 | - break; | |
1526 | + p_buff = "SN12 T"; | |
1527 | + break; | |
1488 | 1528 | case SN13_TONE_MAP: |
1489 | - p_buff = "SN13 T"; | |
1490 | - break; | |
1529 | + p_buff = "SN13 T"; | |
1530 | + break; | |
1491 | 1531 | case SN14_TONE_MAP: |
1492 | - p_buff = "SN14 T"; | |
1493 | - break; | |
1532 | + p_buff = "SN14 T"; | |
1533 | + break; | |
1494 | 1534 | case SN15_TONE_MAP: |
1495 | - p_buff = "SN15 T"; | |
1496 | - break; | |
1535 | + p_buff = "SN15 T"; | |
1536 | + break; | |
1497 | 1537 | case SN02_DRUM_MAP: |
1498 | - p_buff = "SN02 D"; | |
1499 | - break; | |
1538 | + p_buff = "SN02 D"; | |
1539 | + break; | |
1500 | 1540 | case SN10_DRUM_MAP: |
1501 | - p_buff = "SN10 D"; | |
1502 | - break; | |
1503 | - } | |
1541 | + p_buff = "SN10 D"; | |
1542 | + break; | |
1543 | + } | |
1504 | 1544 | |
1505 | - if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_inst_map) == 0) | |
1506 | - cheap_string_view_draw(&rc, p_buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, lockflag); | |
1545 | + if (get_ch_rc(ch, &rc, &w32g_tracer_wnd.rc_inst_map) == 0) | |
1546 | + cheap_string_view_draw(&rc, p_buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, lockflag); | |
1507 | 1547 | |
1508 | - return 0; | |
1548 | + return 0; | |
1509 | 1549 | } |
1510 | 1550 | |
1511 | 1551 | static int effect_view_border_draw(RECT *lprc, int lockflag) |
1512 | 1552 | { |
1513 | - HDC hdc; | |
1514 | - COLORREF base = RGB(128, 128, 128); | |
1515 | - HPEN hPen1 = NULL; | |
1516 | - HPEN hPen3 = NULL; | |
1517 | - HPEN hOldPen = NULL; | |
1518 | - | |
1519 | - if (!w32g_tracer_wnd.active) | |
1520 | - return 0; | |
1521 | - hdc = w32g_tracer_wnd.hmdc; | |
1522 | - | |
1523 | - hPen1 = CreatePen(PS_SOLID, 1, base); | |
1524 | - hPen3 = CreatePen(PS_SOLID, 1, base); | |
1525 | - if (lockflag) TRACER_LOCK(); | |
1526 | - hOldPen = (HPEN) SelectObject(hdc, GetStockObject(NULL_PEN)); | |
1553 | + HDC hdc; | |
1554 | + COLORREF base = RGB(128, 128, 128); | |
1555 | + HPEN hPen1 = NULL; | |
1556 | + HPEN hPen3 = NULL; | |
1557 | + HPEN hOldPen = NULL; | |
1527 | 1558 | |
1528 | - // 右線 | |
1529 | - SelectObject(hdc, hPen3); | |
1530 | - MoveToEx(hdc, lprc->right, lprc->top - 1, NULL); | |
1531 | - LineTo(hdc, lprc->right, lprc->bottom + 1); | |
1559 | + if (!w32g_tracer_wnd.active) | |
1560 | + return 0; | |
1561 | + hdc = w32g_tracer_wnd.hmdc; | |
1532 | 1562 | |
1533 | - // 下線 | |
1534 | - SelectObject(hdc, hPen1); | |
1535 | - MoveToEx(hdc, lprc->left - 1, lprc->bottom, NULL); | |
1536 | - LineTo(hdc, lprc->right + 1, lprc->bottom); | |
1563 | + hPen1 = CreatePen(PS_SOLID, 1, base); | |
1564 | + hPen3 = CreatePen(PS_SOLID, 1, base); | |
1565 | + if (lockflag) TRACER_LOCK(); | |
1566 | + hOldPen = (HPEN)SelectObject(hdc, GetStockObject(NULL_PEN)); | |
1537 | 1567 | |
1538 | - SelectObject(hdc, hOldPen); | |
1568 | + // 右線 | |
1569 | + SelectObject(hdc, hPen3); | |
1570 | + MoveToEx(hdc, lprc->right, lprc->top - 1, NULL); | |
1571 | + LineTo(hdc, lprc->right, lprc->bottom + 1); | |
1539 | 1572 | |
1540 | - if (lockflag) TRACER_UNLOCK(); | |
1573 | + // 下線 | |
1574 | + SelectObject(hdc, hPen1); | |
1575 | + MoveToEx(hdc, lprc->left - 1, lprc->bottom, NULL); | |
1576 | + LineTo(hdc, lprc->right + 1, lprc->bottom); | |
1577 | + | |
1578 | + SelectObject(hdc, hOldPen); | |
1541 | 1579 | |
1542 | - DeleteObject(hPen1); | |
1543 | - DeleteObject(hPen3); | |
1580 | + if (lockflag) TRACER_UNLOCK(); | |
1544 | 1581 | |
1545 | - return 0; | |
1582 | + DeleteObject(hPen1); | |
1583 | + DeleteObject(hPen3); | |
1584 | + | |
1585 | + return 0; | |
1546 | 1586 | } |
1547 | 1587 | |
1548 | 1588 | static int tracer_velocity_draw(RECT *lprc, int vol, int max, int lockflag) |
1549 | 1589 | { |
1550 | - return tracer_velocity_draw_ex(lprc, vol, -1, max, lockflag); | |
1590 | + return tracer_velocity_draw_ex(lprc, vol, -1, max, lockflag); | |
1551 | 1591 | } |
1552 | 1592 | |
1553 | 1593 | static int tracer_velocity_draw_ex(RECT *lprc, int vol, int vol_old, int max, int lockflag) |
1554 | 1594 | { |
1555 | - HDC hdc; | |
1556 | - const int view_max = 30, div = 17; | |
1557 | - RECT rc; | |
1558 | - if (!w32g_tracer_wnd.active) | |
1559 | - return 0; | |
1560 | - hdc = w32g_tracer_wnd.hmdc; | |
1561 | - | |
1562 | - vol /= div; | |
1563 | - if (vol_old < 0) vol_old = max; | |
1564 | - vol_old /= div; | |
1565 | - RANGE(vol, 0, view_max); | |
1566 | - RANGE(vol_old, 0, view_max); | |
1567 | - | |
1568 | - if (lockflag) TRACER_LOCK(); | |
1569 | - // 必要なだけベロシティバーの背景を描画 | |
1570 | -// BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1571 | - BitBlt(hdc, lprc->left + vol, lprc->top, vol_old - vol, lprc->bottom - lprc->top, | |
1572 | - tracer_bmp.hmdc, tracer_bmp.rc_velocity[0].left + vol, tracer_bmp.rc_velocity[0].top, SRCCOPY); | |
1573 | - | |
1574 | - // 必要なだけベロシティバーを描画 | |
1575 | - BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1576 | - tracer_bmp.hmdc, tracer_bmp.rc_velocity[0].left, tracer_bmp.rc_velocity[0].top + 1 + ITEM_HEIGHT, SRCCOPY); | |
1577 | - | |
1578 | - SetRect(&rc, lprc->left, lprc->top, lprc->left + ((vol_old > vol) ? vol_old : vol), lprc->bottom); | |
1579 | - effect_view_border_draw(lprc, lockflag); | |
1580 | - InvalidateRect(w32g_tracer_wnd.hwnd, &rc, FALSE); | |
1581 | - | |
1582 | - if (lockflag) TRACER_UNLOCK(); | |
1583 | - return 0; | |
1595 | + HDC hdc; | |
1596 | + const int view_max = 30, div = 17; | |
1597 | + RECT rc; | |
1598 | + if (!w32g_tracer_wnd.active) | |
1599 | + return 0; | |
1600 | + hdc = w32g_tracer_wnd.hmdc; | |
1601 | + | |
1602 | + vol /= div; | |
1603 | + if (vol_old < 0) vol_old = max; | |
1604 | + vol_old /= div; | |
1605 | + RANGE(vol, 0, view_max); | |
1606 | + RANGE(vol_old, 0, view_max); | |
1607 | + | |
1608 | + if (lockflag) TRACER_LOCK(); | |
1609 | + // 必要なだけベロシティバーの背景を描画 | |
1610 | +// BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1611 | + BitBlt(hdc, lprc->left + vol, lprc->top, vol_old - vol, lprc->bottom - lprc->top, | |
1612 | + tracer_bmp.hmdc, tracer_bmp.rc_velocity[0].left + vol, tracer_bmp.rc_velocity[0].top, SRCCOPY); | |
1613 | + | |
1614 | + // 必要なだけベロシティバーを描画 | |
1615 | + BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1616 | + tracer_bmp.hmdc, tracer_bmp.rc_velocity[0].left, tracer_bmp.rc_velocity[0].top + 1 + ITEM_HEIGHT, SRCCOPY); | |
1617 | + | |
1618 | + SetRect(&rc, lprc->left, lprc->top, lprc->left + ((vol_old > vol) ? vol_old : vol), lprc->bottom); | |
1619 | + effect_view_border_draw(lprc, lockflag); | |
1620 | + InvalidateRect(w32g_tracer_wnd.hwnd, &rc, FALSE); | |
1621 | + | |
1622 | + if (lockflag) TRACER_UNLOCK(); | |
1623 | + return 0; | |
1584 | 1624 | } |
1585 | 1625 | |
1586 | 1626 | static int tracer_volume_draw(RECT *lprc, int vol, int max, int lockflag) |
1587 | 1627 | { |
1588 | - HDC hdc; | |
1589 | - const int view_max = 20, div = 7; | |
1590 | - if (!w32g_tracer_wnd.active) | |
1591 | - return 0; | |
1592 | - hdc = w32g_tracer_wnd.hmdc; | |
1593 | - | |
1594 | - vol /= div; | |
1595 | - RANGE(vol, 0, view_max); | |
1596 | - | |
1597 | - if (lockflag) TRACER_LOCK(); | |
1598 | - // 必要なだけ背景を描画 | |
1599 | - BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1600 | - tracer_bmp.hmdc, tracer_bmp.rc_volume.left, tracer_bmp.rc_volume.top, SRCCOPY); | |
1601 | - // 必要なだけ描画 | |
1602 | - BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1603 | - tracer_bmp.hmdc, tracer_bmp.rc_volume.left, tracer_bmp.rc_volume.top + 9 + 1, SRCCOPY); | |
1604 | - if (lockflag) TRACER_UNLOCK(); | |
1605 | - effect_view_border_draw(lprc, lockflag); | |
1606 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1607 | - | |
1608 | - return 0; | |
1628 | + HDC hdc; | |
1629 | + const int view_max = 20, div = 7; | |
1630 | + if (!w32g_tracer_wnd.active) | |
1631 | + return 0; | |
1632 | + hdc = w32g_tracer_wnd.hmdc; | |
1633 | + | |
1634 | + vol /= div; | |
1635 | + RANGE(vol, 0, view_max); | |
1636 | + | |
1637 | + if (lockflag) TRACER_LOCK(); | |
1638 | + // 必要なだけ背景を描画 | |
1639 | + BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1640 | + tracer_bmp.hmdc, tracer_bmp.rc_volume.left, tracer_bmp.rc_volume.top, SRCCOPY); | |
1641 | + // 必要なだけ描画 | |
1642 | + BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1643 | + tracer_bmp.hmdc, tracer_bmp.rc_volume.left, tracer_bmp.rc_volume.top + 9 + 1, SRCCOPY); | |
1644 | + if (lockflag) TRACER_UNLOCK(); | |
1645 | + effect_view_border_draw(lprc, lockflag); | |
1646 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1647 | + | |
1648 | + return 0; | |
1609 | 1649 | } |
1610 | 1650 | |
1611 | 1651 | static int tracer_expression_draw(RECT *lprc, int vol, int max, int lockflag) |
1612 | 1652 | { |
1613 | - HDC hdc; | |
1614 | - const int view_max = 20, div = 7; | |
1615 | - if (!w32g_tracer_wnd.active) | |
1616 | - return 0; | |
1617 | - hdc = w32g_tracer_wnd.hmdc; | |
1618 | - | |
1619 | - vol /= div; | |
1620 | - RANGE(vol, 0, view_max); | |
1621 | - | |
1622 | - if (lockflag) TRACER_LOCK(); | |
1623 | - // 必要なだけ背景を描画 | |
1624 | - BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1625 | - tracer_bmp.hmdc, tracer_bmp.rc_expression.left, tracer_bmp.rc_expression.top, SRCCOPY); | |
1626 | - // 必要なだけ描画 | |
1627 | - BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1628 | - tracer_bmp.hmdc, tracer_bmp.rc_expression.left, tracer_bmp.rc_expression.top + 9 + 1, SRCCOPY); | |
1629 | - if (lockflag) TRACER_UNLOCK(); | |
1630 | - effect_view_border_draw(lprc, lockflag); | |
1631 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1632 | - | |
1633 | - return 0; | |
1653 | + HDC hdc; | |
1654 | + const int view_max = 20, div = 7; | |
1655 | + if (!w32g_tracer_wnd.active) | |
1656 | + return 0; | |
1657 | + hdc = w32g_tracer_wnd.hmdc; | |
1658 | + | |
1659 | + vol /= div; | |
1660 | + RANGE(vol, 0, view_max); | |
1661 | + | |
1662 | + if (lockflag) TRACER_LOCK(); | |
1663 | + // 必要なだけ背景を描画 | |
1664 | + BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1665 | + tracer_bmp.hmdc, tracer_bmp.rc_expression.left, tracer_bmp.rc_expression.top, SRCCOPY); | |
1666 | + // 必要なだけ描画 | |
1667 | + BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1668 | + tracer_bmp.hmdc, tracer_bmp.rc_expression.left, tracer_bmp.rc_expression.top + 9 + 1, SRCCOPY); | |
1669 | + if (lockflag) TRACER_UNLOCK(); | |
1670 | + effect_view_border_draw(lprc, lockflag); | |
1671 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1672 | + | |
1673 | + return 0; | |
1634 | 1674 | } |
1635 | 1675 | |
1636 | 1676 | static int tracer_pan_draw(RECT *lprc, int vol, int max, int lockflag) |
1637 | 1677 | { |
1638 | - HDC hdc; | |
1639 | - const int view_max = 10, div = 7; | |
1640 | - if (!w32g_tracer_wnd.active) | |
1641 | - return 0; | |
1642 | - hdc = w32g_tracer_wnd.hmdc; | |
1643 | - | |
1644 | - vol = (vol - 64) / div; | |
1645 | - RANGE(vol, -view_max, view_max); | |
1646 | - | |
1647 | - if (lockflag) TRACER_LOCK(); | |
1648 | - // 背景を描画 | |
1649 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1650 | - tracer_bmp.hmdc, tracer_bmp.rc_pan.left, tracer_bmp.rc_pan.top, SRCCOPY); | |
1651 | - // ※以下の2つの転送処理では無駄な部分も転送しているので、うまくやれば省ける。 | |
1652 | - // マスクを描画 | |
1653 | - BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1654 | - tracer_bmp.hmdc, tracer_bmp.rc_pan.left, tracer_bmp.rc_pan.top + (9 + 1) * 2, SRCPAINT); | |
1655 | - // つまみを描画 | |
1656 | - BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1657 | - tracer_bmp.hmdc, tracer_bmp.rc_pan.left, tracer_bmp.rc_pan.top + 9 + 1, SRCAND); | |
1658 | - if (lockflag) TRACER_UNLOCK(); | |
1659 | - effect_view_border_draw(lprc, lockflag); | |
1660 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1661 | - | |
1662 | - return 0; | |
1678 | + HDC hdc; | |
1679 | + const int view_max = 10, div = 7; | |
1680 | + if (!w32g_tracer_wnd.active) | |
1681 | + return 0; | |
1682 | + hdc = w32g_tracer_wnd.hmdc; | |
1683 | + | |
1684 | + vol = (vol - 64) / div; | |
1685 | + RANGE(vol, -view_max, view_max); | |
1686 | + | |
1687 | + if (lockflag) TRACER_LOCK(); | |
1688 | + // 背景を描画 | |
1689 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1690 | + tracer_bmp.hmdc, tracer_bmp.rc_pan.left, tracer_bmp.rc_pan.top, SRCCOPY); | |
1691 | + // ※以下の2つの転送処理では無駄な部分も転送しているので、うまくやれば省ける。 | |
1692 | + // マスクを描画 | |
1693 | + BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1694 | + tracer_bmp.hmdc, tracer_bmp.rc_pan.left, tracer_bmp.rc_pan.top + (9 + 1) * 2, SRCPAINT); | |
1695 | + // つまみを描画 | |
1696 | + BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1697 | + tracer_bmp.hmdc, tracer_bmp.rc_pan.left, tracer_bmp.rc_pan.top + 9 + 1, SRCAND); | |
1698 | + if (lockflag) TRACER_UNLOCK(); | |
1699 | + effect_view_border_draw(lprc, lockflag); | |
1700 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1701 | + | |
1702 | + return 0; | |
1663 | 1703 | } |
1664 | 1704 | |
1665 | 1705 | static int tracer_sustain_draw(RECT *lprc, int vol, int lockflag) |
1666 | 1706 | { |
1667 | - HDC hdc; | |
1668 | - const int view_max = 20, div = 6; | |
1669 | - if (!w32g_tracer_wnd.active) | |
1670 | - return 0; | |
1671 | - hdc = w32g_tracer_wnd.hmdc; | |
1672 | - | |
1673 | - vol /= div; | |
1674 | - RANGE(vol, 0, view_max); | |
1675 | - | |
1676 | - if (lockflag) TRACER_LOCK(); | |
1677 | - // 必要なだけ背景を描画 | |
1678 | - BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1679 | - tracer_bmp.hmdc, tracer_bmp.rc_sustain.left, tracer_bmp.rc_sustain.top, SRCCOPY); | |
1680 | - // 必要なだけ描画 | |
1681 | - BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1682 | - tracer_bmp.hmdc, tracer_bmp.rc_sustain.left, tracer_bmp.rc_sustain.top + 9 + 1, SRCCOPY); | |
1683 | - if (lockflag) TRACER_UNLOCK(); | |
1684 | - effect_view_border_draw(lprc, lockflag); | |
1685 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1686 | - | |
1687 | - return 0; | |
1707 | + HDC hdc; | |
1708 | + const int view_max = 20, div = 6; | |
1709 | + if (!w32g_tracer_wnd.active) | |
1710 | + return 0; | |
1711 | + hdc = w32g_tracer_wnd.hmdc; | |
1712 | + | |
1713 | + vol /= div; | |
1714 | + RANGE(vol, 0, view_max); | |
1715 | + | |
1716 | + if (lockflag) TRACER_LOCK(); | |
1717 | + // 必要なだけ背景を描画 | |
1718 | + BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1719 | + tracer_bmp.hmdc, tracer_bmp.rc_sustain.left, tracer_bmp.rc_sustain.top, SRCCOPY); | |
1720 | + // 必要なだけ描画 | |
1721 | + BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1722 | + tracer_bmp.hmdc, tracer_bmp.rc_sustain.left, tracer_bmp.rc_sustain.top + 9 + 1, SRCCOPY); | |
1723 | + if (lockflag) TRACER_UNLOCK(); | |
1724 | + effect_view_border_draw(lprc, lockflag); | |
1725 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1726 | + | |
1727 | + return 0; | |
1688 | 1728 | /* |
1689 | - HDC hdc; | |
1690 | - if (!w32g_tracer_wnd.active) | |
1691 | - return 0; | |
1692 | - hdc = w32g_tracer_wnd.hmdc; | |
1693 | - RANGE(vol, 0, 1); | |
1694 | - if (lockflag) TRACER_LOCK(); | |
1695 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1696 | - tracer_bmp.hmdc, tracer_bmp.rc_sustain.left, tracer_bmp.rc_sustain.top + vol * (9 + 1), SRCCOPY); | |
1697 | - if (lockflag) TRACER_UNLOCK(); | |
1698 | - | |
1699 | - effect_view_border_draw(lprc, lockflag); | |
1700 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1701 | - return 0;*/ | |
1729 | + HDC hdc; | |
1730 | + if (!w32g_tracer_wnd.active) | |
1731 | + return 0; | |
1732 | + hdc = w32g_tracer_wnd.hmdc; | |
1733 | + RANGE(vol, 0, 1); | |
1734 | + if (lockflag) TRACER_LOCK(); | |
1735 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1736 | + tracer_bmp.hmdc, tracer_bmp.rc_sustain.left, tracer_bmp.rc_sustain.top + vol * (9 + 1), SRCCOPY); | |
1737 | + if (lockflag) TRACER_UNLOCK(); | |
1738 | + | |
1739 | + effect_view_border_draw(lprc, lockflag); | |
1740 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1741 | + return 0;*/ | |
1702 | 1742 | } |
1703 | 1743 | |
1704 | 1744 | static int tracer_pitch_bend_draw(RECT *lprc, int vol, int max, int lockflag) |
1705 | 1745 | { |
1706 | - HDC hdc; | |
1707 | - const int view_max = 10; | |
1708 | - if (!w32g_tracer_wnd.active) | |
1709 | - return 0; | |
1710 | - hdc = w32g_tracer_wnd.hmdc; | |
1711 | - | |
1712 | - vol = (vol - max / 2) * view_max * 2 / max; | |
1713 | - RANGE(vol, -view_max, view_max); | |
1714 | - | |
1715 | - if (lockflag) TRACER_LOCK(); | |
1716 | - // 背景を描画 | |
1717 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1718 | - tracer_bmp.hmdc, tracer_bmp.rc_pitch_bend.left, tracer_bmp.rc_pitch_bend.top, SRCCOPY); | |
1719 | - if (vol > 0) { // 必要なだけ描画 | |
1720 | - BitBlt(hdc, lprc->left + view_max, lprc->top, vol, lprc->bottom - lprc->top, | |
1721 | - tracer_bmp.hmdc, tracer_bmp.rc_pitch_bend.left + view_max, tracer_bmp.rc_pitch_bend.top + 9 + 1, SRCCOPY); | |
1722 | - } else if (vol < 0) { | |
1723 | - BitBlt(hdc, lprc->left + view_max + vol, lprc->top, -vol, lprc->bottom - lprc->top, | |
1724 | - tracer_bmp.hmdc, tracer_bmp.rc_pitch_bend.left + view_max + vol, tracer_bmp.rc_pitch_bend.top + 9 + 1, SRCCOPY); | |
1725 | - } | |
1726 | - if (lockflag) TRACER_UNLOCK(); | |
1727 | - effect_view_border_draw(lprc, lockflag); | |
1728 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1729 | - | |
1730 | - return 0; | |
1746 | + HDC hdc; | |
1747 | + const int view_max = 10; | |
1748 | + if (!w32g_tracer_wnd.active) | |
1749 | + return 0; | |
1750 | + hdc = w32g_tracer_wnd.hmdc; | |
1751 | + | |
1752 | + vol = (vol - max / 2) * view_max * 2 / max; | |
1753 | + RANGE(vol, -view_max, view_max); | |
1754 | + | |
1755 | + if (lockflag) TRACER_LOCK(); | |
1756 | + // 背景を描画 | |
1757 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1758 | + tracer_bmp.hmdc, tracer_bmp.rc_pitch_bend.left, tracer_bmp.rc_pitch_bend.top, SRCCOPY); | |
1759 | + if (vol > 0) { // 必要なだけ描画 | |
1760 | + BitBlt(hdc, lprc->left + view_max, lprc->top, vol, lprc->bottom - lprc->top, | |
1761 | + tracer_bmp.hmdc, tracer_bmp.rc_pitch_bend.left + view_max, tracer_bmp.rc_pitch_bend.top + 9 + 1, SRCCOPY); | |
1762 | + } else if (vol < 0) { | |
1763 | + BitBlt(hdc, lprc->left + view_max + vol, lprc->top, -vol, lprc->bottom - lprc->top, | |
1764 | + tracer_bmp.hmdc, tracer_bmp.rc_pitch_bend.left + view_max + vol, tracer_bmp.rc_pitch_bend.top + 9 + 1, SRCCOPY); | |
1765 | + } | |
1766 | + if (lockflag) TRACER_UNLOCK(); | |
1767 | + effect_view_border_draw(lprc, lockflag); | |
1768 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1769 | + | |
1770 | + return 0; | |
1731 | 1771 | } |
1732 | 1772 | |
1733 | 1773 | static int tracer_mod_wheel_draw(RECT *lprc, int vol, int max, int lockflag) |
1734 | 1774 | { |
1735 | - HDC hdc; | |
1736 | - const int view_max = 20, div = 7; | |
1737 | - if (!w32g_tracer_wnd.active) | |
1738 | - return 0; | |
1739 | - hdc = w32g_tracer_wnd.hmdc; | |
1740 | - | |
1741 | - vol /= div; | |
1742 | - RANGE(vol, 0, view_max); | |
1743 | - | |
1744 | - if (lockflag) TRACER_LOCK(); | |
1745 | - // 必要なだけ背景を描画 | |
1746 | - BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1747 | - tracer_bmp.hmdc, tracer_bmp.rc_mod_wheel.left, tracer_bmp.rc_mod_wheel.top, SRCCOPY); | |
1748 | - // 必要なだけ描画 | |
1749 | - BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1750 | - tracer_bmp.hmdc, tracer_bmp.rc_mod_wheel.left, tracer_bmp.rc_mod_wheel.top + 9 + 1, SRCCOPY); | |
1751 | - if (lockflag) TRACER_UNLOCK(); | |
1752 | - effect_view_border_draw(lprc, lockflag); | |
1753 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1754 | - | |
1755 | - return 0; | |
1775 | + HDC hdc; | |
1776 | + const int view_max = 20, div = 7; | |
1777 | + if (!w32g_tracer_wnd.active) | |
1778 | + return 0; | |
1779 | + hdc = w32g_tracer_wnd.hmdc; | |
1780 | + | |
1781 | + vol /= div; | |
1782 | + RANGE(vol, 0, view_max); | |
1783 | + | |
1784 | + if (lockflag) TRACER_LOCK(); | |
1785 | + // 必要なだけ背景を描画 | |
1786 | + BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1787 | + tracer_bmp.hmdc, tracer_bmp.rc_mod_wheel.left, tracer_bmp.rc_mod_wheel.top, SRCCOPY); | |
1788 | + // 必要なだけ描画 | |
1789 | + BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1790 | + tracer_bmp.hmdc, tracer_bmp.rc_mod_wheel.left, tracer_bmp.rc_mod_wheel.top + 9 + 1, SRCCOPY); | |
1791 | + if (lockflag) TRACER_UNLOCK(); | |
1792 | + effect_view_border_draw(lprc, lockflag); | |
1793 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1794 | + | |
1795 | + return 0; | |
1756 | 1796 | } |
1757 | 1797 | |
1758 | 1798 | static int tracer_chorus_effect_draw(RECT *lprc, int vol, int max, int lockflag) |
1759 | 1799 | { |
1760 | - HDC hdc; | |
1761 | - const int view_max = 20, div = 7; | |
1762 | - if (!w32g_tracer_wnd.active) | |
1763 | - return 0; | |
1764 | - hdc = w32g_tracer_wnd.hmdc; | |
1765 | - | |
1766 | - vol /= div; | |
1767 | - RANGE(vol, 0, view_max); | |
1768 | - | |
1769 | - if (lockflag) TRACER_LOCK(); | |
1770 | - // 必要なだけ背景を描画 | |
1771 | - BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1772 | - tracer_bmp.hmdc, tracer_bmp.rc_chorus_effect.left, tracer_bmp.rc_chorus_effect.top, SRCCOPY); | |
1773 | - // 必要なだけ描画 | |
1774 | - BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1775 | - tracer_bmp.hmdc, tracer_bmp.rc_chorus_effect.left, tracer_bmp.rc_chorus_effect.top + 9 + 1, SRCCOPY); | |
1776 | - if (lockflag) TRACER_UNLOCK(); | |
1777 | - effect_view_border_draw(lprc, lockflag); | |
1778 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1779 | - | |
1780 | - return 0; | |
1800 | + HDC hdc; | |
1801 | + const int view_max = 20, div = 7; | |
1802 | + if (!w32g_tracer_wnd.active) | |
1803 | + return 0; | |
1804 | + hdc = w32g_tracer_wnd.hmdc; | |
1805 | + | |
1806 | + vol /= div; | |
1807 | + RANGE(vol, 0, view_max); | |
1808 | + | |
1809 | + if (lockflag) TRACER_LOCK(); | |
1810 | + // 必要なだけ背景を描画 | |
1811 | + BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1812 | + tracer_bmp.hmdc, tracer_bmp.rc_chorus_effect.left, tracer_bmp.rc_chorus_effect.top, SRCCOPY); | |
1813 | + // 必要なだけ描画 | |
1814 | + BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1815 | + tracer_bmp.hmdc, tracer_bmp.rc_chorus_effect.left, tracer_bmp.rc_chorus_effect.top + 9 + 1, SRCCOPY); | |
1816 | + if (lockflag) TRACER_UNLOCK(); | |
1817 | + effect_view_border_draw(lprc, lockflag); | |
1818 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1819 | + | |
1820 | + return 0; | |
1781 | 1821 | } |
1782 | 1822 | |
1783 | 1823 | static int tracer_reverb_effect_draw(RECT *lprc, int vol, int max, int lockflag) |
1784 | 1824 | { |
1785 | - HDC hdc; | |
1786 | - const int view_max = 20, div = 7; | |
1787 | - if (!w32g_tracer_wnd.active) | |
1788 | - return 0; | |
1789 | - hdc = w32g_tracer_wnd.hmdc; | |
1790 | - | |
1791 | - vol /= div; | |
1792 | - RANGE(vol, 0, view_max); | |
1793 | - | |
1794 | - if (lockflag) TRACER_LOCK(); | |
1795 | - // 必要なだけ背景を描画 | |
1796 | - BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1797 | - tracer_bmp.hmdc, tracer_bmp.rc_reverb_effect.left, tracer_bmp.rc_reverb_effect.top, SRCCOPY); | |
1798 | - // 必要なだけ描画 | |
1799 | - BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1800 | - tracer_bmp.hmdc, tracer_bmp.rc_reverb_effect.left, tracer_bmp.rc_reverb_effect.top + 9 + 1, SRCCOPY); | |
1801 | - if (lockflag) TRACER_UNLOCK(); | |
1802 | - effect_view_border_draw(lprc, lockflag); | |
1803 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1804 | - | |
1805 | - return 0; | |
1825 | + HDC hdc; | |
1826 | + const int view_max = 20, div = 7; | |
1827 | + if (!w32g_tracer_wnd.active) | |
1828 | + return 0; | |
1829 | + hdc = w32g_tracer_wnd.hmdc; | |
1830 | + | |
1831 | + vol /= div; | |
1832 | + RANGE(vol, 0, view_max); | |
1833 | + | |
1834 | + if (lockflag) TRACER_LOCK(); | |
1835 | + // 必要なだけ背景を描画 | |
1836 | + BitBlt(hdc, lprc->left + vol, lprc->top, lprc->right - lprc->left - vol, lprc->bottom - lprc->top, | |
1837 | + tracer_bmp.hmdc, tracer_bmp.rc_reverb_effect.left, tracer_bmp.rc_reverb_effect.top, SRCCOPY); | |
1838 | + // 必要なだけ描画 | |
1839 | + BitBlt(hdc, lprc->left, lprc->top, vol, lprc->bottom - lprc->top, | |
1840 | + tracer_bmp.hmdc, tracer_bmp.rc_reverb_effect.left, tracer_bmp.rc_reverb_effect.top + 9 + 1, SRCCOPY); | |
1841 | + if (lockflag) TRACER_UNLOCK(); | |
1842 | + effect_view_border_draw(lprc, lockflag); | |
1843 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1844 | + | |
1845 | + return 0; | |
1806 | 1846 | } |
1807 | 1847 | |
1808 | 1848 | static int tracer_temper_keysig_draw(RECT *lprc, int8 tk, int ko, int lockflag) |
1809 | 1849 | { |
1810 | - static int8 lastkeysig = CTL_STATUS_UPDATE; | |
1811 | - static int lastoffset = CTL_STATUS_UPDATE; | |
1812 | - int adj, i, j; | |
1813 | - HDC hdc; | |
1814 | - | |
1815 | - if (tk == CTL_STATUS_UPDATE) | |
1816 | - tk = lastkeysig; | |
1817 | - else | |
1818 | - lastkeysig = tk; | |
1819 | - if (ko == CTL_STATUS_UPDATE) | |
1820 | - ko = lastoffset; | |
1821 | - else | |
1822 | - lastoffset = ko; | |
1823 | - adj = tk + 8 & 0x20, tk = (tk + 8) % 32 - 8; | |
1824 | - i = tk + ((tk < 8) ? 7 : -9); | |
1825 | - if (ko > 0) | |
1826 | - for (j = 0; j < ko; j++) | |
1827 | - i += (i > 7) ? -5 : 7; | |
1828 | - else | |
1829 | - for (j = 0; j < abs(ko); j++) | |
1830 | - i += (i < 7) ? 5 : -7; | |
1831 | - i += (tk < 8) ? 1 : 17; | |
1832 | - if (!w32g_tracer_wnd.active) | |
1833 | - return 0; | |
1834 | - hdc = w32g_tracer_wnd.hmdc; | |
1835 | - if (lockflag) | |
1836 | - TRACER_LOCK(); | |
1837 | - BitBlt(hdc, lprc->left, lprc->top, | |
1838 | - lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1839 | - tracer_bmp.hmdc, tracer_bmp.rc_temper_keysig[i].left, | |
1840 | - tracer_bmp.rc_temper_keysig[i].top, (adj) ? NOTSRCCOPY : SRCCOPY); | |
1841 | - if (lockflag) | |
1842 | - TRACER_UNLOCK(); | |
1843 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1844 | - return 0; | |
1850 | + static int8 lastkeysig = CTL_STATUS_UPDATE; | |
1851 | + static int lastoffset = CTL_STATUS_UPDATE; | |
1852 | + int adj, i, j; | |
1853 | + HDC hdc; | |
1854 | + | |
1855 | + if (tk == CTL_STATUS_UPDATE) | |
1856 | + tk = lastkeysig; | |
1857 | + else | |
1858 | + lastkeysig = tk; | |
1859 | + if (ko == CTL_STATUS_UPDATE) | |
1860 | + ko = lastoffset; | |
1861 | + else | |
1862 | + lastoffset = ko; | |
1863 | + adj = tk + 8 & 0x20, tk = (tk + 8) % 32 - 8; | |
1864 | + i = tk + ((tk < 8) ? 7 : -9); | |
1865 | + if (ko > 0) | |
1866 | + for (j = 0; j < ko; j++) | |
1867 | + i += (i > 7) ? -5 : 7; | |
1868 | + else | |
1869 | + for (j = 0; j < abs(ko); j++) | |
1870 | + i += (i < 7) ? 5 : -7; | |
1871 | + i += (tk < 8) ? 1 : 17; | |
1872 | + if (!w32g_tracer_wnd.active) | |
1873 | + return 0; | |
1874 | + hdc = w32g_tracer_wnd.hmdc; | |
1875 | + if (lockflag) | |
1876 | + TRACER_LOCK(); | |
1877 | + BitBlt(hdc, lprc->left, lprc->top, | |
1878 | + lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1879 | + tracer_bmp.hmdc, tracer_bmp.rc_temper_keysig[i].left, | |
1880 | + tracer_bmp.rc_temper_keysig[i].top, (adj) ? NOTSRCCOPY : SRCCOPY); | |
1881 | + if (lockflag) | |
1882 | + TRACER_UNLOCK(); | |
1883 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1884 | + return 0; | |
1845 | 1885 | } |
1846 | 1886 | |
1847 | 1887 | static int tracer_temper_type_draw(RECT *lprc, int ch, int8 tt, int lockflag) |
1848 | 1888 | { |
1849 | - HDC hdc; | |
1850 | - | |
1851 | - if (tt != CTL_STATUS_UPDATE) { | |
1852 | - if (w32g_tracer_wnd.tt[ch] == tt) | |
1853 | - return 0; | |
1854 | - w32g_tracer_wnd.tt[ch] = tt; | |
1855 | - } else | |
1856 | - tt = w32g_tracer_wnd.tt[ch]; | |
1857 | - if (!w32g_tracer_wnd.active) | |
1858 | - return 0; | |
1859 | - hdc = w32g_tracer_wnd.hmdc; | |
1860 | - if (lockflag) | |
1861 | - TRACER_LOCK(); | |
1862 | - BitBlt(hdc, lprc->left, lprc->top, | |
1863 | - lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1864 | - tracer_bmp.hmdc, | |
1865 | - tracer_bmp.rc_temper_type[(tt < 0x40) ? tt : tt - 0x3c].left, | |
1866 | - tracer_bmp.rc_temper_type[(tt < 0x40) ? tt : tt - 0x3c].top, | |
1867 | - SRCCOPY); | |
1868 | - if (lockflag) | |
1869 | - TRACER_UNLOCK(); | |
1870 | - effect_view_border_draw(lprc, lockflag); | |
1871 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1872 | - return 0; | |
1889 | + HDC hdc; | |
1890 | + | |
1891 | + if (tt != CTL_STATUS_UPDATE) { | |
1892 | + if (w32g_tracer_wnd.tt[ch] == tt) | |
1893 | + return 0; | |
1894 | + w32g_tracer_wnd.tt[ch] = tt; | |
1895 | + } else | |
1896 | + tt = w32g_tracer_wnd.tt[ch]; | |
1897 | + if (!w32g_tracer_wnd.active) | |
1898 | + return 0; | |
1899 | + hdc = w32g_tracer_wnd.hmdc; | |
1900 | + if (lockflag) | |
1901 | + TRACER_LOCK(); | |
1902 | + BitBlt(hdc, lprc->left, lprc->top, | |
1903 | + lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1904 | + tracer_bmp.hmdc, | |
1905 | + tracer_bmp.rc_temper_type[(tt < 0x40) ? tt : tt - 0x3c].left, | |
1906 | + tracer_bmp.rc_temper_type[(tt < 0x40) ? tt : tt - 0x3c].top, | |
1907 | + SRCCOPY); | |
1908 | + if (lockflag) | |
1909 | + TRACER_UNLOCK(); | |
1910 | + effect_view_border_draw(lprc, lockflag); | |
1911 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1912 | + return 0; | |
1873 | 1913 | } |
1874 | 1914 | |
1875 | 1915 | static int tracer_gm_draw(RECT *lprc, int flag, int lockflag) |
1876 | 1916 | { |
1877 | - HDC hdc; | |
1878 | - if (!w32g_tracer_wnd.active) | |
1879 | - return 0; | |
1880 | - hdc = w32g_tracer_wnd.hmdc; | |
1881 | - if (lockflag) TRACER_LOCK(); | |
1882 | - switch (flag) { | |
1883 | - default: | |
1884 | - case 0: | |
1885 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1886 | - tracer_bmp.hmdc, tracer_bmp.rc_gm_off.left, tracer_bmp.rc_gm_off.top, SRCCOPY); | |
1887 | - break; | |
1888 | - case 1: | |
1889 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1890 | - tracer_bmp.hmdc, tracer_bmp.rc_gm_on.left, tracer_bmp.rc_gm_on.top, SRCCOPY); | |
1891 | - break; | |
1892 | - } | |
1893 | - if (lockflag) TRACER_UNLOCK(); | |
1894 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1895 | - return 0; | |
1917 | + HDC hdc; | |
1918 | + if (!w32g_tracer_wnd.active) | |
1919 | + return 0; | |
1920 | + hdc = w32g_tracer_wnd.hmdc; | |
1921 | + if (lockflag) TRACER_LOCK(); | |
1922 | + switch (flag) { | |
1923 | + default: | |
1924 | + case 0: | |
1925 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1926 | + tracer_bmp.hmdc, tracer_bmp.rc_gm_off.left, tracer_bmp.rc_gm_off.top, SRCCOPY); | |
1927 | + break; | |
1928 | + case 1: | |
1929 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1930 | + tracer_bmp.hmdc, tracer_bmp.rc_gm_on.left, tracer_bmp.rc_gm_on.top, SRCCOPY); | |
1931 | + break; | |
1932 | + } | |
1933 | + if (lockflag) TRACER_UNLOCK(); | |
1934 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1935 | + return 0; | |
1896 | 1936 | } |
1897 | 1937 | |
1898 | 1938 | static int tracer_gs_draw(RECT *lprc, int flag, int lockflag) |
1899 | 1939 | { |
1900 | - HDC hdc; | |
1901 | - if (!w32g_tracer_wnd.active) | |
1902 | - return 0; | |
1903 | - hdc = w32g_tracer_wnd.hmdc; | |
1904 | - if (lockflag) TRACER_LOCK(); | |
1905 | - switch (flag) { | |
1906 | - default: | |
1907 | - case 0: | |
1908 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1909 | - tracer_bmp.hmdc, tracer_bmp.rc_gs_off.left, tracer_bmp.rc_gs_off.top, SRCCOPY); | |
1910 | - break; | |
1911 | - case 1: | |
1912 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1913 | - tracer_bmp.hmdc, tracer_bmp.rc_gs_on.left, tracer_bmp.rc_gs_on.top, SRCCOPY); | |
1914 | - break; | |
1915 | - } | |
1916 | - if (lockflag) TRACER_UNLOCK(); | |
1917 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1918 | - return 0; | |
1940 | + HDC hdc; | |
1941 | + if (!w32g_tracer_wnd.active) | |
1942 | + return 0; | |
1943 | + hdc = w32g_tracer_wnd.hmdc; | |
1944 | + if (lockflag) TRACER_LOCK(); | |
1945 | + switch (flag) { | |
1946 | + default: | |
1947 | + case 0: | |
1948 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1949 | + tracer_bmp.hmdc, tracer_bmp.rc_gs_off.left, tracer_bmp.rc_gs_off.top, SRCCOPY); | |
1950 | + break; | |
1951 | + case 1: | |
1952 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1953 | + tracer_bmp.hmdc, tracer_bmp.rc_gs_on.left, tracer_bmp.rc_gs_on.top, SRCCOPY); | |
1954 | + break; | |
1955 | + } | |
1956 | + if (lockflag) TRACER_UNLOCK(); | |
1957 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1958 | + return 0; | |
1919 | 1959 | } |
1920 | 1960 | |
1921 | 1961 | static int tracer_xg_draw(RECT *lprc, int flag, int lockflag) |
1922 | 1962 | { |
1923 | - HDC hdc; | |
1924 | - if (!w32g_tracer_wnd.active) | |
1925 | - return 0; | |
1926 | - hdc = w32g_tracer_wnd.hmdc; | |
1927 | - if (lockflag) TRACER_LOCK(); | |
1928 | - switch (flag) { | |
1929 | - default: | |
1930 | - case 0: | |
1931 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1932 | - tracer_bmp.hmdc, tracer_bmp.rc_xg_off.left, tracer_bmp.rc_xg_off.top, SRCCOPY); | |
1933 | - break; | |
1934 | - case 1: | |
1935 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1936 | - tracer_bmp.hmdc, tracer_bmp.rc_xg_on.left, tracer_bmp.rc_xg_on.top, SRCCOPY); | |
1937 | - break; | |
1938 | - } | |
1939 | - if (lockflag) TRACER_UNLOCK(); | |
1940 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1941 | - return 0; | |
1963 | + HDC hdc; | |
1964 | + if (!w32g_tracer_wnd.active) | |
1965 | + return 0; | |
1966 | + hdc = w32g_tracer_wnd.hmdc; | |
1967 | + if (lockflag) TRACER_LOCK(); | |
1968 | + switch (flag) { | |
1969 | + default: | |
1970 | + case 0: | |
1971 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1972 | + tracer_bmp.hmdc, tracer_bmp.rc_xg_off.left, tracer_bmp.rc_xg_off.top, SRCCOPY); | |
1973 | + break; | |
1974 | + case 1: | |
1975 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1976 | + tracer_bmp.hmdc, tracer_bmp.rc_xg_on.left, tracer_bmp.rc_xg_on.top, SRCCOPY); | |
1977 | + break; | |
1978 | + } | |
1979 | + if (lockflag) TRACER_UNLOCK(); | |
1980 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1981 | + return 0; | |
1942 | 1982 | } |
1943 | 1983 | ///r |
1944 | 1984 | static int tracer_gm2_draw(RECT *lprc, int flag, int lockflag) |
1945 | 1985 | { |
1946 | - HDC hdc; | |
1947 | - if (!w32g_tracer_wnd.active) | |
1948 | - return 0; | |
1949 | - hdc = w32g_tracer_wnd.hmdc; | |
1950 | - if (lockflag) TRACER_LOCK(); | |
1951 | - switch (flag) { | |
1952 | - default: | |
1953 | - case 0: | |
1954 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1955 | - tracer_bmp.hmdc, tracer_bmp.rc_gm2_off.left, tracer_bmp.rc_gm2_off.top, SRCCOPY); | |
1956 | - break; | |
1957 | - case 1: | |
1958 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1959 | - tracer_bmp.hmdc, tracer_bmp.rc_gm2_on.left, tracer_bmp.rc_gm2_on.top, SRCCOPY); | |
1960 | - break; | |
1961 | - } | |
1962 | - if (lockflag) TRACER_UNLOCK(); | |
1963 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1964 | - return 0; | |
1986 | + HDC hdc; | |
1987 | + if (!w32g_tracer_wnd.active) | |
1988 | + return 0; | |
1989 | + hdc = w32g_tracer_wnd.hmdc; | |
1990 | + if (lockflag) TRACER_LOCK(); | |
1991 | + switch (flag) { | |
1992 | + default: | |
1993 | + case 0: | |
1994 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1995 | + tracer_bmp.hmdc, tracer_bmp.rc_gm2_off.left, tracer_bmp.rc_gm2_off.top, SRCCOPY); | |
1996 | + break; | |
1997 | + case 1: | |
1998 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1999 | + tracer_bmp.hmdc, tracer_bmp.rc_gm2_on.left, tracer_bmp.rc_gm2_on.top, SRCCOPY); | |
2000 | + break; | |
2001 | + } | |
2002 | + if (lockflag) TRACER_UNLOCK(); | |
2003 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
2004 | + return 0; | |
1965 | 2005 | } |
1966 | 2006 | |
1967 | 2007 | static int tracer_sd_draw(RECT *lprc, int flag, int lockflag) |
1968 | 2008 | { |
1969 | - HDC hdc; | |
1970 | - if (!w32g_tracer_wnd.active) | |
1971 | - return 0; | |
1972 | - hdc = w32g_tracer_wnd.hmdc; | |
1973 | - if (lockflag) TRACER_LOCK(); | |
1974 | - switch (flag) { | |
1975 | - default: | |
1976 | - case 0: | |
1977 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1978 | - tracer_bmp.hmdc, tracer_bmp.rc_sd_off.left, tracer_bmp.rc_sd_off.top, SRCCOPY); | |
1979 | - break; | |
1980 | - case 1: | |
1981 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
1982 | - tracer_bmp.hmdc, tracer_bmp.rc_sd_on.left, tracer_bmp.rc_sd_on.top, SRCCOPY); | |
1983 | - break; | |
1984 | - } | |
1985 | - if (lockflag) TRACER_UNLOCK(); | |
1986 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
1987 | - return 0; | |
2009 | + HDC hdc; | |
2010 | + if (!w32g_tracer_wnd.active) | |
2011 | + return 0; | |
2012 | + hdc = w32g_tracer_wnd.hmdc; | |
2013 | + if (lockflag) TRACER_LOCK(); | |
2014 | + switch (flag) { | |
2015 | + default: | |
2016 | + case 0: | |
2017 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
2018 | + tracer_bmp.hmdc, tracer_bmp.rc_sd_off.left, tracer_bmp.rc_sd_off.top, SRCCOPY); | |
2019 | + break; | |
2020 | + case 1: | |
2021 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
2022 | + tracer_bmp.hmdc, tracer_bmp.rc_sd_on.left, tracer_bmp.rc_sd_on.top, SRCCOPY); | |
2023 | + break; | |
2024 | + } | |
2025 | + if (lockflag) TRACER_UNLOCK(); | |
2026 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
2027 | + return 0; | |
1988 | 2028 | } |
1989 | 2029 | |
1990 | 2030 | static int tracer_kg_draw(RECT *lprc, int flag, int lockflag) |
1991 | 2031 | { |
1992 | - HDC hdc; | |
1993 | - if (!w32g_tracer_wnd.active) | |
1994 | - return 0; | |
1995 | - hdc = w32g_tracer_wnd.hmdc; | |
1996 | - if (lockflag) TRACER_LOCK(); | |
1997 | - switch (flag) { | |
1998 | - default: | |
1999 | - case 0: | |
2000 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
2001 | - tracer_bmp.hmdc, tracer_bmp.rc_kg_off.left, tracer_bmp.rc_kg_off.top, SRCCOPY); | |
2002 | - break; | |
2003 | - case 1: | |
2004 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
2005 | - tracer_bmp.hmdc, tracer_bmp.rc_kg_on.left, tracer_bmp.rc_kg_on.top, SRCCOPY); | |
2006 | - break; | |
2007 | - } | |
2008 | - if (lockflag) TRACER_UNLOCK(); | |
2009 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
2010 | - return 0; | |
2032 | + HDC hdc; | |
2033 | + if (!w32g_tracer_wnd.active) | |
2034 | + return 0; | |
2035 | + hdc = w32g_tracer_wnd.hmdc; | |
2036 | + if (lockflag) TRACER_LOCK(); | |
2037 | + switch (flag) { | |
2038 | + default: | |
2039 | + case 0: | |
2040 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
2041 | + tracer_bmp.hmdc, tracer_bmp.rc_kg_off.left, tracer_bmp.rc_kg_off.top, SRCCOPY); | |
2042 | + break; | |
2043 | + case 1: | |
2044 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
2045 | + tracer_bmp.hmdc, tracer_bmp.rc_kg_on.left, tracer_bmp.rc_kg_on.top, SRCCOPY); | |
2046 | + break; | |
2047 | + } | |
2048 | + if (lockflag) TRACER_UNLOCK(); | |
2049 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
2050 | + return 0; | |
2011 | 2051 | } |
2012 | 2052 | |
2013 | 2053 | static int tracer_cm_draw(RECT *lprc, int flag, int lockflag) |
2014 | 2054 | { |
2015 | - HDC hdc; | |
2016 | - if (!w32g_tracer_wnd.active) | |
2017 | - return 0; | |
2018 | - hdc = w32g_tracer_wnd.hmdc; | |
2019 | - if (lockflag) TRACER_LOCK(); | |
2020 | - switch (flag) { | |
2021 | - default: | |
2022 | - case 0: | |
2023 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
2024 | - tracer_bmp.hmdc, tracer_bmp.rc_cm_off.left, tracer_bmp.rc_cm_off.top, SRCCOPY); | |
2025 | - break; | |
2026 | - case 1: | |
2027 | - BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
2028 | - tracer_bmp.hmdc, tracer_bmp.rc_cm_on.left, tracer_bmp.rc_cm_on.top, SRCCOPY); | |
2029 | - break; | |
2030 | - } | |
2031 | - if (lockflag) TRACER_UNLOCK(); | |
2032 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
2033 | - return 0; | |
2055 | + HDC hdc; | |
2056 | + if (!w32g_tracer_wnd.active) | |
2057 | + return 0; | |
2058 | + hdc = w32g_tracer_wnd.hmdc; | |
2059 | + if (lockflag) TRACER_LOCK(); | |
2060 | + switch (flag) { | |
2061 | + default: | |
2062 | + case 0: | |
2063 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
2064 | + tracer_bmp.hmdc, tracer_bmp.rc_cm_off.left, tracer_bmp.rc_cm_off.top, SRCCOPY); | |
2065 | + break; | |
2066 | + case 1: | |
2067 | + BitBlt(hdc, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, | |
2068 | + tracer_bmp.hmdc, tracer_bmp.rc_cm_on.left, tracer_bmp.rc_cm_on.top, SRCCOPY); | |
2069 | + break; | |
2070 | + } | |
2071 | + if (lockflag) TRACER_UNLOCK(); | |
2072 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
2073 | + return 0; | |
2034 | 2074 | } |
2035 | - | |
2036 | 2075 | #if 0 |
2037 | 2076 | static int cheap_volume_view_draw(RECT *lprc, int vol, int max, COLORREF fore, COLORREF back, int type, int lockflag) |
2038 | 2077 | { |
2039 | - RECT rc1; | |
2040 | - HDC hdc; | |
2041 | - HBRUSH hFore, hBack; | |
2042 | - | |
2043 | - if (!w32g_tracer_wnd.active) | |
2044 | - return 0; | |
2045 | - rc1; | |
2046 | - hdc = w32g_tracer_wnd.hmdc; | |
2047 | - hFore = CreateSolidBrush(fore); | |
2048 | - hBack = CreateSolidBrush(back); | |
2049 | - RANGE(vol, 0, max); | |
2050 | - switch (type) { | |
2051 | - default: | |
2052 | - case CVV_TYPE_LEFT: | |
2053 | - rc1.left = lprc->left; | |
2054 | - rc1.right = lprc->left + (lprc->right - lprc->left) * vol / max; | |
2055 | - rc1.top = lprc->top; | |
2056 | - rc1.bottom = lprc->bottom; | |
2057 | - break; | |
2058 | - case CVV_TYPE_RIGHT: | |
2059 | - rc1.left = lprc->left + (lprc->right - lprc->left) * (max - vol) / max; | |
2060 | - rc1.right = lprc->right; | |
2061 | - rc1.top = lprc->top; | |
2062 | - rc1.bottom = lprc->bottom; | |
2063 | - break; | |
2064 | - case CVV_TYPE_TOP: | |
2065 | - rc1.left = lprc->left; | |
2066 | - rc1.right = lprc->right; | |
2067 | - rc1.top = lprc->top; | |
2068 | - rc1.bottom = lprc->top + (lprc->bottom - lprc->top) * vol / max; | |
2069 | - break; | |
2070 | - case CVV_TYPE_BOTTOM: | |
2071 | - rc1.left = lprc->left; | |
2072 | - rc1.right = lprc->right; | |
2073 | - rc1.top = lprc->top + (lprc->bottom - lprc->top) * (max - vol) / max; | |
2074 | - rc1.bottom = lprc->bottom; | |
2075 | - break; | |
2076 | - } | |
2077 | - if (lockflag) TRACER_LOCK(); | |
2078 | - FillRect(hdc, &rc1, hFore); | |
2079 | - if (lockflag) TRACER_UNLOCK(); | |
2080 | - InvalidateRect(w32g_tracer_wnd.hwnd, &rc1, FALSE); | |
2081 | - | |
2082 | - switch (type) { | |
2083 | - default: | |
2084 | - case CVV_TYPE_LEFT: | |
2085 | - rc1.left = rc1.right; | |
2086 | - rc1.right = lprc->right; | |
2087 | - break; | |
2088 | - case CVV_TYPE_RIGHT: | |
2089 | - rc1.left = lprc->left; | |
2090 | - rc1.right = rc1.left; | |
2091 | - break; | |
2092 | - case CVV_TYPE_TOP: | |
2093 | - rc1.top = rc1.bottom; | |
2094 | - rc1.bottom = lprc->bottom; | |
2095 | - break; | |
2096 | - case CVV_TYPE_BOTTOM: | |
2097 | - rc1.top = lprc->top; | |
2098 | - rc1.bottom = rc1.top; | |
2099 | - break; | |
2100 | - } | |
2101 | - if (lockflag) TRACER_LOCK(); | |
2102 | - FillRect(hdc, &rc1, hBack); | |
2103 | - if (lockflag) TRACER_UNLOCK(); | |
2104 | - InvalidateRect(w32g_tracer_wnd.hwnd, &rc1, FALSE); | |
2105 | - | |
2106 | - DeleteObject((HGDIOBJ) hFore); | |
2107 | - DeleteObject((HGDIOBJ) hBack); | |
2108 | - | |
2109 | - return 0; | |
2078 | + RECT rc1; | |
2079 | + HDC hdc; | |
2080 | + HBRUSH hFore, hBack; | |
2081 | + | |
2082 | + if (!w32g_tracer_wnd.active) | |
2083 | + return 0; | |
2084 | + rc1; | |
2085 | + hdc = w32g_tracer_wnd.hmdc; | |
2086 | + hFore = CreateSolidBrush(fore); | |
2087 | + hBack = CreateSolidBrush(back); | |
2088 | + RANGE(vol, 0, max); | |
2089 | + switch (type) { | |
2090 | + default: | |
2091 | + case CVV_TYPE_LEFT: | |
2092 | + rc1.left = lprc->left; | |
2093 | + rc1.right = lprc->left + (lprc->right - lprc->left) * vol / max; | |
2094 | + rc1.top = lprc->top; | |
2095 | + rc1.bottom = lprc->bottom; | |
2096 | + break; | |
2097 | + case CVV_TYPE_RIGHT: | |
2098 | + rc1.left = lprc->left + (lprc->right - lprc->left) * (max - vol) / max; | |
2099 | + rc1.right = lprc->right; | |
2100 | + rc1.top = lprc->top; | |
2101 | + rc1.bottom = lprc->bottom; | |
2102 | + break; | |
2103 | + case CVV_TYPE_TOP: | |
2104 | + rc1.left = lprc->left; | |
2105 | + rc1.right = lprc->right; | |
2106 | + rc1.top = lprc->top; | |
2107 | + rc1.bottom = lprc->top + (lprc->bottom - lprc->top) * vol / max; | |
2108 | + break; | |
2109 | + case CVV_TYPE_BOTTOM: | |
2110 | + rc1.left = lprc->left; | |
2111 | + rc1.right = lprc->right; | |
2112 | + rc1.top = lprc->top + (lprc->bottom - lprc->top) * (max - vol) / max; | |
2113 | + rc1.bottom = lprc->bottom; | |
2114 | + break; | |
2115 | + } | |
2116 | + if (lockflag) TRACER_LOCK(); | |
2117 | + FillRect(hdc, &rc1, hFore); | |
2118 | + if (lockflag) TRACER_UNLOCK(); | |
2119 | + InvalidateRect(w32g_tracer_wnd.hwnd, &rc1, FALSE); | |
2120 | + | |
2121 | + switch (type) { | |
2122 | + default: | |
2123 | + case CVV_TYPE_LEFT: | |
2124 | + rc1.left = rc1.right; | |
2125 | + rc1.right = lprc->right; | |
2126 | + break; | |
2127 | + case CVV_TYPE_RIGHT: | |
2128 | + rc1.left = lprc->left; | |
2129 | + rc1.right = rc1.left; | |
2130 | + break; | |
2131 | + case CVV_TYPE_TOP: | |
2132 | + rc1.top = rc1.bottom; | |
2133 | + rc1.bottom = lprc->bottom; | |
2134 | + break; | |
2135 | + case CVV_TYPE_BOTTOM: | |
2136 | + rc1.top = lprc->top; | |
2137 | + rc1.bottom = rc1.top; | |
2138 | + break; | |
2139 | + } | |
2140 | + if (lockflag) TRACER_LOCK(); | |
2141 | + FillRect(hdc, &rc1, hBack); | |
2142 | + if (lockflag) TRACER_UNLOCK(); | |
2143 | + InvalidateRect(w32g_tracer_wnd.hwnd, &rc1, FALSE); | |
2144 | + | |
2145 | + DeleteObject((HGDIOBJ) hFore); | |
2146 | + DeleteObject((HGDIOBJ) hBack); | |
2147 | + | |
2148 | + return 0; | |
2110 | 2149 | } |
2111 | 2150 | #endif |
2112 | - | |
2113 | 2151 | DWORD string_view_get_rgb(DWORD back, BYTE vpr, BYTE vpg, BYTE vrb) |
2114 | 2152 | { |
2115 | - BYTE r = (uint8)(((uint16)(back & 0xff) + vpr) & 0xff); | |
2116 | - BYTE g = (uint8)(((uint16)((back >> 8) & 0xff) + vpr) & 0xff); | |
2117 | - BYTE b = (uint8)(((uint16)((back >> 16) & 0xff) + vpr) & 0xff); | |
2153 | + BYTE r = (uint8)(((uint16)(back & 0xff) + vpr) & 0xff); | |
2154 | + BYTE g = (uint8)(((uint16)((back >> 8) & 0xff) + vpr) & 0xff); | |
2155 | + BYTE b = (uint8)(((uint16)((back >> 16) & 0xff) + vpr) & 0xff); | |
2118 | 2156 | |
2119 | - return(r |(g << 8) |(b << 16)); | |
2157 | + return(r |(g << 8) |(b << 16)); | |
2120 | 2158 | } |
2121 | 2159 | |
2122 | 2160 | static int string_view_border_draw(RECT *lprc, COLORREF back, int lockflag) |
2123 | 2161 | { |
2124 | - HDC hdc; | |
2125 | - HPEN hPen1 = NULL; | |
2126 | - HPEN hPen2 = NULL; | |
2127 | - HPEN hPen3 = NULL; | |
2128 | - HPEN hPen4 = NULL; | |
2129 | - HPEN hOldPen = NULL; | |
2130 | - | |
2131 | - if (!w32g_tracer_wnd.active) | |
2132 | - return 0; | |
2133 | - hdc = w32g_tracer_wnd.hmdc; | |
2162 | + HDC hdc; | |
2163 | + HPEN hPen1 = NULL; | |
2164 | + HPEN hPen2 = NULL; | |
2165 | + HPEN hPen3 = NULL; | |
2166 | + HPEN hPen4 = NULL; | |
2167 | + HPEN hOldPen = NULL; | |
2168 | + | |
2169 | + if (!w32g_tracer_wnd.active) | |
2170 | + return 0; | |
2171 | + hdc = w32g_tracer_wnd.hmdc; | |
2134 | 2172 | #ifdef _DEBUG |
2135 | - hPen1 = CreatePen(PS_SOLID, 1, string_view_get_rgb(back, 32, 32, 32)); | |
2136 | - hPen2 = CreatePen(PS_SOLID, 1, string_view_get_rgb(back, -16, -16, -16)); | |
2137 | - hPen3 = CreatePen(PS_SOLID, 1, string_view_get_rgb(back, 16, 16, 16)); | |
2138 | - hPen4 = CreatePen(PS_SOLID, 1, string_view_get_rgb(back, -32, -32, -32)); | |
2173 | + hPen1 = CreatePen(PS_SOLID, 1, string_view_get_rgb(back, 32, 32, 32)); | |
2174 | + hPen2 = CreatePen(PS_SOLID, 1, string_view_get_rgb(back, -16, -16, -16)); | |
2175 | + hPen3 = CreatePen(PS_SOLID, 1, string_view_get_rgb(back, 16, 16, 16)); | |
2176 | + hPen4 = CreatePen(PS_SOLID, 1, string_view_get_rgb(back, -32, -32, -32)); | |
2139 | 2177 | #else |
2140 | - hPen1 = CreatePen(PS_SOLID, 1, RGB(GetRValue(back) + 32, GetGValue(back) + 32, GetBValue(back) + 32)); | |
2141 | - hPen2 = CreatePen(PS_SOLID, 1, RGB(GetRValue(back) - 16, GetGValue(back) - 16, GetBValue(back) - 16)); | |
2142 | - hPen3 = CreatePen(PS_SOLID, 1, RGB(GetRValue(back) + 16, GetGValue(back) + 16, GetBValue(back) + 16)); | |
2143 | - hPen4 = CreatePen(PS_SOLID, 1, RGB(GetRValue(back) - 32, GetGValue(back) - 32, GetBValue(back) - 32)); | |
2178 | + hPen1 = CreatePen(PS_SOLID, 1, RGB(GetRValue(back) + 32, GetGValue(back) + 32, GetBValue(back) + 32)); | |
2179 | + hPen2 = CreatePen(PS_SOLID, 1, RGB(GetRValue(back) - 16, GetGValue(back) - 16, GetBValue(back) - 16)); | |
2180 | + hPen3 = CreatePen(PS_SOLID, 1, RGB(GetRValue(back) + 16, GetGValue(back) + 16, GetBValue(back) + 16)); | |
2181 | + hPen4 = CreatePen(PS_SOLID, 1, RGB(GetRValue(back) - 32, GetGValue(back) - 32, GetBValue(back) - 32)); | |
2144 | 2182 | #endif |
2145 | - if (lockflag) TRACER_LOCK(); | |
2146 | - hOldPen = (HPEN) SelectObject(hdc, GetStockObject(NULL_PEN)); | |
2183 | + if (lockflag) TRACER_LOCK(); | |
2184 | + hOldPen = (HPEN)SelectObject(hdc, GetStockObject(NULL_PEN)); | |
2147 | 2185 | |
2148 | - // 上線 | |
2149 | - SelectObject(hdc, hPen1); | |
2150 | - MoveToEx(hdc, lprc->left, lprc->top, NULL); | |
2151 | - LineTo(hdc, lprc->right, lprc->top); | |
2186 | + // 上線 | |
2187 | + SelectObject(hdc, hPen1); | |
2188 | + MoveToEx(hdc, lprc->left, lprc->top, NULL); | |
2189 | + LineTo(hdc, lprc->right, lprc->top); | |
2152 | 2190 | |
2153 | - // 左線 | |
2154 | - SelectObject(hdc, hPen3); | |
2155 | - MoveToEx(hdc, lprc->left, lprc->top, NULL); | |
2156 | - LineTo(hdc, lprc->left, lprc->bottom); | |
2191 | + // 左線 | |
2192 | + SelectObject(hdc, hPen3); | |
2193 | + MoveToEx(hdc, lprc->left, lprc->top, NULL); | |
2194 | + LineTo(hdc, lprc->left, lprc->bottom); | |
2157 | 2195 | |
2158 | - // 下線 | |
2159 | - SelectObject(hdc, hPen2); | |
2160 | - MoveToEx(hdc, lprc->left, lprc->bottom - 1, NULL); | |
2161 | - LineTo(hdc, lprc->right, lprc->bottom - 1); | |
2196 | + // 下線 | |
2197 | + SelectObject(hdc, hPen2); | |
2198 | + MoveToEx(hdc, lprc->left, lprc->bottom - 1, NULL); | |
2199 | + LineTo(hdc, lprc->right, lprc->bottom - 1); | |
2162 | 2200 | |
2163 | - // 右線 | |
2164 | - SelectObject(hdc, hPen4); | |
2165 | - MoveToEx(hdc, lprc->right - 1, lprc->top, NULL); | |
2166 | - LineTo(hdc, lprc->right - 1, lprc->bottom); | |
2201 | + // 右線 | |
2202 | + SelectObject(hdc, hPen4); | |
2203 | + MoveToEx(hdc, lprc->right - 1, lprc->top, NULL); | |
2204 | + LineTo(hdc, lprc->right - 1, lprc->bottom); | |
2167 | 2205 | |
2168 | - SelectObject(hdc, hOldPen); | |
2206 | + SelectObject(hdc, hOldPen); | |
2169 | 2207 | |
2170 | - if (lockflag) TRACER_UNLOCK(); | |
2208 | + if (lockflag) TRACER_UNLOCK(); | |
2171 | 2209 | |
2172 | - DeleteObject(hPen1); | |
2173 | - DeleteObject(hPen2); | |
2174 | - DeleteObject(hPen3); | |
2175 | - DeleteObject(hPen4); | |
2210 | + DeleteObject(hPen1); | |
2211 | + DeleteObject(hPen2); | |
2212 | + DeleteObject(hPen3); | |
2213 | + DeleteObject(hPen4); | |
2176 | 2214 | |
2177 | - return 0; | |
2215 | + return 0; | |
2178 | 2216 | } |
2179 | 2217 | |
2180 | 2218 | static int cheap_string_view_draw_font(RECT *lprc, char *str, COLORREF fore, COLORREF back, int mode, HFONT hFont, int lockflag) |
2181 | 2219 | { |
2182 | - HDC hdc; | |
2183 | - COLORREF old_fore, old_back; | |
2184 | - HGDIOBJ hgdiobj; | |
2185 | - UINT old_mode; | |
2186 | - int left, top, bottom; | |
2187 | - if (!w32g_tracer_wnd.active) | |
2188 | - return 0; | |
2189 | - hdc = w32g_tracer_wnd.hmdc; | |
2190 | - if (lockflag) TRACER_LOCK(); | |
2191 | - if (mode == CSV_CENTER) { | |
2192 | - old_mode = SetTextAlign(hdc, TA_CENTER | TA_BOTTOM); | |
2193 | - left = (lprc->left + lprc->right) / 2; | |
2194 | - top = lprc->top; | |
2195 | - bottom = lprc->bottom; | |
2196 | - } else if (mode == CSV_LEFT) { | |
2197 | - old_mode = SetTextAlign(hdc, TA_LEFT | TA_BOTTOM); | |
2198 | - left = lprc->left; | |
2199 | - top = lprc->top; | |
2200 | - bottom = lprc->bottom; | |
2201 | - } else if (mode == CSV_RIGHT) { | |
2202 | - old_mode = SetTextAlign(hdc, TA_RIGHT | TA_BOTTOM); | |
2203 | - left = lprc->right; | |
2204 | - top = lprc->top; | |
2205 | - bottom = lprc->bottom; | |
2206 | - } | |
2207 | - old_fore = SetTextColor(hdc, fore); | |
2208 | - old_back = SetBkColor(hdc, back); | |
2209 | - hgdiobj = SelectObject(hdc, hFont); | |
2210 | -// ExtTextOutA(hdc, left, top, ETO_CLIPPED | ETO_OPAQUE, lprc, str, strlen(str), NULL); | |
2211 | - ExtTextOutA(hdc, left, bottom - 2, ETO_CLIPPED | ETO_OPAQUE, lprc, str, strlen(str), NULL); | |
2212 | - SetTextColor(hdc, old_fore); | |
2213 | - SetBkColor(hdc, old_back); | |
2214 | - SelectObject(hdc, hgdiobj); | |
2215 | - SetTextAlign(hdc, old_mode); | |
2216 | - | |
2217 | - string_view_border_draw(lprc, back, FALSE); | |
2218 | - if (lockflag) TRACER_UNLOCK(); | |
2219 | - | |
2220 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
2221 | - | |
2222 | - return 0; | |
2220 | + HDC hdc; | |
2221 | + COLORREF old_fore, old_back; | |
2222 | + HGDIOBJ hgdiobj; | |
2223 | + UINT old_mode; | |
2224 | + int left, top, bottom; | |
2225 | + if (!w32g_tracer_wnd.active) | |
2226 | + return 0; | |
2227 | + hdc = w32g_tracer_wnd.hmdc; | |
2228 | + if (lockflag) TRACER_LOCK(); | |
2229 | + if (mode == CSV_CENTER) { | |
2230 | + old_mode = SetTextAlign(hdc, TA_CENTER | TA_BOTTOM); | |
2231 | + left = (lprc->left + lprc->right) / 2; | |
2232 | + top = lprc->top; | |
2233 | + bottom = lprc->bottom; | |
2234 | + } else if (mode == CSV_LEFT) { | |
2235 | + old_mode = SetTextAlign(hdc, TA_LEFT | TA_BOTTOM); | |
2236 | + left = lprc->left; | |
2237 | + top = lprc->top; | |
2238 | + bottom = lprc->bottom; | |
2239 | + } else if (mode == CSV_RIGHT) { | |
2240 | + old_mode = SetTextAlign(hdc, TA_RIGHT | TA_BOTTOM); | |
2241 | + left = lprc->right; | |
2242 | + top = lprc->top; | |
2243 | + bottom = lprc->bottom; | |
2244 | + } | |
2245 | + old_fore = SetTextColor(hdc, fore); | |
2246 | + old_back = SetBkColor(hdc, back); | |
2247 | + hgdiobj = SelectObject(hdc, hFont); | |
2248 | +// ExtTextOutA(hdc, left, top, ETO_CLIPPED | ETO_OPAQUE, lprc, str, strlen(str), NULL); | |
2249 | + ExtTextOutA(hdc, left, bottom - 2, ETO_CLIPPED | ETO_OPAQUE, lprc, str, strlen(str), NULL); | |
2250 | + SetTextColor(hdc, old_fore); | |
2251 | + SetBkColor(hdc, old_back); | |
2252 | + SelectObject(hdc, hgdiobj); | |
2253 | + SetTextAlign(hdc, old_mode); | |
2254 | + | |
2255 | + string_view_border_draw(lprc, back, FALSE); | |
2256 | + if (lockflag) TRACER_UNLOCK(); | |
2257 | + | |
2258 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
2259 | + | |
2260 | + return 0; | |
2223 | 2261 | } |
2224 | 2262 | |
2225 | 2263 | static int cheap_string_view_draw(RECT *lprc, char *str, COLORREF fore, COLORREF back, int mode, int lockflag) |
2226 | 2264 | { |
2227 | - return cheap_string_view_draw_font(lprc, str, fore, back, mode, w32g_tracer_wnd.hFontCommon, lockflag); | |
2265 | + return cheap_string_view_draw_font(lprc, str, fore, back, mode, w32g_tracer_wnd.hFontCommon, lockflag); | |
2228 | 2266 | } |
2229 | 2267 | |
2230 | 2268 | static int cheap_half_string_view_draw(RECT *lprc, char *str, COLORREF fore, COLORREF back, int mode, int lockflag) |
2231 | 2269 | { |
2232 | - HDC hdc; | |
2233 | - COLORREF old_fore, old_back; | |
2234 | - HGDIOBJ hgdiobj; | |
2235 | - UINT old_mode; | |
2236 | - HFONT hFont = w32g_tracer_wnd.hFontHalf; | |
2237 | - int left, top; | |
2238 | - if (!w32g_tracer_wnd.active) | |
2239 | - return 0; | |
2240 | - hdc = w32g_tracer_wnd.hmdc; | |
2241 | - if (lockflag) TRACER_LOCK(); | |
2242 | - if (mode == CSV_CENTER) { | |
2243 | - old_mode = SetTextAlign(hdc, TA_CENTER); | |
2244 | - left = (lprc->left + lprc->right) / 2; | |
2245 | - top = lprc->top; | |
2246 | - } else if (mode == CSV_LEFT) { | |
2247 | - old_mode = SetTextAlign(hdc, TA_LEFT); | |
2248 | - left = lprc->left; | |
2249 | - top = lprc->top; | |
2250 | - } else if (mode == CSV_RIGHT) { | |
2251 | - old_mode = SetTextAlign(hdc, TA_RIGHT); | |
2252 | - left = lprc->right; | |
2253 | - top = lprc->top; | |
2254 | - } | |
2255 | - old_fore = SetTextColor(hdc, fore); | |
2256 | - old_back = SetBkColor(hdc, back); | |
2257 | - hgdiobj = SelectObject(hdc, hFont); | |
2258 | - ExtTextOutA(hdc, left, top - 3, ETO_CLIPPED | ETO_OPAQUE, lprc, str, strlen(str), NULL); | |
2259 | - SetTextColor(hdc, old_fore); | |
2260 | - SetBkColor(hdc, old_back); | |
2261 | - SelectObject(hdc, hgdiobj); | |
2262 | - SetTextAlign(hdc, old_mode); | |
2263 | - | |
2264 | - string_view_border_draw(lprc, back, FALSE); | |
2265 | - if (lockflag) TRACER_UNLOCK(); | |
2266 | - | |
2267 | - InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
2268 | - | |
2269 | - return 0; | |
2270 | + HDC hdc; | |
2271 | + COLORREF old_fore, old_back; | |
2272 | + HGDIOBJ hgdiobj; | |
2273 | + UINT old_mode; | |
2274 | + HFONT hFont = w32g_tracer_wnd.hFontHalf; | |
2275 | + int left, top; | |
2276 | + if (!w32g_tracer_wnd.active) | |
2277 | + return 0; | |
2278 | + hdc = w32g_tracer_wnd.hmdc; | |
2279 | + if (lockflag) TRACER_LOCK(); | |
2280 | + if (mode == CSV_CENTER) { | |
2281 | + old_mode = SetTextAlign(hdc, TA_CENTER); | |
2282 | + left = (lprc->left + lprc->right) / 2; | |
2283 | + top = lprc->top; | |
2284 | + } else if (mode == CSV_LEFT) { | |
2285 | + old_mode = SetTextAlign(hdc, TA_LEFT); | |
2286 | + left = lprc->left; | |
2287 | + top = lprc->top; | |
2288 | + } else if (mode == CSV_RIGHT) { | |
2289 | + old_mode = SetTextAlign(hdc, TA_RIGHT); | |
2290 | + left = lprc->right; | |
2291 | + top = lprc->top; | |
2292 | + } | |
2293 | + old_fore = SetTextColor(hdc, fore); | |
2294 | + old_back = SetBkColor(hdc, back); | |
2295 | + hgdiobj = SelectObject(hdc, hFont); | |
2296 | + ExtTextOutA(hdc, left, top - 3, ETO_CLIPPED | ETO_OPAQUE, lprc, str, strlen(str), NULL); | |
2297 | + SetTextColor(hdc, old_fore); | |
2298 | + SetBkColor(hdc, old_back); | |
2299 | + SelectObject(hdc, hgdiobj); | |
2300 | + SetTextAlign(hdc, old_mode); | |
2301 | + | |
2302 | + string_view_border_draw(lprc, back, FALSE); | |
2303 | + if (lockflag) TRACER_UNLOCK(); | |
2304 | + | |
2305 | + InvalidateRect(w32g_tracer_wnd.hwnd, lprc, FALSE); | |
2306 | + | |
2307 | + return 0; | |
2270 | 2308 | } |
2271 | 2309 | |
2272 | 2310 | |
2273 | 2311 | |
2274 | 2312 | void TracerWndPaintAll(int lockflag) |
2275 | 2313 | { |
2276 | - int i, j; | |
2277 | - char buff[1024]; | |
2278 | - RECT rc; | |
2279 | - if (!w32g_tracer_wnd.active) | |
2280 | - return; | |
2281 | - if (lockflag) TRACER_LOCK(); | |
2282 | - // タイトル | |
2283 | - strcpy(buff, "ch"); | |
2284 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_channel_top); | |
2285 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2286 | - strcpy(buff, " instrument "); | |
2287 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_instrument); | |
2288 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2289 | - strcpy(buff, " map "); | |
2290 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_inst_map); | |
2291 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2292 | - strcpy(buff, "bank"); | |
2293 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_bank); | |
2294 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2295 | - strcpy(buff, "prog"); | |
2296 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_program); | |
2297 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2298 | - strcpy(buff, "vel"); | |
2299 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_velocity); | |
2300 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2301 | - strcpy(buff, "vo"); | |
2302 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_volume); | |
2303 | - cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2304 | - strcpy(buff, "ex"); | |
2305 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_expression); | |
2306 | - cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2307 | - strcpy(buff, "pa"); | |
2308 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_panning); | |
2309 | - cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2310 | - strcpy(buff, "su"); | |
2311 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_sustain); | |
2312 | - cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2313 | - strcpy(buff, "pb"); | |
2314 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_pitch_bend); | |
2315 | - cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2316 | - strcpy(buff, "mw"); | |
2317 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_mod_wheel); | |
2318 | - cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2319 | - strcpy(buff, "ch"); | |
2320 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_chorus_effect); | |
2321 | - cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2322 | - strcpy(buff, "re"); | |
2323 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_reverb_effect); | |
2324 | - cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2325 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_temper_keysig); | |
2326 | - tracer_temper_keysig_draw(&rc, CTL_STATUS_UPDATE, CTL_STATUS_UPDATE, FALSE); | |
2327 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_gm); | |
2328 | - tracer_gm_draw(&rc, w32g_tracer_wnd.play_system_mode == GM_SYSTEM_MODE ? 1 : 0, FALSE); | |
2329 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_gs); | |
2330 | - tracer_gs_draw(&rc, w32g_tracer_wnd.play_system_mode == GS_SYSTEM_MODE ? 1 : 0, FALSE); | |
2331 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_xg); | |
2332 | - tracer_xg_draw(&rc, w32g_tracer_wnd.play_system_mode == XG_SYSTEM_MODE ? 1 : 0, FALSE); | |
2314 | + int i, j; | |
2315 | + char buff[1024]; | |
2316 | + RECT rc; | |
2317 | + if (!w32g_tracer_wnd.active) | |
2318 | + return; | |
2319 | + if (lockflag) TRACER_LOCK(); | |
2320 | + // タイトル | |
2321 | + strcpy(buff, "ch"); | |
2322 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_channel_top); | |
2323 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2324 | + strcpy(buff, " instrument "); | |
2325 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_instrument); | |
2326 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2327 | + strcpy(buff, " map "); | |
2328 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_inst_map); | |
2329 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2330 | + strcpy(buff, "bank"); | |
2331 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_bank); | |
2332 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2333 | + strcpy(buff, "prog"); | |
2334 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_program); | |
2335 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2336 | + strcpy(buff, "vel"); | |
2337 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_velocity); | |
2338 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2339 | + strcpy(buff, "vo"); | |
2340 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_volume); | |
2341 | + cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2342 | + strcpy(buff, "ex"); | |
2343 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_expression); | |
2344 | + cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2345 | + strcpy(buff, "pa"); | |
2346 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_panning); | |
2347 | + cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2348 | + strcpy(buff, "su"); | |
2349 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_sustain); | |
2350 | + cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2351 | + strcpy(buff, "pb"); | |
2352 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_pitch_bend); | |
2353 | + cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2354 | + strcpy(buff, "mw"); | |
2355 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_mod_wheel); | |
2356 | + cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2357 | + strcpy(buff, "ch"); | |
2358 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_chorus_effect); | |
2359 | + cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2360 | + strcpy(buff, "re"); | |
2361 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_reverb_effect); | |
2362 | + cheap_half_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, FALSE); | |
2363 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_temper_keysig); | |
2364 | + tracer_temper_keysig_draw(&rc, CTL_STATUS_UPDATE, CTL_STATUS_UPDATE, FALSE); | |
2365 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_gm); | |
2366 | + tracer_gm_draw(&rc, w32g_tracer_wnd.play_system_mode == GM_SYSTEM_MODE ? 1 : 0, FALSE); | |
2367 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_gs); | |
2368 | + tracer_gs_draw(&rc, w32g_tracer_wnd.play_system_mode == GS_SYSTEM_MODE ? 1 : 0, FALSE); | |
2369 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_xg); | |
2370 | + tracer_xg_draw(&rc, w32g_tracer_wnd.play_system_mode == XG_SYSTEM_MODE ? 1 : 0, FALSE); | |
2333 | 2371 | ///r |
2334 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_gm2); | |
2335 | - tracer_gm2_draw(&rc, w32g_tracer_wnd.play_system_mode == GM2_SYSTEM_MODE ? 1 : 0, FALSE); | |
2336 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_sd); | |
2337 | - tracer_sd_draw(&rc, w32g_tracer_wnd.play_system_mode == SD_SYSTEM_MODE ? 1 : 0, FALSE); | |
2338 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_kg); | |
2339 | - tracer_kg_draw(&rc, w32g_tracer_wnd.play_system_mode == KG_SYSTEM_MODE ? 1 : 0, FALSE); | |
2340 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_cm); | |
2341 | - tracer_cm_draw(&rc, w32g_tracer_wnd.play_system_mode == CM_SYSTEM_MODE ? 1 : 0, FALSE); | |
2342 | - | |
2343 | - strcpy(buff, w32g_tracer_wnd.titlename); | |
2344 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_head_rest); | |
2345 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_LEFT, FALSE); | |
2346 | - | |
2347 | - // 各チャンネル | |
2348 | - //for (i = 0; i < TRACER_CHANNELS; i++) { | |
2349 | - for (i = TracerWndViewCh - min(TracerWndViewCh, 2); i < min(TracerWndViewCh + TracerWndInfo.mode + 1, TRACER_CHANNELS); i++) { | |
2372 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_gm2); | |
2373 | + tracer_gm2_draw(&rc, w32g_tracer_wnd.play_system_mode == GM2_SYSTEM_MODE ? 1 : 0, FALSE); | |
2374 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_sd); | |
2375 | + tracer_sd_draw(&rc, w32g_tracer_wnd.play_system_mode == SD_SYSTEM_MODE ? 1 : 0, FALSE); | |
2376 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_kg); | |
2377 | + tracer_kg_draw(&rc, w32g_tracer_wnd.play_system_mode == KG_SYSTEM_MODE ? 1 : 0, FALSE); | |
2378 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_cm); | |
2379 | + tracer_cm_draw(&rc, w32g_tracer_wnd.play_system_mode == CM_SYSTEM_MODE ? 1 : 0, FALSE); | |
2380 | + | |
2381 | + strcpy(buff, w32g_tracer_wnd.titlename); | |
2382 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_head_rest); | |
2383 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_LEFT, FALSE); | |
2384 | + | |
2385 | + // 各チャンネル | |
2386 | + //for (i = 0; i < TRACER_CHANNELS; i++) { | |
2387 | + for (i = TracerWndViewCh - min(TracerWndViewCh, 2); i < min(TracerWndViewCh + TracerWndInfo.mode + 1, TRACER_CHANNELS); i++) { | |
2350 | 2388 | #if 0 |
2351 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_channel_top) == 0) { | |
2352 | - sprintf(buff, "%02d", i + 1); | |
2353 | - if (IS_SET_CHANNELMASK(w32g_tracer_wnd.quietchannels, i)) | |
2354 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_VERY_DARK, CSV_CENTER, FALSE); | |
2355 | - else { | |
2356 | - if (IS_SET_CHANNELMASK(w32g_tracer_wnd.channel_mute, i)) | |
2357 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_DARK, CSV_CENTER, FALSE); | |
2358 | - else { | |
2359 | - inst = (w32g_tracer_wnd.insertion_effect[i] > 0) ? 1 : 0; | |
2360 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, | |
2361 | - (inst) ? C_TEXT_BACK_INSERTION : C_TEXT_BACK, | |
2362 | - CSV_CENTER, FALSE); | |
2363 | - } | |
2364 | - } | |
2365 | - } | |
2389 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_channel_top) == 0) { | |
2390 | + sprintf(buff, "%02d", i + 1); | |
2391 | + if (IS_SET_CHANNELMASK(w32g_tracer_wnd.quietchannels, i)) | |
2392 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_VERY_DARK, CSV_CENTER, FALSE); | |
2393 | + else { | |
2394 | + if (IS_SET_CHANNELMASK(w32g_tracer_wnd.channel_mute, i)) | |
2395 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_DARK, CSV_CENTER, FALSE); | |
2396 | + else { | |
2397 | + inst = (w32g_tracer_wnd.insertion_effect[i] > 0) ? 1 : 0; | |
2398 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, | |
2399 | + (inst) ? C_TEXT_BACK_INSERTION : C_TEXT_BACK, | |
2400 | + CSV_CENTER, FALSE); | |
2401 | + } | |
2402 | + } | |
2403 | + } | |
2366 | 2404 | #endif |
2367 | - tracer_ch_number_draw(i, CTL_STATUS_UPDATE, 0); | |
2405 | + tracer_ch_number_draw(i, CTL_STATUS_UPDATE, 0); | |
2368 | 2406 | |
2369 | - tracer_ch_program_draw(i, w32g_tracer_wnd.bank[i], w32g_tracer_wnd.program[i], w32g_tracer_wnd.instrument[i], w32g_tracer_wnd.mapID[i], FALSE); | |
2407 | + tracer_ch_program_draw(i, w32g_tracer_wnd.bank[i], w32g_tracer_wnd.program[i], w32g_tracer_wnd.instrument[i], w32g_tracer_wnd.mapID[i], FALSE); | |
2370 | 2408 | |
2371 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_velocity) == 0) | |
2372 | - tracer_velocity_draw(&rc, w32g_tracer_wnd.velocity[i], VEL_MAX, FALSE); | |
2409 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_velocity) == 0) | |
2410 | + tracer_velocity_draw(&rc, w32g_tracer_wnd.velocity[i], VEL_MAX, FALSE); | |
2373 | 2411 | |
2374 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_volume) == 0) | |
2375 | - tracer_volume_draw(&rc, w32g_tracer_wnd.volume[i], 128, FALSE); | |
2412 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_volume) == 0) | |
2413 | + tracer_volume_draw(&rc, w32g_tracer_wnd.volume[i], 128, FALSE); | |
2376 | 2414 | |
2377 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_expression) == 0) | |
2378 | - tracer_expression_draw(&rc, w32g_tracer_wnd.expression[i], 128, FALSE); | |
2415 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_expression) == 0) | |
2416 | + tracer_expression_draw(&rc, w32g_tracer_wnd.expression[i], 128, FALSE); | |
2379 | 2417 | |
2380 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_panning) == 0) | |
2381 | - tracer_pan_draw(&rc, w32g_tracer_wnd.panning[i], 128, FALSE); | |
2418 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_panning) == 0) | |
2419 | + tracer_pan_draw(&rc, w32g_tracer_wnd.panning[i], 128, FALSE); | |
2382 | 2420 | |
2383 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_sustain) == 0) | |
2384 | - tracer_sustain_draw(&rc, w32g_tracer_wnd.sustain[i], FALSE); | |
2421 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_sustain) == 0) | |
2422 | + tracer_sustain_draw(&rc, w32g_tracer_wnd.sustain[i], FALSE); | |
2385 | 2423 | |
2386 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_pitch_bend) == 0) | |
2387 | - tracer_pitch_bend_draw(&rc, w32g_tracer_wnd.pitch_bend[i], 0x4000, FALSE); | |
2424 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_pitch_bend) == 0) | |
2425 | + tracer_pitch_bend_draw(&rc, w32g_tracer_wnd.pitch_bend[i], 0x4000, FALSE); | |
2388 | 2426 | |
2389 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_mod_wheel) == 0) | |
2390 | - tracer_mod_wheel_draw(&rc, w32g_tracer_wnd.mod_wheel[i], 32, FALSE); | |
2427 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_mod_wheel) == 0) | |
2428 | + tracer_mod_wheel_draw(&rc, w32g_tracer_wnd.mod_wheel[i], 32, FALSE); | |
2391 | 2429 | |
2392 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_chorus_effect) == 0) | |
2393 | - tracer_chorus_effect_draw(&rc, w32g_tracer_wnd.chorus_effect[i], 128, FALSE); | |
2430 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_chorus_effect) == 0) | |
2431 | + tracer_chorus_effect_draw(&rc, w32g_tracer_wnd.chorus_effect[i], 128, FALSE); | |
2394 | 2432 | |
2395 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_reverb_effect) == 0) | |
2396 | - tracer_reverb_effect_draw(&rc, w32g_tracer_wnd.reverb_effect[i], 128, FALSE); | |
2433 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_reverb_effect) == 0) | |
2434 | + tracer_reverb_effect_draw(&rc, w32g_tracer_wnd.reverb_effect[i], 128, FALSE); | |
2397 | 2435 | |
2398 | - if (!get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_temper_type)) | |
2399 | - tracer_temper_type_draw(&rc, i, CTL_STATUS_UPDATE, FALSE); | |
2436 | + if (!get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_temper_type)) | |
2437 | + tracer_temper_type_draw(&rc, i, CTL_STATUS_UPDATE, FALSE); | |
2400 | 2438 | |
2401 | - for (j = 0; j < 128; j++) { | |
2402 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_notes) == 0) | |
2403 | - notes_view_draw(&rc, j, w32g_tracer_wnd.note_voice[i][j], w32g_tracer_wnd.note_vel[i][j], TRUE, FALSE); | |
2404 | - } | |
2405 | - } | |
2439 | + for (j = 0; j < 128; j++) { | |
2440 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_notes) == 0) | |
2441 | + notes_view_draw(&rc, j, w32g_tracer_wnd.note_voice[i][j], w32g_tracer_wnd.note_vel[i][j], TRUE, FALSE); | |
2442 | + } | |
2406 | 2443 | |
2407 | - // ... | |
2408 | - if (lockflag) TRACER_UNLOCK(); | |
2409 | - InvalidateRect(w32g_tracer_wnd.hwnd, NULL, FALSE); | |
2444 | + } | |
2445 | + | |
2446 | + // ... | |
2447 | + if (lockflag) TRACER_UNLOCK(); | |
2448 | + InvalidateRect(w32g_tracer_wnd.hwnd, NULL, FALSE); | |
2410 | 2449 | } |
2411 | 2450 | |
2412 | 2451 | // GUI スレッドからのみ呼べる |
2413 | 2452 | void TracerWndPaintDo(int flag) |
2414 | 2453 | { |
2415 | - RECT rc; | |
2416 | - if (!w32g_tracer_wnd.active) | |
2417 | - return; | |
2418 | - if (flag) InvalidateRect(w32g_tracer_wnd.hwnd, NULL, FALSE); | |
2419 | - if (GetUpdateRect(w32g_tracer_wnd.hwnd, &rc, FALSE)) { | |
2420 | - PAINTSTRUCT ps; | |
2421 | - if (GDI_LOCK_EX(0) == 0) { | |
2422 | - TRACER_LOCK(); | |
2423 | - w32g_tracer_wnd.hdc = BeginPaint(w32g_tracer_wnd.hwnd, &ps); | |
2424 | - BitBlt(w32g_tracer_wnd.hdc, rc.left, rc.top, rc.right, rc.bottom, w32g_tracer_wnd.hmdc, rc.left, rc.top, SRCCOPY); | |
2425 | - EndPaint(w32g_tracer_wnd.hwnd, &ps); | |
2426 | - GDI_UNLOCK(); | |
2427 | - TRACER_UNLOCK(); | |
2428 | - } else { | |
2429 | - InvalidateRect(w32g_tracer_wnd.hwnd, &rc, FALSE); | |
2430 | - } | |
2431 | - } | |
2454 | + RECT rc; | |
2455 | + if (!w32g_tracer_wnd.active) | |
2456 | + return; | |
2457 | + if (flag) InvalidateRect(w32g_tracer_wnd.hwnd, NULL, FALSE); | |
2458 | + if (GetUpdateRect(w32g_tracer_wnd.hwnd, &rc, FALSE)) { | |
2459 | + PAINTSTRUCT ps; | |
2460 | + if (GDI_LOCK_EX(0) == 0) { | |
2461 | + TRACER_LOCK(); | |
2462 | + w32g_tracer_wnd.hdc = BeginPaint(w32g_tracer_wnd.hwnd, &ps); | |
2463 | + BitBlt(w32g_tracer_wnd.hdc, rc.left, rc.top, rc.right, rc.bottom, w32g_tracer_wnd.hmdc, rc.left, rc.top, SRCCOPY); | |
2464 | + EndPaint(w32g_tracer_wnd.hwnd, &ps); | |
2465 | + GDI_UNLOCK(); | |
2466 | + TRACER_UNLOCK(); | |
2467 | + } else { | |
2468 | + InvalidateRect(w32g_tracer_wnd.hwnd, &rc, FALSE); | |
2469 | + } | |
2470 | + } | |
2432 | 2471 | } |
2433 | 2472 | |
2434 | 2473 | LRESULT CALLBACK |
2435 | 2474 | TracerCanvasWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) |
2436 | 2475 | { |
2437 | - static int work = 0; | |
2438 | - switch (uMess) { | |
2439 | - case WM_CREATE: | |
2440 | - break; | |
2441 | - case WM_ERASEBKGND: | |
2442 | - break; | |
2443 | - case WM_PAINT: | |
2444 | - TracerWndPaintDo(FALSE); | |
2445 | - return 0; | |
2446 | - case WM_DROPFILES: | |
2447 | - SendMessage(hMainWnd, WM_DROPFILES, wParam, lParam); | |
2448 | - return 0; | |
2449 | - case WM_RBUTTONDBLCLK: | |
2450 | - case WM_LBUTTONDBLCLK: { | |
2451 | - int i, mode; | |
2452 | - int xPos = LOWORD(lParam); | |
2453 | - int yPos = HIWORD(lParam); | |
2454 | - RECT rc; | |
2455 | - int flag = FALSE; | |
2456 | - get_head_rc(&rc, &w32g_tracer_wnd.rc_channel_top); | |
2457 | - if (rc.left <= xPos && xPos <= rc.right && rc.top <= yPos && yPos <= rc.bottom) { | |
2458 | - char buff[64]; | |
2459 | - for (i = 0; i < TRACER_CHANNELS; i++) { | |
2460 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_channel_top) == 0) { | |
2461 | - sprintf(buff, "%02d", i + 1); | |
2462 | - if (uMess == WM_RBUTTONDBLCLK) | |
2463 | - UNSET_CHANNELMASK(channel_mute, i); | |
2464 | - else | |
2465 | - TOGGLE_CHANNELMASK(channel_mute, i); | |
2476 | + static int work = 0; | |
2477 | + switch (uMess) | |
2478 | + { | |
2479 | + case WM_CREATE: | |
2480 | + { | |
2481 | + TTTOOLINFO ti = {0}; | |
2482 | + int i = 0; | |
2483 | + | |
2484 | + w32g_tracer_wnd.hTool = CreateWindowEx( | |
2485 | + 0, | |
2486 | + TOOLTIPS_CLASS, | |
2487 | + NULL, | |
2488 | + TTS_ALWAYSTIP | TTS_NOPREFIX, | |
2489 | + CW_USEDEFAULT, | |
2490 | + CW_USEDEFAULT, | |
2491 | + CW_USEDEFAULT, | |
2492 | + CW_USEDEFAULT, | |
2493 | + hwnd, | |
2494 | + NULL, | |
2495 | + ((LPCREATESTRUCT)lParam)->hInstance, | |
2496 | + NULL | |
2497 | + ); | |
2498 | + | |
2499 | + ti.cbSize = sizeof(ti); | |
2500 | + ti.uFlags = TTF_SUBCLASS; | |
2501 | + ti.hwnd = hwnd; | |
2502 | + ti.lpszText = LPSTR_TEXTCALLBACK; | |
2503 | + | |
2504 | + // title | |
2505 | + ti.uId = TRACER_CHANNELS; | |
2506 | + if (get_head_rc(&ti.rect, &w32g_tracer_wnd.rc_head_rest) != 0) | |
2507 | + memset(&ti.rect, 0, sizeof(ti.rect)); | |
2508 | + SendMessage(w32g_tracer_wnd.hTool, TTM_ADDTOOL, 0, (LPARAM)&ti); | |
2509 | + | |
2510 | + // instruments | |
2511 | + for (i = 0; i < TRACER_CHANNELS; i++) { | |
2512 | + ti.uId = i; | |
2513 | + if (get_ch_rc(i, &ti.rect, &w32g_tracer_wnd.rc_instrument) != 0) | |
2514 | + memset(&ti.rect, 0, sizeof(ti.rect)); | |
2515 | + SendMessage(w32g_tracer_wnd.hTool, TTM_ADDTOOL, 0, (LPARAM)&ti); | |
2516 | + } | |
2517 | + } | |
2518 | + break; | |
2519 | + case WM_ERASEBKGND: | |
2520 | + break; | |
2521 | + case WM_PAINT: | |
2522 | + TracerWndPaintDo(FALSE); | |
2523 | + return 0; | |
2524 | + case WM_DROPFILES: | |
2525 | + SendMessage(hMainWnd, WM_DROPFILES, wParam, lParam); | |
2526 | + return 0; | |
2527 | + case WM_RBUTTONDBLCLK: | |
2528 | + case WM_LBUTTONDBLCLK: | |
2529 | + { | |
2530 | + int i, mode; | |
2531 | + int xPos = LOWORD(lParam); | |
2532 | + int yPos = HIWORD(lParam); | |
2533 | + RECT rc; | |
2534 | + int flag = FALSE; | |
2535 | + get_head_rc(&rc, &w32g_tracer_wnd.rc_channel_top); | |
2536 | + if (rc.left <= xPos && xPos <= rc.right && rc.top <= yPos && yPos <= rc.bottom) { | |
2537 | + char buff[64]; | |
2538 | + for (i = 0; i < TRACER_CHANNELS; i++) { | |
2539 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_channel_top) == 0) { | |
2540 | + sprintf(buff, "%02d", i + 1); | |
2541 | + if (uMess == WM_RBUTTONDBLCLK) | |
2542 | + UNSET_CHANNELMASK(channel_mute, i); | |
2543 | + else | |
2544 | + TOGGLE_CHANNELMASK(channel_mute, i); | |
2466 | 2545 | #if 0 |
2467 | - if (IS_SET_CHANNELMASK(quietchannels, i)) | |
2468 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_VERY_DARK, CSV_CENTER, TRUE); | |
2469 | - else { | |
2470 | - flag = TRUE; | |
2471 | - if (IS_SET_CHANNELMASK(channel_mute, i)) | |
2472 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_DARK, CSV_CENTER, TRUE); | |
2473 | - else | |
2474 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, TRUE); | |
2475 | - } | |
2546 | + if (IS_SET_CHANNELMASK(quietchannels, i)) | |
2547 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_VERY_DARK, CSV_CENTER, TRUE); | |
2548 | + else { | |
2549 | + flag = TRUE; | |
2550 | + if (IS_SET_CHANNELMASK(channel_mute, i)) | |
2551 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_DARK, CSV_CENTER, TRUE); | |
2552 | + else | |
2553 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, TRUE); | |
2554 | + } | |
2476 | 2555 | #endif |
2477 | - if (!IS_SET_CHANNELMASK(quietchannels, i)) | |
2478 | - flag = TRUE; | |
2479 | - w32g_tracer_wnd.channel_mute = channel_mute; | |
2480 | - tracer_ch_number_draw(i, CTL_STATUS_UPDATE, TRUE); | |
2481 | - } | |
2482 | - } | |
2483 | - if (flag) | |
2484 | - w32g_send_rc(RC_SYNC_RESTART, 0); | |
2485 | - w32g_tracer_wnd.channel_mute = channel_mute; | |
2486 | - w32g_tracer_wnd.quietchannels = quietchannels; | |
2487 | - flag = TRUE; | |
2488 | - } | |
2489 | - if (uMess == WM_RBUTTONDBLCLK) | |
2490 | - break; | |
2491 | - if (flag) | |
2492 | - break; | |
2493 | - for (i = 0; i < TRACER_CHANNELS; i++) { | |
2494 | - if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_channel_top) == 0) { | |
2495 | - if (rc.left <= xPos && xPos <= rc.right && rc.top <= yPos && yPos <= rc.bottom) { | |
2556 | + if (!IS_SET_CHANNELMASK(quietchannels, i)) | |
2557 | + flag = TRUE; | |
2558 | + w32g_tracer_wnd.channel_mute = channel_mute; | |
2559 | + tracer_ch_number_draw(i, CTL_STATUS_UPDATE, TRUE); | |
2560 | + } | |
2561 | + } | |
2562 | + if (flag) | |
2563 | + w32g_send_rc(RC_SYNC_RESTART, 0); | |
2564 | + w32g_tracer_wnd.channel_mute = channel_mute; | |
2565 | + w32g_tracer_wnd.quietchannels = quietchannels; | |
2566 | + flag = TRUE; | |
2567 | + } | |
2568 | + if (uMess == WM_RBUTTONDBLCLK) | |
2569 | + break; | |
2570 | + if (flag) | |
2571 | + break; | |
2572 | + for (i = 0; i < TRACER_CHANNELS; i++) { | |
2573 | + if (get_ch_rc(i, &rc, &w32g_tracer_wnd.rc_channel_top) == 0) { | |
2574 | + if (rc.left <= xPos && xPos <= rc.right && rc.top <= yPos && yPos <= rc.bottom) { | |
2496 | 2575 | #if 0 |
2497 | - char buff[64]; | |
2498 | - sprintf(buff, "%02d", i + 1); | |
2499 | - TOGGLE_CHANNELMASK(channel_mute, i); | |
2500 | - if (IS_SET_CHANNELMASK(quietchannels, i)) | |
2501 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_VERY_DARK, CSV_CENTER, TRUE); | |
2502 | - else { | |
2503 | - flag = TRUE; | |
2504 | - if (IS_SET_CHANNELMASK(channel_mute, i)) | |
2505 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_DARK, CSV_CENTER, TRUE); | |
2506 | - else | |
2507 | - cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, TRUE); | |
2508 | - } | |
2576 | + char buff[64]; | |
2577 | + sprintf(buff, "%02d", i + 1); | |
2578 | + TOGGLE_CHANNELMASK(channel_mute, i); | |
2579 | + if (IS_SET_CHANNELMASK(quietchannels, i)) | |
2580 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_VERY_DARK, CSV_CENTER, TRUE); | |
2581 | + else { | |
2582 | + flag = TRUE; | |
2583 | + if (IS_SET_CHANNELMASK(channel_mute, i)) | |
2584 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK_DARK, CSV_CENTER, TRUE); | |
2585 | + else | |
2586 | + cheap_string_view_draw(&rc, buff, C_TEXT_FORE, C_TEXT_BACK, CSV_CENTER, TRUE); | |
2587 | + } | |
2509 | 2588 | #endif |
2510 | - TOGGLE_CHANNELMASK(channel_mute, i); | |
2511 | - if (!IS_SET_CHANNELMASK(quietchannels, i)) | |
2512 | - flag = TRUE; | |
2513 | - w32g_tracer_wnd.channel_mute = channel_mute; | |
2514 | - w32g_tracer_wnd.quietchannels = quietchannels; | |
2515 | - tracer_ch_number_draw(i, CTL_STATUS_UPDATE, TRUE); | |
2516 | - if (flag) | |
2517 | - w32g_send_rc(RC_SYNC_RESTART, 0); | |
2518 | - flag = TRUE; | |
2519 | - break; | |
2520 | - } | |
2521 | - } | |
2522 | - } | |
2523 | - if (flag) | |
2524 | - break; | |
2589 | + TOGGLE_CHANNELMASK(channel_mute, i); | |
2590 | + if (!IS_SET_CHANNELMASK(quietchannels, i)) | |
2591 | + flag = TRUE; | |
2592 | + w32g_tracer_wnd.channel_mute = channel_mute; | |
2593 | + w32g_tracer_wnd.quietchannels = quietchannels; | |
2594 | + tracer_ch_number_draw(i, CTL_STATUS_UPDATE, TRUE); | |
2595 | + if (flag) | |
2596 | + w32g_send_rc(RC_SYNC_RESTART, 0); | |
2597 | + flag = TRUE; | |
2598 | + break; | |
2599 | + } | |
2600 | + } | |
2601 | + } | |
2602 | + if (flag) | |
2603 | + break; | |
2525 | 2604 | ///r |
2526 | - mode = TracerWndInfo.mode; | |
2527 | - switch (TracerWndInfo.mode) { | |
2528 | - case TWI_MODE_32CH: | |
2529 | - if (TracerWndViewCh >= 32) { | |
2530 | - TracerWndViewCh = 0; | |
2531 | - mode = TWI_MODE_16CH; | |
2532 | - } | |
2533 | - else if (TracerWndViewCh >= 0) { | |
2534 | - TracerWndViewCh = 32; | |
2535 | - } | |
2536 | - break; | |
2537 | - default: | |
2538 | - case TWI_MODE_16CH: | |
2539 | - if (TracerWndViewCh >= 48) { | |
2540 | - TracerWndViewCh = 0; | |
2541 | - mode = TWI_MODE_32CH; | |
2542 | - } | |
2543 | - else if (TracerWndViewCh >= 32) { | |
2544 | - TracerWndViewCh = 48; | |
2545 | - } | |
2546 | - else if (TracerWndViewCh >= 16) { | |
2547 | - TracerWndViewCh = 32; | |
2548 | - } | |
2549 | - else if (TracerWndViewCh >= 0) { | |
2550 | - TracerWndViewCh = 16; | |
2551 | - } | |
2552 | - break; | |
2553 | - } | |
2554 | - change_tracer_wnd_mode(mode); | |
2555 | - break; } | |
2556 | - case WM_MOUSEWHEEL: { | |
2557 | - static int16 wheel_delta = 0; | |
2558 | - int16 wheel_speed; | |
2559 | - wheel_delta += (int16) GET_WHEEL_DELTA_WPARAM(wParam); | |
2560 | - wheel_speed = wheel_delta / WHEEL_DELTA; // upper 16bit sined int // 1knoch = 120 | |
2561 | - TracerWndViewCh -= 4 * wheel_speed; | |
2562 | - wheel_delta %= WHEEL_DELTA; | |
2563 | - | |
2564 | - RANGE(TracerWndViewCh, 0, TRACER_CHANNELS - TracerWndInfo.mode); | |
2565 | - TracerWndClear(TRUE); | |
2566 | - TracerWndPaintAll(TRUE); | |
2567 | - break; } | |
2568 | - case WM_VSCROLL: | |
2569 | - if (work) return 0; | |
2570 | - work = TRUE; | |
2571 | - switch (wParam & 0xFFFF) { | |
2572 | - case SB_LINEUP: | |
2573 | - TracerWndViewCh--; | |
2574 | - break; | |
2575 | - case SB_PAGEUP: | |
2576 | - TracerWndViewCh -= 16; | |
2577 | - break; | |
2578 | - case SB_TOP: | |
2579 | - TracerWndViewCh = 0; | |
2580 | - break; | |
2581 | - case SB_LINEDOWN: | |
2582 | - TracerWndViewCh++; | |
2583 | - break; | |
2584 | - case SB_PAGEDOWN: | |
2585 | - TracerWndViewCh += 16; | |
2586 | - break; | |
2587 | - case SB_BOTTOM: | |
2588 | - TracerWndViewCh = TRACER_CHANNELS - TracerWndInfo.mode; | |
2589 | - break; | |
2590 | - default: | |
2591 | - return 0L; | |
2592 | - } | |
2593 | - RANGE(TracerWndViewCh, 0, TRACER_CHANNELS - TracerWndInfo.mode); | |
2594 | - //change_tracer_wnd_mode(TracerWndInfo.mode); | |
2595 | - TracerWndClear(TRUE); | |
2596 | - TracerWndPaintAll(TRUE); | |
2597 | - work = FALSE; | |
2598 | - break; | |
2599 | - case WM_KEYDOWN: { | |
2600 | - BOOL changed = FALSE; | |
2601 | - if (work) return 0; | |
2602 | - work = TRUE; | |
2603 | - switch (wParam) { | |
2604 | - case VK_UP: | |
2605 | - TracerWndViewCh--; | |
2606 | - changed = TRUE; | |
2607 | - break; | |
2608 | - case VK_DOWN: | |
2609 | - TracerWndViewCh++; | |
2610 | - changed = TRUE; | |
2611 | - break; | |
2612 | - case VK_PRIOR: | |
2613 | - TracerWndViewCh -= (TracerWndInfo.mode == TWI_MODE_16CH) ? 16 : 32; | |
2614 | - changed = TRUE; | |
2615 | - break; | |
2616 | - case VK_NEXT: | |
2617 | - TracerWndViewCh += (TracerWndInfo.mode == TWI_MODE_16CH) ? 16 : 32; | |
2618 | - changed = TRUE; | |
2619 | - break; | |
2620 | - case VK_HOME: | |
2621 | - TracerWndViewCh = 0; | |
2622 | - changed = TRUE; | |
2623 | - break; | |
2624 | - case VK_END: | |
2625 | - TracerWndViewCh = TRACER_CHANNELS - TracerWndInfo.mode; | |
2626 | - changed = TRUE; | |
2627 | - break; | |
2628 | - } | |
2629 | - RANGE(TracerWndViewCh, 0, TRACER_CHANNELS - TracerWndInfo.mode); | |
2630 | - if (changed) { | |
2631 | - //change_tracer_wnd_mode(TracerWndInfo.mode); | |
2632 | - TracerWndClear(TRUE); | |
2633 | - TracerWndPaintAll(TRUE); | |
2634 | - } | |
2635 | - work = FALSE; | |
2636 | - break; } | |
2637 | - case WM_CHAR: | |
2638 | -// case WM_KEYDOWN: | |
2639 | -// ctl->cmsg(CMSG_ERROR, VERB_NORMAL, | |
2640 | -// "%x", wParam); | |
2641 | - switch (wParam) { | |
2642 | - case 0x50: // P | |
2643 | - case 0x70: // p | |
2644 | - SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(IDM_PREV, 0), 0); | |
2645 | - return 0; | |
2646 | - case 0x4e: // N | |
2647 | - case 0x6e: // n | |
2648 | - SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(IDM_NEXT, 0), 0); | |
2649 | - return 0; | |
2650 | - case 0x45: // E | |
2651 | - case 0x65: // e | |
2652 | - w32g_send_rc(RC_RESTART, 0); | |
2653 | - SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(IDM_STOP, 0), 0); | |
2654 | - return 0; | |
2655 | - case 0x48: // H | |
2656 | - case 0x68: // h | |
2657 | - if (PlayerLanguage == LANGUAGE_JAPANESE) { | |
2658 | - MessageBoxA(hTracerWnd, | |
2659 | - "キーコマンド" NLS | |
2660 | - "トレーサウインドウコマンド" NLS | |
2661 | - " ESC: ヘルプを閉じる H: ヘルプを出す" NLS | |
2662 | - " +: キーアップ -: キーダウン" NLS | |
2663 | - " >: スピードアップ <: スピードダウン" NLS | |
2664 | - " UP: -1ch スクロール DOWN: +1ch スクロール" NLS | |
2665 | - " PgUp: ページアップスクロール PgDn: ページダウンスクロール" NLS | |
2666 | - " HOME: ページアップスクロール END: ページダウンスクロール" NLS | |
2667 | - "プレイヤーコマンド" NLS | |
2668 | - " SPACE/ENTER: 演奏開始 E: 停止 S: 一時停止" NLS | |
2669 | - " P: 前の曲 N: 次の曲" NLS | |
2670 | - "TiMidity コマンド" NLS | |
2671 | - " Q: 終了" NLS | |
2672 | - "マウスコマンド" NLS | |
2673 | - " チャンネル番号: ミュートOn/Off" NLS | |
2674 | - " チャンネルカラムヘッダ: 全チャンネルのミュートOn/Off" NLS | |
2675 | - " トレーサー: チャンネル表示切り替え" NLS | |
2676 | - , "ヘルプ", MB_OK); | |
2677 | - } else { | |
2678 | - MessageBoxA(hTracerWnd, | |
2679 | - "Usage of key." NLS | |
2680 | - "Tracer window command." NLS | |
2681 | - " ESC: Close Help H: Help" NLS | |
2682 | - " +: Key up -: Key down" NLS | |
2683 | - " >: Speed up <: Speed down" NLS | |
2684 | - " UP: -1ch scroll DOWN: +1ch scroll" NLS | |
2685 | - " PgUp: Page up scroll PgDn: Page down scroll" NLS | |
2686 | - " HOME: Page up scroll END: Page down scroll" NLS | |
2687 | - "Player command." NLS | |
2688 | - " SPACE/ENTER: PLAY E: Stop S: Pause" NLS | |
2689 | - " P: Prev N: Next" NLS | |
2690 | - "TiMidity command." NLS | |
2691 | - " Q: Quit" NLS | |
2692 | - "Usage of mouse." NLS | |
2693 | - " Channel: Mute On/Off" NLS | |
2694 | - " Channel header: Mute On/Off of all ch" NLS | |
2695 | - " Tracer: Toggle window" NLS | |
2696 | - , "Help", MB_OK); | |
2697 | - } | |
2698 | - return 0; | |
2699 | - case 0x52: // R | |
2700 | - case 0x72: // r | |
2701 | - return 0; | |
2702 | - case 0x53: // S | |
2703 | - case 0x73: // s | |
2704 | - SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(IDM_PAUSE, 0), 0); | |
2705 | - return 0; | |
2706 | - case VK_ESCAPE: | |
2707 | - SendMessage(hTracerWnd, WM_COMMAND, MAKEWPARAM(0, IDCLOSE), 0); | |
2708 | - return 0; | |
2709 | - case 0x51: // Q | |
2710 | - case 0x71: // q | |
2711 | - if (MessageBox(hTracerWnd, "Quit TiMidity?", "TiMidity", MB_ICONQUESTION|MB_YESNO) == IDYES) | |
2712 | - SendMessage(hMainWnd, WM_CLOSE, 0, 0); | |
2713 | - return 0; | |
2714 | - case VK_SPACE: | |
2715 | - case VK_RETURN: | |
2716 | - SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(IDM_PLAY, 0), 0); | |
2717 | - return 0; | |
2718 | - case 0x3E: // < | |
2719 | - w32g_send_rc(RC_SPEEDUP, 1); | |
2720 | - return 0; | |
2721 | - case 0x3C: // < | |
2722 | - w32g_send_rc(RC_SPEEDDOWN, 1); | |
2723 | - return 0; | |
2724 | - case 0x2B: // + | |
2725 | - w32g_send_rc(RC_KEYUP, 1); | |
2726 | - return 0; | |
2727 | - case 0x2D: // - | |
2728 | -// w32g_send_rc(RC_KEYDOWN, 1); | |
2729 | - w32g_send_rc(RC_KEYDOWN, -1); | |
2730 | - return 0; | |
2605 | + mode = TracerWndInfo.mode; | |
2606 | + switch (TracerWndInfo.mode) { | |
2607 | + case TWI_MODE_32CH: | |
2608 | + if (TracerWndViewCh >= 32) { | |
2609 | + TracerWndViewCh = 0; | |
2610 | + mode = TWI_MODE_16CH; | |
2611 | + } | |
2612 | + else if (TracerWndViewCh >= 0) { | |
2613 | + TracerWndViewCh = 32; | |
2614 | + } | |
2615 | + break; | |
2616 | + default: | |
2617 | + case TWI_MODE_16CH: | |
2618 | + if (TracerWndViewCh >= 48) { | |
2619 | + TracerWndViewCh = 0; | |
2620 | + mode = TWI_MODE_32CH; | |
2621 | + } | |
2622 | + else if (TracerWndViewCh >= 32) { | |
2623 | + TracerWndViewCh = 48; | |
2624 | + } | |
2625 | + else if (TracerWndViewCh >= 16) { | |
2626 | + TracerWndViewCh = 32; | |
2627 | + } | |
2628 | + else if (TracerWndViewCh >= 0) { | |
2629 | + TracerWndViewCh = 16; | |
2630 | + } | |
2631 | + break; | |
2632 | + } | |
2633 | + change_tracer_wnd_mode(mode); | |
2634 | + } | |
2635 | + break; | |
2636 | + case WM_MOUSEWHEEL: | |
2637 | + { | |
2638 | + static int16 wheel_delta = 0; | |
2639 | + int16 wheel_speed; | |
2640 | + wheel_delta += (int16)GET_WHEEL_DELTA_WPARAM(wParam); | |
2641 | + wheel_speed = wheel_delta / WHEEL_DELTA; // upper 16bit sined int // 1knoch = 120 | |
2642 | + TracerWndViewCh -= 4 * wheel_speed; | |
2643 | + wheel_delta %= WHEEL_DELTA; | |
2644 | + | |
2645 | + RANGE(TracerWndViewCh, 0, TRACER_CHANNELS - TracerWndInfo.mode); | |
2646 | + TracerWndClear(TRUE); | |
2647 | + TracerWndRecalcLayout(TRUE); | |
2648 | + TracerWndPaintAll(TRUE); | |
2649 | + break; | |
2650 | + } | |
2651 | + case WM_VSCROLL: | |
2652 | + if (work) return 0; | |
2653 | + work = TRUE; | |
2654 | + switch (wParam & 0xFFFF) { | |
2655 | + case SB_LINEUP: | |
2656 | + TracerWndViewCh--; | |
2657 | + break; | |
2658 | + case SB_PAGEUP: | |
2659 | + TracerWndViewCh -= 16; | |
2660 | + break; | |
2661 | + case SB_TOP: | |
2662 | + TracerWndViewCh = 0; | |
2663 | + break; | |
2664 | + case SB_LINEDOWN: | |
2665 | + TracerWndViewCh++; | |
2666 | + break; | |
2667 | + case SB_PAGEDOWN: | |
2668 | + TracerWndViewCh += 16; | |
2669 | + break; | |
2670 | + case SB_BOTTOM: | |
2671 | + TracerWndViewCh = TRACER_CHANNELS - TracerWndInfo.mode; | |
2672 | + break; | |
2673 | + default: | |
2674 | + return 0L; | |
2675 | + } | |
2676 | + RANGE(TracerWndViewCh, 0, TRACER_CHANNELS - TracerWndInfo.mode); | |
2677 | + //change_tracer_wnd_mode(TracerWndInfo.mode); | |
2678 | + TracerWndClear(TRUE); | |
2679 | + TracerWndRecalcLayout(TRUE); | |
2680 | + TracerWndPaintAll(TRUE); | |
2681 | + work = FALSE; | |
2682 | + break; | |
2683 | + case WM_KEYDOWN: | |
2684 | + { | |
2685 | + BOOL changed = FALSE; | |
2686 | + if (work) return 0; | |
2687 | + work = TRUE; | |
2688 | + switch (wParam) { | |
2689 | + case VK_UP: | |
2690 | + TracerWndViewCh--; | |
2691 | + changed = TRUE; | |
2692 | + break; | |
2693 | + case VK_DOWN: | |
2694 | + TracerWndViewCh++; | |
2695 | + changed = TRUE; | |
2696 | + break; | |
2697 | + case VK_PRIOR: | |
2698 | + TracerWndViewCh -= (TracerWndInfo.mode == TWI_MODE_16CH) ? 16 : 32; | |
2699 | + changed = TRUE; | |
2700 | + break; | |
2701 | + case VK_NEXT: | |
2702 | + TracerWndViewCh += (TracerWndInfo.mode == TWI_MODE_16CH) ? 16 : 32; | |
2703 | + changed = TRUE; | |
2704 | + break; | |
2705 | + case VK_HOME: | |
2706 | + TracerWndViewCh = 0; | |
2707 | + changed = TRUE; | |
2708 | + break; | |
2709 | + case VK_END: | |
2710 | + TracerWndViewCh = TRACER_CHANNELS - TracerWndInfo.mode; | |
2711 | + changed = TRUE; | |
2712 | + break; | |
2713 | + } | |
2714 | + RANGE(TracerWndViewCh, 0, TRACER_CHANNELS - TracerWndInfo.mode); | |
2715 | + if (changed) { | |
2716 | + //change_tracer_wnd_mode(TracerWndInfo.mode); | |
2717 | + TracerWndClear(TRUE); | |
2718 | + TracerWndRecalcLayout(TRUE); | |
2719 | + TracerWndPaintAll(TRUE); | |
2720 | + } | |
2721 | + work = FALSE; | |
2722 | + break; | |
2723 | + } | |
2724 | + case WM_CHAR: | |
2725 | +// case WM_KEYDOWN: | |
2726 | +// ctl->cmsg(CMSG_ERROR, VERB_NORMAL, | |
2727 | +// "%x", wParam); | |
2728 | + switch (wParam) { | |
2729 | + case 0x50: // P | |
2730 | + case 0x70: // p | |
2731 | + SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(IDM_PREV, 0), 0); | |
2732 | + return 0; | |
2733 | + case 0x4e: // N | |
2734 | + case 0x6e: // n | |
2735 | + SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(IDM_NEXT, 0), 0); | |
2736 | + return 0; | |
2737 | + case 0x45: // E | |
2738 | + case 0x65: // e | |
2739 | + w32g_send_rc(RC_RESTART, 0); | |
2740 | + SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(IDM_STOP, 0), 0); | |
2741 | + return 0; | |
2742 | + case 0x48: // H | |
2743 | + case 0x68: // h | |
2744 | + if (PlayerLanguage == LANGUAGE_JAPANESE) { | |
2745 | + MessageBox(hTracerWnd, | |
2746 | + "キーコマンド\n" | |
2747 | + "トレーサウインドウコマンド\n" | |
2748 | + " ESC: ヘルプを閉じる H: ヘルプを出す\n" | |
2749 | + " +: キーアップ -: キーダウン\n" | |
2750 | + " >: スピードアップ <: スピードダウン\n" | |
2751 | + " UP: -1ch スクロール DOWN: +1ch スクロール\n" | |
2752 | + " PgUp: ページアップスクロール PgDn: ページダウンスクロール\n" | |
2753 | + " HOME: ページアップスクロール END: ページダウンスクロール\n" | |
2754 | + "プレイヤーコマンド\n" | |
2755 | + " SPACE/ENTER: 演奏開始 E: 停止 S: 一時停止\n" | |
2756 | + " P: 前の曲 N: 次の曲\n" | |
2757 | + "TiMidity コマンド\n" | |
2758 | + " Q: 終了\n" | |
2759 | + , "ヘルプ", MB_OK); | |
2760 | + } else { | |
2761 | + MessageBox(hTracerWnd, | |
2762 | + "Usage of key.\n" | |
2763 | + "Tracer window command.\n" | |
2764 | + " ESC: Close Help H: Help\n" | |
2765 | + " +: Key up -: Key down\n" | |
2766 | + " >: Speed up <: Speed down\n" | |
2767 | + " UP: -1ch scroll DOWN: +1ch scroll\n" | |
2768 | + " PgUp: Page up scroll PgDn: Page down scroll\n" | |
2769 | + " HOME: Page up scroll END: Page down scroll\n" | |
2770 | + "Player command.\n" | |
2771 | + " SPACE/ENTER: PLAY E: Stop S: Pause\n" | |
2772 | + " P: Prev N: Next\n" | |
2773 | + "TiMidity command.\n" | |
2774 | + " Q: Quit\n" | |
2775 | + , "Help", MB_OK); | |
2776 | + } | |
2777 | + return 0; | |
2778 | + case 0x52: // R | |
2779 | + case 0x72: // r | |
2780 | + return 0; | |
2781 | + case 0x53: // S | |
2782 | + case 0x73: // s | |
2783 | + SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(IDM_PAUSE, 0), 0); | |
2784 | + return 0; | |
2785 | + case VK_ESCAPE: | |
2786 | + SendMessage(hTracerWnd, WM_COMMAND, MAKEWPARAM(0, IDCLOSE), 0); | |
2787 | + return 0; | |
2788 | + case 0x51: // Q | |
2789 | + case 0x71: // q | |
2790 | + if (MessageBox(hTracerWnd, "Quit TiMidity?", "TiMidity", MB_ICONQUESTION|MB_YESNO) == IDYES) | |
2791 | + SendMessage(hMainWnd, WM_CLOSE, 0, 0); | |
2792 | + return 0; | |
2793 | + case VK_SPACE: | |
2794 | + case VK_RETURN: | |
2795 | + SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(IDM_PLAY, 0), 0); | |
2796 | + return 0; | |
2797 | + case 0x3E: // < | |
2798 | + w32g_send_rc(RC_SPEEDUP, 1); | |
2799 | + return 0; | |
2800 | + case 0x3C: // < | |
2801 | + w32g_send_rc(RC_SPEEDDOWN, 1); | |
2802 | + return 0; | |
2803 | + case 0x2B: // + | |
2804 | + w32g_send_rc(RC_KEYUP, 1); | |
2805 | + return 0; | |
2806 | + case 0x2D: // - | |
2807 | +// w32g_send_rc(RC_KEYDOWN, 1); | |
2808 | + w32g_send_rc(RC_KEYDOWN, -1); | |
2809 | + return 0; | |
2731 | 2810 | #if 0 |
2732 | - case 0x4F: // O | |
2733 | - w32g_send_rc(RC_VOICEINCR, 1); | |
2734 | - return 0; | |
2735 | - case 0x6F: // o | |
2736 | - w32g_send_rc(RC_VOICEDECR, 1); | |
2737 | - return 0; | |
2811 | + case 0x4F: // O | |
2812 | + w32g_send_rc(RC_VOICEINCR, 1); | |
2813 | + return 0; | |
2814 | + case 0x6F: // o | |
2815 | + w32g_send_rc(RC_VOICEDECR, 1); | |
2816 | + return 0; | |
2738 | 2817 | #endif |
2739 | - } | |
2740 | - default: | |
2741 | - return DefWindowProc(hwnd, uMess, wParam, lParam); | |
2742 | - } | |
2743 | - return 0L; | |
2818 | + } | |
2819 | + default: | |
2820 | + return DefWindowProc(hwnd, uMess, wParam, lParam); | |
2821 | + } | |
2822 | + return 0L; | |
2744 | 2823 | } |
2745 | 2824 | |
2746 | 2825 | extern void MainWndUpdateTracerButton(void); |
2747 | 2826 | |
2748 | -INT_PTR CALLBACK | |
2827 | +LRESULT CALLBACK | |
2749 | 2828 | TracerWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) |
2750 | 2829 | { |
2751 | - switch (uMess) { | |
2752 | - case WM_INITDIALOG: | |
2753 | - SetWindowPosSize(NULL, hwnd, TracerWndInfo.PosX, TracerWndInfo.PosY); | |
2754 | - return FALSE; | |
2755 | - case WM_ERASEBKGND: | |
2756 | - break; | |
2757 | - case WM_PAINT: | |
2758 | - break; | |
2759 | - case WM_DESTROY: | |
2760 | - { | |
2761 | - RECT rc; | |
2762 | - GetWindowRect(hwnd, &rc); | |
2763 | - TracerWndInfo.PosX = rc.left; | |
2764 | - TracerWndInfo.PosY = rc.top; | |
2765 | - } | |
2766 | - INISaveTracerWnd(); | |
2767 | - break; | |
2768 | - case WM_COMMAND: | |
2769 | - switch (LOWORD(wParam)) { | |
2770 | - case IDCLOSE: | |
2771 | - ShowWindow(hwnd, SW_HIDE); | |
2772 | - MainWndUpdateTracerButton(); | |
2773 | - break; | |
2774 | - default: | |
2775 | - return FALSE; | |
2776 | - } | |
2777 | - case WM_GETMINMAXINFO: | |
2778 | - { | |
2779 | - RECT rc = { 0 }; | |
2780 | - LPMINMAXINFO lpmmi = (LPMINMAXINFO) lParam; | |
2781 | - rc.right = TRACER_MINWIDTH; | |
2782 | - rc.bottom = w32g_tracer_wnd.height; | |
2783 | - AdjustWindowRectEx(&rc, GetWindowLong(hwnd, GWL_STYLE), FALSE, GetWindowLong(hwnd, GWL_EXSTYLE)); | |
2784 | - rc.right -= rc.left; | |
2785 | - rc.bottom -= rc.top; | |
2786 | - lpmmi->ptMinTrackSize.x = max(rc.right, lpmmi->ptMinTrackSize.x); | |
2787 | - lpmmi->ptMinTrackSize.y = max(rc.bottom, lpmmi->ptMinTrackSize.y); | |
2788 | - rc.right = TRACER_MAXWIDTH; | |
2789 | - rc.bottom = w32g_tracer_wnd.height; | |
2790 | - AdjustWindowRectEx(&rc, GetWindowLong(hwnd, GWL_STYLE), FALSE, GetWindowLong(hwnd, GWL_EXSTYLE)); | |
2791 | - rc.right -= rc.left; | |
2792 | - rc.bottom -= rc.top; | |
2793 | - lpmmi->ptMaxTrackSize.x = min(rc.right, lpmmi->ptMaxTrackSize.x); | |
2794 | - lpmmi->ptMaxTrackSize.y = lpmmi->ptMinTrackSize.y; | |
2795 | - } | |
2796 | - break; | |
2797 | - case WM_SIZE: | |
2798 | - if (w32g_tracer_wnd.width != LOWORD(lParam) && wParam == SIZE_RESTORED && IsWindowVisible(hwnd)) { | |
2799 | - RECT rc; | |
2800 | - GetWindowRect(hwnd, &rc); | |
2801 | - TracerWndInfo.PosX = rc.left; | |
2802 | - TracerWndInfo.PosY = rc.top; | |
2803 | - | |
2804 | - w32g_tracer_wnd.width = LOWORD(lParam); | |
2805 | - | |
2806 | - recalc_tracer_rc(); | |
2807 | - | |
2808 | - //MoveWindow(w32g_tracer_wnd.hwnd, 0, 0, w32g_tracer_wnd.width, w32g_tracer_wnd.height, TRUE); | |
2809 | - | |
2810 | - TracerWndClear(TRUE); | |
2811 | - TracerWndPaintAll(TRUE); | |
2812 | - | |
2813 | - TracerWndInfo.Width = w32g_tracer_wnd.width; | |
2814 | - } | |
2815 | - break; | |
2816 | - case WM_SIZING: | |
2817 | - { | |
2818 | - RECT rc; | |
2819 | - CopyMemory(&rc, (LPRECT) lParam, sizeof(RECT)); | |
2820 | - TracerWndInfo.PosX = rc.left; | |
2821 | - TracerWndInfo.PosY = rc.top; | |
2822 | - | |
2823 | - GetClientRect(hwnd, &rc); | |
2824 | - w32g_tracer_wnd.width = rc.right - rc.left; | |
2825 | - | |
2826 | - recalc_tracer_rc(); | |
2827 | - | |
2828 | - //MoveWindow(w32g_tracer_wnd.hwnd, 0, 0, w32g_tracer_wnd.width, w32g_tracer_wnd.height, TRUE); | |
2829 | - | |
2830 | - //TracerWndClear(TRUE); | |
2831 | - //TracerWndPaintAll(TRUE); | |
2832 | - | |
2833 | - TracerWndInfo.Width = w32g_tracer_wnd.width; | |
2834 | - } | |
2835 | - break; | |
2836 | - case WM_MOVE: | |
2837 | - // TracerWndInfo.PosX = (int) LOWORD(lParam); | |
2838 | - // TracerWndInfo.PosY = (int) HIWORD(lParam); | |
2839 | - if (IsWindowVisible(hwnd)) { | |
2840 | - RECT rc; | |
2841 | - GetWindowRect(hwnd, &rc); | |
2842 | - TracerWndInfo.PosX = rc.left; | |
2843 | - TracerWndInfo.PosY = rc.top; | |
2844 | - GetClientRect(hwnd, &rc); | |
2845 | - TracerWndInfo.Width = rc.right; | |
2846 | - } | |
2847 | - break; | |
2848 | - case WM_SHOWWINDOW: | |
2849 | - if (wParam) { | |
2850 | - w32g_tracer_wnd.active = TRUE; | |
2851 | - TracerWndClear(TRUE); | |
2852 | - TracerWndPaintAll(TRUE); | |
2853 | - } else { | |
2854 | - w32g_tracer_wnd.active = FALSE; | |
2855 | - } | |
2856 | - break; | |
2857 | - case WM_CLOSE: | |
2858 | - ShowWindow(hTracerWnd, SW_HIDE); | |
2859 | - MainWndUpdateTracerButton(); | |
2860 | - break; | |
2861 | - case WM_DROPFILES: | |
2862 | - SendMessage(hMainWnd, WM_DROPFILES, wParam, lParam); | |
2863 | - return 0; | |
2864 | - case WM_HELP: | |
2865 | - PostMessage(w32g_tracer_wnd.hwnd, WM_CHAR, 'H', 0); | |
2866 | - break; | |
2867 | - default: | |
2868 | - return FALSE; | |
2869 | - } | |
2870 | - return FALSE; | |
2830 | + switch (uMess) { | |
2831 | + case WM_INITDIALOG: | |
2832 | + SetWindowPosSize(NULL, hwnd, TracerWndInfo.PosX, TracerWndInfo.PosY); | |
2833 | + return FALSE; | |
2834 | + case WM_ERASEBKGND: | |
2835 | + break; | |
2836 | + case WM_PAINT: | |
2837 | + break; | |
2838 | + case WM_DESTROY: | |
2839 | + { | |
2840 | + RECT rc; | |
2841 | + GetWindowRect(hwnd, &rc); | |
2842 | + TracerWndInfo.PosX = rc.left; | |
2843 | + TracerWndInfo.PosY = rc.top; | |
2844 | + } | |
2845 | + INISaveTracerWnd(); | |
2846 | + break; | |
2847 | + case WM_COMMAND: | |
2848 | + switch (LOWORD(wParam)) { | |
2849 | + case IDCLOSE: | |
2850 | + ShowWindow(hwnd, SW_HIDE); | |
2851 | + MainWndUpdateTracerButton(); | |
2852 | + break; | |
2853 | + default: | |
2854 | + return FALSE; | |
2855 | + } | |
2856 | + case WM_GETMINMAXINFO: | |
2857 | + { | |
2858 | + RECT rc = { 0 }; | |
2859 | + LPMINMAXINFO lpmmi = (LPMINMAXINFO) lParam; | |
2860 | + rc.right = TRACER_MINWIDTH; | |
2861 | + rc.bottom = w32g_tracer_wnd.height; | |
2862 | + AdjustWindowRectEx(&rc, GetWindowLong(hwnd, GWL_STYLE), FALSE, GetWindowLong(hwnd, GWL_EXSTYLE)); | |
2863 | + rc.right -= rc.left; | |
2864 | + rc.bottom -= rc.top; | |
2865 | + lpmmi->ptMinTrackSize.x = max(rc.right, lpmmi->ptMinTrackSize.x); | |
2866 | + lpmmi->ptMinTrackSize.y = max(rc.bottom, lpmmi->ptMinTrackSize.y); | |
2867 | + rc.right = TRACER_MAXWIDTH; | |
2868 | + rc.bottom = w32g_tracer_wnd.height; | |
2869 | + AdjustWindowRectEx(&rc, GetWindowLong(hwnd, GWL_STYLE), FALSE, GetWindowLong(hwnd, GWL_EXSTYLE)); | |
2870 | + rc.right -= rc.left; | |
2871 | + rc.bottom -= rc.top; | |
2872 | + lpmmi->ptMaxTrackSize.x = min(rc.right, lpmmi->ptMaxTrackSize.x); | |
2873 | + lpmmi->ptMaxTrackSize.y = lpmmi->ptMinTrackSize.y; | |
2874 | + } | |
2875 | + break; | |
2876 | + case WM_SIZE: | |
2877 | + if (w32g_tracer_wnd.width != LOWORD(lParam) && wParam == SIZE_RESTORED && IsWindowVisible(hwnd)) { | |
2878 | + RECT rc; | |
2879 | + GetWindowRect(hwnd, &rc); | |
2880 | + TracerWndInfo.PosX = rc.left; | |
2881 | + TracerWndInfo.PosY = rc.top; | |
2882 | + | |
2883 | + w32g_tracer_wnd.width = LOWORD(lParam); | |
2884 | + | |
2885 | + recalc_tracer_rc(); | |
2886 | + | |
2887 | + //MoveWindow(w32g_tracer_wnd.hwnd, 0, 0, w32g_tracer_wnd.width, w32g_tracer_wnd.height, TRUE); | |
2888 | + | |
2889 | + TracerWndClear(TRUE); | |
2890 | + TracerWndRecalcLayout(TRUE); | |
2891 | + TracerWndPaintAll(TRUE); | |
2892 | + | |
2893 | + TracerWndInfo.Width = w32g_tracer_wnd.width; | |
2894 | + } | |
2895 | + break; | |
2896 | + case WM_SIZING: | |
2897 | + { | |
2898 | + RECT rc; | |
2899 | + CopyMemory(&rc, (LPRECT) lParam, sizeof(RECT)); | |
2900 | + TracerWndInfo.PosX = rc.left; | |
2901 | + TracerWndInfo.PosY = rc.top; | |
2902 | + | |
2903 | + GetClientRect(hwnd, &rc); | |
2904 | + w32g_tracer_wnd.width = rc.right - rc.left; | |
2905 | + | |
2906 | + recalc_tracer_rc(); | |
2907 | + | |
2908 | + //MoveWindow(w32g_tracer_wnd.hwnd, 0, 0, w32g_tracer_wnd.width, w32g_tracer_wnd.height, TRUE); | |
2909 | + | |
2910 | + //TracerWndClear(TRUE); | |
2911 | + //TracerWndRecalcLayout(TRUE); | |
2912 | + //TracerWndPaintAll(TRUE); | |
2913 | + | |
2914 | + TracerWndInfo.Width = w32g_tracer_wnd.width; | |
2915 | + } | |
2916 | + break; | |
2917 | + case WM_MOVE: | |
2918 | + // TracerWndInfo.PosX = (int) LOWORD(lParam); | |
2919 | + // TracerWndInfo.PosY = (int) HIWORD(lParam); | |
2920 | + if (IsWindowVisible(hwnd)) { | |
2921 | + RECT rc; | |
2922 | + GetWindowRect(hwnd, &rc); | |
2923 | + TracerWndInfo.PosX = rc.left; | |
2924 | + TracerWndInfo.PosY = rc.top; | |
2925 | + GetClientRect(hwnd, &rc); | |
2926 | + TracerWndInfo.Width = rc.right; | |
2927 | + } | |
2928 | + break; | |
2929 | + case WM_SHOWWINDOW: | |
2930 | + if (wParam) { | |
2931 | + w32g_tracer_wnd.active = TRUE; | |
2932 | + TracerWndClear(TRUE); | |
2933 | + TracerWndRecalcLayout(TRUE); | |
2934 | + TracerWndPaintAll(TRUE); | |
2935 | + } else { | |
2936 | + w32g_tracer_wnd.active = FALSE; | |
2937 | + } | |
2938 | + break; | |
2939 | + case WM_CLOSE: | |
2940 | + ShowWindow(hTracerWnd, SW_HIDE); | |
2941 | + MainWndUpdateTracerButton(); | |
2942 | + break; | |
2943 | + case WM_DROPFILES: | |
2944 | + SendMessage(hMainWnd, WM_DROPFILES, wParam, lParam); | |
2945 | + return 0; | |
2946 | + case WM_HELP: | |
2947 | + PostMessage(w32g_tracer_wnd.hwnd, WM_CHAR, 'H', 0); | |
2948 | + break; | |
2949 | + default: | |
2950 | + return FALSE; | |
2951 | + } | |
2952 | + return FALSE; | |
2871 | 2953 | } |
2872 | 2954 | |
2873 | 2955 |
@@ -2876,106 +2958,106 @@ extern int PosSizeSave; | ||
2876 | 2958 | #define SEC_TRACERWND "TracerWnd" |
2877 | 2959 | int INISaveTracerWnd(void) |
2878 | 2960 | { |
2879 | - char *section = SEC_TRACERWND; | |
2880 | - char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
2881 | - char buffer[256]; | |
2882 | - int num; | |
2883 | - if (PosSizeSave) { | |
2884 | - if (TracerWndInfo.PosX >= 0 || TracerWndInfo.PosY >= 0) { | |
2885 | - if (TracerWndInfo.PosX < 0) | |
2886 | - TracerWndInfo.PosX = 0; | |
2887 | - if (TracerWndInfo.PosY < 0) | |
2888 | - TracerWndInfo.PosY = 0; | |
2889 | - } | |
2890 | - sprintf(buffer, "%d", TracerWndInfo.PosX); | |
2891 | - if (TracerWndInfo.PosX >= 0) | |
2892 | - WritePrivateProfileString(section, "PosX", buffer, inifile); | |
2893 | - sprintf(buffer, "%d", TracerWndInfo.PosY); | |
2894 | - if (TracerWndInfo.PosY >= 0) | |
2895 | - WritePrivateProfileString(section, "PosY", buffer, inifile); | |
2896 | - sprintf(buffer, "%d", TracerWndInfo.Width); | |
2897 | - if (TracerWndInfo.Width >= 0) | |
2898 | - WritePrivateProfileString(section, "Width", buffer, inifile); | |
2899 | - } | |
2900 | - if (TracerWndInfo.mode == TWI_MODE_16CH) | |
2901 | - num = 2; | |
2902 | - else | |
2903 | - num = 1; | |
2904 | - sprintf(buffer, "%d", num); | |
2905 | - WritePrivateProfileString(section, "mode", buffer, inifile); | |
2906 | - WritePrivateProfileString(NULL, NULL, NULL, inifile); // Write Flush | |
2907 | - return 0; | |
2961 | + char *section = SEC_TRACERWND; | |
2962 | + char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
2963 | + char buffer[256]; | |
2964 | + int num; | |
2965 | + if (PosSizeSave) { | |
2966 | + if (TracerWndInfo.PosX >= 0 || TracerWndInfo.PosY >= 0) { | |
2967 | + if (TracerWndInfo.PosX < 0) | |
2968 | + TracerWndInfo.PosX = 0; | |
2969 | + if (TracerWndInfo.PosY < 0) | |
2970 | + TracerWndInfo.PosY = 0; | |
2971 | + } | |
2972 | + sprintf(buffer, "%d", TracerWndInfo.PosX); | |
2973 | + if (TracerWndInfo.PosX >= 0) | |
2974 | + WritePrivateProfileString(section, "PosX", buffer, inifile); | |
2975 | + sprintf(buffer, "%d", TracerWndInfo.PosY); | |
2976 | + if (TracerWndInfo.PosY >= 0) | |
2977 | + WritePrivateProfileString(section, "PosY", buffer, inifile); | |
2978 | + sprintf(buffer, "%d", TracerWndInfo.Width); | |
2979 | + if (TracerWndInfo.Width >= 0) | |
2980 | + WritePrivateProfileString(section, "Width", buffer, inifile); | |
2981 | + } | |
2982 | + if (TracerWndInfo.mode == TWI_MODE_16CH) | |
2983 | + num = 2; | |
2984 | + else | |
2985 | + num = 1; | |
2986 | + sprintf(buffer, "%d", num); | |
2987 | + WritePrivateProfileString(section, "mode", buffer, inifile); | |
2988 | + WritePrivateProfileString(NULL, NULL, NULL, inifile); // Write Flush | |
2989 | + return 0; | |
2908 | 2990 | } |
2909 | 2991 | |
2910 | 2992 | int INILoadTracerWnd(void) |
2911 | 2993 | { |
2912 | - char *section = SEC_TRACERWND; | |
2913 | - char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
2914 | - int num; | |
2915 | - num = GetPrivateProfileInt(section, "PosX", -1, inifile); | |
2916 | - TracerWndInfo.PosX = num; | |
2917 | - num = GetPrivateProfileInt(section, "PosY", -1, inifile); | |
2918 | - TracerWndInfo.PosY = num; | |
2919 | - num = GetPrivateProfileInt(section, "Width", TRACER_DEFWIDTH, inifile); | |
2920 | - TracerWndInfo.Width = num; | |
2921 | - RANGE(TracerWndInfo.Width, TRACER_MINWIDTH, TRACER_MAXWIDTH); | |
2922 | - num = GetPrivateProfileInt(section, "mode", 0, inifile); // 0 TWI_MODE_DEFAULT | |
2923 | - if (num == 1) | |
2924 | - TracerWndInfo.mode = TWI_MODE_32CH; | |
2925 | - else if (num == 2 || num == 3) | |
2926 | - TracerWndInfo.mode = TWI_MODE_16CH; | |
2927 | - else | |
2928 | - TracerWndInfo.mode = TWI_MODE_DEFAULT; | |
2929 | - return 0; | |
2994 | + char *section = SEC_TRACERWND; | |
2995 | + char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
2996 | + int num; | |
2997 | + num = GetPrivateProfileInt(section, "PosX", -1, inifile); | |
2998 | + TracerWndInfo.PosX = num; | |
2999 | + num = GetPrivateProfileInt(section, "PosY", -1, inifile); | |
3000 | + TracerWndInfo.PosY = num; | |
3001 | + num = GetPrivateProfileInt(section, "Width", TRACER_DEFWIDTH, inifile); | |
3002 | + TracerWndInfo.Width = num; | |
3003 | + RANGE(TracerWndInfo.Width, TRACER_MINWIDTH, TRACER_MAXWIDTH); | |
3004 | + num = GetPrivateProfileInt(section, "mode", 0, inifile); // 0 TWI_MODE_DEFAULT | |
3005 | + if (num == 1) | |
3006 | + TracerWndInfo.mode = TWI_MODE_32CH; | |
3007 | + else if (num == 2 || num == 3) | |
3008 | + TracerWndInfo.mode = TWI_MODE_16CH; | |
3009 | + else | |
3010 | + TracerWndInfo.mode = TWI_MODE_DEFAULT; | |
3011 | + return 0; | |
2930 | 3012 | } |
2931 | 3013 | |
2932 | 3014 | static int TracerWndInfoReset(HWND hwnd) |
2933 | 3015 | { |
2934 | - ZeroMemory(&TracerWndInfo, sizeof(TRACERWNDINFO)); | |
2935 | - TracerWndInfo.PosX = - 1; | |
2936 | - TracerWndInfo.PosY = - 1; | |
2937 | - TracerWndInfo.Width = TRACER_DEFWIDTH; | |
2938 | - TracerWndInfo.mode = TWI_MODE_DEFAULT; | |
2939 | - return 0; | |
3016 | + ZeroMemory(&TracerWndInfo, sizeof(TRACERWNDINFO)); | |
3017 | + TracerWndInfo.PosX = - 1; | |
3018 | + TracerWndInfo.PosY = - 1; | |
3019 | + TracerWndInfo.Width = TRACER_DEFWIDTH; | |
3020 | + TracerWndInfo.mode = TWI_MODE_DEFAULT; | |
3021 | + return 0; | |
2940 | 3022 | } |
2941 | 3023 | |
2942 | 3024 | static int TracerWndInfoApply(void) |
2943 | 3025 | { |
2944 | - change_tracer_wnd_mode(TracerWndInfo.mode); | |
2945 | - return 0; | |
3026 | + change_tracer_wnd_mode(TracerWndInfo.mode); | |
3027 | + return 0; | |
2946 | 3028 | } |
2947 | 3029 | |
2948 | 3030 | static int change_tracer_wnd_mode(int mode) |
2949 | 3031 | { |
2950 | - RECT rc, rc2; | |
3032 | + RECT rc, rc2; | |
2951 | 3033 | ///r |
2952 | - switch (mode) { | |
2953 | - default: | |
2954 | - case TWI_MODE_32CH: | |
2955 | - w32g_tracer_wnd.height = CANVAS_MARGIN + ITEM_SPACER + ITEM_HEIGHT + (ITEM_SPACER + ITEM_HEIGHT) * 32 + ITEM_SPACER + CANVAS_MARGIN; | |
2956 | - break; | |
2957 | - case TWI_MODE_16CH: | |
2958 | - w32g_tracer_wnd.height = CANVAS_MARGIN + ITEM_SPACER + ITEM_HEIGHT + (ITEM_SPACER + ITEM_HEIGHT) * 16 + ITEM_SPACER + CANVAS_MARGIN; | |
2959 | - break; | |
2960 | - } | |
2961 | - GetWindowRect(hTracerWnd, &rc); | |
2962 | - GetClientRect(hTracerWnd, &rc2); | |
2963 | - rc.left = rc.left; | |
2964 | - rc.top = rc.top; | |
2965 | - rc.right = (rc.right - rc.left) - (rc2.right - rc2.left) + w32g_tracer_wnd.width; | |
2966 | - rc.bottom = (rc.bottom - rc.top) - (rc2.bottom - rc2.top) + w32g_tracer_wnd.height; | |
2967 | - MoveWindow(hTracerWnd, rc.left, rc.top, rc.right, rc.bottom, TRUE); | |
2968 | - //MoveWindow(w32g_tracer_wnd.hwnd, 0, 0, w32g_tracer_wnd.width, w32g_tracer_wnd.height, TRUE); | |
2969 | - TracerWndInfo.mode = mode; | |
2970 | - TracerWndClear(TRUE); | |
2971 | - TracerWndPaintAll(TRUE); | |
2972 | - return 0; | |
3034 | + switch (mode) { | |
3035 | + default: | |
3036 | + case TWI_MODE_32CH: | |
3037 | + w32g_tracer_wnd.height = CANVAS_MARGIN + ITEM_SPACER + ITEM_HEIGHT + (ITEM_SPACER + ITEM_HEIGHT) * 32 + ITEM_SPACER + CANVAS_MARGIN; | |
3038 | + break; | |
3039 | + case TWI_MODE_16CH: | |
3040 | + w32g_tracer_wnd.height = CANVAS_MARGIN + ITEM_SPACER + ITEM_HEIGHT + (ITEM_SPACER + ITEM_HEIGHT) * 16 + ITEM_SPACER + CANVAS_MARGIN; | |
3041 | + break; | |
3042 | + } | |
3043 | + GetWindowRect(hTracerWnd, &rc); | |
3044 | + GetClientRect(hTracerWnd, &rc2); | |
3045 | + rc.left = rc.left; | |
3046 | + rc.top = rc.top; | |
3047 | + rc.right = (rc.right - rc.left) - (rc2.right - rc2.left) + w32g_tracer_wnd.width; | |
3048 | + rc.bottom = (rc.bottom - rc.top) - (rc2.bottom - rc2.top) + w32g_tracer_wnd.height; | |
3049 | + MoveWindow(hTracerWnd, rc.left, rc.top, rc.right, rc.bottom, TRUE); | |
3050 | + //MoveWindow(w32g_tracer_wnd.hwnd, 0, 0, w32g_tracer_wnd.width, w32g_tracer_wnd.height, TRUE); | |
3051 | + TracerWndInfo.mode = mode; | |
3052 | + TracerWndClear(TRUE); | |
3053 | + TracerWndPaintAll(TRUE); | |
3054 | + return 0; | |
2973 | 3055 | } |
2974 | 3056 | |
2975 | 3057 | void TracerWndApplyQuietChannel(ChannelBitMask quietchannels_) |
2976 | 3058 | { |
2977 | - w32g_tracer_wnd.quietchannels = quietchannels_; | |
2978 | - TracerWndPaintAll(TRUE); | |
3059 | + w32g_tracer_wnd.quietchannels = quietchannels_; | |
3060 | + TracerWndPaintAll(TRUE); | |
2979 | 3061 | } |
2980 | 3062 | |
2981 | 3063 |
@@ -104,6 +104,7 @@ typedef struct w32g_syn_t_ { | ||
104 | 104 | static w32g_syn_t w32g_syn; |
105 | 105 | |
106 | 106 | // 各種変数 (^^;;; |
107 | +HWND hMainWnd = 0; | |
107 | 108 | HINSTANCE hInst = NULL; |
108 | 109 | int PlayerLanguage = LANGUAGE_ENGLISH; |
109 | 110 | int IniFileAutoSave = 1; |
@@ -465,7 +466,7 @@ static int w32g_syn_main(void) | ||
465 | 466 | return 0; |
466 | 467 | } |
467 | 468 | |
468 | -static VOID CALLBACK forced_exit(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime) | |
469 | +static VOID CALLBACK forced_exit(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) | |
469 | 470 | { |
470 | 471 | exit(0); |
471 | 472 | } |
@@ -1015,6 +1016,7 @@ static int start_syn_thread(void) | ||
1015 | 1016 | NULL, 0, & w32g_syn.syn_dwThreadId); |
1016 | 1017 | if (!w32g_syn.syn_hThread) |
1017 | 1018 | return -1; |
1019 | + set_thread_description((ptr_size_t)w32g_syn.syn_hThread, "Syn Thread"); | |
1018 | 1020 | for (;;) { |
1019 | 1021 | if (syn_thread_started == 1) |
1020 | 1022 | break; |
@@ -1815,7 +1817,7 @@ static void ConsoleWndVerbosityUpdate(void); | ||
1815 | 1817 | static void ConsoleWndVerbosityApply(void); |
1816 | 1818 | static void ConsoleWndValidUpdate(void); |
1817 | 1819 | static void ConsoleWndValidApply(void); |
1818 | -static void ConsoleWndVerbosityApplyIncDec(int num); | |
1820 | +static void ConsoleWndVerbosityApplySet(int num); | |
1819 | 1821 | static int ConsoleWndInfoReset(HWND hwnd); |
1820 | 1822 | static int ConsoleWndInfoApply(void); |
1821 | 1823 |
@@ -1849,7 +1851,7 @@ void InitConsoleWnd(HWND hParentWnd) | ||
1849 | 1851 | ShowWindow(hConsoleWnd, ConsoleWndStartFlag ? SW_SHOW : SW_HIDE); |
1850 | 1852 | UpdateWindow(hConsoleWnd); |
1851 | 1853 | |
1852 | - ConsoleWndVerbosityApplyIncDec(0); | |
1854 | + ConsoleWndVerbosityApply(); | |
1853 | 1855 | CheckDlgButton(hConsoleWnd, IDC_CHECKBOX_VALID, ConsoleWndFlag); |
1854 | 1856 | Edit_LimitText(GetDlgItem(hConsoleWnd, IDC_EDIT), ConsoleWndMaxSize); |
1855 | 1857 | } |
@@ -1878,10 +1880,18 @@ ConsoleWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam) | ||
1878 | 1880 | ConsoleWndVerbosityApply(); |
1879 | 1881 | break; |
1880 | 1882 | case IDC_BUTTON_INC: |
1881 | - ConsoleWndVerbosityApplyIncDec(1); | |
1883 | + { | |
1884 | + int n = (int)GetDlgItemInt(hwnd, IDC_EDIT_VERBOSITY, NULL, TRUE); | |
1885 | + n++; | |
1886 | + ConsoleWndVerbosityApplySet(n); | |
1887 | + } | |
1882 | 1888 | break; |
1883 | 1889 | case IDC_BUTTON_DEC: |
1884 | - ConsoleWndVerbosityApplyIncDec(-1); | |
1890 | + { | |
1891 | + int n = (int)GetDlgItemInt(hwnd, IDC_EDIT_VERBOSITY, NULL, TRUE); | |
1892 | + n--; | |
1893 | + ConsoleWndVerbosityApplySet(n); | |
1894 | + } | |
1885 | 1895 | break; |
1886 | 1896 | default: |
1887 | 1897 | break; |
@@ -2092,10 +2102,10 @@ static void ConsoleWndVerbosityApply(void) | ||
2092 | 2102 | ConsoleWndVerbosityUpdate(); |
2093 | 2103 | } |
2094 | 2104 | |
2095 | -static void ConsoleWndVerbosityApplyIncDec(int num) | |
2105 | +static void ConsoleWndVerbosityApplySet(int num) | |
2096 | 2106 | { |
2097 | 2107 | if (!IsWindow(hConsoleWnd)) return; |
2098 | - ctl->verbosity += num; | |
2108 | + ctl->verbosity = num; | |
2099 | 2109 | RANGE(ctl->verbosity, -1, 4); |
2100 | 2110 | ConsoleWndVerbosityUpdate(); |
2101 | 2111 | } |
@@ -3,26 +3,27 @@ | ||
3 | 3 | ///r |
4 | 4 | #define TRACER_CHANNELS MAX_CHANNELS |
5 | 5 | typedef struct w32g_tracer_wnd_t_ { |
6 | - HWND hwnd; | |
7 | - HWND hParentWnd; | |
8 | - HDC hdc; | |
9 | - HDC hmdc; | |
10 | - HGDIOBJ hgdiobj_hmdcprev; | |
11 | - HBITMAP hbitmap; | |
12 | - HFONT hFontCommon; | |
13 | - HFONT hFontHalf; | |
14 | - RECT rc; | |
15 | - int font_common_height; | |
16 | - int font_common_width; | |
17 | - int height; | |
18 | - int width; | |
19 | - int valid; | |
20 | - int active; | |
21 | - int updateall; | |
22 | - RECT rc_current_time; | |
23 | - RECT rc_tempo; | |
24 | - RECT rc_master_volume; // マスターボリューム | |
25 | - RECT rc_maxvoices; | |
6 | + HWND hwnd; | |
7 | + HWND hParentWnd; | |
8 | + HWND hTool; | |
9 | + HDC hdc; | |
10 | + HDC hmdc; | |
11 | + HGDIOBJ hgdiobj_hmdcprev; | |
12 | + HBITMAP hbitmap; | |
13 | + HFONT hFontCommon; | |
14 | + HFONT hFontHalf; | |
15 | + RECT rc; | |
16 | + int font_common_height; | |
17 | + int font_common_width; | |
18 | + int height; | |
19 | + int width; | |
20 | + int valid; | |
21 | + int active; | |
22 | + int updateall; | |
23 | + RECT rc_current_time; | |
24 | + RECT rc_tempo; | |
25 | + RECT rc_master_volume; // マスターボリューム | |
26 | + RECT rc_maxvoices; | |
26 | 27 | |
27 | 28 | RECT rc_head; |
28 | 29 | RECT rc_all_channels; // すべてのチャンネル |
@@ -90,6 +91,7 @@ typedef struct w32g_tracer_wnd_t_ { | ||
90 | 91 | |
91 | 92 | extern void TracerWndReset(void); |
92 | 93 | extern void TracerWndClear(int lockflag); |
94 | +extern void TracerWndRecalcLayout(int lockflag); | |
93 | 95 | extern void TracerWndPaintAll(int lockflag); |
94 | 96 | extern void TracerWndPaintDo(int flag); |
95 | 97 | extern w32g_tracer_wnd_t w32g_tracer_wnd; |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* |
2 | 2 | TiMidity++ -- MIDI to WAVE converter and player |
3 | - Copyright (C) 1999-2018 Masanao Izumo <iz@onicos.co.jp> | |
3 | + Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp> | |
4 | 4 | Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi> |
5 | 5 | |
6 | 6 | This program is free software; you can redistribute it and/or modify |
@@ -45,8 +45,6 @@ | ||
45 | 45 | |
46 | 46 | extern char *timidity_window_inifile; |
47 | 47 | |
48 | -#define DEFAULT_CANVAS_MODE CANVAS_MODE_MAP32 | |
49 | - | |
50 | 48 | // **************************************************************************** |
51 | 49 | // DlgChooseFont |
52 | 50 | // hwnd: Owner Window of This Dialog |
@@ -54,118 +52,116 @@ extern char *timidity_window_inifile; | ||
54 | 52 | // hFontPre: Previous Font of hwndFontChange (Call CloseHandle()) |
55 | 53 | int DlgChooseFontAndApply(HWND hwnd, HWND hwndFontChange, HFONT hFontPre, char *fontname, int *fontheight, int *fontwidth) |
56 | 54 | { |
57 | - LOGFONTA lf; | |
58 | - CHOOSEFONTA cf; | |
59 | - HFONT hFont; | |
60 | - ZeroMemory(&lf, sizeof(LOGFONTA)); | |
61 | - ZeroMemory(&cf, sizeof(CHOOSEFONTA)); | |
55 | + LOGFONT lf; | |
56 | + CHOOSEFONT cf; | |
57 | + HFONT hFont; | |
58 | + memset(&lf,0,sizeof(LOGFONT)); | |
59 | + memset(&cf,0,sizeof(CHOOSEFONT)); | |
62 | 60 | |
63 | -// lf.lfHeight = 16; | |
64 | -// lf.lfWidth = 8; | |
65 | - strcpy(lf.lfFaceName, "MS 明朝"); | |
66 | - cf.lStructSize = sizeof(CHOOSEFONTA); | |
61 | +// lf.lfHeight = 16; | |
62 | +// lf.lfWidth = 8; | |
63 | + strcpy(lf.lfFaceName,"MS 明朝"); | |
64 | + cf.lStructSize = sizeof(CHOOSEFONT); | |
67 | 65 | cf.hwndOwner = hwnd; |
68 | -// cf.hDC = NULL; | |
66 | +// cf.hDC = NULL; | |
69 | 67 | cf.lpLogFont = &lf; |
70 | -// cf.iPointSize = 16; | |
71 | -// cf.Flags = CF_ANSIONLY | CF_FORCEFONTEXIST; | |
72 | - cf.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT; | |
73 | -// cf.rgbColors = RGB(0, 0, 0); | |
74 | -// cf.lCustData = NULL; | |
75 | -// cf.lpfnHook = NULL; | |
76 | -// cf.lpTemplateName = NULL; | |
77 | -// cf.hInstance = 0; | |
78 | -// cf.lpszStyle = NULL; | |
68 | +// cf.iPointSize = 16; | |
69 | +// cf.Flags = CF_ANSIONLY | CF_FORCEFONTEXIST ; | |
70 | + cf.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT;; | |
71 | +// cf.rgbColors = RGB(0,0,0); | |
72 | +// cf.lCustData = NULL; | |
73 | +// cf.lpfnHook = NULL; | |
74 | +// cf.lpTemplateName = NULL; | |
75 | +// cf.hInstance = 0; | |
76 | +// cf.lpszStyle = NULL; | |
79 | 77 | cf.nFontType = SCREEN_FONTTYPE; |
80 | -// cf.nSizeMin = 4; | |
81 | -// cf.nSizeMax = 72; | |
82 | - ChooseFontA(&cf); | |
83 | - | |
84 | -// if (ChooseFontA(&cf) == TRUE) | |
85 | -// return -1; | |
86 | - if (hFontPre != NULL) | |
87 | - CloseHandle(hFontPre); | |
88 | - hFont = CreateFontIndirectA(&lf); | |
89 | - SendMessage(hwndFontChange, WM_SETFONT, (WPARAM) hFont, MAKELPARAM(TRUE,0)); | |
90 | - if (fontname != NULL) strcpy(fontname, lf.lfFaceName); | |
91 | - if (fontname != NULL) fontname[LF_FACESIZE - 1] = 0; | |
92 | - if (fontheight != NULL) *fontheight = lf.lfHeight; | |
93 | - if (fontwidth != NULL) *fontwidth = lf.lfWidth; | |
94 | - return 0; | |
78 | +// cf.nSizeMin = 4; | |
79 | +// cf.nSizeMax = 72; | |
80 | + ChooseFont(&cf); | |
81 | + | |
82 | +// if(ChooseFont(&cf)==TRUE) | |
83 | +// return -1; | |
84 | + if(hFontPre!=NULL) | |
85 | + CloseHandle(hFontPre); | |
86 | + hFont = CreateFontIndirect(&lf); | |
87 | + SendMessage(hwndFontChange,WM_SETFONT,(WPARAM)hFont,(LPARAM)MAKELPARAM(TRUE,0)); | |
88 | + if(fontname!=NULL) strcpy(fontname,lf.lfFaceName); | |
89 | + if(fontheight!=NULL) *fontheight = lf.lfHeight; | |
90 | + if(fontwidth!=NULL) *fontwidth = lf.lfWidth; | |
91 | + return 0; | |
95 | 92 | } |
96 | 93 | |
97 | 94 | int DlgChooseFont(HWND hwnd, char *fontName, int *fontHeight, int *fontWidth) |
98 | 95 | { |
99 | - LOGFONTA lf; | |
100 | - CHOOSEFONTA cf; | |
96 | + LOGFONT lf; | |
97 | + CHOOSEFONT cf; | |
101 | 98 | |
102 | - ZeroMemory(&lf, sizeof(LOGFONTA)); | |
103 | - if (fontHeight) lf.lfHeight = *fontHeight; | |
104 | - if (fontWidth) lf.lfWidth = *fontWidth; | |
105 | - if (fontName) strcpy(lf.lfFaceName, fontName); | |
99 | + memset(&lf,0,sizeof(LOGFONT)); | |
100 | + if(fontHeight!=NULL) lf.lfHeight = *fontHeight; | |
101 | + if(fontWidth!=NULL) lf.lfWidth = *fontWidth; | |
102 | + if(fontName!=NULL) strcpy(lf.lfFaceName,fontName); | |
106 | 103 | |
107 | - ZeroMemory(&cf, sizeof(CHOOSEFONTA)); | |
108 | - cf.lStructSize = sizeof(CHOOSEFONTA); | |
104 | + memset(&cf,0,sizeof(CHOOSEFONT)); | |
105 | + cf.lStructSize = sizeof(CHOOSEFONT); | |
109 | 106 | cf.hwndOwner = hwnd; |
110 | -// cf.hDC = NULL; | |
107 | +// cf.hDC = NULL; | |
111 | 108 | cf.lpLogFont = &lf; |
112 | -// cf.iPointSize = 16; | |
113 | -// cf.Flags = CF_ANSIONLY | CF_FORCEFONTEXIST; | |
109 | +// cf.iPointSize = 16; | |
110 | +// cf.Flags = CF_ANSIONLY | CF_FORCEFONTEXIST ; | |
114 | 111 | cf.Flags = CF_ANSIONLY | CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT; |
115 | -// cf.rgbColors = RGB(0,0,0); | |
116 | -// cf.lCustData = NULL; | |
117 | -// cf.lpfnHook = NULL; | |
118 | -// cf.lpTemplateName = NULL; | |
119 | -// cf.hInstance = 0; | |
120 | -// cf.lpszStyle = NULL; | |
112 | +// cf.rgbColors = RGB(0,0,0); | |
113 | +// cf.lCustData = NULL; | |
114 | +// cf.lpfnHook = NULL; | |
115 | +// cf.lpTemplateName = NULL; | |
116 | +// cf.hInstance = 0; | |
117 | +// cf.lpszStyle = NULL; | |
121 | 118 | cf.nFontType = SCREEN_FONTTYPE; |
122 | -// cf.nSizeMin = 4; | |
123 | -// cf.nSizeMax = 72; | |
124 | - if (ChooseFontA(&cf) != TRUE) | |
125 | - return -1; | |
119 | +// cf.nSizeMin = 4; | |
120 | +// cf.nSizeMax = 72; | |
121 | + if(ChooseFont(&cf)!=TRUE) | |
122 | + return -1; | |
126 | 123 | |
127 | - if (fontName != NULL) strcpy(fontName, lf.lfFaceName); | |
128 | - if (fontName != NULL) fontName[LF_FACESIZE - 1] = 0; | |
129 | - if (fontHeight != NULL) *fontHeight = abs(lf.lfHeight); | |
130 | - if (fontWidth != NULL) *fontWidth = lf.lfWidth; | |
131 | - return 0; | |
124 | + if(fontName!=NULL) strcpy(fontName,lf.lfFaceName); | |
125 | + if(fontHeight!=NULL) *fontHeight = abs(lf.lfHeight); | |
126 | + if(fontWidth!=NULL) *fontWidth = lf.lfWidth; | |
127 | + return 0; | |
132 | 128 | } |
133 | 129 | |
134 | 130 | /**********************************************************************/ |
135 | -void SetWindowPosSize(HWND parent_hwnd, HWND hwnd, int x, int y) | |
136 | -{ | |
137 | - RECT rc1, rc2; | |
138 | - int width1, height1; | |
139 | - int width2, height2; | |
140 | - if (GetWindowRect(hwnd, &rc1)) { | |
141 | - width1 = rc1.right - rc1.left; | |
142 | - height1 = rc1.bottom - rc1.top; | |
143 | - if (x >= 0) { | |
144 | - rc1.right = rc1.right - rc1.left + x; | |
145 | - rc1.left = x; | |
146 | - } else { | |
147 | -// rc1.right = rc1.right - rc1.left; | |
148 | -// rc1.left = 0; | |
149 | - } | |
150 | - if (y >= 0) { | |
151 | - rc1.bottom = rc1.bottom - rc1.top + y; | |
152 | - rc1.top = y; | |
153 | - } else { | |
154 | -// rc1.bottom = rc1.bottom - rc1.top; | |
155 | -// rc1.top = 0; | |
156 | - } | |
157 | - if (GetClientRect(parent_hwnd, &rc2)) { | |
158 | - width2 = rc2.right - rc2.left; | |
159 | - height2 = rc2.bottom - rc2.top; | |
160 | - if (rc1.left < rc2.left) rc1.left = rc2.left; | |
161 | - if (rc1.left > rc2.right) rc1.left = rc2.right; | |
162 | - if (rc1.top < rc2.top) rc1.top = rc2.top; | |
163 | - if (rc1.top > rc2.bottom) rc1.top = rc2.bottom; | |
164 | - if (width1 > width2) width1 = width2; | |
165 | - if (height1 > height2) height1 = height2; | |
166 | - MoveWindow(hwnd, rc1.left, rc1.top, width1, height1, TRUE); | |
167 | - } | |
168 | - } | |
131 | +void SetWindowPosSize ( HWND parent_hwnd, HWND hwnd, int x, int y ) | |
132 | +{ | |
133 | + RECT rc1, rc2; | |
134 | + int width1, height1; | |
135 | + int width2, height2; | |
136 | + if ( GetWindowRect ( hwnd, &rc1 ) ) { | |
137 | + width1 = rc1.right - rc1.left; | |
138 | + height1 = rc1.bottom - rc1.top; | |
139 | + if ( x >= 0 ) { | |
140 | + rc1.right = rc1.right - rc1.left + x; | |
141 | + rc1.left = x; | |
142 | + } else { | |
143 | +// rc1.right = rc1.right - rc1.left; | |
144 | +// rc1.left = 0; | |
145 | + } | |
146 | + if ( y >= 0 ) { | |
147 | + rc1.bottom = rc1.bottom - rc1.top + y; | |
148 | + rc1.top = y; | |
149 | + } else { | |
150 | +// rc1.bottom = rc1.bottom - rc1.top; | |
151 | +// rc1.top = 0; | |
152 | + } | |
153 | + if ( GetClientRect ( parent_hwnd, &rc2 ) ) { | |
154 | + width2 = rc2.right - rc2.left; | |
155 | + height2 = rc2.bottom - rc2.top; | |
156 | + if ( rc1.left < rc2.left ) rc1.left = rc2.left; | |
157 | + if ( rc1.left > rc2.right ) rc1.left = rc2.right; | |
158 | + if ( rc1.top < rc2.top ) rc1.top = rc2.top; | |
159 | + if ( rc1.top > rc2.bottom ) rc1.top = rc2.bottom; | |
160 | + if ( width1 > width2 ) width1 = width2; | |
161 | + if ( height1 > height2 ) height1 = height2; | |
162 | + MoveWindow ( hwnd, rc1.left, rc1.top, width1, height1, TRUE ); | |
163 | + } | |
164 | + } | |
169 | 165 | } |
170 | 166 | |
171 | 167 | /**********************************************************************/ |
@@ -174,300 +170,299 @@ BOOL PosSizeSave = TRUE; | ||
174 | 170 | #define SEC_MAINWND "MainWnd" |
175 | 171 | int INISaveMainWnd(void) |
176 | 172 | { |
177 | - char *section = SEC_MAINWND; | |
178 | - char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
179 | - char buffer[256]; | |
180 | - if ( PosSizeSave ) { | |
181 | - sprintf(buffer,"%d",MainWndInfo.PosX); | |
182 | - if ( MainWndInfo.PosX >= 0 || MainWndInfo.PosY >= 0 ) { | |
183 | - if ( MainWndInfo.PosX < 0 ) | |
184 | - MainWndInfo.PosX = 0; | |
185 | - if ( MainWndInfo.PosY < 0 ) | |
186 | - MainWndInfo.PosY = 0; | |
187 | - } | |
188 | - if ( MainWndInfo.PosX >= 0 ) | |
189 | - WritePrivateProfileStringA(section,"PosX",buffer,inifile); | |
190 | - sprintf(buffer,"%d",MainWndInfo.PosY); | |
191 | - if ( MainWndInfo.PosY >= 0 ) | |
192 | - WritePrivateProfileStringA(section,"PosY",buffer,inifile); | |
193 | - sprintf(buffer,"%d",MainWndInfo.Width); | |
194 | - WritePrivateProfileStringA(section,"Width",buffer,inifile); | |
195 | - sprintf(buffer,"%d",MainWndInfo.Height); | |
196 | - WritePrivateProfileStringA(section,"Height",buffer,inifile); | |
197 | - } | |
198 | - sprintf(buffer,"%d",MainWndInfo.CanvasMode); | |
199 | - WritePrivateProfileStringA(section,"CanvasMode",buffer,inifile); | |
200 | - WritePrivateProfileStringA(NULL,NULL,NULL,inifile); // Write Flush | |
201 | - return 0; | |
173 | + char *section = SEC_MAINWND; | |
174 | + char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
175 | + char buffer[256]; | |
176 | + if ( PosSizeSave ) { | |
177 | + sprintf(buffer,"%d",MainWndInfo.PosX); | |
178 | + if ( MainWndInfo.PosX >= 0 || MainWndInfo.PosY >= 0 ) { | |
179 | + if ( MainWndInfo.PosX < 0 ) | |
180 | + MainWndInfo.PosX = 0; | |
181 | + if ( MainWndInfo.PosY < 0 ) | |
182 | + MainWndInfo.PosY = 0; | |
183 | + } | |
184 | + if ( MainWndInfo.PosX >= 0 ) | |
185 | + WritePrivateProfileString(section,"PosX",buffer,inifile); | |
186 | + sprintf(buffer,"%d",MainWndInfo.PosY); | |
187 | + if ( MainWndInfo.PosY >= 0 ) | |
188 | + WritePrivateProfileString(section,"PosY",buffer,inifile); | |
189 | + sprintf(buffer,"%d",MainWndInfo.Width); | |
190 | + WritePrivateProfileString(section,"Width",buffer,inifile); | |
191 | + sprintf(buffer,"%d",MainWndInfo.Height); | |
192 | + WritePrivateProfileString(section,"Height",buffer,inifile); | |
193 | + } | |
194 | + sprintf(buffer,"%d",MainWndInfo.CanvasMode); | |
195 | + WritePrivateProfileString(section,"CanvasMode",buffer,inifile); | |
196 | + WritePrivateProfileString(NULL,NULL,NULL,inifile); // Write Flush | |
197 | + return 0; | |
202 | 198 | } |
203 | 199 | |
204 | 200 | int INILoadMainWnd(void) |
205 | 201 | { |
206 | - char *section = SEC_MAINWND; | |
207 | - char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
208 | - int num; | |
209 | - num = GetPrivateProfileInt(section,"PosX",-1,inifile); | |
210 | - MainWndInfo.PosX = num; | |
211 | - num = GetPrivateProfileInt(section,"PosY",-1,inifile); | |
212 | - MainWndInfo.PosY = num; | |
213 | - num = GetPrivateProfileInt(section,"Width",-1,inifile); | |
214 | - MainWndInfo.Width = num; | |
215 | - num = GetPrivateProfileInt(section,"Height",-1,inifile); | |
216 | - MainWndInfo.Height = num; | |
217 | - num = GetPrivateProfileInt(section,"CanvasMode",-1,inifile); | |
218 | - if (num == -1) num = DEFAULT_CANVAS_MODE; | |
219 | - MainWndInfo.CanvasMode = num; | |
220 | - return 0; | |
202 | + char *section = SEC_MAINWND; | |
203 | + char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
204 | + int num; | |
205 | + num = GetPrivateProfileInt(section,"PosX",-1,inifile); | |
206 | + MainWndInfo.PosX = num; | |
207 | + num = GetPrivateProfileInt(section,"PosY",-1,inifile); | |
208 | + MainWndInfo.PosY = num; | |
209 | + num = GetPrivateProfileInt(section,"Width",-1,inifile); | |
210 | + MainWndInfo.Width = num; | |
211 | + num = GetPrivateProfileInt(section,"Height",-1,inifile); | |
212 | + MainWndInfo.Height = num; | |
213 | + num = GetPrivateProfileInt(section,"CanvasMode",-1,inifile); | |
214 | + MainWndInfo.CanvasMode = num; | |
215 | + return 0; | |
221 | 216 | } |
222 | 217 | |
223 | 218 | #define SEC_LISTWND "ListWnd" |
224 | 219 | int INISaveListWnd(void) |
225 | 220 | { |
226 | - char *section = SEC_LISTWND; | |
227 | - char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
228 | - char buffer[256]; | |
229 | - int i; | |
230 | - char key[30] = ""; | |
231 | - | |
232 | - if ( PosSizeSave ) { | |
233 | - if ( ListWndInfo.PosX >= 0 || ListWndInfo.PosY >= 0 ) { | |
234 | - if ( ListWndInfo.PosX < 0 ) | |
235 | - ListWndInfo.PosX = 0; | |
236 | - if ( ListWndInfo.PosY < 0 ) | |
237 | - ListWndInfo.PosY = 0; | |
238 | - } | |
239 | - sprintf(buffer,"%d",ListWndInfo.PosX); | |
240 | - if ( ListWndInfo.PosX >= 0 ) | |
241 | - WritePrivateProfileStringA(section,"PosX",buffer,inifile); | |
242 | - sprintf(buffer,"%d",ListWndInfo.PosY); | |
243 | - if ( ListWndInfo.PosY >= 0 ) | |
244 | - WritePrivateProfileStringA(section,"PosY",buffer,inifile); | |
245 | - sprintf(buffer,"%d",ListWndInfo.Width); | |
246 | - WritePrivateProfileStringA(section,"Width",buffer,inifile); | |
247 | - sprintf(buffer,"%d",ListWndInfo.Height); | |
248 | - WritePrivateProfileStringA(section,"Height",buffer,inifile); | |
249 | - } | |
250 | - WritePrivateProfileStringA(section,"fontNameEN",ListWndInfo.fontNameEN,inifile); | |
251 | - WritePrivateProfileStringA(section,"fontNameJA",ListWndInfo.fontNameJA,inifile); | |
252 | - sprintf(buffer,"%d",ListWndInfo.fontWidth); | |
253 | - WritePrivateProfileStringA(section,"fontWidth",buffer,inifile); | |
254 | - sprintf(buffer,"%d",ListWndInfo.fontHeight); | |
255 | - WritePrivateProfileStringA(section,"fontHeight",buffer,inifile); | |
256 | - sprintf(buffer,"%d",ListWndInfo.fontFlags); | |
257 | - WritePrivateProfileStringA(section,"fontFlags",buffer,inifile); | |
258 | - // ListName | |
259 | - for (i = 0; i < playlist_max; i++) { | |
260 | - snprintf(key, sizeof(key), "ListName%d", i); | |
261 | - WritePrivateProfileStringA(section,key,ListWndInfo.ListName[i],inifile); | |
262 | - } | |
263 | - // columWidth | |
264 | - for (i = 0; i < LISTWND_COLUM; i++) { | |
265 | - snprintf(key, sizeof(key), "ColumWidth%d", i); | |
266 | - sprintf(buffer,"%d",ListWndInfo.columWidth[i]); | |
267 | - WritePrivateProfileStringA(section,key,buffer,inifile); | |
268 | - } | |
269 | - // | |
270 | - WritePrivateProfileStringA(NULL,NULL,NULL,inifile); // Write Flush | |
271 | - return 0; | |
221 | + char *section = SEC_LISTWND; | |
222 | + char *inifile = TIMIDITY_WINDOW_INI_FILE; | |
223 | + char buffer[256]; | |
224 | + int i; | |
225 | + char key[30] = ""; | |
226 | + | |
227 | + if ( PosSizeSave ) { | |
228 | + if ( ListWndInfo.PosX >= 0 || ListWndInfo.PosY >= 0 ) { | |
229 | + if ( ListWndInfo.PosX < 0 ) | |
230 | + ListWndInfo.PosX = 0; | |
231 | + if ( ListWndInfo.PosY < 0 ) | |
232 | + ListWndInfo.PosY = 0; | |
233 | + } | |
234 | + sprintf(buffer,"%d",ListWndInfo.PosX); | |
235 | + if ( ListWndInfo.PosX >= 0 ) | |
236 | + WritePrivateProfileString(section,"PosX",buffer,inifile); | |
237 | + sprintf(buffer,"%d",ListWndInfo.PosY); | |
238 | + if ( ListWndInfo.PosY >= 0 ) | |
239 | + WritePrivateProfileString(section,"PosY",buffer,inifile); | |
240 | + sprintf(buffer,"%d",ListWndInfo.Width); | |
241 | + WritePrivateProfileString(section,"Width",buffer,inifile); | |
242 | + sprintf(buffer,"%d",ListWndInfo.Height); | |
243 | + WritePrivateProfileString(section,"Height",buffer,inifile); | |
244 | + } | |
245 | + WritePrivateProfileString(section,"fontNameEN",ListWndInfo.fontNameEN,inifile); | |
246 | + WritePrivateProfileString(section,"fontNameJA",ListWndInfo.fontNameJA,inifile); | |
247 | + sprintf(buffer,"%d",ListWndInfo.fontWidth); | |
248 | + WritePrivateProfileString(section,"fontWidth",buffer,inifile); | |
249 | + sprintf(buffer,"%d",ListWndInfo.fontHeight); | |
250 | + WritePrivateProfileString(section,"fontHeight",buffer,inifile); | |
251 | + sprintf(buffer,"%d",ListWndInfo.fontFlags); | |
252 | + WritePrivate |
Part of diff was cut off due to size limit. Use your local client to view the full diff.