protected void btnPreGain2_MouseClick(object sender, MouseEventArgs e)
        {
            int ch_num = int.Parse(((PictureButton)sender).Name.Substring(5, 1));

            int settings_index = (28 + ch_num - 1);

            GainConfig cached_gain = (GainConfig)PROGRAMS[CURRENT_PROGRAM].gains[ch_num - 1][1].Clone();

            if (e.Button == MouseButtons.Right)
            {
                temp_from_ch = ch_num;
                temp_from_index = 0;
                temp_from_preset = CURRENT_PROGRAM;

                TempConfig = cached_gain;
                ShowCopyMenu(sender);
                return;
            }

            using (GainForm gainForm = new GainForm(this, ch_num - 1, 1, settings_index, false, "CH" + ch_num.ToString() + " - Premix Gain"))
            {
                if (!LIVE_MODE)
                {
                    gainForm.Width = 132;
                }
                else
                {
                    gainForm.Width = 187;
                }

                gainForm.Height = 414;

                DialogResult showBlock = gainForm.ShowDialog(this);

                if (showBlock == DialogResult.Cancel)
                {
                    if (!PROGRAMS[CURRENT_PROGRAM].gains[ch_num - 1][1].Equals(cached_gain))
                    {
                        PROGRAMS[CURRENT_PROGRAM].gains[ch_num - 1][1] = (GainConfig) cached_gain.Clone();

                        if (LIVE_MODE)
                        {
                            PROGRAMS[CURRENT_PROGRAM].gains[ch_num - 1][1].QueueChange(this, settings_index);
                        }
                    }

                }
                else
                {
                    UpdateTooltips();
                }

            }
        }
        protected void btnPreGain1_MouseClick(object sender, MouseEventArgs e)
        {
            int ch_num = int.Parse(((PictureButton)sender).Name.Substring(5, 1));

            int settings_index = (0 + ch_num - 1);

            GainConfig cached_gain = (GainConfig)PROGRAMS[CURRENT_PROGRAM].gains[ch_num - 1][0].Clone();

            if(e.Button == MouseButtons.Right)
            {
                TempConfig = cached_gain;

                temp_from_ch = ch_num;
                temp_from_index = 0;
                temp_from_preset = CURRENT_PROGRAM;

                ShowCopyMenu(sender);
                return;
            }

            using (GainForm gainForm = new GainForm(this, ch_num - 1, 0, settings_index, false, "CH" + ch_num.ToString() + " - Input Gain"))
            {

                if (!LIVE_MODE)
                {
                    gainForm.Width = 132;
                }
                else
                {
                    gainForm.Width = 187;
                }

                gainForm.Height = 414;

                DialogResult showBlock = gainForm.ShowDialog(this);

                if (showBlock == DialogResult.Cancel)
                {
                    if (!PROGRAMS[CURRENT_PROGRAM].gains[ch_num - 1][0].Equals(cached_gain))
                    {
                        PROGRAMS[CURRENT_PROGRAM].gains[ch_num - 1][0] = (GainConfig) cached_gain.Clone();
                        PROGRAMS[CURRENT_PROGRAM].gains[ch_num - 1][0].QueueChange(this, settings_index, true, ch_num - 1);

                        if (LIVE_MODE && FIRMWARE_VERSION > 2.5)
                        {

                            UInt32 new_input_gain = DSP_Math.double_to_MN(PROGRAMS[CURRENT_PROGRAM].pregains[ch_num - 1] +
                                                                          PROGRAMS[CURRENT_PROGRAM].gains[ch_num - 1][0].Gain, 9, 23);

                            AddItemToQueue(new LiveQueueItem((0 + ch_num - 1), new_input_gain));
                        }
                    }

                }
                else
                {
                    UpdateTooltips();
                }
            }
        }