Пример #1
0
        internal Tuning(TuningSet parent, XmlReader xmlReader) : this(parent)
        {
            if (null == xmlReader)
            {
                throw new ArgumentNullException(nameof(xmlReader));
            }

            using (xmlReader)
            {
                if (xmlReader.IsStartElement() && xmlReader.Name == "tuning")
                {
                    Name = xmlReader.GetAttribute("name");

                    string notes = xmlReader.GetAttribute("notes");

                    string[] s = notes.Split(';');

                    FullNote[] rootNotes = new FullNote[s.Length];

                    if (rootNotes.Length != Parent.Instrument.NumStrings)
                    {
                        throw new ArgumentOutOfRangeException();
                    }

                    for (int i = 0; i < rootNotes.Length; i++)
                    {
                        rootNotes[i] = FullNote.Parse(s[i]);
                    }
                    RootNotes = rootNotes;
                }
            }

            UpdateParent = true;
        }
Пример #2
0
        internal Tuning(TuningSet parent, string name, FullNote[] rootNotes) : this(parent)
        {
            Name      = name;
            RootNotes = rootNotes;

            UpdateParent = true;
        }
Пример #3
0
 public TuningAlreadyExistsException(TuningSet tuningSet, string longName) : base(tuningSet, longName)
 {
 }
Пример #4
0
 public TuningNotFoundException(TuningSet tuningSet, string longName) : base(tuningSet, longName)
 {
 }
Пример #5
0
 public TargetTuningException(TuningSet tuningSet, string longName) : base(tuningSet)
 {
     LongName = longName;
 }
Пример #6
0
 public TuningSetException(TuningSet tuningSet) : base()
 {
     TuningSet = tuningSet;
 }
Пример #7
0
 private Instrument(InstrumentSet parent)
 {
     ReadOnly = false;
     _tunings = new TuningSet(this);
     Parent   = parent;
 }
Пример #8
0
 private Tuning(TuningSet parent)
 {
     ReadOnly = false;
     _parent  = parent ?? throw new ArgumentNullException(nameof(parent));
 }