Exemplo n.º 1
0
        public DelayForm(MainForm_Template _parent, int chan_num, int _settings_offset)
        {
            InitializeComponent();

            SETTINGS_INDEX = _settings_offset;
            PARENT_FORM = _parent;

            CH_NUMBER = chan_num;

            this.Text = "CH " + CH_NUMBER + " - Delay";

            delayMS = new Dial(TextDelayMS, DialDelayMS, new double[] { 0, 0.018, 0.034, 0.050, 0.067, 0.084, 0.100 }, DialHelpers.Format_String_Delay_MS, Images.knob_red_bg, Images.knob_red_line);
            delayFT = new Dial(TextDelayFT, DialDelayFT, new double[] { 0.11, 19.98, 37.74, 55.5, 74.37, 93.24, 111.5 }, DialHelpers.Format_String_Delay_FT, Images.knob_blue_bg, Images.knob_blue_line);
            delayM = new Dial(TextDelayM, DialDelayM, new double[] { 0, 6.12, 11.56, 17, 22.78, 28.56, 34.0 }, DialHelpers.Format_String_Delay_M, Images.knob_green_bg, Images.knob_green_line);

            delayMS.OnChange += new DialEventHandler(this.DialMS_OnChange);
            delayFT.OnChange += new DialEventHandler(this.DialFT_OnChange);
            delayM.OnChange += new DialEventHandler(this.DialM_OnChange);

            delayMS.Value = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].delays[CH_NUMBER - 1].Delay;

            dropAction.SelectedIndex = 0;
            dropAction.Invalidate();

            SetInitialDistances();
        }
        public CompressorForm(MainForm_Template _parentForm, int channel, int _settings_offset, CompressorType compType = CompressorType.Compressor)
        {
            InitializeComponent();

            ADDR_THRESHOLD = _settings_offset;
            ADDR_KNEE = _settings_offset+1;
            ADDR_RATIO = _settings_offset+2;
            ADDR_ATTACK = _settings_offset+3;
            ADDR_RELEASE = _settings_offset+4;
            ADDR_BYPASS = _settings_offset+5;

            dropAction.SelectedIndex = 0;
            dropAction.Invalidate();

            PARENT_FORM = _parentForm;
            CH_NUMBER = channel;

            if (compType == CompressorType.Compressor)
            {
                is_limiter = false;
                COMP_INDEX = 0;
            }
            else
            {
                is_limiter = true;
                COMP_INDEX = 1;
            }

            try
            {

                FixedLine = dynChart.Series[0];
                MarkerLine = dynChart.Series[1];
                StraightResponseLine = dynChart.Series[2];
                KneedResponseLine = dynChart.Series[3];

                nudCompThreshold.Value = (decimal)PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].compressors[CH_NUMBER - 1][COMP_INDEX].Threshold;
                nudCompRatio.Value = (decimal)(Math.Min(100.0, PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].compressors[CH_NUMBER - 1][COMP_INDEX].Ratio));

                if (compType == CompressorType.Limiter)
                {
                    lblRatio.Visible = false;
                    lblRatioSuffix.Visible = false;
                    nudCompRatio.Visible = false;

                    MarkerLine.Points[2].MarkerSize = 0;

                    dynChart.Invalidate();

                    this.Text = "Limiter - CH" + channel.ToString();
                }
                else
                {
                    MarkerLine.Points[2].MarkerSize = 12;
                    this.Text = "Compressor - CH" + channel.ToString();
                }

                AttackDial = new Dial(TextCompAttack, DialCompAttack, new double[] {0.001, 0.003, 0.01, 0.03, 0.08, 0.3, 1.0},
                         DialHelpers.Format_String_Comp_Attack, Images.knob_blue_bg, Images.knob_blue_line);

                AttackDial.Value = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].compressors[CH_NUMBER - 1][COMP_INDEX].Attack;
                AttackDial.OnChange += new DialEventHandler(this.AttackDial_OnChange);

                ReleaseDial = new Dial(TextCompRelease, DialCompRelease, new double[] {0.010, 0.038, 0.150, 0.530, 1.250, 7.0, 30.0},
                         DialHelpers.Format_String_Comp_Release, Images.knob_orange_bg, Images.knob_orange_line);
                ReleaseDial.Value = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].compressors[CH_NUMBER - 1][COMP_INDEX].Release;
                ReleaseDial.OnChange += new DialEventHandler(this.ReleaseDial_OnChange);

                var backImage = new NamedImage("DynamicsBackground", GlobalResources.DynamicsGraph_BG_Blue);
                dynChart.Images.Add(backImage);
                dynChart.ChartAreas[0].BackImage = "DynamicsBackground";

                /* Load Image Resources */

                update_soft_knee();

                chkSoftKnee.Checked = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].compressors[CH_NUMBER - 1][COMP_INDEX].SoftKnee;

                if (chkSoftKnee.Checked)
                {
                    KneedResponseLine.Enabled = true;
                    StraightResponseLine.Enabled = false;
                }
                else
                {
                    KneedResponseLine.Enabled = false;
                    StraightResponseLine.Enabled = true;
                }

                chkBypass.Checked = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].compressors[CH_NUMBER - 1][COMP_INDEX].Bypassed;

                if (_parentForm.LIVE_MODE && _parentForm._PIC_Conn.isOpen)
                {
                    signalTimer.Enabled = true;
                    gainMeterIn.Visible = true;
                    gainMeterOut.Visible = true;
                    lblIn.Visible = true;
                    lblOut.Visible = true;
                    panel1.Location = new Point(35, 366);
                } else
                {
                    signalTimer.Enabled = false;
                    gainMeterIn.Visible = false;
                    gainMeterOut.Visible = false;
                    lblIn.Visible = false;
                    lblOut.Visible = false;
                    panel1.Location = new Point(78, 366);
                }

            } catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemplo n.º 3
0
        public DuckerForm(MainForm_Template _parentForm, int _settings_offset)
        {
            InitializeComponent();

            ADDR_THRESHOLD = _settings_offset;
            ADDR_HOLD = _settings_offset+1;
            ADDR_DEPTH = _settings_offset+2;
            ADDR_ATTACK = _settings_offset+3;
            ADDR_RELEASE = _settings_offset+4;
            ADDR_BYPASS = _settings_offset+5;

            PARENT_FORM = _parentForm;

            try
            {
                dropPriorityChannel.Items.Clear();
                dropPriorityChannel.Text = "";

                for(int i = 0; i < PARENT_FORM.GetNumInputChannels(); i++)
                {
                    dropPriorityChannel.Items.Add(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].inputs[i].Name);
                }

                nudDuckThreshold.Value = (decimal)PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].ducker.Threshold;
                nudDuckDepth.Value = (decimal)PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].ducker.Depth;

                dropPriorityChannel.SelectedIndex = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].ducker.PriorityChannel;
                dropPriorityChannel.Invalidate();

                HoldDial = new Dial(TextDuckHold, DialDuckHold, new double[] { 0.001, 0.003, 0.01, 0.03, 0.08, 0.3, 1.0 },
                         DialHelpers.Format_String_Duck_Hold, Images.knob_green_bg, Images.knob_green_line);

                HoldDial.Value = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].ducker.Holdtime;
                HoldDial.OnChange += new DialEventHandler(this.HoldDial_OnChange);

                AttackDial = new Dial(TextDuckAttack, DialDuckAttack, new double[] { 0.001, 0.003, 0.01, 0.03, 0.08, 0.3, 1.0 },
                         DialHelpers.Format_String_Comp_Attack, Images.knob_blue_bg, Images.knob_blue_line);

                AttackDial.Value = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].ducker.Attack;
                AttackDial.OnChange += new DialEventHandler(this.AttackDial_OnChange);

                ReleaseDial = new Dial(TextDuckRelease, DialDuckRelease, new double[] {0.010, 0.038, 0.150, 0.530, 1.250, 7.0, 30.0},
                         DialHelpers.Format_String_Comp_Release, Images.knob_orange_bg, Images.knob_orange_line);
                ReleaseDial.Value = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].ducker.Release;
                ReleaseDial.OnChange += new DialEventHandler(this.ReleaseDial_OnChange);

                chkBypass.Checked = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].ducker.Bypassed;

                if (_parentForm.LIVE_MODE && _parentForm._PIC_Conn.isOpen)
                {
                    signalTimer.Enabled = true;
                    //gainMeterIn.Visible = true;
                    //gainMeterOut.Visible = true;
                } else
                {
                    signalTimer.Enabled = false;
                    //gainMeterIn.Visible = false;
                    //gainMeterOut.Visible = false;
                }

            } catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            form_loaded = true;
        }