Exemple #1
0
void ToneFilter::init(float newFs){
  for(int n=0;n<3;n++){
    B[n]=0;
    A[n]=0;
    for(int m=0;m<2;m++){
      x[m][n]=0;
      y[m][n]=0;
    }
  }
  setTone(0.5);
  setFs(newFs);
}
Exemple #2
0
//------------------------------------------------------------------------------
//## Basic
TEST_F(Test_UI_UIElement, RenderEffects)
{
    //* [ ] UISprite はデフォルトで BlendMode=Alpha
	{
        auto tex1 = Assets::loadTexture(LN_ASSETFILE("Sprite1.png"));

        //* [ ] Visible
        auto sprite1 = newObject<UISprite>();
        sprite1->setTexture(tex1);
        sprite1->setPosition(0, 0, 0);
        sprite1->setVisible(false);

        //* [ ] BlendMode
        auto sprite2 = newObject<UISprite>();
        sprite2->setTexture(tex1);
        sprite2->setBlendMode(BlendMode::Add);
        sprite2->setPosition(32, 0, 0);

        //* [ ] Opacity
        auto sprite3 = newObject<UISprite>();
        sprite3->setTexture(tex1);
        sprite3->setPosition(64, 0, 0);
        sprite3->setOpacity(0.5);

        //* [ ] ColorScale
        auto sprite4 = newObject<UISprite>();
        sprite4->setTexture(tex1);
        sprite4->setPosition(96, 0, 0);
        sprite4->setColorScale(Color(1, 0, 0, 1));

        //* [ ] BlendColor
        auto sprite5 = newObject<UISprite>();
        sprite5->setTexture(tex1);
        sprite5->setPosition(0, 32, 0);
        sprite5->setBlendColor(Color(1, 0, 0, 1));

        //* [ ] Tone
        auto sprite6 = newObject<UISprite>();
        sprite6->setTexture(tex1);
        sprite6->setPosition(32, 32, 0);
        sprite6->setTone(ColorTone(0.5, 0.3, 0.1, 1.0));

        TestEnv::updateFrame();
        ASSERT_SCREEN(LN_ASSETFILE("Result/Test_UI_UIElement-RenderEffects-1.png"));
        LN_TEST_CLEAN_SCENE;
	}
}
//------------------------------------------------------------------------------
//## Basic
TEST_F(Test_Visual_VisualComponent, BuiltinEffects)
{
    // TODO: Builtin shader ごとに行う
	{
        auto tex1 = Assets::loadTexture(LN_ASSETFILE("Sprite1.png"));

        //* [ ] Hide
        auto sprite1 = Sprite::create(tex1, 3, 3);
        //sprite1->setShadingModel(ShadingModel::UnLighting);
        sprite1->setPosition(-6, 0, 0);
        sprite1->setVisible(false);

        //* [ ] Normal
        auto sprite2 = Sprite::create(tex1, 3, 3);
        //sprite2->setShadingModel(ShadingModel::UnLighting);
        sprite2->setPosition(-3, 0, 0);

        //* [ ] Opacity
        auto sprite3 = Sprite::create(tex1, 3, 3);
        //sprite3->setShadingModel(ShadingModel::UnLighting);
        sprite3->setPosition(-6, 3, 0);
        sprite3->setBlendMode(BlendMode::Alpha);
        sprite3->setOpacity(0.5);

        //* [ ] ColorScale
        auto sprite4 = Sprite::create(tex1, 3, 3);
        //sprite4->setShadingModel(ShadingModel::UnLighting);
        sprite4->setPosition(-3, 3, 0);
        sprite4->setColorScale(Color(1, 0, 0, 1));

        //* [ ] BlendColor
        auto sprite5 = Sprite::create(tex1, 3, 3);
        //sprite5->setShadingModel(ShadingModel::UnLighting);
        sprite5->setPosition(0, 3, 0);
        sprite5->setBlendColor(Color(1, 0, 0, 1));

        //* [ ] Tone
        auto sprite6 = Sprite::create(tex1, 3, 3);
        //sprite6->setShadingModel(ShadingModel::UnLighting);
        sprite6->setPosition(3, 3, 0);
        sprite6->setTone(ColorTone(0.5, 0.3, 0.1, 1.0));

        TestEnv::updateFrame();
        ASSERT_SCREEN(LN_ASSETFILE("Visual/Result/Test_Visual_VisualComponent-BuiltinEffects-1.png"));
        LN_TEST_CLEAN_SCENE;
	}
}
Exemple #4
0
Sound::Sound (int number, int tone)

{
	setNumber(number);
	setTone(tone);
		if (number == 1) {
		switch (tone) {
		case(0) :
			PlaySound(TEXT("Sounds/horse1a.wav"), NULL, SND_SYNC);
			break;
		case(1) :
			PlaySound(TEXT("Sounds/hen2.wav"), NULL, SND_SYNC);
			break;
		case(2) :
			PlaySound(TEXT("Sounds/crow1a.wav"), NULL, SND_SYNC);
			break;
		case(3) :
			PlaySound(TEXT("Sounds/lamb.wav"), NULL, SND_SYNC);
			break;
		default:
			break;
		}


	}
	else if (number == 2) {
		switch (tone) {
		case(0) :
			PlaySound(TEXT("Sounds\g (1).wav"), NULL, SND_SYNC);
			break;
		case(1) :
			PlaySound(TEXT("Sounds\g (2).wav"), NULL, SND_SYNC);
			break;
		case(2) :
			PlaySound(TEXT("Sounds\g (3).wav"), NULL, SND_SYNC);
			break;
		case(3) :
			PlaySound(TEXT("Sounds\g (4).wav"), NULL, SND_SYNC);
			break;
		default:
			break;
		}


	}
	else if (number == 3) {
Exemple #5
0
void YMVoice::handleCC(byte number, byte value)
{
  //Handle the Control Changes for YM2149
  switch (number) {  
    case 2:
      YM2149::setEnvelopeCONT(value);
      break;
    case 3:
      YM2149::setEnvelopeATT(value);
      break;
    case 4:
      YM2149::setEnvelopeALT(value);
      break;
    case 5:
      YM2149::setEnvelopeHOLD(value);
      break;    
    case 6:
      setNoise(value);
      break; 
    case 7:
      setTone(value);
      break;    
    case 8:
      setEnvelope(value);
      break; 
    case 71:
      setVolume(value/8);
      break;       
    case 74:
      YM2149::setNoiseFrequency(value);
      break;        
    case 75:
      YM2149::setEnvelopeFrequencyLo(value << 1);
      break;    
    case 76:
      YM2149::setEnvelopeFrequencyHi(value << 1);
      break;                 
    default:
      return;
      break;       
  }     
}