mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
restructured project structure: move projects into sub-folders, split dispmanx-grabber from hyperion
This commit is contained in:
8
src/hyperiond/CMakeLists.txt
Normal file
8
src/hyperiond/CMakeLists.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
add_executable(hyperiond
|
||||
hyperiond.cpp)
|
||||
|
||||
target_link_libraries(hyperiond
|
||||
hyperion
|
||||
dispmanx-grabber
|
||||
jsonserver)
|
49
src/hyperiond/hyperiond.cpp
Normal file
49
src/hyperiond/hyperiond.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
// QT includes
|
||||
#include <QCoreApplication>
|
||||
|
||||
// Json-Schema includes
|
||||
#include <utils/jsonschema/JsonFactory.h>
|
||||
|
||||
// Hyperion includes
|
||||
#include <hyperion/Hyperion.h>
|
||||
|
||||
// Dispmanx grabber includes
|
||||
#include <dispmanx-grabber/DispmanxWrapper.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;
|
||||
|
||||
// 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";
|
||||
|
||||
// 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;
|
||||
|
||||
Hyperion hyperion(config);
|
||||
std::cout << "Hyperion created and initialised" << std::endl;
|
||||
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user