static LRESULT CALLBACK SndmixDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { int i; int ctrlid; switch (msg) { case WM_INITDIALOG: for (i=0; i<5; i++) { sliderinit(hWnd, &sndmixitem[i]); } return(TRUE); case WM_COMMAND: switch(LOWORD(wp)) { case IDC_SNDMIXDEF: for (i=0; i<5; i++) { slidersetvalue(hWnd, &sndmixitem[i], 64); } break; } break; case WM_HSCROLL: ctrlid = GetDlgCtrlID((HWND)lp); for (i=0; i<5; i++) { if (ctrlid == sndmixitem[i].res) { sliderresetpos(hWnd, &sndmixitem[i]); return(TRUE); } } break; case WM_NOTIFY: if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { for (i=0; i<5; i++) { if (sliderrestore(hWnd, &sndmixitem[i])) { sysmng_update(SYS_UPDATECFG); } } opngen_setvol(np2cfg.vol_fm); psggen_setvol(np2cfg.vol_ssg); rhythm_setvol(np2cfg.vol_rhythm); adpcm_setvol(np2cfg.vol_adpcm); pcm86gen_setvol(np2cfg.vol_pcm); pcm86gen_update(); for (i = 0; i < NELEMENTS(g_opna); i++) { rhythm_update(&g_opna[i].rhythm); adpcm_update(&g_opna[i].adpcm); } return(TRUE); } break; } return(FALSE); }
static LRESULT CALLBACK Snd14optDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { int i; int ctrlid; switch (msg) { case WM_INITDIALOG: for (i=0; i<6; i++) { sliderinit(hWnd, &snd14item[i]); } return(TRUE); case WM_HSCROLL: ctrlid = GetDlgCtrlID((HWND)lp); for (i=0; i<6; i++) { if (ctrlid == snd14item[i].res) { sliderresetpos(hWnd, &snd14item[i]); return(TRUE); } } break; case WM_NOTIFY: if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { for (i=0; i<6; i++) { if (sliderrestore(hWnd, &snd14item[i])) { sysmng_update(SYS_UPDATECFG); } } tms3631_setvol(np2cfg.vol14); return(TRUE); } break; } return(FALSE); }