-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.cpp
28 lines (22 loc) · 913 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <QCoreApplication>
#include "jackautoconnect.h"
int main(int argc, char *argv[])
{
int i;
QHash<QRegExp*, QRegExp*>* connectionsToDo = new QHash<QRegExp*, QRegExp*>();
QCoreApplication a(argc, argv);
if (argc < 3)
{
qCritical() << "Not enough parameters";
}
// Iterate over the command line arguments to create Output/Input-port RegEx pairs that shall be automatically connected
for (i = 1; i < (argc - 1); i = i + 2)
{
connectionsToDo->insert(new QRegExp(QString(argv[i]), Qt::CaseInsensitive, QRegExp::Wildcard), new QRegExp(QString(argv[i + 1]), Qt::CaseInsensitive, QRegExp::Wildcard));
}
// Create the object that connects to jack and does all the work
JackAutoconnect* worker = new JackAutoconnect(connectionsToDo);
Q_UNUSED(worker);
// Simply enter the event loop and wait for the things to come
return a.exec();
}