예제 #1
0
        /// <summary>
        /// Show a selection of the data grid as chord
        /// </summary>
        public void ShowChangeCoupling(List <EdgeData> data)
        {
            var descr = new ChordViewModel();

            descr.Data  = data;
            descr.Title = Strings.ChangeCouplingVisualize;
            ShowTab(descr, true);
        }
예제 #2
0
        /// <summary>
        /// Show a selection of the data grid as chord
        /// </summary>
        public void ShowChangeCoupling(List <EdgeData> data)
        {
            var descr = new ChordViewModel();

            descr.Data  = data;
            descr.Title = "Change Couplings (Chord)";
            ShowTab(descr, true);
        }
예제 #3
0
        public ChordViewModel GetChordViewModel(Key key, Alteration alteration, string chordQuality)
        {
            var dbChordQuality = _chordQualityService.GetByName(chordQuality);
            var chord          = _chordService.GetChord(new Note(key, alteration), dbChordQuality);

            var vm = new ChordViewModel();

            vm.Name  = chord.Name;
            vm.Notes = chord.Notes.Select((n, i) => new NoteViewModel {
                Note = n, Interval = dbChordQuality.ChordQualityIntervals.ElementAt(i).Interval
            }).ToList();
            vm.Notes.Add(new NoteViewModel
            {
                Interval = new Interval {
                    Number = IntervalNumber.Fundamental, Quality = IntervalQuality.Perfect
                },
                Note = chord.Fundamental
            });
            vm.Notes = vm.Notes.OrderBy(n => n.Interval.Number).ToList();

            return(vm);
        }