Example #1
0
        public static SpectrumWave[] LoadWaves()
        {
            if (File.Exists(wavesFilePath))
            {
                string[]       config = File.ReadAllLines(wavesFilePath);
                SpectrumWave[] waves  = new SpectrumWave[config.Length];

                string[] data;

                for (int i = 0; i < config.Length; i++)
                {
                    data = config[i].Split('|');

                    SpectrumWave wave = new SpectrumWave()
                    {
                        WaveColor = Color.FromArgb(255, int.Parse(data[0]), int.Parse(data[1]),
                                                   int.Parse(data[2])),
                        Increment     = float.Parse(data[3]),
                        BarsInfluence = int.Parse(data[4]),
                        PromLoops     = int.Parse(data[5])
                    };

                    waves[i] = wave;
                }

                return(waves);
            }
            else
            {
                return(GetDefaultWaves());
            }
        }
Example #2
0
        public static SpectrumWave[] GetWaveConfig()
        {
            try
            {
                string[] waveData = configData[1].Split((char)47);

                SpectrumWave[] waves = new SpectrumWave[waveData.Length];

                string[] data;

                for (int i = 0; i < waveData.Length; i++)
                {
                    data     = waveData[i].Split(sep.ToCharArray());
                    waves[i] = new SpectrumWave()
                    {
                        WaveColor     = Color.FromArgb(int.Parse(data[0]), int.Parse(data[1]), int.Parse(data[2])),
                        Increment     = float.Parse(data[3]),
                        BarsInfluence = int.Parse(data[4]),
                        PromLoops     = int.Parse(data[5])
                    };
                }

                return(waves);
            }
            catch
            {
                return(GetDefaultWaves());
            }
        }
        public LightWaveEditor(SpectrumWave wave) : this()
        {
            Wave = wave;

            R = wave.WaveColor.R;
            G = wave.WaveColor.G;
            B = wave.WaveColor.B;

            IncrementTxt.Text     = wave.Increment.ToString();
            BarsInfluenceTxt.Text = wave.BarsInfluence.ToString();
            PromLoopsTxt.Text     = wave.PromLoops.ToString();

            Handled = false;

            UpdateColorPicker();
        }
Example #4
0
        public static SpectrumWave[] GetDefaultWaves()
        {
            SpectrumWave[] Waves = new SpectrumWave[9];

            Waves[0] = new SpectrumWave
            {
                WaveColor     = Color.White,
                Increment     = 0,
                BarsInfluence = 0,
                PromLoops     = 0
            };

            Waves[1] = new SpectrumWave
            {
                WaveColor     = Color.Yellow,
                Increment     = 0.5f,
                BarsInfluence = 2,
                PromLoops     = 1
            };

            Waves[2] = new SpectrumWave
            {
                WaveColor     = Color.FromArgb(255, 150, 0),
                Increment     = 0.5f,
                BarsInfluence = 2,
                PromLoops     = 2
            };

            Waves[3] = new SpectrumWave
            {
                WaveColor     = Color.Red,
                Increment     = 0.5f,
                BarsInfluence = 2,
                PromLoops     = 3
            };

            Waves[4] = new SpectrumWave
            {
                WaveColor     = Color.FromArgb(255, 100, 255),
                Increment     = 0.5f,
                BarsInfluence = 2,
                PromLoops     = 4
            };

            Waves[5] = new SpectrumWave
            {
                WaveColor     = Color.FromArgb(50, 50, 155),
                Increment     = 0.5f,
                BarsInfluence = 2,
                PromLoops     = 5
            };

            Waves[6] = new SpectrumWave
            {
                WaveColor     = Color.Blue,
                Increment     = 0.5f,
                BarsInfluence = 2,
                PromLoops     = 6
            };

            Waves[7] = new SpectrumWave
            {
                WaveColor     = Color.FromArgb(50, 205, 255),
                Increment     = 0.5f,
                BarsInfluence = 2,
                PromLoops     = 7
            };

            Waves[8] = new SpectrumWave
            {
                WaveColor     = Color.FromArgb(0, 255, 0),
                Increment     = 0.5f,
                BarsInfluence = 2,
                PromLoops     = 8
            };

            return(Waves);
        }