# HG changeset patch # User Chris Cannam # Date 1434483164 -3600 # Node ID 393134235fa0f1aa9cd4d1fc68a732030296365e # Parent e86a7ea3dc38d6b2d4a5523054a17bb359aea85e Two-channel test diff -r e86a7ea3dc38 -r 393134235fa0 base/StorageAdviser.cpp --- a/base/StorageAdviser.cpp Tue Jun 16 20:28:23 2015 +0100 +++ b/base/StorageAdviser.cpp Tue Jun 16 20:32:44 2015 +0100 @@ -22,7 +22,7 @@ #include -#define DEBUG_STORAGE_ADVISER 1 +//#define DEBUG_STORAGE_ADVISER 1 size_t StorageAdviser::m_discPlanned = 0; size_t StorageAdviser::m_memoryPlanned = 0; diff -r e86a7ea3dc38 -r 393134235fa0 data/fileio/AudioFileSizeEstimator.cpp --- a/data/fileio/AudioFileSizeEstimator.cpp Tue Jun 16 20:28:23 2015 +0100 +++ b/data/fileio/AudioFileSizeEstimator.cpp Tue Jun 16 20:32:44 2015 +0100 @@ -18,6 +18,8 @@ #include +//#define DEBUG_AUDIO_FILE_SIZE_ESTIMATOR 1 + sv_frame_t AudioFileSizeEstimator::estimate(FileSource source, sv_samplerate_t targetRate) @@ -61,7 +63,9 @@ { QFile f(source.getLocalFilename()); if (f.open(QFile::ReadOnly)) { +#ifdef DEBUG_AUDIO_FILE_SIZE_ESTIMATOR cerr << "opened file, size is " << f.size() << endl; +#endif sz = f.size(); f.close(); } @@ -90,11 +94,14 @@ estimate = sv_frame_t(double(sz) * 1.2 * rateRatio); } +#ifdef DEBUG_AUDIO_FILE_SIZE_ESTIMATOR cerr << "AudioFileSizeEstimator: for extension " << extension << ", estimate = " << estimate << endl; - +#endif } +#ifdef DEBUG_AUDIO_FILE_SIZE_ESTIMATOR cerr << "estimate = " << estimate << endl; +#endif return estimate; } diff -r e86a7ea3dc38 -r 393134235fa0 data/model/test/TestFFTModel.h --- a/data/model/test/TestFFTModel.h Tue Jun 16 20:28:23 2015 +0100 +++ b/data/model/test/TestFFTModel.h Tue Jun 16 20:32:44 2015 +0100 @@ -168,6 +168,31 @@ { { {}, {}, {}, {}, {} } }, 4); } + void twochan_simple_rect() { + MockWaveModel mwm({ Sine, Cosine }, 16, 4); + // Test that the two channels are read and converted separately + test(&mwm, RectangularWindow, 8, 8, 8, 0, + { + { {}, {}, {}, {}, {} }, + { {}, {}, {}, {}, {} } + }, 4); + test(&mwm, RectangularWindow, 8, 8, 8, 1, + { + { {}, { 0.f, 2.f }, {}, {}, {} }, + { {}, { -2.f, 0.f }, {}, {}, {} } + }, 4); + test(&mwm, RectangularWindow, 8, 8, 8, 2, + { + { {}, { 0.f, 2.f }, {}, {}, {} }, + { {}, { -2.f, 0.f }, {}, {}, {} } + }, 4); + test(&mwm, RectangularWindow, 8, 8, 8, 3, + { + { {}, {}, {}, {}, {} }, + { {}, {}, {}, {}, {} } + }, 4); + } + void nyquist_simple_rect() { MockWaveModel mwm({ Nyquist }, 16, 4); // Again, the sign is flipped. This has the same amount of diff -r e86a7ea3dc38 -r 393134235fa0 data/model/test/test.pro --- a/data/model/test/test.pro Tue Jun 16 20:28:23 2015 +0100 +++ b/data/model/test/test.pro Tue Jun 16 20:32:44 2015 +0100 @@ -61,7 +61,7 @@ !win32 { !macx* { - QMAKE_POST_LINK=valgrind ./$${TARGET} + QMAKE_POST_LINK=./$${TARGET} } macx* { QMAKE_POST_LINK=./$${TARGET}.app/Contents/MacOS/$${TARGET}