public static TuningEditorViewModel EditExistingTuning(ObservableTuning tuning)
        {
            if (null == tuning)
            {
                throw new ArgumentNullException("tuning");
            }

            TuningEditorViewModel tuningEditorVM = new TuningEditorViewModel(false, tuning.ReadOnly, (name, notes) =>
            {
                FullNote[] rootNotes = new FullNote[notes.Count];

                for (int i = 0; i < notes.Count; i++)
                {
                    rootNotes[i] = notes[i].FullNote;
                }

                tuning.Tuning.Update(name, rootNotes);
            });

            tuningEditorVM.Name = tuning.Name;

            foreach (ObservableNote note in tuning.Notes)
            {
                tuningEditorVM.RootNotes.Add(new ObservableNote(note.FullNote.Clone()));
            }

            return(tuningEditorVM);
        }
        public static TuningEditorViewModel CopyExistingTuning(ObservableTuning tuning, ObservableInstrument targetInstrument)
        {
            if (null == tuning)
            {
                throw new ArgumentNullException("tuning");
            }

            if (null == targetInstrument)
            {
                throw new ArgumentNullException("targetInstrument");
            }

            return(CopyExistingTuning(tuning.Tuning, targetInstrument.Instrument));
        }
Example #3
0
 public ShowTuningEditorMessage(ObservableTuning tuning, ObservableInstrument targetInstrument, Action <bool> callback = null) : base()
 {
     TuningEditorVM = TuningEditorViewModel.CopyExistingTuning(tuning, targetInstrument);
     Callback       = callback;
 }
Example #4
0
 public ShowTuningEditorMessage(ObservableTuning tuning, Action <bool> callback = null) : base()
 {
     TuningEditorVM = TuningEditorViewModel.EditExistingTuning(tuning);
     Callback       = callback;
 }