Пример #1
0
//****************************************************************************
//---------------------------------------------------------------------------
void action_ButtonPressed3(void)
{
	STM_EVAL_LEDOn(LED_Blue);

	switch (param)
	{
	case 0 : 	pitchGenRequestChangePoints(); 	break ;
	case 1 :  	toggleChorus();	break;
	case 2 : 	incMaxFreq(); 	break;
	case 3 : 	incTempo();		break;
	case 4 : 	doubleTempo();	break;
	case 5 : 	toggleGlide();	break;
	case 6 : 	nextSound();	break;
	case 7 : 	incDecay();		break;
	case 8 : 	muteSomeNotes();break; // toggle function !
	case 9 :	nextScale();	break;
	case 10 : 	incVol();		break;
	case 11 : 	incSynthOut();	break;
	case 12 :	transpUp();		break;
	case 13 :	AdditiveGen_newWaveform();	break;
	case 14 :	inc_delayfeedback(); 		break;
	case 15 :	inc_delayTime(); 			break;
	case 16 :	inc_chorusFeedback();		break;
	case 17 :	inc_chorusRate();			break;
	case 18 :	inc_chorusDelay();			break;
	case 19 :	inc_chorusSweep();			break;
	case 20 : 	toggleChorusMode();			break;
	case 21: 	toggleVibrato();			break;
	}
}
Пример #2
0
//--------------------------------------------------------------------------------------
// Name: BasicSound::CreateDeviceIndependentResources
// Desc: Common sample set up
//--------------------------------------------------------------------------------------
void BasicSound::CreateDeviceIndependentResources()
{
    DirectXBase::CreateDeviceIndependentResources();

    //
    // Read the sound files and add them to the XAudio2 sound player, if we have sound.
    //
    if (m_soundPlayer == nullptr)
    {
        // We have no sound devices
        return;
    }
    for (size_t index = 0; SOUND_FILE_LIST[index]; ++index)
    {
        try
        {
            SoundFileReader nextSound(ref new Platform::String(SOUND_FILE_LIST[index]));
            (void)m_soundPlayer->AddSound(nextSound.GetSoundFormat(), nextSound.GetSoundData());
        }
        catch (Platform::FailureException^)
        {
            // If we have a failure, don't play that file, not worth stopping the whole sample
        }
    }

    // We should have at least one sound to play
    if (m_soundPlayer->GetSoundCount() == 0)
    {
        throw ref new Platform::FailureException();
    }
}