예제 #1
0
static int wrap_setPitchShift(lua_State* L) {
  lua_settop(L, 2);
  OutputStream* self = luaAudiere_checkOutputStream(L, 1);
  float shift = float(luaL_checknumber(L, 2));
  self->setPitchShift(shift);
  return 0;
}
예제 #2
0
void D3DCore_Impl::Channel_SetPitch(HCHANNEL chn, float pitch)
{
	if(!m_pADevice) return;

	OutputStream* OStream = (OutputStream*)chn;
	for( Channel* I = channels; I != NULL; I = I->next )
	{
		if( I->Handler == chn )
		{			
			OStream->setPitchShift( pitch );
			return;
		}
	}

	//Recorrer los stream
	for( CStreamList* I = streams; I != NULL; I = I->next )
	{
		if( I->hstream == chn )
		{			
			OStream->setPitchShift( pitch );
			return;
		}
	}
}
예제 #3
0
void D3DCore_Impl::Channel_Slide_Update( float dt )
{
	Slide *I =  slides, *Prev =  0;
	while( I != NULL )
	{
		OutputStream* OStream = (*I).chn;
		(*I).time -= dt;

		float NewVolume = OStream->getVolume() + ((*I).dVolume * dt);
		float NewPan = OStream->getPan() + ((*I).dPan * dt);
		float NewPitch = OStream->getPitchShift() + ((*I).dPitch * dt);

		OStream->setVolume( NewVolume );
		OStream->setPan( NewPan );
		OStream->setPitchShift( NewPitch );

		if( (*I).time <= 0.0f )
		{
			if(Prev)
			{
				Prev->next=I->next;
				delete I;
				I = Prev->next;
			}
			else
			{
				slides=I->next;
				delete I;
				I = slides;
			}			
		}
		else
		{
			Prev = I;
			I = I->next;
		}
	}
}
예제 #4
0
HCHANNEL D3DCore_Impl::Effect_PlayEx(HEFFECT eff, int volume, int pan, float pitch, bool loop)
{
	if(m_pADevice && eff != 0)
	{
		SampleSource* SSource = (SampleSource*)eff;
		OutputStream* OStream = OpenSound( m_pADevice, SSource, false );
		OStream->setVolume( m_VolFX * (volume/100.0f) );
		OStream->setPan( pan/100.0f );
		OStream->setPitchShift( pitch );
		OStream->setRepeat( loop );
		OStream->play();
		OStream->ref();
//		EffectChannelList.insert((HCHANNEL)OStream);

		Channel* chn = new Channel;
		chn->Handler = (HCHANNEL)OStream;
		chn->Type = CT_EFFECT;
		chn->next = channels;
		channels = chn;

		return (HCHANNEL)OStream;
	}
	else return 0;
}