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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user