Пример #1
0
        public override XmlElement Export(XmlDocument doc, XmlElement parent)
        {
            XmlElement current = base.Export(doc, parent);

            foreach (var wcmNote in NoteHistory)
            {
                wcmNote.Export(doc, current);
            }

            if (MessageDraft != null)
            {
                current.SetAttribute("MESSAGE_DRAFT", MessageDraft);
            }
            current.SetAttribute("NOTES_STATUS", NotesStatus.ToString());
            return(current);
        }
Пример #2
0
        private void DeletePredeclaredControlCommands(Intermediate src, LinkedList <TempoSet> tempoSetList, List <CommandPartSet> partSet, Settings settings, List <NotesStatus> statusList)
        {
            try
            {
                NotesStatus status = null;
                int         i      = 0;
                foreach (CommandPartSet set in partSet)
                {
                    NotesStatus sts = statusList.Find(x => (x.TrackNumber == src.TrackList[i].Number && x.NumberInTrack == src.TrackList[i].NotesList[0].NumberInTrack));
                    if (i == 0)
                    {
                        status = sts;
                    }

                    var newInstrumentSetList = new LinkedList <ChangeEventSet>();
                    LinkedListNode <ChangeEventSet> curInstNode = set.InstrumentSetList.First;
                    while (curInstNode != null)
                    {
                        if (curInstNode.Previous == null ||
                            curInstNode.Value.ToString(settings, sts.SoundModule) != curInstNode.Previous.Value.ToString(settings, sts.SoundModule))
                        {
                            newInstrumentSetList.AddLast(curInstNode.Value);
                        }
                        curInstNode = curInstNode.Next;
                    }
                    set.InstrumentSetList = newInstrumentSetList;

                    var newVolumeSetList = new LinkedList <ChangeEventSet>();
                    LinkedListNode <ChangeEventSet> curVolNode = set.VolumeSetList.First;
                    while (curVolNode != null)
                    {
                        if (curVolNode.Previous == null ||
                            curVolNode.Value.ToString(settings, sts.SoundModule) != curVolNode.Previous.Value.ToString(settings, sts.SoundModule))
                        {
                            newVolumeSetList.AddLast(curVolNode.Value);
                        }
                        curVolNode = curVolNode.Next;
                    }
                    set.VolumeSetList = newVolumeSetList;

                    var newPanSetList = new LinkedList <ChangeEventSet>();
                    LinkedListNode <ChangeEventSet> curPanNode = set.PanSetList.First;
                    while (curPanNode != null)
                    {
                        if (curPanNode.Previous == null ||
                            curPanNode.Value.ToString(settings, sts.SoundModule) != curPanNode.Previous.Value.ToString(settings, sts.SoundModule))
                        {
                            newPanSetList.AddLast(curPanNode.Value);
                        }
                        curPanNode = curPanNode.Next;
                    }
                    set.PanSetList = newPanSetList;

                    i++;
                }

                var newTempoSetList = new LinkedList <TempoSet>();
                LinkedListNode <TempoSet> curTempoNode = tempoSetList.First;
                while (curTempoNode != null)
                {
                    if (curTempoNode.Previous == null ||
                        curTempoNode.Value.ToString(settings, status.SoundModule) != curTempoNode.Previous.Value.ToString(settings, status.SoundModule))
                    {
                        newTempoSetList.AddLast(curTempoNode.Value);
                    }
                    curTempoNode = curTempoNode.Next;
                }
                tempoSetList = newTempoSetList;
            }
            catch (Exception ex)
            {
                throw new Exception(Resources.ErrorModifierOptimizeSameTypeValue, ex);
            }
        }