예제 #1
0
        public static void SetMuteSolo(int partKey, muteStatus ms, Document doc = null)
        {
            if (doc == null)
            {
                doc = crntDoc;
            }
            if (doc == null)
            {
                return;
            }
            if (!lstMuteStatus.ContainsKey(doc))
            {
                return;
            }
            if (!lstMuteStatus[doc].ContainsKey(partKey))
            {
                return;
            }

            muteStatus mts = lstMuteStatus[doc][partKey];

            mts.mute  = ms.mute;
            mts.solo  = ms.solo;
            mts.cache = ms.cache;

            SetChipMute(doc, mts.chipName, mts.chipIndex, mts.chipNumber, mts.partNumber, mts.mute);
        }
예제 #2
0
        public static int UpdateTrackInfo(Document doc, object[] cells, int key = -1)
        {
            crntDoc = doc;

            Add(doc);

            //if (trackNum < 0) return -1;
            Dictionary <int, muteStatus> dms = lstMuteStatus[doc];

            if (key == -1)
            {
                key = GetKey(doc, cells);
            }

            //自動で要素追加
            if (dms == null || !dms.ContainsKey(key))
            {
                if (dms == null)
                {
                    dms = new Dictionary <int, muteStatus>();
                }

                dms.Add(key, new muteStatus());
                lstMuteStatus[doc] = dms;
            }

            muteStatus ms = dms[key];

            ms.partNumber = (int)cells[0];
            ms.chipIndex  = (int)cells[1];
            ms.chipNumber = (int)cells[2];
            ms.trackName  = (string)cells[3];
            ms.chipName   = (string)cells[4];

            //SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, ms.partNumber, false);

            return(key);
        }
예제 #3
0
        public static void ClickSolo(int partKey, Document doc = null)
        {
            if (doc == null)
            {
                doc = crntDoc;
            }
            if (doc == null)
            {
                return;
            }
            if (!lstMuteStatus.ContainsKey(doc))
            {
                return;
            }
            if (!lstMuteStatus[doc].ContainsKey(partKey))
            {
                return;
            }

            muteStatus mts     = lstMuteStatus[doc][partKey];
            bool       nowSolo = mts.solo;

            //SOLOモードではなく、SOLOではない場合はチェックを行う
            if (!SoloMode[doc] && !nowSolo && !CheckSoloCh(doc))
            {
                SoloMode[doc] = true;
                //mute退避
                foreach (muteStatus ms in lstMuteStatus[doc].Values)
                {
                    ms.cache = ms.mute;
                    ms.mute  = true;
                    SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, ms.partNumber, ms.mute);
                    if (ms.partNumber == 13 && doc.srcFileFormat == EnmMmlFileFormat.MUC)
                    {
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 13, ms.mute); //b
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 14, ms.mute); //s
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 15, ms.mute); //c
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 16, ms.mute); //h
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 17, ms.mute); //t
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 18, ms.mute); //r
                    }
                }
            }

            mts.solo = !nowSolo;
            if (SoloMode[doc])
            {
                mts.mute = nowSolo;
            }
            SetChipMute(doc, mts.chipName, mts.chipIndex, mts.chipNumber, mts.partNumber, mts.mute);

            if (doc.srcFileFormat != EnmMmlFileFormat.MUC)
            {
                if (SoloMode[doc] && nowSolo && !CheckSoloCh(doc))
                {
                    SoloMode[doc] = false;
                    //mute復帰
                    foreach (muteStatus ms in lstMuteStatus[doc].Values)
                    {
                        ms.mute = ms.cache;
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, ms.partNumber, ms.mute);
                    }
                }

                return;
            }

            string tn = mts.trackName;

            if (tn.Length >= 2)
            {
                char t = tn[0];
                foreach (muteStatus ms in lstMuteStatus[doc].Values)
                {
                    if (ms.trackName[0] != t)
                    {
                        continue;
                    }

                    ms.mute  = mts.mute;
                    ms.solo  = mts.solo;
                    ms.cache = mts.cache;
                    SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, ms.partNumber, ms.mute);
                    if (mts.partNumber >= 13 && mts.partNumber <= 18)
                    {
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 13, ms.mute); //b
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 14, ms.mute); //s
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 15, ms.mute); //c
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 16, ms.mute); //h
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 17, ms.mute); //t
                        SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, 18, ms.mute); //r
                    }
                }
            }

            if (SoloMode[doc] && nowSolo && !CheckSoloCh(doc))
            {
                SoloMode[doc] = false;
                //mute復帰
                foreach (muteStatus ms in lstMuteStatus[doc].Values)
                {
                    ms.mute = ms.cache;
                    SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, ms.partNumber, ms.mute);
                }
            }
        }
예제 #4
0
        public static void ClickMute(int partKey, Document doc = null)
        {
            if (doc == null)
            {
                doc = crntDoc;
            }
            if (doc == null)
            {
                return;
            }
            if (!lstMuteStatus.ContainsKey(doc))
            {
                return;
            }
            if (!lstMuteStatus[doc].ContainsKey(partKey))
            {
                return;
            }

            muteStatus mts     = lstMuteStatus[doc][partKey];
            bool       nowMute = mts.mute;

            mts.mute = !nowMute;
            if (SoloMode[doc])
            {
                mts.solo = nowMute;
            }

            SetChipMute(doc, mts.chipName, mts.chipIndex, mts.chipNumber, mts.partNumber, mts.mute);

            if (SoloMode[doc] && !nowMute && !CheckSoloCh(doc))
            {
                SoloMode[doc] = false;

                //mute復帰
                foreach (muteStatus ms in lstMuteStatus[doc].Values)
                {
                    ms.mute = ms.cache;
                    SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, ms.partNumber, ms.mute);
                }
            }

            if (doc.srcFileFormat != EnmMmlFileFormat.MUC)
            {
                return;
            }
            string tn = mts.trackName;

            if (tn.Length < 2)
            {
                return;
            }
            char t = tn[0];

            foreach (muteStatus ms in lstMuteStatus[doc].Values)
            {
                if (ms.trackName[0] != t)
                {
                    continue;
                }

                ms.mute  = mts.mute;
                ms.solo  = mts.solo;
                ms.cache = mts.cache;
                SetChipMute(doc, ms.chipName, ms.chipIndex, ms.chipNumber, ms.partNumber, ms.mute);
            }
        }
예제 #5
0
        public void AddPartCounter(object[] cells)
        {
            DataGridViewRow r = new DataGridViewRow();

            r.CreateCells(dgvPartCounter);

            r.Cells[dgvPartCounter.Columns["ClmPartNumber"].Index].Value  = cells[0];
            r.Cells[dgvPartCounter.Columns["ClmChipIndex"].Index].Value   = cells[1];
            r.Cells[dgvPartCounter.Columns["ClmChipNumber"].Index].Value  = cells[2];
            r.Cells[dgvPartCounter.Columns["ClmPart"].Index].Value        = cells[3];
            r.Cells[dgvPartCounter.Columns["ClmChip"].Index].Value        = cells[4];
            r.Cells[dgvPartCounter.Columns["ClmCOunter"].Index].Value     = cells[5];
            r.Cells[dgvPartCounter.Columns["ClmLoopCounter"].Index].Value = cells[6];
            r.Cells[dgvPartCounter.Columns["ClmMuteMngKey"].Index].Value  = cells[7];

            muteStatus ms = muteManager.GetStatus((int)cells[7]);

            if (ms != null)
            {
                r.Cells[dgvPartCounter.Columns["ClmMute"].Index].Value = ms.mute ? "M" : "";
                r.Cells[dgvPartCounter.Columns["ClmPush"].Index].Value = ms.cache ? "M" : "";
                r.Cells[dgvPartCounter.Columns["ClmSolo"].Index].Value = ms.solo ? "S" : "";
            }
            else
            {
                r.Cells[dgvPartCounter.Columns["ClmMute"].Index].Value = "";
                r.Cells[dgvPartCounter.Columns["ClmPush"].Index].Value = "";
                r.Cells[dgvPartCounter.Columns["ClmSolo"].Index].Value = "";
            }


            ////mute状態を復帰する
            //bool fnd = false;
            //foreach (Tuple<string, int, int, int, bool, bool, bool> l in lstCacheMuteSolo)
            //{
            //    if (l.Item1 != (string)cells[4]
            //        || l.Item2 != (int)cells[1]
            //        || l.Item3 != (int)cells[2]
            //        || l.Item4 != (int)cells[0])
            //        continue;

            //    r.Cells[dgvPartCounter.Columns["ClmMute"].Index].Value = (bool)l.Item5 ? "M" : "";
            //    r.Cells[dgvPartCounter.Columns["ClmPush"].Index].Value = (bool)l.Item6 ? "M" : "";
            //    r.Cells[dgvPartCounter.Columns["ClmSolo"].Index].Value = (bool)l.Item7 ? "S" : "";
            //    //if (SoloMode) r.Cells[dgvPartCounter.Columns["ClmSolo"].Index].Value = (!(bool)l.Item5) ? "S" : "";
            //    //else r.Cells[dgvPartCounter.Columns["ClmSolo"].Index].Value = "";
            //    fnd = true;
            //    break;
            //}
            ////見つからない場合は初期値をセット
            //if (!fnd)
            //{
            //    SoloMode = false;
            //    r.Cells[dgvPartCounter.Columns["ClmMute"].Index].Value = "";
            //    r.Cells[dgvPartCounter.Columns["ClmSolo"].Index].Value = "";// SoloMode ? "S" : "";
            //    r.Cells[dgvPartCounter.Columns["ClmPush"].Index].Value = "";
            //}


            dgvPartCounter.Rows.Add(r);
            SetMute(r);
        }