hyperion.ng/src/hyperion-d.cpp

48 lines
1.3 KiB
C++
Raw Normal View History

// QT includes
#include <QCoreApplication>
2013-08-14 10:54:49 +02:00
// Json-Schema includes
#include <utils/jsonschema/JsonFactory.h>
// Hyperion includes
#include <hyperion/DispmanxWrapper.h>
2013-08-14 10:54:49 +02:00
#include <hyperion/Hyperion.h>
// JsonServer includes
#include <jsonserver/JsonServer.h>
int main(int argc, char** argv)
{
// Initialising QCoreApplication
QCoreApplication app(argc, argv);
std::cout << "QCoreApplication initialised" << std::endl;
2013-08-14 10:54:49 +02:00
// Select config and schema file
//const std::string homeDir = getenv("RASPILIGHT_HOME");
const std::string schemaFile = "hyperion.schema.json";
const std::string configFile = "hyperion.config.json";
2013-08-14 10:54:49 +02:00
// Load configuration and check against the schema at the same time
Json::Value config;
if (JsonFactory::load(schemaFile, configFile, config) < 0)
{
std::cerr << "UNABLE TO LOAD CONFIGURATION" << std::endl;
return -1;
}
std::cout << "Configuration loaded from: " << configFile << std::endl;
2013-08-14 10:54:49 +02:00
Hyperion hyperion(config);
std::cout << "Hyperion created and initialised" << std::endl;
2013-08-14 10:54:49 +02:00
DispmanxWrapper dispmanx(64, 64, 10, &hyperion);
dispmanx.start();
std::cout << "Frame grabber created and started" << std::endl;
JsonServer jsonServer(&hyperion);
std::cout << "Json server created and started on port " << jsonServer.getPort() << std::endl;
app.exec();
std::cout << "Application closed" << std::endl;
}