annotate data/model/test/main.cpp @ 1196:c7b9c902642f spectrogram-minor-refactor

Fix threshold in spectrogram -- it wasn't working in the last release. There is a new protocol for this. Formerly the threshold parameter had a range from -50dB to 0 with the default at -50, and -50 treated internally as "no threshold". However, there was a hardcoded, hidden internal threshold for spectrogram colour mapping at -80dB with anything below this being rounded to zero. Now the threshold parameter has range -81 to -1 with the default at -80, -81 is treated internally as "no threshold", and there is no hidden internal threshold. So the default behaviour is the same as before, an effective -80dB threshold, but it is now possible to change this in both directions. Sessions reloaded from prior versions may look slightly different because, if the session says there should be no threshold, there will now actually be no threshold instead of having the hidden internal one. Still need to do something in the UI to make it apparent that the -81dB setting removes the threshold entirely. This is at least no worse than the previous, also obscured, magic -50dB setting.
author Chris Cannam
date Mon, 01 Aug 2016 16:21:01 +0100
parents 9f4505ac9072
children
rev   line source
Chris@1086 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@1086 2 /*
Chris@1086 3 Sonic Visualiser
Chris@1086 4 An audio file viewer and annotation editor.
Chris@1086 5 Centre for Digital Music, Queen Mary, University of London.
Chris@1086 6
Chris@1086 7 This program is free software; you can redistribute it and/or
Chris@1086 8 modify it under the terms of the GNU General Public License as
Chris@1086 9 published by the Free Software Foundation; either version 2 of the
Chris@1086 10 License, or (at your option) any later version. See the file
Chris@1086 11 COPYING included with this distribution for more information.
Chris@1086 12 */
Chris@1086 13
Chris@1086 14 #include "TestFFTModel.h"
Chris@1086 15
Chris@1086 16 #include <QtTest>
Chris@1086 17
Chris@1086 18 #include <iostream>
Chris@1086 19
Chris@1086 20 using namespace std;
Chris@1086 21
Chris@1086 22 int main(int argc, char *argv[])
Chris@1086 23 {
Chris@1086 24 int good = 0, bad = 0;
Chris@1086 25
Chris@1086 26 QCoreApplication app(argc, argv);
Chris@1086 27 app.setOrganizationName("Sonic Visualiser");
Chris@1086 28 app.setApplicationName("test-model");
Chris@1086 29
Chris@1086 30 {
Chris@1086 31 TestFFTModel t;
Chris@1086 32 if (QTest::qExec(&t, argc, argv) == 0) ++good;
Chris@1086 33 else ++bad;
Chris@1086 34 }
Chris@1086 35
Chris@1086 36 if (bad > 0) {
Chris@1086 37 cerr << "\n********* " << bad << " test suite(s) failed!\n" << endl;
Chris@1086 38 return 1;
Chris@1086 39 } else {
Chris@1086 40 cerr << "All tests passed" << endl;
Chris@1086 41 return 0;
Chris@1086 42 }
Chris@1086 43 }
Chris@1086 44