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 void ContextMenu_Copy(object sender, EventArgs e) { CopyType = CopyTypeFromControl(activeBlockForMenu); CopyConfig = TempConfig; copy_from_preset = temp_from_preset; copy_from_index = temp_from_index; has_copy_config = true; }