# HG changeset patch # User Chris Cannam # Date 1412855815 -3600 # Node ID f0df07da6f46dec1149a84f5189a578c5f284455 # Parent e6379b2e1c5cbd3fad590e4f60f7b17ee8ef6436 Update version, add --minversion flag diff -r e6379b2e1c5c -r f0df07da6f46 CHANGELOG --- a/CHANGELOG Thu Oct 09 12:27:17 2014 +0100 +++ b/CHANGELOG Thu Oct 09 12:56:55 2014 +0100 @@ -1,3 +1,12 @@ + +Changes in Sonic Annotator 1.1 since the previous release 1.0: + +Front-end changes: + + - Add support for the start time and duration properties of a + transform, applying a plugin to only a range of the input audio + - Add --normalise to request each audio file be normalised to 1.0 max + - Add --multiplex Changes in Sonic Annotator 1.0 since the previous release 0.7: diff -r e6379b2e1c5c -r f0df07da6f46 runner/main.cpp --- a/runner/main.cpp Thu Oct 09 12:27:17 2014 +0100 +++ b/runner/main.cpp Thu Oct 09 12:56:55 2014 +0100 @@ -137,6 +137,50 @@ return ws; } +static bool +isVersionNewerThan(QString a, QString b) // from VersionTester in svapp +{ + QRegExp re("[._-]"); + QStringList alist = a.split(re, QString::SkipEmptyParts); + QStringList blist = b.split(re, QString::SkipEmptyParts); + int ae = alist.size(); + int be = blist.size(); + int e = std::max(ae, be); + for (int i = 0; i < e; ++i) { + int an = 0, bn = 0; + if (i < ae) { + an = alist[i].toInt(); + if (an == 0 && alist[i] != "0") { + an = -1; // non-numeric field -> "-pre1" etc + } + } + if (i < be) { + bn = blist[i].toInt(); + if (bn == 0 && blist[i] != "0") { + bn = -1; + } + } + if (an < bn) return false; + if (an > bn) return true; + } + return false; +} + +static int +checkMinVersion(QString myname, QString v) +{ + if (v == RUNNER_VERSION) { + return 0; + } else if (isVersionNewerThan(RUNNER_VERSION, v)) { + return 0; + } else { + cerr << myname << ": version " + << RUNNER_VERSION << " is less than requested min version " + << v << ", failing" << endl; + return 1; + } +} + void printUsage(QString myname) { cerr << endl; @@ -150,15 +194,15 @@ cerr << "This program is supplied with NO WARRANTY, to the extent permitted by law." << endl; cerr << endl; cerr << "Usage: " << endl; - cerr << " " << myname.toStdString() + cerr << " " << myname << " [-mrnf] -t transform.ttl [..] -w [..]