Exemplo n.º 1
0
        public static FilterBase Create(string s)
        {
            var tokens = Split(s);

            if (tokens == null || tokens.Length < 1)
            {
                return(null);
            }

            // Refer FilterType enum in FilterBase.cs

            switch (tokens[0])
            {
            case "Gain":
                return(GainFilter.Restore(tokens));

            case "ZohUpsampler":
                return(ZeroOrderHoldUpsampler.Restore(tokens));

            case "LowPassFilter":
                return(LowpassFilter.Restore(tokens));

            case "FftUpsampler":
                return(FftUpsampler.Restore(tokens));

            case "Mash2":
                return(MashFilter.Restore(tokens));

            case "NoiseShaping":
                return(NoiseShapingFilter.Restore(tokens));

            case "NoiseShaping4th":
                return(NoiseShaping4thFilter.Restore(tokens));

            case "TagEdit":
                return(TagEditFilter.Restore(tokens));

            case "Downsampler":
                return(Downsampler.Restore(tokens));

            case "CicFilter":
                return(CicFilter.Restore(tokens));

            case "InsertZeroesUpsampler":
                return(InsertZeroesUpsampler.Restore(tokens));

            case "HalfbandFilter":
                return(HalfbandFilter.Restore(tokens));

            case "Crossfeed":
                return(CrossfeedFilter.Restore(tokens));

            default:
                return(null);
            }
        }
Exemplo n.º 2
0
        public static FilterBase Create(string s)
        {
            var tokens = Split(s);

            if (tokens == null || tokens.Length < 1)
            {
                return(null);
            }

            // Refer FilterType enum in FilterBase.cs

            switch (tokens[0])
            {
            case "Gain":
                return(GainFilter.Restore(tokens));

            case "ZohUpsampler":
                return(ZeroOrderHoldUpsampler.Restore(tokens));

            case "LineDrawUpsampler":
                return(LineDrawUpsampler.Restore(tokens));

            case "CubicHermiteSplineUpsampler":
                return(CubicHermiteSplineUpsampler.Restore(tokens));

            case "LowPassFilter":
                return(LowpassFilter.Restore(tokens));

            case "FftUpsampler":
                return(FftUpsampler.Restore(tokens));

            case "Mash2":
                return(MashFilter.Restore(tokens));

            case "NoiseShaping":
                return(NoiseShapingFilter.Restore(tokens));

            case "NoiseShaping4th":
                return(NoiseShaping4thFilter.Restore(tokens));

            case "TagEdit":
                return(TagEditFilter.Restore(tokens));

            case "Downsampler":
                return(Downsampler.Restore(tokens));

            case "CicFilter":
                return(CicFilter.Restore(tokens));

            case "InsertZeroesUpsampler":
                return(InsertZeroesUpsampler.Restore(tokens));

            case "HalfbandFilter":
                return(HalfbandFilter.Restore(tokens));

            case "Crossfeed":
                return(CrossfeedFilter.Restore(tokens));

            case "JitterAdd":
                return(JitterAddFilter.Restore(tokens));

            case "GaussianNoise":
                return(GaussianNoiseFilter.Restore(tokens));

            case "DynamicRangeCompression":
                return(DynamicRangeCompressionFilter.Restore(tokens));

            case "UnevenBitDac":
                return(UnevenBitDacFilter.Restore(tokens));

            case "Normalize":
                return(NormalizeFilter.Restore(tokens));

            case "ReduceBitDepth":
                return(ReduceBitDepth.Restore(tokens));

            case "FirstOrderAllPassIIR":
                return(FirstOrderAllPassIIRFilter.Restore(tokens));

            case "SecondOrderAllPassIIR":
                return(SecondOrderAllPassIIRFilter.Restore(tokens));

            case "WindowedSincUpsampler":
                return(WindowedSincUpsampler.Restore(tokens));

            default:
                return(null);
            }
        }