Exemple #1
0
/**
 * ユーザーが OK のボタン (IDOK ID がのボタン) をクリックすると呼び出されます
 */
void SndOptMixerPage::OnOK()
{
	bool bUpdated = false;

	const UINT8 cFM = static_cast<UINT8>(m_fm.GetPos());
	if (np2cfg.vol_fm != cFM)
	{
		np2cfg.vol_fm = cFM;
		opngen_setvol(cFM);
		bUpdated = true;
	}

	const UINT8 cPSG = static_cast<UINT8>(m_psg.GetPos());
	if (np2cfg.vol_ssg != cPSG)
	{
		np2cfg.vol_ssg = cPSG;
		psggen_setvol(cPSG);
		bUpdated = true;
	}

	const UINT8 cADPCM = static_cast<UINT8>(m_adpcm.GetPos());
	if (np2cfg.vol_adpcm != cADPCM)
	{
		np2cfg.vol_adpcm = cADPCM;
		adpcm_setvol(cADPCM);
		for (UINT i = 0; i < _countof(g_opna); i++)
		{
			adpcm_update(&g_opna[i].adpcm);
		}
		bUpdated = true;
	}

	const UINT8 cPCM = static_cast<UINT8>(m_pcm.GetPos());
	if (np2cfg.vol_pcm != cPCM)
	{
		np2cfg.vol_pcm = cPCM;
		pcm86gen_setvol(cPCM);
		pcm86gen_update();
		bUpdated = true;
	}

	const UINT8 cRhythm = static_cast<UINT8>(m_rhythm.GetPos());
	if (np2cfg.vol_rhythm != cRhythm)
	{
		np2cfg.vol_rhythm = cRhythm;
		rhythm_setvol(cRhythm);
		for (UINT i = 0; i < _countof(g_opna); i++)
		{
			rhythm_update(&g_opna[i].rhythm);
		}
		bUpdated = true;
	}

	if (bUpdated)
	{
		::sysmng_update(SYS_UPDATECFG);
	}
}
Exemple #2
0
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);
}
Exemple #3
0
static void changeSoundOpt(void) {
    SINT32	val;
	UInt8	update;
	int		renewal;
    short	i,j;
    
    renewal = 0;
    for (j=0;j<5;j++) {
        val = getControlValue('vMix', j);
        if (val != *cfg[j]) {
            *cfg[j] = val;
            renewal = 1;
        }
    }
    if (renewal) {
        sysmng_update(SYS_UPDATECFG);
    }
    opngen_setvol(np2cfg.vol_fm);
    psggen_setvol(np2cfg.vol_ssg);
    rhythm_setvol(np2cfg.vol_rhythm);
    rhythm_update(&g_rhythm);
    adpcm_setvol(np2cfg.vol_adpcm);
    adpcm_update(&g_adpcm);
    pcm86gen_setvol(np2cfg.vol_pcm);
    pcm86gen_update();

    renewal = 0;
    for (i=0;i<6;i++) {
        val = getControlValue('vMix',i+10);
        if (val != np2cfg.vol14[i]) {
            np2cfg.vol14[i] = val;
            renewal = 1;
        }
    }
    if (renewal) {
        sysmng_update(SYS_UPDATECFG);
        tms3631_setvol(np2cfg.vol14);
    }

    if (np2cfg.snd26opt != snd26) {
        np2cfg.snd26opt = snd26;
        sysmng_update(SYS_UPDATECFG);
    }
    if (np2cfg.snd86opt != snd86) {
        np2cfg.snd86opt = snd86;
        sysmng_update(SYS_UPDATECFG);
    }

    update = 0;
    if (np2cfg.spbopt != spb) {
        np2cfg.spbopt = spb;
        update |= SYS_UPDATECFG;
    }
    if (np2cfg.spb_vrc != spbvrc) {
        np2cfg.spb_vrc = spbvrc;
        update |= SYS_UPDATECFG;
    }
    val = getControlValue('splv', 0);
    if (np2cfg.spb_vrl != val) {
        np2cfg.spb_vrl = val;
        update |= SYS_UPDATECFG;
    }
    opngen_setVR(np2cfg.spb_vrc, np2cfg.spb_vrl);
    val = getControlValue('sprv', 0);
    if (np2cfg.spb_x != val) {
        np2cfg.spb_x = val;
        update |= SYS_UPDATECFG;
    }
    sysmng_update(update);
    changeJoyPadSetup();                
}