public bool Equals(FilterConfig compareConfig)
        {
            if (compareConfig == null)
            {
                return false;
            }

            if(this.Type != compareConfig.Type)
            {
                return false;
            }

            if(this.Filter.CenterFrequency != compareConfig.Filter.CenterFrequency)
            {
                return false;
            }

            if(this.Type == FilterType.Peak || this.Type == FilterType.LowShelf || this.Type == FilterType.HighShelf || this.Type == FilterType.Notch)
            {
                if (this.Filter.QValue != compareConfig.Filter.QValue)
                {
                    return false;
                }
            }

            if(this.Type == FilterType.Peak || this.Type == FilterType.LowShelf || this.Type == FilterType.HighShelf)
            {
                if (this.Filter.Gain != compareConfig.Filter.Gain)
                {
                    return false;
                }
            }

            return true;
        }
Esempio n. 2
0
        public static UInt32 filter_to_package(FilterConfig in_filter)
        {
            UInt32 return_int = 0x00;

            return_int |= Convert.ToUInt32(in_filter.Bypassed);

            return_int <<= 4;

            return_int |= (uint)in_filter.Filter.FilterType;

            return_int <<= 3;

            if (in_filter.Type == FilterType.SecondOrderHighPass || in_filter.Type == FilterType.SecondOrderLowPass)
            {
                return_int |= 0x01;
            }
            else
            {
                return_int |= 0x00;
            }

            return_int <<= 23;

            return_int |= (uint)in_filter.Filter.CenterFrequency;

            return return_int;
        }
        public ProgramConfig(string _name = "")
        {
            this.Name = _name;

            for (int i = 0; i < 4; i++)
            {

                filters[i] = new FilterConfig[9];
                crosspoints[i] = new GainConfig[4];
                gains[i] = new GainConfig[4];
                inputs[i] = new InputConfig(i);
                outputs[i] = new OutputConfig(i);

                compressors[i] = new CompressorConfig[2];

                compressors[i][0] = new CompressorConfig(CompressorType.Compressor);
                compressors[i][1] = new CompressorConfig(CompressorType.Limiter);

                delays[i] = new DelayConfig();

                for (int j = 0; j < 4; j++)
                {
                    gains[i][j] = new GainConfig();
                    crosspoints[i][j] = new GainConfig();

                    if (i == j)
                    {
                        crosspoints[i][j].Gain = 0;
                    }
                    else
                    {
                        crosspoints[i][j].Muted = true;
                    }
                }
            }

            for (int j = 4; j < 6; j++)
            {
                crosspoints[j] = new GainConfig[4];

                for (int k = 0; k < 4; k++)
                {
                    crosspoints[j][k] = new GainConfig(0, true);
                }
            }

            inputs[0].Name = "Input #1";
            inputs[1].Name = "Input #2";
            inputs[2].Name = "Input #3";
            inputs[3].Name = "Input #4";

            outputs[0].Name = "Output #1";
            outputs[1].Name = "Output #2";
            outputs[2].Name = "Output #3";
            outputs[3].Name = "Output #4";
        }
        public bool IsEqual(FilterConfig compareFilter)
        {
            if(Type != compareFilter.Type)
            {
                return false;
            }

            if(Bypassed != compareFilter.Bypassed)
            {
                return false;
            }

            if(!Filter.IsEqual(compareFilter.Filter))
            {
                return false;
            }

            return true;
        }
Esempio n. 5
0
        private string FilterToDescription(FilterConfig in_filter)
        {
            switch (in_filter.Type)
            {
                case FilterType.FirstOrderLowPass:
                    return "Low Pass at " + FilterFrequencyString(in_filter.Filter.CenterFrequency);

                case FilterType.SecondOrderLowPass:
                    return "Low Pass at " + FilterFrequencyString(in_filter.Filter.CenterFrequency);

                case FilterType.FirstOrderHighPass:
                    return "High Pass at " + FilterFrequencyString(in_filter.Filter.CenterFrequency);

                case FilterType.SecondOrderHighPass:
                    return "High Pass at " + FilterFrequencyString(in_filter.Filter.CenterFrequency);

                case FilterType.LowShelf:
                    return "Low Shelf at " + FilterFrequencyString(in_filter.Filter.CenterFrequency);

                case FilterType.HighShelf:
                    return "High Shelf at " + FilterFrequencyString(in_filter.Filter.CenterFrequency);

                case FilterType.Peak:
                    return "Peak at " + FilterFrequencyString(in_filter.Filter.CenterFrequency);

                case FilterType.Notch:
                    return "Notch at " + FilterFrequencyString(in_filter.Filter.CenterFrequency);

                default:
                    return "Not used";
            }
        }