/** * CWndProc オブジェクトの Windows プロシージャ (WindowProc) が用意されています * @param[in] nMsg 処理される Windows メッセージを指定します * @param[in] wParam メッセージの処理で使う付加情報を提供します。このパラメータの値はメッセージに依存します * @param[in] lParam メッセージの処理で使う付加情報を提供します。このパラメータの値はメッセージに依存します * @return メッセージに依存する値を返します */ LRESULT SndOptSpbPage::WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam) { switch (nMsg) { case WM_DRAWITEM: if (LOWORD(wParam) == IDC_SPBJMP) { UINT8* pBitmap = dipswbmp_getsndspb(m_spb, m_vr); m_dipsw.Draw((reinterpret_cast<LPDRAWITEMSTRUCT>(lParam))->hDC, pBitmap); _MFREE(pBitmap); } return FALSE; } return CDlgProc::WindowProc(nMsg, wParam, lParam); }
static void initSoundWindow(void) { PicHandle pict; ControlRef disp; BYTE data[5]; short i; for (i=0;i<5;i++) { data[i] = *(cfg[i]); } initMixer(data); init14(np2cfg.vol14); snd26 = np2cfg.snd26opt; uncheckAllPopupMenuItems('26io', 2, soundWin); uncheckAllPopupMenuItems('26in', 4, soundWin); uncheckAllPopupMenuItems('26rm', 5, soundWin); set26s(snd26, '26io', '26in', '26rm'); disp = getControlRefByID('BMP ', 0, soundWin); setbmp(dipswbmp_getsnd26(snd26), &pict); SetControlData(disp, kControlNoPart, kControlPictureHandleTag, sizeof(PicHandle), &pict); snd86 = np2cfg.snd86opt; uncheckAllPopupMenuItems('86io', 2, soundWin); uncheckAllPopupMenuItems('86in', 4, soundWin); uncheckAllPopupMenuItems('86id', 8, soundWin); set86s(); disp = getControlRefByID('BMP ', 1, soundWin); setbmp(dipswbmp_getsnd86(snd86), &pict); SetControlData(disp, kControlNoPart, kControlPictureHandleTag, sizeof(PicHandle), &pict); spb = np2cfg.spbopt; spbvrc = np2cfg.spb_vrc; // ver0.30 uncheckAllPopupMenuItems('spio', 2, soundWin); uncheckAllPopupMenuItems('spin', 4, soundWin); uncheckAllPopupMenuItems('sprm', 5, soundWin); setSPB(); setControlValue('splv', 0, np2cfg.spb_vrl); setControlValue('sprv', 0, np2cfg.spb_x); disp = getControlRefByID('BMP ', 2, soundWin); setbmp(dipswbmp_getsndspb(spb, spbvrc), &pict); SetControlData(disp, kControlNoPart, kControlPictureHandleTag, sizeof(PicHandle), &pict); initJoyPad(); }
static LRESULT CALLBACK SPBoptDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { UINT8 b; UINT update; switch(msg) { case WM_INITDIALOG: spbcreate(hWnd); return(TRUE); case WM_COMMAND: switch(LOWORD(wp)) { case IDC_SPBIO: setspbjmp(hWnd, getsnd26io(hWnd, IDC_SPBIO), 0x10); break; case IDC_SPBINT: setspbjmp(hWnd, getsnd26int(hWnd, IDC_SPBINT), 0xc0); break; case IDC_SPBROM: setspbjmp(hWnd, getsnd26rom(hWnd, IDC_SPBROM), 0x07); break; case IDC_SPBDEF: spb = 0xd1; setsnd26io(hWnd, IDC_SPBIO, spb); setsnd26int(hWnd, IDC_SPBINT, spb); setsnd26rom(hWnd, IDC_SPBROM, spb); spbvrc = 0; setspbVRch(hWnd); InvalidateRect(GetDlgItem(hWnd, IDC_SPBJMP), NULL, TRUE); break; case IDC_SPBVRL: case IDC_SPBVRR: b = getspbVRch(hWnd); if ((spbvrc ^ b) & 3) { spbvrc = b; InvalidateRect(GetDlgItem(hWnd, IDC_SPBJMP), NULL, TRUE); } break; case IDC_SPBJMP: spbcmdjmp(hWnd); break; } break; case WM_NOTIFY: if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { update = 0; if (np2cfg.spbopt != spb) { np2cfg.spbopt = spb; update |= SYS_UPDATECFG; } if (np2cfg.spb_vrc != spbvrc) { np2cfg.spb_vrc = spbvrc; update |= SYS_UPDATECFG; } b = (UINT8)SendDlgItemMessage(hWnd, IDC_SPBVRLEVEL, TBM_GETPOS, 0, 0); if (np2cfg.spb_vrl != b) { np2cfg.spb_vrl = b; update |= SYS_UPDATECFG; } opngen_setVR(np2cfg.spb_vrc, np2cfg.spb_vrl); b = (UINT8)GetDlgItemCheck(hWnd, IDC_SPBREVERSE); if (np2cfg.spb_x != b) { np2cfg.spb_x = b; update |= SYS_UPDATECFG; } sysmng_update(update); return(TRUE); } break; case WM_DRAWITEM: if (LOWORD(wp) == IDC_SPBJMP) { dlgs_drawbmp(((LPDRAWITEMSTRUCT)lp)->hDC, dipswbmp_getsndspb(spb, spbvrc)); } return(FALSE); } return(FALSE); }
static pascal OSStatus spbproc(EventHandlerCallRef myHandler, EventRef event, void* userData) { OSStatus err = eventNotHandledErr; HIPoint pos; Point p; BYTE bit, b; Rect ctrlbounds, winbounds; PicHandle pict; BOOL redraw = FALSE; if (GetEventClass(event)==kEventClassControl && GetEventKind(event)==kEventControlClick ) { err = noErr; GetEventParameter(event, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(HIPoint), NULL, &pos); GetControlBounds((ControlRef)userData, &ctrlbounds); GetWindowBounds(soundWin, kWindowContentRgn, &winbounds); p.h = (short)pos.x; p.v = (short)pos.y; p.h -= (ctrlbounds.left + winbounds.left); p.h /= 9; p.v -= (ctrlbounds.top + winbounds.top); p.v /= 9; if ((p.v < 1) || (p.v >= 3)) { return(err); } if ((p.h >= 2) && (p.h < 5)) { b = spb; bit = 0x40 << (2 - p.v); switch(p.h) { case 2: b |= bit; break; case 3: b ^= bit; break; case 4: b &= ~bit; break; } if (spb != b) { spb = b; set26s(b, 'spio', 'spin', 'sprm'); redraw = TRUE; } } else if (p.h == 7) { spb ^= 0x20; redraw = TRUE; } else if ((p.h >= 10) && (p.h < 12)) { b = (BYTE)((p.h - 10) << 4); if ((spb ^ b) & 0x10) { spb &= ~0x10; spb |= b; set26s(b, 'spio', 'spin', 'sprm'); redraw = TRUE; } } else if ((p.h >= 14) && (p.h < 19)) { b = (BYTE)(p.h - 14); if ((spb ^ b) & 7) { spb &= ~0x07; spb |= b; set26s(b, 'spio', 'spin', 'sprm'); redraw = TRUE; } } else if ((p.h >= 21) && (p.h < 24)) { spbvrc ^= (BYTE)(3 - p.v); setControlValue('spvl', 0, (spbvrc & 1)?1:0); setControlValue('spvr', 0, (spbvrc & 2)?1:0); redraw = TRUE; } if (redraw) { setbmp(dipswbmp_getsndspb(spb, spbvrc), &pict); SetControlData((ControlRef)userData, kControlNoPart, kControlPictureHandleTag, sizeof(PicHandle), &pict); Draw1Control((ControlRef)userData); } } (void)myHandler; (void)userData; return err; }