public virtual void Close() { BitmapSourceProvider.Dispose(); if (Mpeg4Recorder != null) { Mpeg4Recorder.Dispose(); } Detector.MotionDetection -= Detector_MotionDetection; Detector.Dispose(); VadFilter.VoiceDetected -= VadFilterVoiceDetected; VadFilter.Dispose(); if (SoundTimer != null) { SoundTimer.Elapsed -= ElapsedVoice; SoundTimer.Stop(); SoundTimer.Dispose(); } if (MotionTimer != null) { MotionTimer.Elapsed -= ElapsedVoice; MotionTimer.Stop(); MotionTimer.Dispose(); } }
public override void Update(DwarfTime gameTime, ChunkManager chunks, Camera camera) { DamageTimer.Update(gameTime); CheckLavaTimer.Update(gameTime); SoundTimer.Update(gameTime); if (CheckLavaTimer.HasTriggered) { CheckForLavaAndWater(gameTime, chunks); } Heat *= 0.999f; if (Heat > Flashpoint) { if (DamageTimer.HasTriggered) { Health.Damage(Damage, Health.DamageType.Fire); } if (SoundTimer.HasTriggered) { SoundManager.PlaySound(ContentPaths.Audio.fire, LocParent.Position, true, 0.5f); } double totalSize = (LocParent.BoundingBox.Max - LocParent.BoundingBox.Min).Length(); int numFlames = (int)(totalSize / 4.0f) + 1; for (int i = 0; i < numFlames; i++) { Vector3 extents = (LocParent.BoundingBox.Max - LocParent.BoundingBox.Min); Vector3 randomPoint = LocParent.BoundingBox.Min + new Vector3(extents.X * MathFunctions.Rand(), extents.Y * MathFunctions.Rand(), extents.Z * MathFunctions.Rand()); PlayState.ParticleManager.Trigger("flame", randomPoint, Color.White, GetNumTrigger()); } } base.Update(gameTime, chunks, camera); }
private void StartingSound(BBTravelEnd gate) { if (gate != null) { Sound_Timer = new SoundTimer(gate); Sound_Timer.Start(); } }
private static void IdanVis_OnCommand(CommandEventArgs args) { TeiravonMobile m_Player = ( TeiravonMobile )args.Mobile; SoundTimer stimer = new SoundTimer(args.Mobile); stimer.Start(); }
override public void Update(DwarfTime gameTime, ChunkManager chunks, Camera camera) { if (!Active) { return; } var body = Parent as Body; System.Diagnostics.Debug.Assert(body != null); DamageTimer.Update(gameTime); CheckLavaTimer.Update(gameTime); SoundTimer.Update(gameTime); if (CheckLavaTimer.HasTriggered) { CheckForLavaAndWater(body, gameTime, chunks); } Heat *= 0.999f; if (Heat > Flashpoint) { UpdateRate = 1; if (DamageTimer.HasTriggered) { Health.Damage(Damage, Health.DamageType.Fire); } if (SoundTimer.HasTriggered) { SoundManager.PlaySound(ContentPaths.Audio.fire, body.Position, true, 1.0f); } double totalSize = (body.BoundingBox.Max - body.BoundingBox.Min).Length(); int numFlames = (int)(totalSize / 4.0f) + 1; for (int i = 0; i < numFlames; i++) { Vector3 extents = (body.BoundingBox.Max - body.BoundingBox.Min); Vector3 randomPoint = body.BoundingBox.Min + new Vector3(extents.X * MathFunctions.Rand(), extents.Y * MathFunctions.Rand(), extents.Z * MathFunctions.Rand()); Manager.World.ParticleManager.Trigger("flame", randomPoint, Color.White, GetNumTrigger(body)); } } }
public void UpdateValues() { lblPC.Text = string.Format("0x{0:X2}", PC); lblI.Text = string.Format("0x{0:X2}", I); lblOpCode.Text = string.Format("0x{0:X2}", OpCode); lblCycle.Text = Cycle.ToString(); lblSP.Text = SP.ToString(); lblSoundTimer.Text = SoundTimer.ToString(); lblDelayTimer.Text = DelayTimer.ToString(); lbStackList.Items.Clear(); foreach (short sItem in Stack) { lbStackList.Items.Add(string.Format("0x{0:X4}", sItem)); } for (int i = 0; i < Registers.Length; i++) { ((Label)gbRegistersGroupBox.Controls["lblRegister_" + i]).Text = string.Format("0x{0:X2}", Registers[i]); } }
protected override void ElapsedVoice(object sender, EventArgs eventArgs) { if (SoundTimer != null) { SoundTimer.Stop(); SoundTimer.Elapsed -= ElapsedVoice; SoundTimer.Dispose(); } Connector.Disconnect(_camera.AudioChannel, WaveStreamRecorder); WaveStreamRecorder.Stop(); WaveStreamRecorder.Dispose(); VadFilter.Enabled = true; IsSoundDetected = false; Log.Motion("Sound recording has stopped"); OnGetFilePath(new VoIPEventArgs <string>(SoundFilePath)); }
override public void Update(DwarfTime gameTime, ChunkManager chunks, Camera camera) { if (!Active) { return; } base.Update(gameTime, chunks, camera); var body = Parent as GameComponent; global::System.Diagnostics.Debug.Assert(body != null); DamageTimer.Update(gameTime); CheckLavaTimer.Update(gameTime); SoundTimer.Update(gameTime); if (CheckLavaTimer.HasTriggered) { CheckSurroundings(body, gameTime, chunks); } Heat *= 0.999f; if (Heat > Flashpoint) { if (DamageTimer.HasTriggered) { Health.Damage(Damage, Health.DamageType.Fire); } if (SoundTimer.HasTriggered) { SoundManager.PlaySound(ContentPaths.Audio.fire, body.Position, true, 1.0f); } double totalSize = (body.BoundingBox.Max - body.BoundingBox.Min).Length(); int numFlames = (int)(totalSize / 4.0f) + 1; for (int i = FlameSprites.Count; i < numFlames; i++) { CreateFlameSprite(MathFunctions.RandVector3Box(body.BoundingBox)); } if (MathFunctions.RandEvent(0.06f)) { foreach (var sprite in FlameSprites) { Manager.World.ParticleManager.Trigger("smoke", sprite.Position + Vector3.Up * 0.5f, Color.Black, 1); Manager.World.ParticleManager.Trigger("flame", sprite.Position + Vector3.Up * 0.5f, Color.Black, 1); } } if (MathFunctions.RandEvent(0.01f)) { foreach (var sprite in FlameSprites) { sprite.Die(); } FlameSprites.Clear(); } var mesh = Parent.GetComponent <InstanceMesh>(); if (mesh != null) { mesh.VertexColorTint = Color.DarkGray; } } else { foreach (var sprite in FlameSprites) { sprite.Die(); } FlameSprites.Clear(); } }
private static void ParticleTest_OnCommand( CommandEventArgs e ) { Mobile mob = e.Mobile; ParticleTest.mob = mob; SoundTimer timer = new SoundTimer(); timer.Start(); //CombatSystemAttachment.GetCSA( mob ).DoTrip( 3 ); /*Timer.DelayCall( TimeSpan.FromMilliseconds( 500*1 ), new TimerStateCallback( Callback ), "0x4A9" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*2 ), new TimerStateCallback( Callback ), "0x4A9" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*3 ), new TimerStateCallback( Callback ), "0x4AB" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*4 ), new TimerStateCallback( Callback ), "0x4AF" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*5 ), new TimerStateCallback( Callback ), "0x4AF" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*6 ), new TimerStateCallback( Callback ), "0x4AB" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*7 ), new TimerStateCallback( Callback ), "0x4A9" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*8 ), new TimerStateCallback( Callback ), "0x4A5" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*9 ), new TimerStateCallback( Callback ), "0x4A1" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*10 ), new TimerStateCallback( Callback ), "0x4A1" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*11 ), new TimerStateCallback( Callback ), "0x4A5" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*12 ), new TimerStateCallback( Callback ), "0x4A9" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*13 ), new TimerStateCallback( Callback ), "0x4A5" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*14 ), new TimerStateCallback( Callback ), "0x4A1" ); Timer.DelayCall( TimeSpan.FromMilliseconds( 500*15 ), new TimerStateCallback( Callback ), "0x4A1" );*/ /*mob.PlaySound( 0x4A8 ); mob.PlaySound( 0x4A8 ); mob.PlaySound( 0x4AA ); mob.PlaySound( 0x4AE ); mob.PlaySound( 0x4AE ); mob.PlaySound( 0x4AA ); mob.PlaySound( 0x4A8 ); mob.PlaySound( 0x4A4 ); mob.PlaySound( 0x49F ); mob.PlaySound( 0x49F ); mob.PlaySound( 0x4A4 );- mob.PlaySound( 0x4A8 ); mob.PlaySound( 0x4A4 ); mob.PlaySound( 0x49F ); mob.PlaySound( 0x49F );*/ if (e.Length < 10) return; /*IEntity from = new Entity( Server.Serial.Zero, new Point3D( mob.X, mob.Y, mob.Z ), mob.Map ); IEntity to = new Entity( Server.Serial.Zero, new Point3D( mob.X, mob.Y, mob.Z + 50 ), mob.Map ); Effects.SendMovingParticles( from, to, Convert.ToInt32(e.Arguments[0]), Convert.ToInt32(e.Arguments[1]), Convert.ToInt32(e.Arguments[2]), Convert.ToBoolean(e.Arguments[3]), Convert.ToBoolean(e.Arguments[4]), Convert.ToInt32(e.Arguments[5]), Convert.ToInt32(e.Arguments[6]), Convert.ToInt32(e.Arguments[7]), Convert.ToInt32(e.Arguments[8]), Convert.ToInt32(e.Arguments[9]), EffectLayer.Head, 0x100 ); */ /*for ( int i=-5; i<5; i++) { for (int j=-5; j<5; j++) { Packet regular = null; NetState state = mob.NetState; if ( state != null ) { IEntity entity = new Entity( Server.Serial.Zero, new Point3D( mob.X+(i*2), mob.Y+(j*2), mob.Z + 5 ), mob.Map ); regular = new LocationEffect( entity, 8391, 5, -1, 4410, 500 ); state.Send( regular ); } } } for ( int i=-5; i<5; i++) { for (int j=-5; j<5; j++) { Packet regular = null; NetState state = mob.NetState; if ( state != null ) { IEntity entity = new Entity( Server.Serial.Zero, new Point3D( mob.X+(i*2+1), mob.Y+(j*2+1), mob.Z + 5 ), mob.Map ); regular = new LocationEffect( entity, 8391, 5, -1, 4410, 500 ); state.Send( regular ); } } }*/ }