private void SetMute(DataGridViewRow r) { string chip = (string)r.Cells["ClmChip"].Value; int chipIndex = (int)r.Cells["ClmChipIndex"].Value; int chipNumber = (int)r.Cells["ClmChipNumber"].Value; if (mmlParams == null) { return; } if (!mmlParams.Insts.ContainsKey(chip)) { return; } if (!mmlParams.Insts[chip].ContainsKey(chipIndex) || !mmlParams.Insts[chip][chipIndex].ContainsKey(chipNumber)) { return; } MMLParameter.Instrument mmli = mmlParams.Insts[chip][chipIndex][chipNumber]; int pn = (int)r.Cells["ClmPartNumber"].Value - 1; bool mute = (string)r.Cells["ClmMute"].Value == "M"; mmli.SetMute(pn, mute); //特殊処理:mucの場合はリズムは一括で制御 if (pn == 12 && (string)r.Cells["ClmPart"].Value == "G") { for (int i = 0; i < 5; i++) { mmli.SetMute(i + 13, mute); } } }
private void SetMute(DataGridViewRow r) { string chip = (string)r.Cells["ClmChip"].Value; int chipIndex = (int)r.Cells["ClmChipIndex"].Value; int chipNumber = (int)r.Cells["ClmChipNumber"].Value; if (mmlParams == null) { return; } if (!mmlParams.Insts.ContainsKey(chip)) { return; } if (!mmlParams.Insts[chip].ContainsKey(chipIndex) || !mmlParams.Insts[chip][chipIndex].ContainsKey(chipNumber)) { return; } MMLParameter.Instrument mmli = mmlParams.Insts[chip][chipIndex][chipNumber]; int pn = (int)r.Cells["ClmPartNumber"].Value - 1; bool mute = (string)r.Cells["ClmMute"].Value == "M"; if (!(mmli is YM2608_mucom) && !(mmli is YM2610B_mucom)) { mmli.SetMute(pn, mute); return; } string cp = (string)r.Cells["ClmPart"].Value; int ch = cp[0] - 'A'; int pg;// = cp.Length < 2 ? 0 : (cp[1] - '0'); string mm = (string)r.Cells["ClmMute"].Value; string sm = (string)r.Cells["ClmSolo"].Value; foreach (DataGridViewRow rw in dgvPartCounter.Rows) { string p = (string)rw.Cells["ClmPart"].Value; int c = p[0] - 'A'; if (c != ch) { continue; } rw.Cells["ClmMute"].Value = mm; rw.Cells["ClmSolo"].Value = sm; pn = (int)rw.Cells["ClmPartNumber"].Value - 1; pg = p.Length < 2 ? 0 : (p[1] - '0'); ((YM2608_mucom)mmli).SetMute(pn, ch, pg, mute); } }
private void SetMute(DataGridViewRow r) { string chip = (string)r.Cells["ClmChip"].Value; int chipIndex = (int)r.Cells["ClmChipIndex"].Value; int chipNumber = (int)r.Cells["ClmChipNumber"].Value; if (!mmlParams.Insts.ContainsKey(chip)) { return; } if (!mmlParams.Insts[chip].ContainsKey(chipIndex) || !mmlParams.Insts[chip][chipIndex].ContainsKey(chipNumber)) { return; } MMLParameter.Instrument mmli = mmlParams.Insts[chip][chipIndex][chipNumber]; int pn = (int)r.Cells["ClmPartNumber"].Value - 1; bool mute = (string)r.Cells["ClmMute"].Value == "M"; mmli.SetMute(pn, mute); }
private void SetMute(DataGridViewRow r) { string chip = (string)r.Cells["ClmChip"].Value; int chipIndex = (int)r.Cells["ClmChipIndex"].Value; int chipNumber = (int)r.Cells["ClmChipNumber"].Value; if (mmlParams == null) { return; } if (!mmlParams.Insts.ContainsKey(chip)) { return; } if (!mmlParams.Insts[chip].ContainsKey(chipIndex) || !mmlParams.Insts[chip][chipIndex].ContainsKey(chipNumber)) { return; } MMLParameter.Instrument mmli = mmlParams.Insts[chip][chipIndex][chipNumber]; int pn = (int)r.Cells["ClmPartNumber"].Value - 1; bool mute = (string)r.Cells["ClmMute"].Value == "M"; if (!(mmli is YM2608_mucom) && !(mmli is YM2610B_mucom) && !(mmli is YM2151_mucom)) { mmli.SetMute(pn, mute); return; } string cp = (string)r.Cells["ClmPart"].Value; int isOPNA = "ABCDEFGHIJKLMNOPQRSTUV".IndexOf(cp[0]) < 0 ? ("abcdefghijklmnopqrstuv".IndexOf(cp[0]) < 0 ? 2 : 1) : 0; int ch; int cn = 0; if (isOPNA < 2) { ch = (cp[0] < 'a') ? (cp[0] - 'A') : (cp[0] - 'a'); cn = ch < 11 ? 0 : 1; ch = ch < 11 ? ch : (ch - 11); } else { ch = (cp[0] <= 'w' ? (cp[0] - 'W') : (cp[0] - 'w' + 4)); } int pg;// = cp.Length < 2 ? 0 : (cp[1] - '0'); string mm = (string)r.Cells["ClmMute"].Value; string sm = (string)r.Cells["ClmSolo"].Value; //int partKey = (int)r.Cells["ClmMuteMngKey"].Value; //muteStatus ms = muteManager.GetStatus(partKey); foreach (DataGridViewRow rw in dgvPartCounter.Rows) { string p = (string)rw.Cells["ClmPart"].Value; int isOPNAc = "ABCDEFGHIJKLMNOPQRSTUV".IndexOf(p[0]) < 0 ? ("abcdefghijklmnopqrstuv".IndexOf(p[0]) < 0 ? 2 : 1) : 0; if (isOPNA != isOPNAc) { continue; } int c; int n = 0; if (isOPNAc < 2) { c = (p[0] < 'a') ? (p[0] - 'A') : (p[0] - 'a'); n = c < 11 ? 0 : 1; if (n != cn) { continue; } c = c < 11 ? c : (c - 11); } else { if (n != cn) { continue; } c = (p[0] <= 'w' ? (p[0] - 'W') : (p[0] - 'w' + 4)); } if (c != ch) { continue; } //partKey = (int)rw.Cells["ClmMuteMngKey"].Value; //muteManager.SetMuteSolo(partKey, ms); rw.Cells["ClmMute"].Value = mm; rw.Cells["ClmSolo"].Value = sm; pn = (int)rw.Cells["ClmPartNumber"].Value - 1; pg = p.Length < 2 ? 0 : (p[1] - '0'); if (isOPNA == 0) { ((YM2608_mucom)mmli).SetMute(pn, ch, pg, mute); } else if (isOPNA == 1) { ((YM2610B_mucom)mmli).SetMute(pn, ch, pg, mute); } else { ((YM2151_mucom)mmli).SetMute(pn, ch, pg, mute); } } }