Beispiel #1
0
        private void init()
        {
            InitializeComponent();


            switch (filterMode)
            {
            case FFTFilterMode.LowPass:
                dl2.Hide();
                Width             = Width - dl2.Width;
                dl1.title         = "f";
                dl1.val           = f1;
                dl1.valueChanged += Dl1_valueChanged;
                title             = string.Format("LP{0}", blockSize);
                break;

            case FFTFilterMode.HighPass:
                dl2.Hide();
                Width             = Width - dl2.Width;
                dl1.title         = "f";
                dl1.val           = f1;
                dl1.valueChanged += Dl1_valueChanged;
                title             = string.Format("HP{0}", blockSize);
                break;

            case FFTFilterMode.BandPass:
                dl1.title         = "f1";
                dl1.val           = f1;
                dl1.valueChanged += Dl1_valueChanged;
                dl2.title         = "f2";
                dl2.val           = f2;
                dl2.valueChanged += Dl2_valueChanged;
                title             = string.Format("BP{0}", blockSize);
                break;

            case FFTFilterMode.BandStop:
                dl1.title         = "f1";
                dl1.val           = f1;
                dl1.valueChanged += Dl1_valueChanged;
                dl2.title         = "f2";
                dl2.val           = f2;
                dl2.valueChanged += Dl2_valueChanged;
                title             = string.Format("BS{0}", blockSize);
                break;

            case FFTFilterMode.AllPass:
                dl2.Hide();
                Width             = Width - dl2.Width;
                dl1.title         = "phi";
                dl1.logScale      = false;
                dl1.minVal        = -180;
                dl1.maxVal        = 180;
                dl1.val           = phi * 180 / Math.PI;
                dl1.valueChanged += Dl1_valueChanged;
                title             = string.Format("AP{0}", blockSize);
                break;

            case FFTFilterMode.FrequencyShifter:
                dl2.Hide();
                Width             = Width - dl2.Width;
                dl1.title         = "f";
                dl1.val           = f1;
                dl1.valueChanged += Dl1_valueChanged;
                title             = string.Format("FS{0}", blockSize);
                break;
            }

            processingType = ProcessingType.Processor;
        }
Beispiel #2
0
        private void init()
        {
            InitializeComponent();

            string ord = "";

            switch (filterOrder)
            {
            case FilterOrder.First: ord = "1st O."; break;

            case FilterOrder.Second: ord = "2nd O."; break;

            case FilterOrder.Fourth: ord = "4th O."; break;
            }
            switch (filterType)
            {
            case BiQuad.BiQuadMode.LowPass: title = "LP " + ord; break;

            case BiQuad.BiQuadMode.HighPass: title = "HP " + ord; break;

            case BiQuad.BiQuadMode.BandPass: title = "BP " + ord; break;

            case BiQuad.BiQuadMode.BandStop: title = "BS " + ord; break;

            case BiQuad.BiQuadMode.Allpass: title = "AP " + ord; break;
            }

            int h = Height;

            if (channels < 8)
            {
                ioI8.Hide(); ioO8.Hide(); h = ioO8.Location.Y;
            }
            if (channels < 7)
            {
                ioI7.Hide(); ioO7.Hide(); h = ioO7.Location.Y;
            }
            if (channels < 6)
            {
                ioI6.Hide(); ioO6.Hide(); h = ioO6.Location.Y;
            }
            if (channels < 5)
            {
                ioI5.Hide(); ioO5.Hide(); h = ioO5.Location.Y;
            }
            if (channels < 4)
            {
                ioI4.Hide(); ioO4.Hide(); h = ioO5.Location.Y;
            }
            if (channels < 3)
            {
                ioI3.Hide(); ioO3.Hide(); h = ioO5.Location.Y;
            }
            if (channels < 2)
            {
                ioI2.Hide(); ioO2.Hide(); h = ioO5.Location.Y;
            }
            Height = h;
            if (filterOrder == FilterOrder.First)
            {
                dlQ.Hide();
                Width = Width - dlQ.Width;
            }

            dlFreq.val = fc;
            if (filterOrder != FilterOrder.First)
            {
                dlQ.val = Q;
            }
            dlFreq.valueChanged += DlFreq_valueChanged;
            if (filterOrder != FilterOrder.First)
            {
                dlQ.valueChanged += DlQ_valueChanged;
            }

            updateNeeded   = false;
            processingType = ProcessingType.Processor;
        }
Beispiel #3
0
        private void init()
        {
            InitializeComponent();

            int w  = Width;
            int dx = dl8.Location.X - dl7.Location.X;

            if (inputs < 8)
            {
                ioI8.Hide(); dl8.Hide(); w -= dx;
            }
            if (inputs < 7)
            {
                ioI7.Hide(); dl7.Hide(); w -= dx;
            }
            if (inputs < 6)
            {
                ioI6.Hide(); dl6.Hide(); w -= dx;
            }
            if (inputs < 5)
            {
                ioI5.Hide(); dl5.Hide(); w -= dx;
            }
            if (inputs < 4)
            {
                ioI4.Hide(); dl4.Hide(); w -= dx;
            }
            if (inputs < 3)
            {
                ioI3.Hide(); dl3.Hide(); w -= dx;
            }
            if (inputs < 2)
            {
                ioI2.Hide(); dl2.Hide(); w -= dx;
            }
            Width = w;

            if (inputs >= 1)
            {
                dl1.val = gain[0];
            }
            if (inputs >= 2)
            {
                dl2.val = gain[1];
            }
            if (inputs >= 3)
            {
                dl3.val = gain[2];
            }
            if (inputs >= 4)
            {
                dl4.val = gain[3];
            }
            if (inputs >= 5)
            {
                dl5.val = gain[4];
            }
            if (inputs >= 6)
            {
                dl6.val = gain[5];
            }
            if (inputs >= 7)
            {
                dl7.val = gain[6];
            }
            if (inputs >= 8)
            {
                dl8.val = gain[7];
            }

            if (inputs >= 1)
            {
                dl1.valueChanged += Dl1_valueChanged;
            }
            if (inputs >= 2)
            {
                dl2.valueChanged += Dl2_valueChanged;
            }
            if (inputs >= 3)
            {
                dl3.valueChanged += Dl3_valueChanged;
            }
            if (inputs >= 4)
            {
                dl4.valueChanged += Dl4_valueChanged;
            }
            if (inputs >= 5)
            {
                dl5.valueChanged += Dl5_valueChanged;
            }
            if (inputs >= 6)
            {
                dl6.valueChanged += Dl6_valueChanged;
            }
            if (inputs >= 7)
            {
                dl7.valueChanged += Dl7_valueChanged;
            }
            if (inputs >= 8)
            {
                dl8.valueChanged += Dl8_valueChanged;
            }

            processingType = ProcessingType.Processor;
        }