1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Track cut and copy functions return a unique_ptr argument...

... Because they are factory functions.
This commit is contained in:
Paul Licameli
2016-03-02 15:36:44 -05:00
parent 5ef4dd46a5
commit 3015a9c8d9
15 changed files with 144 additions and 153 deletions

View File

@@ -345,7 +345,6 @@ void BenchmarkDialog::OnRun( wxCommandEvent & WXUNUSED(event))
ZoomInfo zoomInfo(0.0, ZoomInfo::GetDefaultZoom());
DirManager *d = new DirManager();
const auto t = TrackFactory{ d, &zoomInfo }.NewWaveTrack(int16Sample);
Track *tmp = NULL;
t->SetRate(1);
@@ -418,7 +417,7 @@ void BenchmarkDialog::OnRun( wxCommandEvent & WXUNUSED(event))
if (mEditDetail)
Printf(wxT("Cut: %d - %d \n"), x0 * chunkSize, (x0 + xlen) * chunkSize);
t->Cut(double (x0 * chunkSize), double ((x0 + xlen) * chunkSize), &tmp);
auto tmp = t->Cut(double (x0 * chunkSize), double ((x0 + xlen) * chunkSize));
if (!tmp) {
Printf(wxT("Trial %d\n"), z);
Printf(wxT("Cut (%d, %d) failed.\n"), (x0 * chunkSize),
@@ -432,7 +431,7 @@ void BenchmarkDialog::OnRun( wxCommandEvent & WXUNUSED(event))
if (mEditDetail)
Printf(wxT("Paste: %d\n"), y0 * chunkSize);
if (!t->Paste((double)(y0 * chunkSize), tmp))
if (!t->Paste((double)(y0 * chunkSize), tmp.get()))
{
Printf(wxT("Trial %d\nFailed on Paste.\n"), z);
goto fail;
@@ -530,9 +529,6 @@ void BenchmarkDialog::OnRun( wxCommandEvent & WXUNUSED(event))
Printf(wxT("TEST FAILED!!!\n"));
success:
if (tmp)
delete tmp;
delete[]small1;
delete[]small2;
delete[]block;