public SwitchProgramForm(MainForm_Template _parentForm, byte switchCommand) { InitializeComponent(); PARENT_FORM = _parentForm; SWITCH_COMMAND = switchCommand; }
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 SaveForm(MainForm_Template _parentForm, bool param_disable_comms) { InitializeComponent(); PARENT_FORM = _parentForm; disable_comms = param_disable_comms; }
public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX, double CH_NUMBER) { /* UInt32 new_val = DSP_Math.double_to_MN( PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].pregains[CH_NUMBER - 1] + PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].gains[CH_NUMBER - 1][0].Gain, 9, 23); PARENT_FORM.AddItemToQueue(new LiveQueueItem((0 + CH_NUMBER - 1), new_val)); PARENT_FORM.AddItemToQueue(new LiveQueueItem((412 + CH_NUMBER - 1), (uint)dropInputType.SelectedIndex)); * */ }
public MixerForm(MainForm_Template _parentForm) { InitializeComponent(); PARENT_FORM = _parentForm; lblInput0.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].inputs[0].Name; lblInput1.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].inputs[1].Name; lblInput2.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].inputs[2].Name; lblInput3.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].inputs[3].Name; lblOutput0.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].outputs[0].Name; lblOutput1.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].outputs[1].Name; lblOutput2.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].outputs[2].Name; lblOutput3.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].outputs[3].Name; for (int i = 0; i < 6; i++) { for (int j = 0; j < 4; j++) { PictureButton pbControl = (PictureButton)Controls.Find("btnRouter" + (i + 1).ToString() + "_" + (j + 1).ToString(), true).First(); // Create the ToolTip and associate with the Form container. ToolTip toolTip1 = new ToolTip(); // Set up the delays for the ToolTip. toolTip1.AutoPopDelay = 5000; toolTip1.InitialDelay = 10; toolTip1.ReshowDelay = 50; // Force the ToolTip text to be displayed whether or not the form is active. toolTip1.ShowAlways = true; // Set up the ToolTip text for the Button and Checkbox. if (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].crosspoints[i][j].Muted) { toolTip1.SetToolTip(pbControl, "Muted"); pbControl.Overlay3Visible = true; } else { toolTip1.SetToolTip(pbControl, PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].crosspoints[i][j].Gain.ToString("N1") + "dB"); pbControl.Overlay1Visible = true; } pbControl.Invalidate(); } } }
public InputConfiguration(MainForm_Template _parentForm, int _channelNumber, bool show_phantom = true) { InitializeComponent(); PARENT_FORM = _parentForm; CH_NUMBER = _channelNumber; this.Text = "CH " + CH_NUMBER.ToString("N0") + " - Input Configuration"; txtDisplayName.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].inputs[CH_NUMBER-1].Name; chkPhantomPower.Checked = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].inputs[CH_NUMBER - 1].PhantomPower; chkPhantomPower.Invalidate(); if (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].inputs[CH_NUMBER - 1].Type == InputType.Line) { dropInputType.SelectedIndex = 0; } else if (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].inputs[CH_NUMBER - 1].Type == InputType.Microphone6) { dropInputType.SelectedIndex = 1; } else { dropInputType.SelectedIndex = 2; } dropInputType.Invalidate(); if(!show_phantom) { lblPhantomPower.Visible = false; chkPhantomPower.Visible = false; } if (PARENT_FORM.LIVE_MODE) { gainMeter.Visible = true; signalTimer.Enabled = true; } else { gainMeter.Visible = false; signalTimer.Enabled = false; } form_loaded = true; }
public DeviceManagerForm(MainForm_Template _parent) { InitializeComponent(); PARENT_FORM = _parent; devicesFound = new List<SADevice>(); manager = new UsbManager(); manager.StateChanged += new UsbStateChangedEventHandler(USBDeviceStateChanged); if(!PARENT_FORM._vsDebug) { chkDebug.Visible = false; chkProgram1.Visible = false; } }
public PresetManager(MainForm_Template _parent) { InitializeComponent(); dropProgramSelection.Items.Clear(); dropProgramSelection.Text = ""; for(int i = 0; i < _parent.NumPresets(); i++) { dropProgramSelection.Items.Add(_parent._presetNames[i]); } dropProgramSelection.SelectedIndex = 0; dropProgramSelection.Invalidate(); PARENT_FORM = _parent; form_loaded = true; }
public OutputConfiguration(MainForm_Template _parentForm, int _ch_number) { InitializeComponent(); PARENT_FORM = _parentForm; CH_NUMBER = _ch_number; this.Text = "CH " + CH_NUMBER.ToString("N0") + " - Output Configuration"; txtDisplayName.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].outputs[CH_NUMBER-1].Name; if (_parentForm.LIVE_MODE && _parentForm._PIC_Conn.isOpen && PARENT_FORM.FIRMWARE_VERSION > 2.5) { signalTimer.Enabled = true; gainMeterOut.Visible = true; panelRS232.Visible = true; } else { gainMeterOut.Visible = false; panelRS232.Visible = false; } }
public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX, bool is_first_gain = false, int CH_INDEX = 0) { if(this.Muted) { PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, DSP_Math.double_to_MN(DSP_Math.decibels_to_voltage_gain(-100), 3, 29))); } else { if(is_first_gain) { UInt32 new_val = DSP_Math.double_to_MN(this.Gain + PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].pregains[CH_INDEX], 9, 23); // Notice that this is a PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, new_val)); // Save this for the first node so we can remember PARENT_FORM.AddItemToQueue(new LiveQueueItem((416 + CH_INDEX), DSP_Math.double_to_MN(this.Gain, 6, 26))); } else { PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, DSP_Math.double_to_MN(DSP_Math.decibels_to_voltage_gain(this.Gain), 3, 29))); } } }
public static void Read(string inputFile, MainForm_Template FORM_INSTANCE) { string tempLine = ""; string channel_name = ""; int cur_program = 0; using (System.IO.StreamReader file = new System.IO.StreamReader(inputFile)) { int lineCount = 0, index = 0; UInt32 value = 0x00000000; while (file.Peek() >= 0) { lineCount++; tempLine = file.ReadLine(); if (tempLine.Contains("DEVICE-ID:")) { // TODO - CHECK HERE FOR VALID DEVICE-ID continue; } if (tempLine.Contains("DEVICE-ID:")) { // TODO - CHECK HERE FOR VALID DEVICE-ID continue; } if (tempLine.Contains("SERIAL:")) { // TODO - CHECK HERE FOR VALID DEVICE-ID continue; } if (tempLine.Contains("TIMESTAMP:")) { // TODO - CHECK HERE FOR VALID DEVICE-ID continue; } if (tempLine.Contains("PRESET") && tempLine.Substring(7, 1) == ";") { cur_program = int.Parse(tempLine.Substring(6, 1)) - 1; //Console.WriteLine("Changing current program to " + cur_program); continue; } if (tempLine.Substring(0, 5) == "INPUT") { index = int.Parse(tempLine.Substring(6, 1)); channel_name = tempLine.Substring(8, tempLine.Length - 9); FORM_INSTANCE.PROGRAMS[cur_program].inputs[index - 1].Name = channel_name; continue; } if (tempLine.Substring(0, 7) == "PHANTOM") { index = int.Parse(tempLine.Substring(8, 1)); if (tempLine.Substring(17, 1) == "1") { FORM_INSTANCE.PROGRAMS[cur_program].inputs[index - 1].PhantomPower = true; } else { FORM_INSTANCE.PROGRAMS[cur_program].inputs[index - 1].PhantomPower = false; } continue; } if (tempLine.Substring(0, 6) == "OUTPUT") { index = int.Parse(tempLine.Substring(7, 1)); channel_name = tempLine.Substring(9, tempLine.Length - 10); FORM_INSTANCE.PROGRAMS[cur_program].outputs[index - 1].Name = channel_name; continue; } if ((tempLine.Length != 13) || (tempLine.IndexOf('=') != 3) || (tempLine.IndexOf(';') != 12)) { throw new Exception("Invalid format encountered on line " + lineCount); } else { index = int.Parse(tempLine.Substring(0, 3)); bool parsedSuccessfully = UInt32.TryParse(tempLine.Substring(4, 8), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out value); if (!parsedSuccessfully) { throw new Exception("Invalid value encountered on line " + lineCount); } else { FORM_INSTANCE._settings[cur_program][index].Value = value; } } } } }
public ReadForm(MainForm_Template _parentForm) { InitializeComponent(); PARENT_FORM = _parentForm; }
public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX, int PLAINFILTER_INDEX, int CH_NUMBER) { UInt32 B0 = 0x20000000; UInt32 B1 = 0x00000000; UInt32 B2 = 0x00000000; UInt32 A1 = 0x00000000; UInt32 A2 = 0x00000000; UInt32 PACKAGE = 0x00000000; UInt32 PACKAGE_GAIN = 0x00000000; UInt32 PACKAGE_Q = 0x00000000; if(this.Type == FilterType.None) { B0 = 0x20000000; B1 = 0x00000000; B2 = 0x00000000; A1 = 0x00000000; A2 = 0x00000000; PACKAGE = 0x00000000; PACKAGE_GAIN = 0x00000000; PACKAGE_Q = 0x00000000; } else if(this.Bypassed) { B0 = 0x20000000; B1 = 0x00000000; B2 = 0x00000000; A1 = 0x00000000; A2 = 0x00000000; PACKAGE = DSP_Math.filter_to_package(this); PACKAGE_GAIN = DSP_Math.double_to_MN(this.Filter.Gain, 8, 24); PACKAGE_Q = DSP_Math.double_to_MN(this.Filter.QValue, 8, 24); } else { B0 = DSP_Math.double_to_MN(this.Filter.B0, 3, 29); B1 = DSP_Math.double_to_MN(this.Filter.B1, 3, 29); B2 = DSP_Math.double_to_MN(this.Filter.B2, 3, 29); A1 = DSP_Math.double_to_MN(this.Filter.A1 * -1, 2, 30); A2 = DSP_Math.double_to_MN(this.Filter.A2 * -1, 2, 30); PACKAGE = DSP_Math.filter_to_package(this); PACKAGE_GAIN = DSP_Math.double_to_MN(this.Filter.Gain, 8, 24); PACKAGE_Q = DSP_Math.double_to_MN(this.Filter.QValue, 8, 24); } // MUTE THE CHANNEL OUTPUT GAIN TO REDUCE CRAZY NOISES.. PARENT_FORM.AddItemToQueue(new LiveQueueItem(36 + (CH_NUMBER - 1), 0x00000000)); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, B0)); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 1, B1)); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 2, B2)); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 3, A1)); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 4, A2)); UInt32 gain_val = DSP_Math.double_to_MN(DSP_Math.decibels_to_voltage_gain(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].gains[CH_NUMBER - 1][3].Gain), 3, 29); PARENT_FORM.AddItemToQueue(new LiveQueueItem(36 + (CH_NUMBER - 1), gain_val)); PARENT_FORM.AddItemToQueue(new LiveQueueItem(PLAINFILTER_INDEX, PACKAGE)); PARENT_FORM.AddItemToQueue(new LiveQueueItem(PLAINFILTER_INDEX + 1, PACKAGE_GAIN)); PARENT_FORM.AddItemToQueue(new LiveQueueItem(PLAINFILTER_INDEX + 2, PACKAGE_Q)); }
public CopyForm(MainForm_Template _parentForm, int channel_number, CopyFormType formType = CopyFormType.Filter3) { InitializeComponent(); PARENT_FORM = _parentForm; CH_NUMBER = channel_number; FORM_TYPE = formType; ((PictureCheckbox)Controls.Find("pchkChannel" + channel_number, true).First()).Enabled = false; pchkItem1.Visible = true; pchkItem2.Visible = true; pchkItem3.Visible = true; pchkItem4.Visible = true; pchkItem5.Visible = true; pchkItem6.Visible = true; switch (formType) { case CopyFormType.Filter3: pchkItem1.Text = " " + FilterToDescription(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][0]); pchkItem1.Checked = (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][0].Type != FilterType.None); pchkItem2.Text = " " + FilterToDescription(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][1]); pchkItem2.Checked = (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][1].Type != FilterType.None); pchkItem3.Text = " " + FilterToDescription(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][2]); pchkItem3.Checked = (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][2].Type != FilterType.None); pchkItem4.Visible = false; pchkItem5.Visible = false; pchkItem6.Visible = false; break; case CopyFormType.Filter6: pchkItem1.Text = " " + FilterToDescription(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][3]); pchkItem1.Checked = (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][3].Type != FilterType.None); pchkItem2.Text = " " + FilterToDescription(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][4]); pchkItem2.Checked = (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][4].Type != FilterType.None); pchkItem3.Text = " " + FilterToDescription(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][5]); pchkItem3.Checked = (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][5].Type != FilterType.None); pchkItem4.Text = " " + FilterToDescription(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][6]); pchkItem4.Checked = (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][6].Type != FilterType.None); pchkItem5.Text = " " + FilterToDescription(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][7]); pchkItem5.Checked = (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][7].Type != FilterType.None); pchkItem6.Text = " " + FilterToDescription(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][8]); pchkItem6.Checked = (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][8].Type != FilterType.None); break; case CopyFormType.InputConfiguration: // 3 Items are name, input type, phantom power // TODO - show extra warning for phantom power pchkItem4.Visible = false; pchkItem5.Visible = false; pchkItem6.Visible = false; break; case CopyFormType.Compressor: pchkItem1.Text = " Compressor Configuration from CH " + channel_number; pchkItem1.Checked = true; pchkItem2.Visible = false; pchkItem3.Visible = false; pchkItem4.Visible = false; pchkItem5.Visible = false; pchkItem6.Visible = false; break; case CopyFormType.Limiter : pchkItem1.Text = " Limiter Configuration from CH " + channel_number; pchkItem1.Checked = true; pchkItem2.Visible = false; pchkItem3.Visible = false; pchkItem4.Visible = false; pchkItem5.Visible = false; pchkItem6.Visible = false; break; case CopyFormType.Delay : // 1 Item is delay in ms pchkItem1.Text = " Delay Value of " + (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].delays[CH_NUMBER - 1].Delay * 1000).ToString("F1") + "ms"; pchkItem1.Checked = true; pchkItem2.Visible = false; pchkItem3.Visible = false; pchkItem4.Visible = false; pchkItem5.Visible = false; pchkItem6.Visible = false; break; default : // Gain pchkItem2.Visible = false; pchkItem3.Visible = false; pchkItem4.Visible = false; pchkItem5.Visible = false; pchkItem6.Visible = false; break; } pchkItem1.Invalidate(); pchkItem2.Invalidate(); pchkItem3.Invalidate(); pchkItem4.Invalidate(); pchkItem5.Invalidate(); pchkItem6.Invalidate(); }
public RestoreSettingsForm(MainForm_Template _parentForm) { InitializeComponent(); PARENT_FORM = _parentForm; }
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); } }
public GainForm(MainForm_Template _parentForm, int _ch_index, int _gain_index, int _settings_index, bool _is_mixer = false, string formTitle = "CH1 Gain") { InitializeComponent(); PARENT_FORM = _parentForm; CH_INDEX = _ch_index; GAIN_INDEX = _gain_index; IS_MIXER = _is_mixer; SETTINGS_INDEX = _settings_index; if (PARENT_FORM.LIVE_MODE) { gainMeter.Visible = true; signalTimer.Enabled = true; } else { gainMeter.Visible = false; signalTimer.Enabled = false; } if (IS_MIXER) { cur_gain = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].crosspoints[CH_INDEX][GAIN_INDEX].Gain; lblGain.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].crosspoints[CH_INDEX][GAIN_INDEX].Gain.ToString("N1") + "dB"; sliderPB.Location = new Point(18, (int)gain_to_yval(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].crosspoints[CH_INDEX][GAIN_INDEX].Gain)); } else { cur_gain = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].gains[CH_INDEX][GAIN_INDEX].Gain; lblGain.Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].gains[CH_INDEX][GAIN_INDEX].Gain.ToString("N1") + "dB"; sliderPB.Location = new Point(18, (int)gain_to_yval(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].gains[CH_INDEX][GAIN_INDEX].Gain)); } if (cur_gain <= -90) { } this.Text = formTitle; this.MouseWheel += new MouseEventHandler(panel1_MouseWheel); toolTip1 = new ToolTip(); // Set up the delays for the ToolTip. toolTip1.AutoPopDelay = 5000; toolTip1.InitialDelay = 10; toolTip1.ReshowDelay = 50; // Force the ToolTip text to be displayed whether or not the form is active. toolTip1.ShowAlways = true; // Set up the ToolTip text for the Button and Checkbox. toolTip1.SetToolTip(sliderPB, "Muted"); if (IS_MIXER) { if (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].crosspoints[CH_INDEX][GAIN_INDEX].Muted) { sliderPB.Cursor = Cursors.No; toolTip1.SetToolTip(sliderPB, "Muted"); } else { sliderPB.Cursor = Cursors.Hand; toolTip1.SetToolTip(sliderPB, null); } chkMuted.Checked = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].crosspoints[CH_INDEX][GAIN_INDEX].Muted; } else { if (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].gains[CH_INDEX][GAIN_INDEX].Muted) { sliderPB.Cursor = Cursors.No; toolTip1.SetToolTip(sliderPB, "Muted"); } else { sliderPB.Cursor = Cursors.Hand; toolTip1.SetToolTip(sliderPB, null); } chkMuted.Checked = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].gains[CH_INDEX][GAIN_INDEX].Muted; } }
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; }
public void QueueChannelChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX) { // On DSP 4x4, SETTINGS_INDEX will be 278 //UInt32 in_priority_address = SETTINGS_INDEX+ }
public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX) { PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, DSP_Math.double_to_MN(this.Delay, 16, 16))); }
public FilterForm(MainForm_Template _parentForm, int chan_number = 1, bool is_six = false) { CH_NUMBER = chan_number; PARENT_FORM = _parentForm; InitializeComponent(); _threadlock = new Object(); MasterResponseLine = filterChart.Series[6]; MasterMarkerLine = filterChart.Series[7]; if (is_six) { total_filters = 6; starting_filter = 3; active_global_filter_index = 3; pnlSecondRowFilters.Visible = true; pnlButtons.Location = new Point(18, 511); IS_SIX_CHANNEL = true; } else { total_filters = 3; starting_filter = 0; active_global_filter_index = 0; pnlSecondRowFilters.Visible = false; lblFilterSelector3.Visible = false; lblFilterSelector4.Visible = false; lblFilterSelector5.Visible = false; pnlButtons.Location = new Point(18, 407); } try { filterColors[0] = Color.Chocolate; filterColors[1] = Color.Chartreuse; filterColors[2] = Color.DarkMagenta; filterColors[3] = Color.SandyBrown; filterColors[4] = Color.PaleGreen; filterColors[5] = Color.Plum; filterColors[6] = Color.SandyBrown; filterColors[7] = Color.PaleGreen; filterColors[8] = Color.Plum; this.Text = "Filter Designer - CH " + chan_number.ToString(); this.DoubleBuffered = true; bool first_active_selected = false; for (int i = starting_filter; i < starting_filter + total_filters; i++) { int localized_starting_filter = i - starting_filter; if (PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i] == null || PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i].Type == FilterType.None) { // We don't care. Let's reinstantiate even the FilterType.None's PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i] = new FilterConfig(FilterType.None, false); ((ComboBox)Controls.Find("dropFilter" + (localized_starting_filter).ToString(), true)[0]).SelectedIndex = 0; filterChart.Series[localized_starting_filter].Enabled = false; } else { if (!first_active_selected) { active_global_filter_index = i; first_active_selected = true; } ((PictureCheckbox)Controls.Find("chkBypass" + localized_starting_filter.ToString(), true)[0]).Checked = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i].Bypassed; ((PictureCheckbox)Controls.Find("chkBypass" + localized_starting_filter.ToString(), true)[0]).Invalidate(); ((TextBox)Controls.Find("txtGain" + localized_starting_filter.ToString(), true)[0]).Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i].Filter.Gain.ToString("F1"); ((TextBox)Controls.Find("txtFreq" + localized_starting_filter.ToString(), true)[0]).Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i].Filter.CenterFrequency.ToString("#."); ((TextBox)Controls.Find("txtQval" + localized_starting_filter.ToString(), true)[0]).Text = PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i].Filter.QValue.ToString("F3"); if (((int)PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i].Filter.FilterType == 6) || ((int)PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i].Filter.FilterType == 7)) { if ((int)PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i].Filter.FilterType == 6) { //LP 2nd order ((ComboBox)Controls.Find("dropSlope" + localized_starting_filter.ToString(), true)[0]).SelectedIndex = 1; ((ComboBox)Controls.Find("dropSlope" + localized_starting_filter.ToString(), true)[0]).Invalidate(); ((ComboBox)Controls.Find("dropFilter" + localized_starting_filter.ToString(), true)[0]).SelectedIndex = LOW_PASS; } else { //HP 2nd order ((ComboBox)Controls.Find("dropSlope" + localized_starting_filter.ToString(), true)[0]).SelectedIndex = 1; ((ComboBox)Controls.Find("dropSlope" + localized_starting_filter.ToString(), true)[0]).Invalidate(); ((ComboBox)Controls.Find("dropFilter" + localized_starting_filter.ToString(), true)[0]).SelectedIndex = HIGH_PASS; } } else { ((ComboBox)Controls.Find("dropSlope" + localized_starting_filter.ToString(), true)[0]).SelectedIndex = 0; ((ComboBox)Controls.Find("dropSlope" + localized_starting_filter.ToString(), true)[0]).Invalidate(); ((ComboBox)Controls.Find("dropFilter" + localized_starting_filter.ToString(), true)[0]).SelectedIndex = (int)PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].filters[CH_NUMBER - 1][i].Filter.FilterType + 1; } filterColors[localized_starting_filter] = filterColors[localized_starting_filter]; filterChart.Series[localized_starting_filter].Enabled = true; } } RefreshAllFilters(); filterChart.ChartAreas[0].RecalculateAxesScale(); var backImage = new NamedImage("FilterGraph_BG_Blue_Modified", GlobalResources.FilterGraph_BG_Blue_Modified); filterChart.Images.Add(backImage); filterChart.ChartAreas[0].BackImage = "FilterGraph_BG_Blue_Modified"; dropFilter0.BackColor = Helpers.Lighten(filterColors[0], 0.20); dropFilter1.BackColor = Helpers.Lighten(filterColors[1], 0.30); dropFilter2.BackColor = Helpers.Lighten(filterColors[2], 0.40); dropFilter3.BackColor = Helpers.Lighten(filterColors[3], 0.10); dropFilter4.BackColor = Helpers.Lighten(filterColors[4], 0.10); dropFilter5.BackColor = Helpers.Lighten(filterColors[5], 0.10); pnlSecondRowFilters.Invalidate(); lblFilterSelector1.BackColor = Helpers.Darken(filterColors[1], filterSelectorFade); lblFilterSelector2.BackColor = Helpers.Darken(filterColors[2], filterSelectorFade); lblFilterSelector3.BackColor = Helpers.Darken(filterColors[2], filterSelectorFade); lblFilterSelector4.BackColor = Helpers.Darken(filterColors[3], filterSelectorFade); lblFilterSelector5.BackColor = Helpers.Darken(filterColors[4], filterSelectorFade); dropAction.SelectedIndex = 0; dropAction.Invalidate(); UpdateActiveFilter(); graph_loaded = true; } catch (Exception ex) { Console.WriteLine(ex); } }
public static void Write(string outputFile, MainForm_Template FORM_INSTANCE) { using (System.IO.StreamWriter file = new System.IO.StreamWriter(outputFile)) { file.WriteLine("DEVICE-ID:" + FORM_INSTANCE.GetDeviceID().ToString("X8") + ";"); file.WriteLine("SERIAL:" + FORM_INSTANCE.SERIALNUM + ";"); file.WriteLine("TIMESTAMP:" + DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss") + ";"); for (int k = 0; k < 3; k++) { file.WriteLine("PRESET" + (k + 1) + ";"); for (int i = 0; i < FORM_INSTANCE.GetNumInputChannels(); i++) { file.WriteLine("INPUT_" + (i + 1) + ":" + FORM_INSTANCE.PROGRAMS[k].inputs[i].Name + ";"); } for (int j = 0; j < FORM_INSTANCE.GetNumOutputChannels(); j++) { file.WriteLine("OUTPUT_" + (j + 1) + ":" + FORM_INSTANCE.PROGRAMS[k].outputs[j].Name + ";"); } for (int j = 0; j < FORM_INSTANCE.GetNumPhantomPowerChannels(); j++) { file.WriteLine("PHANTOM_" + (j + 1) + ":" + (FORM_INSTANCE.PROGRAMS[k].inputs[j].PhantomPower ? "00000001" : "00000000") + ";"); } foreach (DSP_Setting single_setting in FORM_INSTANCE._settings[k]) { file.WriteLine(single_setting.Index.ToString("D3") + "=" + single_setting.Value.ToString("X8") + ";"); } } } }
public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX) { PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, DSP_Math.double_to_MN(this.Threshold, 9, 23))); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 1, DSP_Math.dynamic_hold_to_value(this.Holdtime))); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 2, DSP_Math.double_to_MN(this.Depth, 9, 23))); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 3, DSP_Math.comp_attack_to_value(this.Attack))); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 4, DSP_Math.comp_release_to_value(this.Release))); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 5, Convert.ToUInt32(this.Bypassed))); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 6, (uint)this.RouterInputs[0])); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 7, (uint)this.RouterInputs[1])); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 8, (uint)this.RouterInputs[2])); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 9, (uint)this.RouterInputs[3])); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 10, (uint)this.RouterOutputs[0])); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 11, (uint)this.RouterOutputs[1])); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 12, (uint)this.RouterOutputs[2])); PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 13, (uint)this.RouterOutputs[3])); }
public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX) { int ADDR_THRESHOLD = SETTINGS_INDEX; int ADDR_KNEE = SETTINGS_INDEX + 1; int ADDR_RATIO = SETTINGS_INDEX + 2; int ADDR_ATTACK = SETTINGS_INDEX + 3; int ADDR_RELEASE = SETTINGS_INDEX + 4; int ADDR_BYPASS = SETTINGS_INDEX + 5; PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_THRESHOLD, DSP_Math.double_to_MN(this.Threshold, 9, 23))); if (this.SoftKnee) { PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_KNEE, 0x03000000)); } else { PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_KNEE, 0x00000000)); } PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_RATIO, DSP_Math.comp_ratio_to_value(this.Ratio))); PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_ATTACK, DSP_Math.comp_attack_to_value(this.Attack))); PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_RELEASE, DSP_Math.comp_release_to_value(this.Release))); if (this.Bypassed) { PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_BYPASS, 0x00000001)); } else { PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_BYPASS, 0x00000000)); } }