Inheritance: BaseSweeperEffect
Beispiel #1
0
        public Xmas2013scene(IEnumerable<string> args)
        {
            hours = new OperatingHours("Hours");

            timeline1 = new Controller.Timeline<string>(1);
            stateMachine = new Controller.EnumStateMachine<States>("Main");
            hatLightState = new Controller.IntStateMachine("Hats");
            lightJesus = new StrobeColorDimmer("Jesus");
            lightStar = new Dimmer("Star");
            lightHat1 = new Dimmer("Hat 1");
            lightHat2 = new Dimmer("Hat 2");
            lightHat3 = new Dimmer("Hat 3");
            lightHat4 = new Dimmer("Hat 4");
            lightSnow1 = new Dimmer("Snow 1");
            lightSnow2 = new Dimmer("Snow 2");
            lightStairs1 = new Dimmer("Stair 1");
            lightStairs2 = new Dimmer("Stairs 2");
            lightGarland1 = new Dimmer("Garland 1");
            lightGarland2 = new Dimmer("Garland 2");
            lightGarland3 = new Dimmer("Garland 3");
            lightGarland4 = new Dimmer("Garland 4");
            lightString1 = new Dimmer("String 1");
            lightString2 = new Dimmer("String 1");
            lightXmasTree = new Dimmer("Xmas Tree");

            lightDeerLarge = new Dimmer("Deer Large");
            lightDeerSmall = new Dimmer("Deer Small");
            lightTreeUp = new StrobeColorDimmer("Tree up");
            switchSanta = new Switch("Santa");
            switchDeerHuge = new Switch("Deer Huge");
            lightTopperSmall = new Dimmer("Topper Small");
            lightTopperLarge = new Dimmer("Topper Large");
            lightNet1 = new Dimmer("Net 1");
            lightNet2 = new Dimmer("Net 2");
            lightVader = new StrobeColorDimmer("Vader");
            light3wise = new StrobeColorDimmer("3wise");

            pulsatingEffect1 = new Effect.Pulsating("Pulse FX 1", S(4), 0.4, 1.0, false);
            pulsatingStar = new Effect.Pulsating("Pulse Star", S(2), 0.2, 0.4, false);
            flickerEffect = new Effect.Flicker("Flicker", 0.5, 0.6, false);
            faderIn = new Effect.Fader("FaderIn", S(2), 0.0, 1.0, false);

            candyCane = new Controller.Sequence("Candy Cane");
            twinkleSeq = new Controller.Sequence("Twinkle");
            backgroundLoop = new Controller.Sequence("Background");
            music1Seq = new Controller.Sequence("Christmas Canon");
            starwarsCane = new Controller.Sequence("Starwars Cane");
            fatherSeq = new Controller.Sequence("Father");
            offHours1Seq = new Controller.Sequence("Off hours 1");
            offHours2Seq = new Controller.Sequence("Off hours 2");
            waveformSeq = new Controller.Sequence("Waveform");

            allPixels = new VirtualPixel1D("All Pixels", 100);
            starwarsPixels = new VirtualPixel1D("Star wars", 50);
            saberPixels = new VirtualPixel1D("Saber", 60);

            buttonTest = new DigitalInput("Test");
            buttonStartInflatables = new DigitalInput("Inflatables");
            buttonOverrideHours = new DigitalInput("Override hours", true);

            buttonBlue = new DigitalInput("Blue");
            buttonRed = new DigitalInput("Red");
            switchButtonBlue = new Switch("Blue");
            switchButtonRed = new Switch("Red");
            elJesus = new Switch("Jesus Halo");
            audioPlayer = new AudioPlayer("Audio");

            popOut1Piano = new Effect.PopOut("Piano", S(0.4));
            popOut1Drums = new Effect.PopOut("Drums", S(0.4));
            popOut1DrumsFast = new Effect.PopOut("Drums Fast", S(0.3));
            popOut1Chord = new Effect.PopOut("Chord", S(0.4));
            popOut1Solo = new Effect.PopOut("Solo", S(0.3));
            popOut1Solo2 = new Effect.PopOut("Solo 2", S(0.2));
            popOut1Choir = new Effect.PopOut("Choir", S(1.0));
            popOut1Voice = new Effect.PopOut("Voice", S(1.0));
            popOut1Vocal2 = new Effect.PopOut("Vocal 2", S(2.0));
            popOut1VocalLong = new Effect.PopOut("Vocal Long", S(5.0));
            popOut1End = new Effect.PopOut("End", S(5.0));

            this.oscServer = new Expander.OscServer(10000);
        }
Beispiel #2
0
        private void ConfigureMusic1()
        {
            popOut1Piano = new Effect.PopOut("Piano", S(0.4));
            popOut1Drums = new Effect.PopOut("Drums", S(0.4));
            popOut1DrumsFast = new Effect.PopOut("Drums Fast", S(0.3));
            popOut1Chord = new Effect.PopOut("Chord", S(0.4));
            popOut1Solo = new Effect.PopOut("Solo", S(0.3));
            popOut1Solo2 = new Effect.PopOut("Solo 2", S(0.2));
            popOut1Choir = new Effect.PopOut("Choir", S(1.0));
            popOut1Voice = new Effect.PopOut("Voice", S(1.0));
            popOut1Vocal2 = new Effect.PopOut("Vocal 2", S(2.0));
            popOut1VocalLong = new Effect.PopOut("Vocal Long", S(5.0));
            popOut1End = new Effect.PopOut("End", S(5.0));

            popOut1Piano
                .AddDevice(lightString1)
                .AddDevice(lightString2)
                .AddDevice(lightTreeUp)
                .AddDevice(lightStar);

            popOut1Drums
                .AddDevice(lightDeerLarge);

            popOut1DrumsFast
                .AddDevice(lightDeerSmall)
                .AddDevice(lightGarland1)
                .AddDevice(lightGarland2)
                .AddDevice(lightGarland3)
                .AddDevice(lightGarland4)
                .AddDevice(allPixels);

            popOut1Chord
                .AddDevice(lightTopperSmall)
                .AddDevice(lightTopperLarge);
            //.AddDevice(lightTree)
            //.AddDevice(lightCeiling2)
            //.AddDevice(lightCeiling3);

            popOut1Solo
                .AddDevice(lightNet1)
                .AddDevice(lightNet2)
                //.AddDevice(lightCeiling1)
                //.AddDevice(lightCeiling3)
                .SetPriority(2);

            popOut1Solo2
                .AddDevice(lightTreeUp)
                //.AddDevice(lightCeiling1)
                //.AddDevice(lightCeiling3)
                .SetPriority(2);

            popOut1Choir
                .AddDevice(lightGarland1)
                .AddDevice(lightSnow1)
                .AddDevice(lightTopperLarge)
                .AddDevice(lightTopperSmall);
            //.AddDevice(lightCeiling1);

            popOut1Voice
                .AddDevice(lightGarland1)
                .AddDevice(lightGarland2)
                .AddDevice(lightSnow2);
            //.AddDevice(lightCeiling3);

            popOut1Vocal2
                //.AddDevice(lightReindeers)
                .AddDevice(allPixels)
                .SetPriority(10);

            popOut1VocalLong
                .AddDevice(lightSnow1)
                .AddDevice(lightSnow2)
                .AddDevice(lightGarland1)
                .AddDevice(lightGarland2)
                .AddDevice(lightGarland3)
                .AddDevice(lightGarland4)
                //.AddDevice(lightNetRight)
                //.AddDevice(lightGarlandRight)
                //.AddDevice(lightHatsRight)
                .SetPriority(10);

            popOut1End
                .AddDevice(lightStar)
                .AddDevice(lightHat1)
                .AddDevice(lightHat2)
                .AddDevice(lightHat3)
                .AddDevice(lightHat4)
                .AddDevice(lightSnow1)
                .AddDevice(lightSnow2)
                .AddDevice(lightStairs1)
                .AddDevice(lightStairs2)
                .AddDevice(lightGarland1)
                .AddDevice(lightGarland2)
                .AddDevice(lightGarland3)
                .AddDevice(lightGarland4)
                .AddDevice(lightString1)
                .AddDevice(lightString2)
                .AddDevice(lightXmasTree)
                .AddDevice(lightDeerLarge)
                .AddDevice(lightDeerSmall)
                .AddDevice(lightTreeUp)
                .AddDevice(lightTopperSmall)
                .AddDevice(lightTopperLarge)
                .AddDevice(lightNet1)
                .AddDevice(lightNet2)
                .AddDevice(allPixels)
                .SetPriority(100);

            timeline1.AddMs(0, "INIT");
            timeline1.PopulateFromCSV("Christmas Canon Rock All Labels.csv");
            int state = 0;
            int halfSolo = 0;

            timeline1.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":
                        hatLightState.NextState();
                        popOut1Piano.Pop(0.4);
                        if (state == 0)
                            allPixels.Inject(Color.Red, 0.5);
                        break;

                    case "N2":
                        hatLightState.NextState();
                        popOut1Piano.Pop(0.6);
                        if (state == 0)
                            allPixels.Inject(Color.White, 0.5);
                        break;

                    case "N3":
                        hatLightState.NextState();
                        popOut1Piano.Pop(0.8);
                        if (state == 0)
                            allPixels.Inject(Color.Blue, 0.5);
                        break;

                    case "N4":
                        hatLightState.NextState();
                        popOut1Piano.Pop(1.0);
                        if (state == 0)
                            allPixels.Inject(Color.Black, 0.0);
                        break;

                    case "Base":
                        popOut1Drums.Pop(1.0);
                        if (state < 3)
                        {
                            allPixels.SetAllOnlyColor(Color.Purple);
                            popOut1DrumsFast.Pop(1.0);
                        }
                        break;

                    case "Cymbal":
                        popOut1Drums.Pop(1.0);
                        if (state < 3)
                        {
                            allPixels.SetAllOnlyColor(Color.Green);
                            popOut1DrumsFast.Pop(1.0);
                        }
                        break;

                    case "Chord":
                        popOut1Chord.Pop(1.0);
                        break;

                    case "Solo":
                        popOut1Solo.Pop(1.0);
                        if ((halfSolo++ % 2) == 0)
                            popOut1Solo2.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":
                        popOut1Choir.Pop(1.0);
                        break;

                    case "Voice":
                        popOut1Voice.Pop(1.0);
                        break;

                    case "Vocal2":
                        popOut1Vocal2.Pop(1.0);
                        break;

                    case "Long":
                        popOut1VocalLong.Pop(1.0);
                        break;

                    case "LongUp":
                        // TODO
                        break;

                    case "Down":
                        // TODO
                        break;

                    case "End":
                        AllLightsOff();
                        popOut1End.Pop(1.0);
                        break;

                    default:
                        log.Info("Unhandled code: " + e.Code);
                        break;
                }
            };
        }
        private void ConfigureMusic1()
        {
            popOut1Piano     = new Effect.PopOut(S(0.4));
            popOut1Drums     = new Effect.PopOut(S(0.4));
            popOut1DrumsFast = new Effect.PopOut(S(0.3));
            popOut1Chord     = new Effect.PopOut(S(0.4));
            popOut1Solo      = new Effect.PopOut(S(0.3));
            popOut1Solo2     = new Effect.PopOut(S(0.2));
            popOut1Choir     = new Effect.PopOut(S(1.0));
            popOut1Voice     = new Effect.PopOut(S(1.0));
            popOut1Vocal2    = new Effect.PopOut(S(2.0));
            popOut1VocalLong = new Effect.PopOut(S(5.0));
            popOut1End       = new Effect.PopOut(S(5.0));

            popOut1Piano
            .AddDevice(lightString1)
            .AddDevice(lightString2)
            .AddDevice(lightTreeUp)
            .AddDevice(lightStar);

            popOut1Drums
            .AddDevice(lightDeerLarge);

            popOut1DrumsFast
            .AddDevice(lightDeerSmall)
            .AddDevice(lightGarland1)
            .AddDevice(lightGarland2)
            .AddDevice(lightGarland3)
            .AddDevice(lightGarland4)
            .AddDevice(allPixels);

            popOut1Chord
            .AddDevice(lightTopperSmall)
            .AddDevice(lightTopperLarge);
            //.AddDevice(lightTree)
            //.AddDevice(lightCeiling2)
            //.AddDevice(lightCeiling3);

            popOut1Solo
            .AddDevice(lightNet1)
            .AddDevice(lightNet2)
            //.AddDevice(lightCeiling1)
            //.AddDevice(lightCeiling3)
            .SetPriority(2);

            popOut1Solo2
            .AddDevice(lightTreeUp)
            //.AddDevice(lightCeiling1)
            //.AddDevice(lightCeiling3)
            .SetPriority(2);

            popOut1Choir
            .AddDevice(lightGarland1)
            .AddDevice(lightSnow1)
            .AddDevice(lightTopperLarge)
            .AddDevice(lightTopperSmall);
            //.AddDevice(lightCeiling1);

            popOut1Voice
            .AddDevice(lightGarland1)
            .AddDevice(lightGarland2)
            .AddDevice(lightSnow2);
            //.AddDevice(lightCeiling3);

            popOut1Vocal2
            //.AddDevice(lightReindeers)
            .AddDevice(allPixels)
            .SetPriority(10);

            popOut1VocalLong
            .AddDevice(lightSnow1)
            .AddDevice(lightSnow2)
            .AddDevice(lightGarland1)
            .AddDevice(lightGarland2)
            .AddDevice(lightGarland3)
            .AddDevice(lightGarland4)
            //.AddDevice(lightNetRight)
            //.AddDevice(lightGarlandRight)
            //.AddDevice(lightHatsRight)
            .SetPriority(10);

            popOut1End
            .AddDevice(lightStar)
            .AddDevice(lightHat1)
            .AddDevice(lightHat2)
            .AddDevice(lightHat3)
            .AddDevice(lightHat4)
            .AddDevice(lightSnow1)
            .AddDevice(lightSnow2)
            .AddDevice(lightStairs1)
            .AddDevice(lightStairs2)
            .AddDevice(lightGarland1)
            .AddDevice(lightGarland2)
            .AddDevice(lightGarland3)
            .AddDevice(lightGarland4)
            .AddDevice(lightString1)
            .AddDevice(lightString2)
            .AddDevice(lightXmasTree)
            .AddDevice(lightDeerLarge)
            .AddDevice(lightDeerSmall)
            .AddDevice(lightTreeUp)
            .AddDevice(lightTopperSmall)
            .AddDevice(lightTopperLarge)
            .AddDevice(lightNet1)
            .AddDevice(lightNet2)
            .AddDevice(allPixels)
            .SetPriority(100);

            timeline1.AddMs(0, "INIT");
            timeline1.PopulateFromCSV("Christmas Canon Rock All Labels.csv");
            int state    = 0;
            int halfSolo = 0;

            timeline1.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":
                    hatLightState.NextState();
                    popOut1Piano.Pop(0.4);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.Red, 0.5);
                    }
                    break;

                case "N2":
                    hatLightState.NextState();
                    popOut1Piano.Pop(0.6);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.White, 0.5);
                    }
                    break;

                case "N3":
                    hatLightState.NextState();
                    popOut1Piano.Pop(0.8);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.Blue, 0.5);
                    }
                    break;

                case "N4":
                    hatLightState.NextState();
                    popOut1Piano.Pop(1.0);
                    if (state == 0)
                    {
                        allPixels.Inject(Color.Black, 0.0);
                    }
                    break;

                case "Base":
                    popOut1Drums.Pop(1.0);
                    if (state < 3)
                    {
                        allPixels.SetAllOnlyColor(Color.Purple);
                        popOut1DrumsFast.Pop(1.0);
                    }
                    break;

                case "Cymbal":
                    popOut1Drums.Pop(1.0);
                    if (state < 3)
                    {
                        allPixels.SetAllOnlyColor(Color.Green);
                        popOut1DrumsFast.Pop(1.0);
                    }
                    break;

                case "Chord":
                    popOut1Chord.Pop(1.0);
                    break;

                case "Solo":
                    popOut1Solo.Pop(1.0);
                    if ((halfSolo++ % 2) == 0)
                    {
                        popOut1Solo2.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":
                    popOut1Choir.Pop(1.0);
                    break;

                case "Voice":
                    popOut1Voice.Pop(1.0);
                    break;

                case "Vocal2":
                    popOut1Vocal2.Pop(1.0);
                    break;

                case "Long":
                    popOut1VocalLong.Pop(1.0);
                    break;

                case "LongUp":
                    // TODO
                    break;

                case "Down":
                    // TODO
                    break;

                case "End":
                    AllLightsOff();
                    popOut1End.Pop(1.0);
                    break;

                default:
                    this.log.Information("Unhandled code: " + e.Code);
                    break;
                }
            };
        }
Beispiel #4
0
        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 Xmas2013scene(IEnumerable <string> args)
        {
            hours = new OperatingHours("Hours");

            timeline1     = new Controller.Timeline <string>(1);
            stateMachine  = new Controller.EnumStateMachine <States>("Main");
            hatLightState = new Controller.IntStateMachine("Hats");
            lightJesus    = new StrobeColorDimmer("Jesus");
            lightStar     = new Dimmer("Star");
            lightHat1     = new Dimmer("Hat 1");
            lightHat2     = new Dimmer("Hat 2");
            lightHat3     = new Dimmer("Hat 3");
            lightHat4     = new Dimmer("Hat 4");
            lightSnow1    = new Dimmer("Snow 1");
            lightSnow2    = new Dimmer("Snow 2");
            lightStairs1  = new Dimmer("Stair 1");
            lightStairs2  = new Dimmer("Stairs 2");
            lightGarland1 = new Dimmer("Garland 1");
            lightGarland2 = new Dimmer("Garland 2");
            lightGarland3 = new Dimmer("Garland 3");
            lightGarland4 = new Dimmer("Garland 4");
            lightString1  = new Dimmer("String 1");
            lightString2  = new Dimmer("String 1");
            lightXmasTree = new Dimmer("Xmas Tree");

            lightDeerLarge   = new Dimmer("Deer Large");
            lightDeerSmall   = new Dimmer("Deer Small");
            lightTreeUp      = new StrobeColorDimmer("Tree up");
            switchSanta      = new Switch("Santa");
            switchDeerHuge   = new Switch("Deer Huge");
            lightTopperSmall = new Dimmer("Topper Small");
            lightTopperLarge = new Dimmer("Topper Large");
            lightNet1        = new Dimmer("Net 1");
            lightNet2        = new Dimmer("Net 2");
            lightVader       = new StrobeColorDimmer("Vader");
            light3wise       = new StrobeColorDimmer("3wise");

            pulsatingEffect1 = new Effect.Pulsating(S(4), 0.4, 1.0, false);
            pulsatingStar    = new Effect.Pulsating(S(2), 0.2, 0.4, false);
            flickerEffect    = new Effect.Flicker(0.5, 0.6, false);
            faderIn          = new Effect.Fader(S(2), 0.0, 1.0, false);

            candyCane      = new Controller.Sequence("Candy Cane");
            twinkleSeq     = new Controller.Sequence("Twinkle");
            backgroundLoop = new Controller.Sequence("Background");
            music1Seq      = new Controller.Sequence("Christmas Canon");
            starwarsCane   = new Controller.Sequence("Starwars Cane");
            fatherSeq      = new Controller.Sequence("Father");
            offHours1Seq   = new Controller.Sequence("Off hours 1");
            offHours2Seq   = new Controller.Sequence("Off hours 2");
            waveformSeq    = new Controller.Sequence("Waveform");

            allPixels      = new VirtualPixel1D(100);
            starwarsPixels = new VirtualPixel1D(50);
            saberPixels    = new VirtualPixel1D(60);

            buttonTest             = new DigitalInput("Test");
            buttonStartInflatables = new DigitalInput("Inflatables");
            buttonOverrideHours    = new DigitalInput("Override hours", true);

            buttonBlue       = new DigitalInput("Blue");
            buttonRed        = new DigitalInput("Red");
            switchButtonBlue = new Switch("Blue");
            switchButtonRed  = new Switch("Red");
            elJesus          = new Switch("Jesus Halo");
            audioPlayer      = new AudioPlayer("Audio");

            popOut1Piano     = new Effect.PopOut(S(0.4));
            popOut1Drums     = new Effect.PopOut(S(0.4));
            popOut1DrumsFast = new Effect.PopOut(S(0.3));
            popOut1Chord     = new Effect.PopOut(S(0.4));
            popOut1Solo      = new Effect.PopOut(S(0.3));
            popOut1Solo2     = new Effect.PopOut(S(0.2));
            popOut1Choir     = new Effect.PopOut(S(1.0));
            popOut1Voice     = new Effect.PopOut(S(1.0));
            popOut1Vocal2    = new Effect.PopOut(S(2.0));
            popOut1VocalLong = new Effect.PopOut(S(5.0));
            popOut1End       = new Effect.PopOut(S(5.0));

            this.oscServer = new Expander.OscServer(10000);

            raspberry.DigitalInputs[4].Connect(buttonRed);
            raspberry.DigitalInputs[5].Connect(buttonBlue);
            raspberry.DigitalOutputs[0].Connect(switchButtonBlue);
            raspberry.DigitalOutputs[1].Connect(switchButtonRed);
            raspberry.DigitalOutputs[2].Connect(elJesus);

            raspberry.Connect(audioPlayer);
        }
        public HalloweenScene2013B(IEnumerable<string> args)
        {
            this.lastFogRun = DateTime.Now;
            stateMachine = new Controller.EnumStateMachine<States>("Main");

            pulsatingEffect1 = new Effect.Pulsating("Pulse FX 1", S(2), 0.1, 0.5, false);
            pulsatingEffect2 = new Effect.Pulsating("Pulse FX 2", S(2), 0.2, 0.8, false);
            flickerEffect = new Effect.Flicker("Flicker", 0.4, 0.6, false);
            flickerEffect2 = new Effect.Flicker("Flicker 2", 0.4, 0.6, false);
            popOutEffect = new Effect.PopOut("PopOut", S(1));

            hoursSmall = new OperatingHours("Hours Small");
            hoursFull = new OperatingHours("Hours Full");
            buttonMotionCat = new DigitalInput("Walkway Motion");
            buttonMotionBeauty = new DigitalInput("Beauty Motion");
            buttonTriggerStairs = new DigitalInput("Stairs Trigger 1");
            buttonTriggerPopup = new DigitalInput("Popup Trigger");
            buttonTestA = new DigitalInput("Test A");
            buttonTestB = new DigitalInput("Test B");
            buttonTestC = new DigitalInput("Test C");
            buttonTestSpider = new DigitalInput("Spider");

            switchDeadendDrive = new Switch("Deadend dr");
            catLights = new Switch("Cat lights");
            catFan = new Switch("Cat");

            georgeMotor = new MotorWithFeedback("George Motor");
            lightPopup = new StrobeDimmer("Popup light");
            lightGeorge = new StrobeColorDimmer("George light");
            lightBeauty = new StrobeColorDimmer("Beauty light");
            lightFloor = new StrobeColorDimmer("Floor light");
            lightSign = new StrobeColorDimmer("Sign");
            skullsLight = new Dimmer("Skulls");
            lightTreeGhost = new Dimmer("Ghosts in tree");
            skullsLight2 = new Dimmer("Skulls 2");
            lightSpiderWeb = new Dimmer("Spiderweb");
            lightEyes = new Switch("Eyes");

            audioCat = new AudioPlayer("Audio Cat");
            audioGeorge = new AudioPlayer("Audio George");
            audioBeauty = new AudioPlayer("Audio Beauty");
            audioSpider = new AudioPlayer("Audio Spider");

            switchHand = new Switch("Hand");
            switchHead = new Switch("Head");
            switchDrawer1 = new Switch("Drawer 1");
            switchDrawer2 = new Switch("Drawer 2");
            switchPopEyes = new Switch("Pop Eyes");
            switchPopUp = new Switch("Pop Up");
            switchSpider = new Switch("Spider");
            switchSpiderEyes1 = new Switch("Spider Eyes 1");
            switchSpiderEyes2 = new Switch("Spider Eyes 2");
            switchFog = new Switch("Fog");

            allPixels = new VirtualPixel1D("All Pixels", 28 + 50);
        }
        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 HalloweenScene2013B(IEnumerable <string> args)
        {
            this.lastFogRun = DateTime.Now;
            stateMachine    = new Controller.EnumStateMachine <States>("Main");

            pulsatingEffect1 = new Effect.Pulsating(S(2), 0.1, 0.5, false);
            pulsatingEffect2 = new Effect.Pulsating(S(2), 0.2, 0.8, false);
            flickerEffect    = new Effect.Flicker(0.4, 0.6, false);
            flickerEffect2   = new Effect.Flicker(0.4, 0.6, false);
            popOutEffect     = new Effect.PopOut(S(1));

            hoursSmall          = new OperatingHours("Hours Small");
            hoursFull           = new OperatingHours("Hours Full");
            buttonMotionCat     = new DigitalInput("Walkway Motion");
            buttonMotionBeauty  = new DigitalInput("Beauty Motion");
            buttonTriggerStairs = new DigitalInput("Stairs Trigger 1");
            buttonTriggerPopup  = new DigitalInput("Popup Trigger");
            buttonTestA         = new DigitalInput("Test A");
            buttonTestB         = new DigitalInput("Test B");
            buttonTestC         = new DigitalInput("Test C");
            buttonTestSpider    = new DigitalInput("Spider");

            switchDeadendDrive = new Switch("Deadend dr");
            catLights          = new Switch("Cat lights");
            catFan             = new Switch("Cat");

            georgeMotor    = new MotorWithFeedback("George Motor");
            lightPopup     = new StrobeDimmer("Popup light");
            lightGeorge    = new StrobeColorDimmer("George light");
            lightBeauty    = new StrobeColorDimmer("Beauty light");
            lightFloor     = new StrobeColorDimmer("Floor light");
            lightSign      = new StrobeColorDimmer("Sign");
            skullsLight    = new Dimmer("Skulls");
            lightTreeGhost = new Dimmer("Ghosts in tree");
            skullsLight2   = new Dimmer("Skulls 2");
            lightSpiderWeb = new Dimmer("Spiderweb");
            lightEyes      = new Switch("Eyes");

            audioCat    = new AudioPlayer("Audio Cat");
            audioGeorge = new AudioPlayer("Audio George");
            audioBeauty = new AudioPlayer("Audio Beauty");
            audioSpider = new AudioPlayer("Audio Spider");

            switchHand        = new Switch("Hand");
            switchHead        = new Switch("Head");
            switchDrawer1     = new Switch("Drawer 1");
            switchDrawer2     = new Switch("Drawer 2");
            switchPopEyes     = new Switch("Pop Eyes");
            switchPopUp       = new Switch("Pop Up");
            switchSpider      = new Switch("Spider");
            switchSpiderEyes1 = new Switch("Spider Eyes 1");
            switchSpiderEyes2 = new Switch("Spider Eyes 2");
            switchFog         = new Switch("Fog");

            allPixels = new VirtualPixel1D(28 + 50);

            // Cat
            raspberry1.DigitalInputs[0].Connect(buttonMotionCat);
            raspberry1.DigitalInputs[4].Connect(buttonTriggerStairs, true);
            raspberry1.DigitalOutputs[0].Connect(switchDeadendDrive);
            raspberry1.DigitalOutputs[1].Connect(switchFog);
            raspberry1.Motor.Connect(georgeMotor);

            raspberry1.Connect(audioCat);

            // Beauty
            raspberry2.Connect(audioBeauty);
            raspberry2.DigitalOutputs[7].Connect(switchHand);
            raspberry2.DigitalOutputs[2].Connect(switchHead);
            raspberry2.DigitalOutputs[5].Connect(switchDrawer1);
            raspberry2.DigitalOutputs[6].Connect(switchDrawer2);
            raspberry2.DigitalOutputs[3].Connect(switchPopEyes);
            raspberry2.DigitalOutputs[4].Connect(switchPopUp);

            raspberry2.DigitalInputs[5].Connect(buttonMotionBeauty, true);
            raspberry2.DigitalInputs[6].Connect(buttonTriggerPopup, true);

            // Background/George
            raspberry3.Connect(audioGeorge);

            // Spider
            raspberry4.Connect(audioSpider);

            raspberry4.DigitalOutputs[0].Connect(switchSpider);
            raspberry4.DigitalOutputs[2].Connect(switchSpiderEyes1);
            raspberry4.DigitalOutputs[3].Connect(switchSpiderEyes2);
        }
        public HalloweenScene2013B(IEnumerable<string> args)
        {
            this.lastFogRun = DateTime.Now;
            stateMachine = new Controller.EnumStateMachine<States>("Main");

            pulsatingEffect1 = new Effect.Pulsating(S(2), 0.1, 0.5, false);
            pulsatingEffect2 = new Effect.Pulsating(S(2), 0.2, 0.8, false);
            flickerEffect = new Effect.Flicker(0.4, 0.6, false);
            flickerEffect2 = new Effect.Flicker(0.4, 0.6, false);
            popOutEffect = new Effect.PopOut(S(1));

            hoursSmall = new OperatingHours("Hours Small");
            hoursFull = new OperatingHours("Hours Full");
            buttonMotionCat = new DigitalInput("Walkway Motion");
            buttonMotionBeauty = new DigitalInput("Beauty Motion");
            buttonTriggerStairs = new DigitalInput("Stairs Trigger 1");
            buttonTriggerPopup = new DigitalInput("Popup Trigger");
            buttonTestA = new DigitalInput("Test A");
            buttonTestB = new DigitalInput("Test B");
            buttonTestC = new DigitalInput("Test C");
            buttonTestSpider = new DigitalInput("Spider");

            switchDeadendDrive = new Switch("Deadend dr");
            catLights = new Switch("Cat lights");
            catFan = new Switch("Cat");

            georgeMotor = new MotorWithFeedback("George Motor");
            lightPopup = new StrobeDimmer("Popup light");
            lightGeorge = new StrobeColorDimmer("George light");
            lightBeauty = new StrobeColorDimmer("Beauty light");
            lightFloor = new StrobeColorDimmer("Floor light");
            lightSign = new StrobeColorDimmer("Sign");
            skullsLight = new Dimmer("Skulls");
            lightTreeGhost = new Dimmer("Ghosts in tree");
            skullsLight2 = new Dimmer("Skulls 2");
            lightSpiderWeb = new Dimmer("Spiderweb");
            lightEyes = new Switch("Eyes");

            audioCat = new AudioPlayer("Audio Cat");
            audioGeorge = new AudioPlayer("Audio George");
            audioBeauty = new AudioPlayer("Audio Beauty");
            audioSpider = new AudioPlayer("Audio Spider");

            switchHand = new Switch("Hand");
            switchHead = new Switch("Head");
            switchDrawer1 = new Switch("Drawer 1");
            switchDrawer2 = new Switch("Drawer 2");
            switchPopEyes = new Switch("Pop Eyes");
            switchPopUp = new Switch("Pop Up");
            switchSpider = new Switch("Spider");
            switchSpiderEyes1 = new Switch("Spider Eyes 1");
            switchSpiderEyes2 = new Switch("Spider Eyes 2");
            switchFog = new Switch("Fog");

            allPixels = new VirtualPixel1D(28 + 50);

            // Cat
            raspberry1.DigitalInputs[0].Connect(buttonMotionCat);
            raspberry1.DigitalInputs[4].Connect(buttonTriggerStairs, true);
            raspberry1.DigitalOutputs[0].Connect(switchDeadendDrive);
            raspberry1.DigitalOutputs[1].Connect(switchFog);
            raspberry1.Motor.Connect(georgeMotor);

            raspberry1.Connect(audioCat);

            // Beauty
            raspberry2.Connect(audioBeauty);
            raspberry2.DigitalOutputs[7].Connect(switchHand);
            raspberry2.DigitalOutputs[2].Connect(switchHead);
            raspberry2.DigitalOutputs[5].Connect(switchDrawer1);
            raspberry2.DigitalOutputs[6].Connect(switchDrawer2);
            raspberry2.DigitalOutputs[3].Connect(switchPopEyes);
            raspberry2.DigitalOutputs[4].Connect(switchPopUp);

            raspberry2.DigitalInputs[5].Connect(buttonMotionBeauty, true);
            raspberry2.DigitalInputs[6].Connect(buttonTriggerPopup, true);

            // Background/George
            raspberry3.Connect(audioGeorge);

            // Spider
            raspberry4.Connect(audioSpider);

            raspberry4.DigitalOutputs[0].Connect(switchSpider);
            raspberry4.DigitalOutputs[2].Connect(switchSpiderEyes1);
            raspberry4.DigitalOutputs[3].Connect(switchSpiderEyes2);
        }