mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Preliminaries for grouped block deletion (#628)
* Change usage of AutoCommitTransaction::Rollback... ... It is the more useful pattern (as in many finally blocks) for the failure path in the destructor (which rolls back) to be the default, but an explicit call must inform it of success. This corrects the early return paths in Effect::DoEffect(). Throw inconsistency exception if Commit() is called again after having been called once, successfully Also remove a friend declaration * UndoManager's interface uses consistent 0-based indexing of states... ... Returned by GetCurrentState() and used by SetStateTo(), GetLongDescription(), GetShortDescription() * SampleBlock::GetBlockID is const * Generalized function to visit sample blocks used in a TrackList... ... Eliminating some duplication; put it in WaveTrack, not Track, to avoid a dependency cycle. * Eliminate more repetition with BlockSpaceUsageAccumulator * Function to delete all blocks of/not-of a given set in one command
This commit is contained in:
@@ -118,7 +118,7 @@ HistoryDialog::HistoryDialog(AudacityProject *parent, UndoManager *manager):
|
||||
wxDefaultSize,
|
||||
wxSP_ARROW_KEYS,
|
||||
0,
|
||||
mManager->GetCurrentState() - 1,
|
||||
mManager->GetCurrentState(),
|
||||
0);
|
||||
S.AddWindow(mLevels);
|
||||
/* i18n-hint: (verb)*/
|
||||
@@ -204,11 +204,11 @@ void HistoryDialog::DoUpdate()
|
||||
mList->DeleteAllItems();
|
||||
|
||||
wxLongLong_t total = 0;
|
||||
mSelected = mManager->GetCurrentState() - 1;
|
||||
mSelected = mManager->GetCurrentState();
|
||||
for (i = 0; i < (int)mManager->GetNumStates(); i++) {
|
||||
TranslatableString desc, size;
|
||||
|
||||
total += mManager->GetLongDescription(i + 1, &desc, &size);
|
||||
total += mManager->GetLongDescription(i, &desc, &size);
|
||||
mList->InsertItem(i, desc.Translation(), i == mSelected ? 1 : 0);
|
||||
mList->SetItem(i, 1, size.Translation());
|
||||
}
|
||||
@@ -261,7 +261,7 @@ void HistoryDialog::OnDiscard(wxCommandEvent & WXUNUSED(event))
|
||||
|
||||
mSelected -= i;
|
||||
mManager->RemoveStates(i);
|
||||
ProjectHistory::Get( *mProject ).SetStateTo(mSelected + 1);
|
||||
ProjectHistory::Get( *mProject ).SetStateTo(mSelected);
|
||||
|
||||
while(--i >= 0)
|
||||
mList->DeleteItem(i);
|
||||
@@ -299,7 +299,7 @@ void HistoryDialog::OnItemSelected(wxListEvent &event)
|
||||
// entry. Doing so can cause unnecessary delays upon initial load or while
|
||||
// clicking the same entry over and over.
|
||||
if (selected != mSelected) {
|
||||
ProjectHistory::Get( *mProject ).SetStateTo(selected + 1);
|
||||
ProjectHistory::Get( *mProject ).SetStateTo(selected);
|
||||
}
|
||||
mSelected = selected;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user