adjustments due to changed API
This commit is contained in:
parent
b911784d28
commit
f74be38936
|
@ -92,21 +92,20 @@ void FfmpegLauncher::nextSong()
|
|||
infoIni.parse(infoFile);
|
||||
// read length scope, only possible if track number known because the track number is used for mapping
|
||||
if(m_watcher.trackNumber()) {
|
||||
try {
|
||||
const auto &lengthScope = infoIni.data().at("length");
|
||||
for(const auto &entry : lengthScope) {
|
||||
try {
|
||||
if(stringToNumber<unsigned int>(entry.first) == m_watcher.trackNumber()) {
|
||||
// length entry for this track
|
||||
length = QString::fromLocal8Bit(entry.second.data());
|
||||
break;
|
||||
for(auto &scope : infoIni.data()) {
|
||||
if(scope.first == "length") {
|
||||
for(const auto &entry : scope.second) {
|
||||
try {
|
||||
if(stringToNumber<unsigned int>(entry.first) == m_watcher.trackNumber()) {
|
||||
// length entry for this track
|
||||
length = QString::fromLocal8Bit(entry.second.data());
|
||||
break;
|
||||
}
|
||||
} catch( const ConversionException &) {
|
||||
cerr << "Warning: Ignoring non-numeric key \"" << entry.first << "\" in info.ini." << endl;
|
||||
}
|
||||
} catch( const ConversionException &) {
|
||||
cerr << "Warning: Ignoring non-numeric key \"" << entry.first << "\" in info.ini." << endl;
|
||||
}
|
||||
}
|
||||
} catch(const out_of_range &) {
|
||||
// no length for the current track specified
|
||||
}
|
||||
}
|
||||
} catch(const ios_base::failure &) {
|
||||
|
|
7
main.cpp
7
main.cpp
|
@ -52,7 +52,7 @@ int main(int argc, char *argv[])
|
|||
parser.parseArgs(argc, argv);
|
||||
} catch (const Failure &e) {
|
||||
cerr << "Unable to parse arguments: " << e.what() << endl;
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
try {
|
||||
if(recordArg.isPresent()) {
|
||||
|
@ -80,9 +80,12 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
// enter app loop
|
||||
return app.exec();
|
||||
} else {
|
||||
cerr << "No operation specified." << endl;
|
||||
return 2;
|
||||
}
|
||||
|
||||
} catch(const runtime_error &e) {
|
||||
cerr << "Fatal error: " << e.what() << endl;
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue