Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,19 +431,26 @@ void MainWindow::startRecording() {
". Please check your permissions.");
return;
}


std::vector<std::string> watchfor;
for (const QString &missing : qAsConst(missingStreams)) {
std::string query;
// Convert missing to query expected by lsl::resolve_stream
// name='BioSemi' and hostname=AASDFSDF
// QRegularExpression rx("(\S+)\s+\((\S+)\)");
QStringList name_host = missing.split(QRegExp("\\s+"));
std::string query = "name='" + name_host[0].toStdString() + "'";
if (name_host.size() > 1) {
std::string host = name_host[1].toStdString();
query += " and hostname='" + host.substr(1, host.length() - 2) + "'";
}
QRegularExpression re("(.+)\\s+\\((\\S+)\\)");
QRegularExpressionMatch match = re.match(missing);
if (match.hasMatch())
{
QString name = match.captured(1);
QString host = match.captured(2);
query = "name='" + match.captured(1).toStdString() + "'";
if (host.size() > 1) {
query += " and hostname='" + host.toStdString() + "'";
}
} else {
// Regexp failed but we can try using the entire string as the stream name.
query = "name='" + missing.toStdString() + "'";
}
watchfor.push_back(query);
}
qInfo() << "Missing: " << missingStreams;
Expand Down Expand Up @@ -557,7 +564,7 @@ QString MainWindow::replaceFilename(QString fullfile) const {
QString run = QString("%1").arg(ui->spin_counter->value(), 3, 10, QChar('0'));
fullfile.replace(counterPlaceholder(), run);

return fullfile;
return fullfile.trimmed();
}

/**
Expand Down