-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
68 lines (54 loc) · 2.06 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <iostream>
#include "n2k/YdvrReader.h"
#include "gopro/GoPro.h"
#include "ffmpeg/FFMpeg.h"
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QLoggingCategory>
class EncodingProgressListener : public IProgressListener {
public:
void progress(const std::string& state, int progress) override {
std::cout << state << " " << progress << std::endl;
}
bool stopRequested() override {
return false;
}
};
static time_t strToTime(const std::string& str) {
struct tm tm{};
strptime(str.c_str(), "%Y-%m-%dT%H:%M", &tm);
return mktime(&tm) + tm.tm_gmtoff;
}
void Test(const std::string& stYdvrDir, const std::string& stGoProDir, const std::string& stCacheDir, const std::string& stPgnSrcCsv, bool bSummaryOnly) {
EncodingProgressListener progressListener;
YdvrReader ydvrReader(stYdvrDir, stCacheDir, stPgnSrcCsv, bSummaryOnly, false, progressListener);
GoPro goPro(stGoProDir, stCacheDir, ydvrReader, progressListener);
int clipCount = 0;
int pointsCount = 0;
for ( auto& clip : goPro.getGoProClipList()) {
clipCount++;
for( auto &ii : *clip.getInstrData()) {
pointsCount++;
}
}
std::cout << "clipCount " << clipCount << std::endl;
std::cout << "pointsCount " << pointsCount << std::endl;
exit(0);
}
int main(int argc, char** argv) {
QCoreApplication::setOrganizationName("Santa Cruz Instruments");
QCoreApplication::setOrganizationDomain("www.santacruzinstruments.com");
QCoreApplication::setApplicationName("sailvue");
QGuiApplication app(argc, argv);
QString appPath = QCoreApplication::applicationDirPath();
if (! FFMpeg::setBinDir(appPath.toStdString()) ){
std::cerr << "FFMpeg::setBinDir failed" << std::endl;
exit(1);
}
QQmlApplicationEngine engine;
QLoggingCategory::setFilterRules(QStringLiteral("qt.qml.binding.removal.info=true"));
engine.load(QUrl(QStringLiteral("qrc:/gui/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return QGuiApplication::exec();
}