示例#1
0
        public void Set(PinSetting[] setting, DMap[] drummap)
        {
            Setting = setting;
            DrumMap = drummap;

            ShowChannels(-1);
        }
示例#2
0
 private void drumMapToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DrumMapForm dmForm = new DrumMapForm(DrumMap);
     if (dmForm.ShowDialog() == DialogResult.OK)
     {
         DrumMap = dmForm.DrumMap;
         lbPads.Items.Clear();
         foreach (DMap dm in DrumMap)
             lbPads.Items.Add(dm.Name);
     }
 }
示例#3
0
 public void Draw(DMap[] DrumMap, PinSetting[] Setting, HHSetting hhSetting)
 {
     _DrumMap = DrumMap;
     _Setting = Setting;
     _hhSetting = hhSetting;
 }
示例#4
0
        private void LoadSetting(string SettingPath)
        {
            //MessageBox.Show(SettingPath);
            if (!File.Exists(SettingPath)) { return; }

            gSetting.DelayTime = Convert.ToByte(UtilityIniFile.GetIniString("General", "Delay", SettingPath));
            //gSetting.HHC1 = Convert.ToByte(UtilityIniFile.GetIniString("General", "HHC1", SettingPath));
            gSetting.NSensor = Convert.ToByte(UtilityIniFile.GetIniString("General", "NSensor", SettingPath));
            gSetting.Xtalk = Convert.ToByte(UtilityIniFile.GetIniString("General", "Xtalk", SettingPath));

            //LoadPinSetting
            for (int i = 0; i < Setting.Length; i++)
            {
                string tmp = UtilityIniFile.GetIniString("PinSetting", "Pin" + i.ToString(), SettingPath);
                if (!String.IsNullOrEmpty(tmp))
                    Setting[i].FromString(tmp);
            }

            //Load DrumMap
            string[] Pads = UtilityIniFile.GetKeys("DrumMap", SettingPath);
            lbPads.Items.Clear();
            cbHH_HHC.Items.Clear();
            DrumMap = new DMap[Pads.Length];
            for (int i = 0; i < Pads.Length; i++)
            {
                string tmp = UtilityIniFile.GetIniString("DrumMap", Pads[i], SettingPath);
                if (!String.IsNullOrEmpty(tmp))
                {
                    string[] split = tmp.Split(';');
                    DrumMap[i].Name = Pads[i];
                    lbPads.Items.Add(Pads[i]);

                    DrumMap[i].Head = Convert.ToByte(split[0]);
                    DrumMap[i].Rim = Convert.ToByte(split[1]);
                    DrumMap[i].Single = (split[2] == "Y");

                    if (Setting[DrumMap[i].Head].Type == PinType.HHC)
                        cbHH_HHC.Items.Add(Pads[i]);
                }
            }
            string[] A = UtilityIniFile.GetIniString("HH", "A", SettingPath).Split(';');
            hhSetting.A_Note = Convert.ToByte(A[0]);
            hhSetting.A_Thresold = Convert.ToByte(A[1]);
            string[] B = UtilityIniFile.GetIniString("HH", "B", SettingPath).Split(';');
            hhSetting.B_Note = Convert.ToByte(B[0]);
            hhSetting.B_Thresold = Convert.ToByte(B[1]);
            string[] C = UtilityIniFile.GetIniString("HH", "C", SettingPath).Split(';');
            hhSetting.C_Note = Convert.ToByte(C[0]);
            hhSetting.C_Thresold = Convert.ToByte(C[1]);
            string[] D = UtilityIniFile.GetIniString("HH", "D", SettingPath).Split(';');
            hhSetting.D_Note = Convert.ToByte(D[0]);
            hhSetting.D_Thresold = Convert.ToByte(D[1]);
            string[] FootClose = UtilityIniFile.GetIniString("HH", "FootClose", SettingPath).Split(';');
            hhSetting.FootCloseNote = Convert.ToByte(FootClose[0]);
            hhSetting.FootCloseThresold = Convert.ToByte(FootClose[1]);
            string[] FootSplash = UtilityIniFile.GetIniString("HH", "FootSplash", SettingPath).Split(';');
            hhSetting.FootSplashNote = Convert.ToByte(FootSplash[0]);
            hhSetting.FootSplashThresold = Convert.ToByte(FootSplash[1]);
        }