public static TuningEditorViewModel AddNewTuning(ObservableInstrument instrument)
        {
            if (null == instrument)
            {
                throw new ArgumentNullException("instrument");
            }

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

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

                instrument.Instrument.Tunings.Add(name, rootNotes);
            });

            for (int i = 0; i < instrument.NumStrings; i++)
            {
                tuningEditorVM.RootNotes.Add(new ObservableNote());
            }

            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));
        }
示例#3
0
 public ShowTuningEditorMessage(ObservableTuning tuning, ObservableInstrument targetInstrument, Action <bool> callback = null) : base()
 {
     TuningEditorVM = TuningEditorViewModel.CopyExistingTuning(tuning, targetInstrument);
     Callback       = callback;
 }
示例#4
0
 public ShowTuningEditorMessage(ObservableInstrument instrument, Action <bool> callback = null) : base()
 {
     TuningEditorVM = TuningEditorViewModel.AddNewTuning(instrument);
     Callback       = callback;
 }