Exemple #1
0
        public void UpdateTrackList()
        {
            if (FileLoaded)
            {
                TrackList = new ObservableCollection <string>(MidiHelper.GenerateTrackList(_currentMidiFile));
            }
            else
            {
                TrackList.Clear();
            }

            SelectedTrackIndex = 0;
            NotifyPropertyChanged("TrackList");
        }
Exemple #2
0
        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;
            }
        }
Exemple #3
0
        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;
                }
            }
        }
Exemple #4
0
 private void UpdateSelectedTrackData()
 {
     SelectedTrackData = MidiHelper.GenerateTrackData(MidiHelper.GetTrack(_currentMidiFile, _selectedTrackIndex));
 }