Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 public ShowTuningEditorMessage(ObservableTuning tuning, ObservableInstrument targetInstrument, Action <bool> callback = null) : base()
 {
     TuningEditorVM = TuningEditorViewModel.CopyExistingTuning(tuning, targetInstrument);
     Callback       = callback;
 }
Ejemplo n.º 4
0
 public ShowTuningEditorMessage(ObservableTuning tuning, Action <bool> callback = null) : base()
 {
     TuningEditorVM = TuningEditorViewModel.EditExistingTuning(tuning);
     Callback       = callback;
 }