Example #1
0
        public void LoadScene(int sceneNo)
        {
            SceneBase scene;

            switch (sceneNo)
            {
            case 0:
                scene = new SceneRandom();
                break;

            case 1:
                scene = new SceneFire();
                break;

            case 2:
                scene = new SceneTwinkle();
                break;

            case 3:
                scene = new SceneOcean();
                break;

            case 4:
                scene = new SceneRainbow();
                break;

            case 5:
                scene = new SceneJuly();
                break;

            case 6:
                scene = new SceneHoliday();
                break;

            case 7:
                scene = new ScenePop();
                break;

            case 8:
                scene = new SceneForest();
                break;

            default:
                scene = null;
                break;
            }

            if (scene == null)
            {
                return;
            }
            CurrentScene  = scene;
            colors        = scene.GetColors();
            animationTime = scene.AnimationTime;
            mode          = scene.Mode;
            startInt      = 0;
            RefreshColors(colors);
        }
Example #2
0
        public void LoadScene(int sceneNo, int vLedCount = 0, int hLedCount = 0)
        {
            if (vLedCount == 0)
            {
                vLedCount = 3;
            }
            if (hLedCount == 0)
            {
                hLedCount = 5;
            }

            _hLedCount = hLedCount;
            _vLedCount = vLedCount;

            SceneBase scene;

            switch (sceneNo)
            {
            case 0:
                scene = new SceneRandom();
                break;

            case 1:
                scene = new SceneFire();
                break;

            case 2:
                scene = new SceneTwinkle();
                break;

            case 3:
                scene = new SceneOcean();
                break;

            case 4:
                scene = new SceneRainbow();
                break;

            case 5:
                scene = new SceneJuly();
                break;

            case 6:
                scene = new SceneHoliday();
                break;

            case 7:
                scene = new ScenePop();
                break;

            case 8:
                scene = new SceneForest();
                break;

            default:
                scene = null;
                break;
            }

            if (scene == null)
            {
                return;
            }
            _colors        = scene.GetColors();
            _animationTime = scene.AnimationTime;
            _mode          = scene.Mode;
            _startInt      = 0;
            RefreshColors(_colors);
        }