HCHANNEL D3DCore_Impl::Stream_Play(HSTREAM stream, bool loop, int volume) { if(m_pADevice && stream != 0) { OutputStream* OStream = (OutputStream*)stream; OStream->setRepeat( loop ); OStream->setVolume( m_VolStream * (volume/100.0f) ); OStream->reset(); OStream->play(); // StreamChannelList.insert(stream); return stream; } else return 0; }
void D3DCore_Impl::Channel_Resume(HCHANNEL chn) { if(!m_pADevice) return; OutputStream* OStream = (OutputStream*)chn; for( Channel* I = channels; I != NULL; I = I->next ) { if( I->Handler == chn ) { OStream->play(); return; } } //Recorrer los stream for( CStreamList* I = streams; I != NULL; I = I->next ) { if( I->hstream == chn ) { OStream->play(); return; } } }
HCHANNEL D3DCore_Impl::Effect_Play(HEFFECT eff) { if(m_pADevice && eff != 0) { SampleSource* SSource = (SampleSource*)eff; OutputStream* OStream = OpenSound( m_pADevice, SSource, false ); OStream->setVolume( m_VolFX ); 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; }
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; }
static int wrap_play(lua_State* L) { lua_settop(L, 1); OutputStream* self = luaAudiere_checkOutputStream(L, 1); self->play(); return 0; }