123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- /*
- Copyright (C) 2016 Tobias Platen
-
- This file is part of OREMO2.
- OREMO2 is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- #include "mainwindow.h"
- #include <QApplication>
- #include "jackconnector.h"
- #include "recordingmanager.h"
- #include "controller.h"
- #include <sys/file.h>
- #include <errno.h>
- #include <unistd.h>
- int main(int argc, char *argv[])
- {
- //TODO: move to common shared lib
- int pid_file = open("/tmp/oremo2.lock", O_CREAT | O_RDWR, 0666);
- int rc = flock(pid_file, LOCK_EX | LOCK_NB);
- if(rc) {
- if(EWOULDBLOCK == errno)
- {
- fprintf(stderr,"oremo is running\n");
- return rc;
- }
- }
- QApplication a(argc, argv);
- //create remote
- //Controller* ctrl = new Controller();
- JackConnector* jack = new JackConnector(&a);
- RecordingManager* rec = new RecordingManager(&a);
- rec->init(jack);
-
- MainWindow w(rec);
- w.show();
- return a.exec();
- }
|