Merge branch 'master' into add_x11

Former-commit-id: 08655bb606c5aae04fc0011a3ec1f0c16e59e7b7
This commit is contained in:
poljvd
2014-11-18 20:35:05 +01:00
46 changed files with 2409 additions and 158 deletions

View File

@@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 2.8)
project(hyperion-remote)
# add protocol buffers
find_package(Protobuf REQUIRED)
# find Qt4
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)

View File

@@ -1,20 +1,23 @@
add_executable(hyperiond
hyperiond.cpp)
target_link_libraries(hyperiond
hyperion
xbmcvideochecker
effectengine
jsonserver
protoserver
boblightserver
)
if (ENABLE_DISPMANX)
target_link_libraries(hyperiond dispmanx-grabber)
endif (ENABLE_DISPMANX)
if (ENABLE_V4L2)
target_link_libraries(hyperiond v4l2-grabber)
endif (ENABLE_V4L2)
add_executable(hyperiond
hyperiond.cpp)
target_link_libraries(hyperiond
hyperion
xbmcvideochecker
effectengine
jsonserver
boblightserver
)
if (ENABLE_DISPMANX)
target_link_libraries(hyperiond dispmanx-grabber)
endif (ENABLE_DISPMANX)
if (ENABLE_V4L2)
target_link_libraries(hyperiond v4l2-grabber)
endif (ENABLE_V4L2)
if (ENABLE_PROTOBUF)
target_link_libraries(hyperiond protoserver)
endif (ENABLE_PROTOBUF)

View File

@@ -36,8 +36,10 @@
// JsonServer includes
#include <jsonserver/JsonServer.h>
#ifdef ENABLE_PROTOBUF
// ProtoServer includes
#include <protoserver/ProtoServer.h>
#endif
// BoblightServer includes
#include <boblightserver/BoblightServer.h>
@@ -112,14 +114,31 @@ int main(int argc, char** argv)
const std::string effectName = effectConfig["effect"].asString();
const unsigned duration_ms = effectConfig["duration_ms"].asUInt();
const int priority = 0;
hyperion.setColor(priority+1, ColorRgb::BLACK, duration_ms, false);
if (hyperion.setEffect(effectName, priority, duration_ms) == 0)
if (effectConfig.isMember("args"))
{
std::cout << "Boot sequence(" << effectName << ") created and started" << std::endl;
const Json::Value effectConfigArgs = effectConfig["args"];
if (hyperion.setEffect(effectName, effectConfigArgs, priority, duration_ms) == 0)
{
std::cout << "Boot sequence(" << effectName << ") with user-defined arguments created and started" << std::endl;
}
else
{
std::cout << "Failed to start boot sequence: " << effectName << " with user-defined arguments" << std::endl;
}
}
else
{
std::cout << "Failed to start boot sequence: " << effectName << std::endl;
if (hyperion.setEffect(effectName, priority, duration_ms) == 0)
{
std::cout << "Boot sequence(" << effectName << ") created and started" << std::endl;
}
else
{
std::cout << "Failed to start boot sequence: " << effectName << std::endl;
}
}
}
@@ -216,6 +235,7 @@ int main(int argc, char** argv)
std::cout << "Json server created and started on port " << jsonServer->getPort() << std::endl;
}
#ifdef ENABLE_PROTOBUF
// Create Proto server if configuration is present
ProtoServer * protoServer = nullptr;
if (config.isMember("protoServer"))
@@ -224,6 +244,7 @@ int main(int argc, char** argv)
protoServer = new ProtoServer(&hyperion, protoServerConfig["port"].asUInt());
std::cout << "Proto server created and started on port " << protoServer->getPort() << std::endl;
}
#endif
// Create Boblight server if configuration is present
BoblightServer * boblightServer = nullptr;
@@ -247,7 +268,9 @@ int main(int argc, char** argv)
#endif
delete xbmcVideoChecker;
delete jsonServer;
#ifdef ENABLE_PROTOBUF
delete protoServer;
#endif
delete boblightServer;
// leave application