public void UpdateTrackList() { if (FileLoaded) { TrackList = new ObservableCollection <string>(MidiHelper.GenerateTrackList(_currentMidiFile)); } else { TrackList.Clear(); } SelectedTrackIndex = 0; NotifyPropertyChanged("TrackList"); }
public void StripUnwantedMessages() { if (_currentMidiFile == null) { StatusBarText = "No CC/PC messages found."; } else { int deletedMessageCount = MidiHelper.StripUnwantedMessages(ref _currentMidiFile); UpdateSelectedTrackData(); StatusBarText = $"{deletedMessageCount} CC/PC {PluralizeMessages(deletedMessageCount)} deleted."; UnsavedChanges = true; } }
public void StripEmptyTracks() { if (_currentMidiFile == null) { StatusBarText = "No file loaded."; } else { int deletedTrackCount = MidiHelper.StripEmptyTracks(ref _currentMidiFile); if (deletedTrackCount == 0) { StatusBarText = "No empty tracks found."; } else { UpdateTrackList(); int remainingTrackCount = _currentMidiFile.Chunks.Count; StatusBarText = $"{deletedTrackCount} empty {PluralizeTracks(deletedTrackCount)} deleted. {remainingTrackCount} {PluralizeTracks(remainingTrackCount)} remaining."; UnsavedChanges = true; } } }
private void UpdateSelectedTrackData() { SelectedTrackData = MidiHelper.GenerateTrackData(MidiHelper.GetTrack(_currentMidiFile, _selectedTrackIndex)); }