public HalloweenScene1(IEnumerable<string> args) { hours = new OperatingHours("Hours"); georgeStrobeLight = new StrobeDimmer("George Strobe"); spiderLight = new StrobeColorDimmer("Spider Light"); skullsLight = new Dimmer("Skulls"); cobWebLight = new Dimmer("Cob Web"); blinkyEyesLight = new Switch("Blinky Eyes"); rgbLightRight = new StrobeColorDimmer("Light Right"); georgeLight = new StrobeColorDimmer("George Light"); leftSkeletonLight = new StrobeColorDimmer("Skeleton Light"); georgeMotor = new MotorWithFeedback("George Motor"); candyLight = new StrobeColorDimmer("Candy Light"); spiderLift = new Switch("Slider Lift"); smokeMachine = new Switch("Smoke Machine"); spiderEyes = new Switch("Spider Eyes"); pressureMat = new DigitalInput("Pressure Mat"); testButton = new DigitalInput("Test"); pulsatingEffect1 = new Effect.Pulsating("Pulse FX 1", S(2), 0.1, 0.4); pulsatingEffect2 = new Effect.Pulsating("Pulse FX 2", S(2), 0.3, 0.5); candyPulse = new Effect.Pulsating("Candy Pulse", S(3), 0.01, 0.1); flickerEffect = new Effect.Flicker("Flicker", 0.4, 0.6); audioPlayer = new Physical.NetworkAudioPlayer( Properties.Settings.Default.NetworkAudioPlayerIP, Properties.Settings.Default.NetworkAudioPlayerPort); }
public XmasScene1(IEnumerable <string> args, System.Collections.Specialized.NameValueCollection settings) { testPixels = new Pixel1D("G35", 50); explosion1 = new Dimmer("Explosion 1"); explosion2 = new Dimmer("Explosion 2"); explosion3 = new Dimmer("Explosion 3"); explosion4 = new Dimmer("Explosion 4"); testButton = new DigitalInput("Test"); audioPlayer = new Physical.NetworkAudioPlayer( settings["NetworkAudioPlayerIP"], int.Parse(settings["NetworkAudioPlayerPort"])); }
public XmasScene1(IEnumerable<string> args, System.Collections.Specialized.NameValueCollection settings) { testPixels = new Pixel1D("G35", 50); explosion1 = new Dimmer("Explosion 1"); explosion2 = new Dimmer("Explosion 2"); explosion3 = new Dimmer("Explosion 3"); explosion4 = new Dimmer("Explosion 4"); testButton = new DigitalInput("Test"); audioPlayer = new Physical.NetworkAudioPlayer( settings["NetworkAudioPlayerIP"], int.Parse(settings["NetworkAudioPlayerPort"])); }
public XmasScene1(IEnumerable<string> args) { testPixels = new Pixel1D("G35", 50); explosion1 = new Dimmer("Explosion 1"); explosion2 = new Dimmer("Explosion 2"); explosion3 = new Dimmer("Explosion 3"); explosion4 = new Dimmer("Explosion 4"); testButton = new DigitalInput("Test"); audioPlayer = new Physical.NetworkAudioPlayer( Properties.Settings.Default.NetworkAudioPlayerIP, Properties.Settings.Default.NetworkAudioPlayerPort); }
public XmasScene2(IEnumerable<string> args, System.Collections.Specialized.NameValueCollection settings) { hours = new OperatingHours("Hours"); if (!args.Contains("TEST")) { hours.AddRange("5:00 pm", "10:00 pm"); hours.AddRange("5:00 am", "7:00 am"); } lightNetRight = new Dimmer("Net Right"); lightGarlandRight = new Dimmer("Garland Right"); lightHatsRight = new Dimmer("Hats Right"); lightTreesRight = new Dimmer("Trees Right"); lightReindeers = new Dimmer("Reindeers"); lightIcicles = new Dimmer("Icicles"); lightNetLeft = new Dimmer("Net Left"); lightTree = new Dimmer("Tree"); lightGarlandLeft = new Dimmer("Garland Left"); lightUnused1 = new Dimmer("Unused 1"); lightUnused2 = new Dimmer("Unused 2"); lightJesus = new StrobeColorDimmer("Jesus"); lightCeiling1 = new StrobeColorDimmer("Ceiling 1"); lightCeiling2 = new StrobeColorDimmer("Ceiling 2"); lightCeiling3 = new StrobeColorDimmer("Ceiling 3"); lightVader = new StrobeColorDimmer("Vader"); buttonLightRed = new Switch("Button Red"); buttonLightBlue = new Switch("Button Blue"); elLightsaber = new Switch("Lightsaber"); elJesus = new Switch("Jesus Halo"); bigReindeer = new Switch("Big Reindeer"); buttonBlue = new DigitalInput("Button Blue"); buttonRed = new DigitalInput("Button Red"); buttonStartReindeer = new DigitalInput("Start Reindeer"); timeline = new Controller.Timeline<string>(1); stateMachine = new Controller.EnumStateMachine<States>("Main"); candyCane = new Controller.Sequence("Candy Cane"); starwarsCane = new Controller.Sequence("Starwars Cane"); backgroundLoop = new Controller.Sequence("Background"); musicSeq = new Controller.Sequence("Christmas Canon"); buttonSeq = new Controller.Sequence("Buttons"); fatherSeq = new Controller.Sequence("Father"); breathSeq = new Controller.Sequence("Breath"); laserSeq = new Controller.Sequence("Laser"); allPixels = new VirtualPixel1D(100); pulsatingEffect1 = new Effect.Pulsating(S(2), 0.3, 1.0, false); pulsatingEffect2 = new Effect.Pulsating(S(2), 0.3, 1.0, false); popOutPiano = new Effect.PopOut(S(0.4)); popOutDrums = new Effect.PopOut(S(0.4)); popOutDrumsFast = new Effect.PopOut(S(0.3)); popOutChord = new Effect.PopOut(S(0.4)); popOutSolo = new Effect.PopOut(S(0.3)); popOutSolo2 = new Effect.PopOut(S(0.2)); popOutChoir = new Effect.PopOut(S(1.0)); popOutVoice = new Effect.PopOut(S(1.0)); popOutVocal2 = new Effect.PopOut(S(2.0)); popOutVocalLong = new Effect.PopOut(S(5.0)); popOutEnd = new Effect.PopOut(S(5.0)); popOutPiano .AddDevice(lightIcicles); popOutDrums .AddDevice(lightReindeers) .AddDevice(lightHatsRight); popOutDrumsFast .AddDevice(lightCeiling1) .AddDevice(allPixels); popOutChord .AddDevice(lightTree) .AddDevice(lightCeiling2) .AddDevice(lightCeiling3); popOutSolo .AddDevice(lightNetLeft) .AddDevice(lightNetRight) .AddDevice(lightCeiling1) .AddDevice(lightCeiling3) .SetPriority(2); popOutSolo2 .AddDevice(lightCeiling1) .AddDevice(lightCeiling3) .SetPriority(2); popOutChoir .AddDevice(lightGarlandRight) .AddDevice(lightTreesRight) .AddDevice(lightCeiling1); popOutVoice .AddDevice(lightGarlandLeft) .AddDevice(lightCeiling3); popOutVocal2 .AddDevice(lightReindeers) .AddDevice(allPixels) .SetPriority(10); popOutVocalLong .AddDevice(lightNetRight) .AddDevice(lightGarlandRight) .AddDevice(lightHatsRight) .SetPriority(10); popOutEnd .AddDevice(lightIcicles) .AddDevice(lightReindeers) .AddDevice(lightHatsRight) .AddDevice(lightCeiling1) .AddDevice(lightCeiling2) .AddDevice(lightCeiling3) .AddDevice(lightGarlandRight) .AddDevice(lightGarlandLeft) .AddDevice(lightTreesRight) .AddDevice(lightNetRight) .AddDevice(lightNetLeft) .AddDevice(allPixels) .SetPriority(100); timeline.AddMs(0, "INIT"); timeline.PopulateFromCSV("Christmas Canon Rock All Labels.csv"); int state = 0; int halfSolo = 0; timeline.TimelineTrigger += (sender, e) => { switch (e.Step) { case 62: // First drum state = 1; allPixels.TurnOff(); break; case 69: state = 2; lightCeiling2.SetOnlyColor(Color.Green); lightCeiling3.SetOnlyColor(Color.Blue); break; case 136: // First solo state = 3; allPixels.TurnOff(); lightCeiling2.SetOnlyColor(Color.White); lightCeiling3.SetOnlyColor(Color.Red); break; case 265: // First choir allPixels.TurnOff(); state = 4; break; case 396: // Vocal 2 state = 5; allPixels.SetAllOnlyColor(Color.Blue); break; case 497: // Second solo state = 6; allPixels.TurnOff(); lightCeiling2.SetOnlyColor(Color.White); lightCeiling3.SetOnlyColor(Color.Red); break; case 561: // End second solo state = 7; allPixels.TurnOff(); break; case 585: // End third solo state = 8; allPixels.TurnOff(); break; case 721: // End third solo state = 9; allPixels.TurnOff(); break; } switch (e.Code) { case "INIT": state = 0; halfSolo = 0; lightCeiling1.SetColor(Color.White, 0); lightCeiling2.SetColor(Color.Blue, 0); lightCeiling3.SetColor(Color.Red, 0); break; case "N1": popOutPiano.Pop(0.4); if (state == 0) allPixels.Inject(Color.Red, 0.5); break; case "N2": popOutPiano.Pop(0.6); if (state == 0) allPixels.Inject(Color.White, 0.5); break; case "N3": popOutPiano.Pop(0.8); if (state == 0) allPixels.Inject(Color.Blue, 0.5); break; case "N4": popOutPiano.Pop(1.0); if (state == 0) allPixels.Inject(Color.Black, 0.0); break; case "Base": popOutDrums.Pop(1.0); if (state < 3) { allPixels.SetAllOnlyColor(Color.Purple); popOutDrumsFast.Pop(1.0); } break; case "Cymbal": popOutDrums.Pop(1.0); if (state < 3) { allPixels.SetAllOnlyColor(Color.Green); popOutDrumsFast.Pop(1.0); } break; case "Chord": popOutChord.Pop(1.0); break; case "Solo": popOutSolo.Pop(1.0); if ((halfSolo++ % 2) == 0) popOutSolo2.Pop(0.8); if (state == 3 || state == 6 || state == 8) { Color pixCol = Color.Black; switch (e.Step % 4) { case 0: pixCol = Color.Red; break; case 1: pixCol = Color.Yellow; break; case 2: pixCol = Color.Blue; break; case 3: pixCol = Color.Pink; break; } allPixels.Inject(pixCol, 1.0); } break; case "Choir": popOutChoir.Pop(1.0); break; case "Voice": popOutVoice.Pop(1.0); break; case "Vocal2": popOutVocal2.Pop(1.0); break; case "Long": popOutVocalLong.Pop(1.0); break; case "LongUp": // TODO break; case "Down": // TODO break; case "End": EverythingOff(); popOutEnd.Pop(1.0); break; default: log.Info("Unhandled code: " + e.Code); break; } }; audioPlayer = new Physical.NetworkAudioPlayer( settings["NetworkAudioPlayerIP"], int.Parse(settings["NetworkAudioPlayerPort"])); }
public XmasScene2(IEnumerable <string> args, System.Collections.Specialized.NameValueCollection settings) { hours = new OperatingHours("Hours"); if (!args.Contains("TEST")) { hours.AddRange("5:00 pm", "10:00 pm"); hours.AddRange("5:00 am", "7:00 am"); } lightNetRight = new Dimmer("Net Right"); lightGarlandRight = new Dimmer("Garland Right"); lightHatsRight = new Dimmer("Hats Right"); lightTreesRight = new Dimmer("Trees Right"); lightReindeers = new Dimmer("Reindeers"); lightIcicles = new Dimmer("Icicles"); lightNetLeft = new Dimmer("Net Left"); lightTree = new Dimmer("Tree"); lightGarlandLeft = new Dimmer("Garland Left"); lightUnused1 = new Dimmer("Unused 1"); lightUnused2 = new Dimmer("Unused 2"); lightJesus = new StrobeColorDimmer("Jesus"); lightCeiling1 = new StrobeColorDimmer("Ceiling 1"); lightCeiling2 = new StrobeColorDimmer("Ceiling 2"); lightCeiling3 = new StrobeColorDimmer("Ceiling 3"); lightVader = new StrobeColorDimmer("Vader"); buttonLightRed = new Switch("Button Red"); buttonLightBlue = new Switch("Button Blue"); elLightsaber = new Switch("Lightsaber"); elJesus = new Switch("Jesus Halo"); bigReindeer = new Switch("Big Reindeer"); buttonBlue = new DigitalInput("Button Blue"); buttonRed = new DigitalInput("Button Red"); buttonStartReindeer = new DigitalInput("Start Reindeer"); timeline = new Controller.Timeline <string>(1); stateMachine = new Controller.EnumStateMachine <States>("Main"); candyCane = new Controller.Sequence("Candy Cane"); starwarsCane = new Controller.Sequence("Starwars Cane"); backgroundLoop = new Controller.Sequence("Background"); musicSeq = new Controller.Sequence("Christmas Canon"); buttonSeq = new Controller.Sequence("Buttons"); fatherSeq = new Controller.Sequence("Father"); breathSeq = new Controller.Sequence("Breath"); laserSeq = new Controller.Sequence("Laser"); allPixels = new VirtualPixel1D(100); pulsatingEffect1 = new Effect.Pulsating(S(2), 0.3, 1.0, false); pulsatingEffect2 = new Effect.Pulsating(S(2), 0.3, 1.0, false); popOutPiano = new Effect.PopOut(S(0.4)); popOutDrums = new Effect.PopOut(S(0.4)); popOutDrumsFast = new Effect.PopOut(S(0.3)); popOutChord = new Effect.PopOut(S(0.4)); popOutSolo = new Effect.PopOut(S(0.3)); popOutSolo2 = new Effect.PopOut(S(0.2)); popOutChoir = new Effect.PopOut(S(1.0)); popOutVoice = new Effect.PopOut(S(1.0)); popOutVocal2 = new Effect.PopOut(S(2.0)); popOutVocalLong = new Effect.PopOut(S(5.0)); popOutEnd = new Effect.PopOut(S(5.0)); popOutPiano .AddDevice(lightIcicles); popOutDrums .AddDevice(lightReindeers) .AddDevice(lightHatsRight); popOutDrumsFast .AddDevice(lightCeiling1) .AddDevice(allPixels); popOutChord .AddDevice(lightTree) .AddDevice(lightCeiling2) .AddDevice(lightCeiling3); popOutSolo .AddDevice(lightNetLeft) .AddDevice(lightNetRight) .AddDevice(lightCeiling1) .AddDevice(lightCeiling3) .SetPriority(2); popOutSolo2 .AddDevice(lightCeiling1) .AddDevice(lightCeiling3) .SetPriority(2); popOutChoir .AddDevice(lightGarlandRight) .AddDevice(lightTreesRight) .AddDevice(lightCeiling1); popOutVoice .AddDevice(lightGarlandLeft) .AddDevice(lightCeiling3); popOutVocal2 .AddDevice(lightReindeers) .AddDevice(allPixels) .SetPriority(10); popOutVocalLong .AddDevice(lightNetRight) .AddDevice(lightGarlandRight) .AddDevice(lightHatsRight) .SetPriority(10); popOutEnd .AddDevice(lightIcicles) .AddDevice(lightReindeers) .AddDevice(lightHatsRight) .AddDevice(lightCeiling1) .AddDevice(lightCeiling2) .AddDevice(lightCeiling3) .AddDevice(lightGarlandRight) .AddDevice(lightGarlandLeft) .AddDevice(lightTreesRight) .AddDevice(lightNetRight) .AddDevice(lightNetLeft) .AddDevice(allPixels) .SetPriority(100); timeline.AddMs(0, "INIT"); timeline.PopulateFromCSV("Christmas Canon Rock All Labels.csv"); int state = 0; int halfSolo = 0; timeline.TimelineTrigger += (sender, e) => { switch (e.Step) { case 62: // First drum state = 1; allPixels.TurnOff(); break; case 69: state = 2; lightCeiling2.SetOnlyColor(Color.Green); lightCeiling3.SetOnlyColor(Color.Blue); break; case 136: // First solo state = 3; allPixels.TurnOff(); lightCeiling2.SetOnlyColor(Color.White); lightCeiling3.SetOnlyColor(Color.Red); break; case 265: // First choir allPixels.TurnOff(); state = 4; break; case 396: // Vocal 2 state = 5; allPixels.SetAllOnlyColor(Color.Blue); break; case 497: // Second solo state = 6; allPixels.TurnOff(); lightCeiling2.SetOnlyColor(Color.White); lightCeiling3.SetOnlyColor(Color.Red); break; case 561: // End second solo state = 7; allPixels.TurnOff(); break; case 585: // End third solo state = 8; allPixels.TurnOff(); break; case 721: // End third solo state = 9; allPixels.TurnOff(); break; } switch (e.Code) { case "INIT": state = 0; halfSolo = 0; lightCeiling1.SetColor(Color.White, 0); lightCeiling2.SetColor(Color.Blue, 0); lightCeiling3.SetColor(Color.Red, 0); break; case "N1": popOutPiano.Pop(0.4); if (state == 0) { allPixels.Inject(Color.Red, 0.5); } break; case "N2": popOutPiano.Pop(0.6); if (state == 0) { allPixels.Inject(Color.White, 0.5); } break; case "N3": popOutPiano.Pop(0.8); if (state == 0) { allPixels.Inject(Color.Blue, 0.5); } break; case "N4": popOutPiano.Pop(1.0); if (state == 0) { allPixels.Inject(Color.Black, 0.0); } break; case "Base": popOutDrums.Pop(1.0); if (state < 3) { allPixels.SetAllOnlyColor(Color.Purple); popOutDrumsFast.Pop(1.0); } break; case "Cymbal": popOutDrums.Pop(1.0); if (state < 3) { allPixels.SetAllOnlyColor(Color.Green); popOutDrumsFast.Pop(1.0); } break; case "Chord": popOutChord.Pop(1.0); break; case "Solo": popOutSolo.Pop(1.0); if ((halfSolo++ % 2) == 0) { popOutSolo2.Pop(0.8); } if (state == 3 || state == 6 || state == 8) { Color pixCol = Color.Black; switch (e.Step % 4) { case 0: pixCol = Color.Red; break; case 1: pixCol = Color.Yellow; break; case 2: pixCol = Color.Blue; break; case 3: pixCol = Color.Pink; break; } allPixels.Inject(pixCol, 1.0); } break; case "Choir": popOutChoir.Pop(1.0); break; case "Voice": popOutVoice.Pop(1.0); break; case "Vocal2": popOutVocal2.Pop(1.0); break; case "Long": popOutVocalLong.Pop(1.0); break; case "LongUp": // TODO break; case "Down": // TODO break; case "End": EverythingOff(); popOutEnd.Pop(1.0); break; default: this.log.Information("Unhandled code: " + e.Code); break; } }; audioPlayer = new Physical.NetworkAudioPlayer( settings["NetworkAudioPlayerIP"], int.Parse(settings["NetworkAudioPlayerPort"])); }
public HalloweenScene1(IEnumerable <string> args, System.Collections.Specialized.NameValueCollection settings) { hours = new OperatingHours("Hours"); georgeStrobeLight = new StrobeDimmer("George Strobe"); spiderLight = new StrobeColorDimmer("Spider Light"); skullsLight = new Dimmer("Skulls"); cobWebLight = new Dimmer("Cob Web"); blinkyEyesLight = new Switch("Blinky Eyes"); rgbLightRight = new StrobeColorDimmer("Light Right"); georgeLight = new StrobeColorDimmer("George Light"); leftSkeletonLight = new StrobeColorDimmer("Skeleton Light"); georgeMotor = new MotorWithFeedback("George Motor"); candyLight = new StrobeColorDimmer("Candy Light"); spiderLift = new Switch("Slider Lift"); smokeMachine = new Switch("Smoke Machine"); spiderEyes = new Switch("Spider Eyes"); pressureMat = new DigitalInput("Pressure Mat"); testButton = new DigitalInput("Test"); pulsatingEffect1 = new Effect.Pulsating(S(2), 0.1, 0.4); pulsatingEffect2 = new Effect.Pulsating(S(2), 0.3, 0.5); candyPulse = new Effect.Pulsating(S(3), 0.01, 0.1); flickerEffect = new Effect.Flicker(0.4, 0.6); audioPlayer = new Physical.NetworkAudioPlayer( settings["NetworkAudioPlayerIP"], int.Parse(settings["NetworkAudioPlayerPort"])); hours.AddRange("6:00 pm", "10:00 pm"); var testSequence = new Controller.Sequence("Test Sequence"); testSequence .WhenExecuted .Execute(instance => { candyPulse.Start(); audioPlayer.PlayEffect("Laugh"); georgeMotor.SetVector(1.0, 160, S(5)); georgeStrobeLight.SetStrobe(0.55, 1.0); georgeLight.SetStrobe(0.78, Color.Brown); georgeMotor.WaitForVectorReached(); instance.WaitFor(S(2)); georgeStrobeLight.TurnOff(); georgeLight.TurnOff(); georgeMotor.SetVector(0.9, 0, S(6)); georgeMotor.WaitForVectorReached(); candyPulse.Stop(); }); var testSequence2 = new Controller.Sequence("Test Sequence 2"); testSequence2.WhenExecuted .Execute(instance => { audioPlayer.PlayEffect("348 Spider Hiss"); spiderLight.SetStrobe(0.78, Color.Red); spiderLift.SetPower(true); instance.WaitFor(S(3)); // Spider up audioPlayer.PlayEffect("Scream"); spiderLift.SetPower(false); instance.WaitFor(S(2)); spiderLight.TurnOff(); }); var testSequence3 = new Controller.Sequence("Test Sequence 3"); testSequence3.WhenExecuted .Execute(instance => { spiderEyes.SetPower(true); instance.WaitFor(S(10)); spiderEyes.SetPower(false); }); var mainSequence = new Controller.Sequence("Main Sequence"); mainSequence.WhenExecuted .Execute(instance => { pulsatingEffect1.Stop(); pulsatingEffect2.Stop(); flickerEffect.Stop(); blinkyEyesLight.SetPower(false); candyLight.SetColor(Color.Red); audioPlayer.PauseBackground(); audioPlayer.PlayEffect("Door-creak"); instance.WaitFor(S(2)); instance.WaitFor(S(2)); candyPulse.Stop(); candyLight.SetStrobe(1, Color.White); instance.WaitFor(S(0.5)); candyLight.TurnOff(); instance.WaitFor(S(1)); audioPlayer.PlayEffect("348 Spider Hiss"); instance.WaitFor(S(0.5)); spiderLight.SetStrobe(0.78, Color.Red); spiderLift.SetPower(true); spiderEyes.SetPower(true); instance.WaitFor(S(1)); audioPlayer.PlayEffect("348 Spider Hiss"); instance.WaitFor(S(2)); // Spider up audioPlayer.PlayEffect("Scream"); spiderLift.SetPower(false); spiderEyes.SetPower(false); smokeMachine.SetPower(true); instance.WaitFor(S(2)); spiderLight.TurnOff(); audioPlayer.PlayEffect("Violin screech"); instance.WaitFor(S(2)); // Skeleton to the right // audioPlayer.PlayEffect("Ghostly"); rgbLightRight.SetStrobe(0.78, Color.Violet); instance.WaitFor(MS(1000)); rgbLightRight.SetColor(Color.Red); instance.WaitFor(MS(1000)); rgbLightRight.SetColor(Color.Blue); instance.WaitFor(S(2)); rgbLightRight.TurnOff(); instance.WaitFor(S(1)); // Skeleton to the left audioPlayer.PlayEffect("death-scream"); instance.WaitFor(S(0.5)); leftSkeletonLight.SetStrobe(0.78, Color.Pink); instance.WaitFor(S(3)); smokeMachine.SetPower(false); instance.WaitFor(S(1)); leftSkeletonLight.TurnOff(); // George audioPlayer.PlayEffect("Laugh"); instance.WaitFor(MS(800)); georgeMotor.SetVector(1.0, 160, S(5)); georgeStrobeLight.SetStrobe(0.55, 1.0); georgeLight.SetStrobe(0.78, Color.Brown); georgeMotor.WaitForVectorReached(); instance.WaitFor(S(2)); georgeStrobeLight.TurnOff(); georgeLight.TurnOff(); candyPulse.MinBrightness = 0.05; candyPulse.MaxBrightness = 1.0; candyLight.SetColor(Color.Violet); candyPulse.Start(); georgeMotor.SetVector(0.9, 0, S(6)); georgeMotor.WaitForVectorReached(); blinkyEyesLight.SetPower(true); flickerEffect.Start(); pulsatingEffect1.Start(); instance.WaitFor(S(5)); smokeMachine.SetPower(true); audioPlayer.PlayBackground(); // Wait for reset instance.WaitFor(S(15)); pulsatingEffect2.Start(); candyPulse.MinBrightness = 0.01; candyPulse.MaxBrightness = 0.1; candyLight.SetColor(Color.Green); smokeMachine.SetPower(false); }); pressureMat.ActiveChanged += (sender, e) => { if (e.NewState) { if (hours.IsOpen) { Executor.Current.Execute(mainSequence); } else { audioPlayer.PlayEffect("Laugh"); } } }; testButton.ActiveChanged += (sender, e) => { if (e.NewState) { Executor.Current.Execute(mainSequence); } }; hours.OpenHoursChanged += (sender, e) => { if (e.IsOpenNow) { pulsatingEffect1.Start(); pulsatingEffect2.Start(); flickerEffect.Start(); candyPulse.Start(); blinkyEyesLight.SetPower(true); audioPlayer.PlayBackground(); } else { pulsatingEffect1.Stop(); pulsatingEffect2.Stop(); flickerEffect.Stop(); candyPulse.Stop(); blinkyEyesLight.SetPower(false); audioPlayer.PauseBackground(); } }; // Have it turned off, but prepare it with blue color for the effect rgbLightRight.SetColor(Color.Blue, 0); candyLight.SetColor(Color.Green, 0); pulsatingEffect1.AddDevice(rgbLightRight); pulsatingEffect2.AddDevice(cobWebLight); candyPulse.AddDevice(candyLight); flickerEffect.AddDevice(skullsLight); }