Example #1
0
        public IActionResult ChordBlock(Key key, Alteration alteration)
        {
            var viewModel = new ChordBlockViewModel();

            viewModel.Chords = _chordService.GetChords(new Note(key, alteration), _chordQualityService.GetAll()).ToList();
            return(PartialView("_ChordBlock", viewModel));
        }
Example #2
0
        private async void LoadData()
        {
            var chords = _chordService.GetChords(Root);

            Chords = chords.Select(c => new ChordsItemViewModel(c));
            RaisePropertyChanged(() => Chords);
        }
Example #3
0
        public IEnumerable <ChordViewModel> GetChordsViewModels(Key key1, Alteration alteration1, Key key2, Alteration alteration2, Key key3, Alteration alteration3)
        {
            var chords = _chordService.GetChords(new Note(key1, alteration1), new Note(key2, alteration2), new Note(key3, alteration3)).ToList();

            return(chords.Select(c => new ChordViewModel
            {
                Name = c.Name,
                Notes = c.Notes.Select((n, i) => new NoteViewModel
                {
                    Note = n,
                    Interval = c.ChordQuality.ChordQualityIntervals.Select(cq => cq.Interval).ElementAt(i)
                }).ToList()
            }).ToList());
        }
        private void LoadChords()
        {
            var chordsGroups = new List <ChordsGroupViewModel>();

            foreach (var n in _chordService.NoteNames)
            {
                var chords = _chordService.GetChords(n).Select(c => new ChordsItemViewModel(c)).ToArray();
                chordsGroups.Add(new ChordsGroupViewModel {
                    Root = n, Chords = chords
                });
            }
            _allChordsGroups = chordsGroups;
            ChordsGroups     = new ObservableCollection <ChordsGroupViewModel>(chordsGroups);
        }
Example #5
0
 public IEnumerable <IChord> GetAllChords([FromServices] IChordService chordService, string note) => chordService.GetChords(note);