protected void ImportSectionFromPreset(Form1.BitmapButtonList _type)
 {
     this.openFileDialog1.FileName = "";
     if (this.openFileDialog1.ShowDialog() != DialogResult.OK)
     {
         return;
     }
     Form1.m_CurrentPatch.LoadFileInSection(_type, this.openFileDialog1.FileName, this);
     this.Refresh();
 }
Example #2
0
        public void LoadFileInSection(Form1.BitmapButtonList _type, string FileName, Form1 form)
        {
            string _patchname = "";

            int[] numArray = this.LoadFileInternal(FileName, ref _patchname, false);
            if (numArray == null)
            {
                return;
            }
            switch (_type)
            {
            case Form1.BitmapButtonList.IMPORT_MOD:
                this.m_PatchFinalValues[16] = numArray[16];
                this.m_PatchFinalValues[17] = numArray[17];
                this.m_PatchFinalValues[18] = numArray[18];
                this.m_PatchFinalValues[19] = numArray[19];
                this.m_PatchFinalValues[20] = numArray[20];
                this.m_PatchFinalValues[21] = numArray[21];
                break;

            case Form1.BitmapButtonList.IMPORT_PRE:
                this.m_PatchFinalValues[7]  = numArray[7];
                this.m_PatchFinalValues[8]  = numArray[8];
                this.m_PatchFinalValues[9]  = numArray[9];
                this.m_PatchFinalValues[10] = numArray[10];
                this.m_PatchFinalValues[11] = numArray[11];
                this.m_PatchFinalValues[12] = numArray[12];
                break;

            case Form1.BitmapButtonList.IMPORT_REV:
                this.m_PatchFinalValues[27] = numArray[27];
                this.m_PatchFinalValues[28] = numArray[28];
                this.m_PatchFinalValues[29] = numArray[29];
                this.m_PatchFinalValues[30] = numArray[30];
                this.m_PatchFinalValues[31] = numArray[31];
                this.m_PatchFinalValues[32] = numArray[32];
                this.m_PatchFinalValues[33] = numArray[33];
                break;

            case Form1.BitmapButtonList.IMPORT_AMP:
                this.m_PatchFinalValues[2]  = numArray[2];
                this.m_PatchFinalValues[3]  = numArray[3];
                this.m_PatchFinalValues[4]  = numArray[4];
                this.m_PatchFinalValues[5]  = numArray[5];
                this.m_PatchFinalValues[6]  = numArray[6];
                this.m_PatchFinalValues[13] = numArray[13];
                this.m_PatchFinalValues[14] = numArray[14];
                this.m_PatchFinalValues[15] = numArray[15];
                break;

            case Form1.BitmapButtonList.IMPORT_DEL:
                this.m_PatchFinalValues[0]  = numArray[0];
                this.m_PatchFinalValues[1]  = numArray[1];
                this.m_PatchFinalValues[22] = numArray[22];
                this.m_PatchFinalValues[23] = numArray[23];
                this.m_PatchFinalValues[24] = numArray[24];
                this.m_PatchFinalValues[25] = numArray[25];
                this.m_PatchFinalValues[26] = numArray[26];
                break;

            case Form1.BitmapButtonList.IMPORT_POW:
                this.m_PatchFinalValues[34] = numArray[34];
                this.m_PatchFinalValues[35] = numArray[35];
                this.m_PatchFinalValues[38] = numArray[38];
                this.m_PatchFinalValues[39] = numArray[39];
                break;
            }
            this.FillEditFromPatch(form);
        }