1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00

AUP3: UP-33 History window shows misleading "space used"

The "Project file size" field in the History dialog didn't work
because it didn't take the journal size into account. So, I removed
the field and improved the size calculation a bit for the sample
blocks.
This commit is contained in:
Leland Lucius 2020-07-15 09:43:48 -05:00
parent 5eb9f75150
commit 3954998083
3 changed files with 2 additions and 11 deletions

View File

@ -100,11 +100,6 @@ HistoryDialog::HistoryDialog(AudacityProject *parent, UndoManager *manager):
S.StartMultiColumn(3, wxCENTRE); S.StartMultiColumn(3, wxCENTRE);
{ {
mFileSize = S.Id(ID_FILESIZE)
.ConnectRoot(wxEVT_KEY_DOWN, &HistoryDialog::OnChar)
.AddTextBox(XXO("&Project file size"), wxT("0"), 10);
S.AddVariableText( {} )->Hide();
mTotal = S.Id(ID_TOTAL) mTotal = S.Id(ID_TOTAL)
.ConnectRoot(wxEVT_KEY_DOWN, &HistoryDialog::OnChar) .ConnectRoot(wxEVT_KEY_DOWN, &HistoryDialog::OnChar)
.AddTextBox(XXO("&Total space used"), wxT("0"), 10); .AddTextBox(XXO("&Total space used"), wxT("0"), 10);
@ -208,10 +203,6 @@ void HistoryDialog::DoUpdate()
mList->DeleteAllItems(); mList->DeleteAllItems();
wxFileName filename(ProjectFileIO::Get(*mProject).GetFileName());
wxULongLong_t filesize = filename.GetSize().GetValue();
mFileSize->SetValue(Internat::FormatSize(filesize).Translation());
wxLongLong_t total = 0; wxLongLong_t total = 0;
mSelected = mManager->GetCurrentState() - 1; mSelected = mManager->GetCurrentState() - 1;
for (i = 0; i < (int)mManager->GetNumStates(); i++) { for (i = 0; i < (int)mManager->GetNumStates(); i++) {

View File

@ -46,7 +46,6 @@ class HistoryDialog final : public wxDialogWrapper {
AudacityProject *mProject; AudacityProject *mProject;
UndoManager *mManager; UndoManager *mManager;
wxListCtrl *mList; wxListCtrl *mList;
wxTextCtrl *mFileSize;
wxTextCtrl *mTotal; wxTextCtrl *mTotal;
wxTextCtrl *mClipboard; wxTextCtrl *mClipboard;
wxTextCtrl *mAvail; wxTextCtrl *mAvail;

View File

@ -433,7 +433,8 @@ MinMaxRMS SqliteSampleBlock::DoGetMinMaxRMS() const
size_t SqliteSampleBlock::GetSpaceUsage() const size_t SqliteSampleBlock::GetSpaceUsage() const
{ {
return mSampleCount * SAMPLE_SIZE(mSampleFormat); // Not an exact number, but close enough
return mSummary256Bytes + mSummary64kBytes + mSampleBytes;
} }
size_t SqliteSampleBlock::GetBlob(void *dest, size_t SqliteSampleBlock::GetBlob(void *dest,