mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
refactor: Address (Windows) compile warnings (#840)
* Windows compile errors and (Qt 5.15 deprecation) warnings * Usability - Enable/Disable Instance button Co-authored-by: brindosch <edeltraud70@gmx.de>
This commit is contained in:
@@ -69,7 +69,7 @@ int main(int argc, char ** argv)
|
||||
if(argAddress.value(parser) == "127.0.0.1:19400")
|
||||
{
|
||||
SSDPDiscover discover;
|
||||
address = discover.getFirstService(STY_FLATBUFSERVER);
|
||||
address = discover.getFirstService(searchType::STY_FLATBUFSERVER);
|
||||
if(address.isEmpty())
|
||||
{
|
||||
address = argAddress.value(parser);
|
||||
|
@@ -57,15 +57,15 @@ int main(int argc, char ** argv)
|
||||
// parse all options
|
||||
parser.process(app);
|
||||
|
||||
VideoMode videoMode = VIDEO_2D;
|
||||
VideoMode videoMode = VideoMode::VIDEO_2D;
|
||||
|
||||
if (parser.isSet(arg3DSBS))
|
||||
{
|
||||
videoMode = VIDEO_3DSBS;
|
||||
videoMode = VideoMode::VIDEO_3DSBS;
|
||||
}
|
||||
else if (parser.isSet(arg3DTAB))
|
||||
{
|
||||
videoMode = VIDEO_3DTAB;
|
||||
videoMode = VideoMode::VIDEO_3DTAB;
|
||||
}
|
||||
|
||||
// check if we need to display the usage. exit if we do.
|
||||
@@ -98,7 +98,7 @@ int main(int argc, char ** argv)
|
||||
if(argAddress.value(parser) == "127.0.0.1:19400")
|
||||
{
|
||||
SSDPDiscover discover;
|
||||
address = discover.getFirstService(STY_FLATBUFSERVER);
|
||||
address = discover.getFirstService(searchType::STY_FLATBUFSERVER);
|
||||
if(address.isEmpty())
|
||||
{
|
||||
address = argAddress.value(parser);
|
||||
|
@@ -62,7 +62,7 @@ int main(int argc, char ** argv)
|
||||
if(argAddress.value(parser) == "127.0.0.1:19400")
|
||||
{
|
||||
SSDPDiscover discover;
|
||||
address = discover.getFirstService(STY_FLATBUFSERVER);
|
||||
address = discover.getFirstService(searchType::STY_FLATBUFSERVER);
|
||||
if(address.isEmpty())
|
||||
{
|
||||
address = argAddress.value(parser);
|
||||
|
@@ -65,7 +65,7 @@ int main(int argc, char ** argv)
|
||||
if(argAddress.value(parser) == "127.0.0.1:19400")
|
||||
{
|
||||
SSDPDiscover discover;
|
||||
address = discover.getFirstService(STY_FLATBUFSERVER);
|
||||
address = discover.getFirstService(searchType::STY_FLATBUFSERVER);
|
||||
if(address.isEmpty())
|
||||
{
|
||||
address = argAddress.value(parser);
|
||||
|
@@ -78,7 +78,7 @@ int main(int argc, char ** argv)
|
||||
if(argAddress.value(parser) == "127.0.0.1:19400")
|
||||
{
|
||||
SSDPDiscover discover;
|
||||
address = discover.getFirstService(STY_FLATBUFSERVER);
|
||||
address = discover.getFirstService(searchType::STY_FLATBUFSERVER);
|
||||
if(address.isEmpty())
|
||||
{
|
||||
address = argAddress.value(parser);
|
||||
|
@@ -182,7 +182,7 @@ int main(int argc, char * argv[])
|
||||
if(argAddress.value(parser) == "127.0.0.1:19444")
|
||||
{
|
||||
SSDPDiscover discover;
|
||||
address = discover.getFirstService(STY_JSONSERVER);
|
||||
address = discover.getFirstService(searchType::STY_JSONSERVER);
|
||||
if(address.isEmpty())
|
||||
{
|
||||
address = argAddress.value(parser);
|
||||
|
@@ -84,18 +84,18 @@ int main(int argc, char** argv)
|
||||
BooleanOption & argSkipReply = parser.add<BooleanOption>(0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
||||
BooleanOption & argHelp = parser.add<BooleanOption>('h', "help", "Show this help message and exit");
|
||||
|
||||
argVideoStandard.addSwitch("pal", VIDEOSTANDARD_PAL);
|
||||
argVideoStandard.addSwitch("ntsc", VIDEOSTANDARD_NTSC);
|
||||
argVideoStandard.addSwitch("secam", VIDEOSTANDARD_SECAM);
|
||||
argVideoStandard.addSwitch("no-change", VIDEOSTANDARD_NO_CHANGE);
|
||||
argVideoStandard.addSwitch("pal", VideoStandard::PAL);
|
||||
argVideoStandard.addSwitch("ntsc", VideoStandard::NTSC);
|
||||
argVideoStandard.addSwitch("secam", VideoStandard::SECAM);
|
||||
argVideoStandard.addSwitch("no-change", VideoStandard::NO_CHANGE);
|
||||
|
||||
argPixelFormat.addSwitch("yuyv", PIXELFORMAT_YUYV);
|
||||
argPixelFormat.addSwitch("uyvy", PIXELFORMAT_UYVY);
|
||||
argPixelFormat.addSwitch("rgb32", PIXELFORMAT_RGB32);
|
||||
argPixelFormat.addSwitch("yuyv", PixelFormat::YUYV);
|
||||
argPixelFormat.addSwitch("uyvy", PixelFormat::UYVY);
|
||||
argPixelFormat.addSwitch("rgb32", PixelFormat::RGB32);
|
||||
#ifdef HAVE_JPEG
|
||||
argPixelFormat.addSwitch("mjpeg", PIXELFORMAT_MJPEG);
|
||||
argPixelFormat.addSwitch("mjpeg", PixelFormat::MJPEG);
|
||||
#endif
|
||||
argPixelFormat.addSwitch("no-change", PIXELFORMAT_NO_CHANGE);
|
||||
argPixelFormat.addSwitch("no-change", PixelFormat::NO_CHANGE);
|
||||
|
||||
// parse all options
|
||||
parser.process(app);
|
||||
@@ -173,11 +173,11 @@ int main(int argc, char** argv)
|
||||
// set 3D mode if applicable
|
||||
if (parser.isSet(arg3DSBS))
|
||||
{
|
||||
grabber.setVideoMode(VIDEO_3DSBS);
|
||||
grabber.setVideoMode(VideoMode::VIDEO_3DSBS);
|
||||
}
|
||||
else if (parser.isSet(arg3DTAB))
|
||||
{
|
||||
grabber.setVideoMode(VIDEO_3DTAB);
|
||||
grabber.setVideoMode(VideoMode::VIDEO_3DTAB);
|
||||
}
|
||||
|
||||
// run the grabber
|
||||
@@ -198,7 +198,7 @@ int main(int argc, char** argv)
|
||||
if(argAddress.value(parser) == "127.0.0.1:19400")
|
||||
{
|
||||
SSDPDiscover discover;
|
||||
address = discover.getFirstService(STY_FLATBUFSERVER);
|
||||
address = discover.getFirstService(searchType::STY_FLATBUFSERVER);
|
||||
if(address.isEmpty())
|
||||
{
|
||||
address = argAddress.value(parser);
|
||||
|
@@ -83,7 +83,7 @@ int main(int argc, char ** argv)
|
||||
if(argAddress.value(parser) == "127.0.0.1:19400")
|
||||
{
|
||||
SSDPDiscover discover;
|
||||
address = discover.getFirstService(STY_FLATBUFSERVER);
|
||||
address = discover.getFirstService(searchType::STY_FLATBUFSERVER);
|
||||
if(address.isEmpty())
|
||||
{
|
||||
address = argAddress.value(parser);
|
||||
|
@@ -77,7 +77,12 @@ unsigned int getProcessIdsByProcessName(const char *processName, QStringList &li
|
||||
if (bytes.isEmpty())
|
||||
return 0;
|
||||
|
||||
listOfPids = QString(bytes).split("\n", QString::SkipEmptyParts);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
listOfPids = QString(bytes).split("\n", Qt::SkipEmptyParts);
|
||||
#else
|
||||
listOfPids = QString(bytes).split("\n", QString::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
return listOfPids.count();
|
||||
|
||||
#endif
|
||||
|
@@ -76,7 +76,7 @@ HyperionDaemon::HyperionDaemon(const QString rootPath, QObject *parent, const bo
|
||||
, _osxGrabber(nullptr)
|
||||
, _qtGrabber(nullptr)
|
||||
, _ssdp(nullptr)
|
||||
, _currVideoMode(VIDEO_2D)
|
||||
, _currVideoMode(VideoMode::VIDEO_2D)
|
||||
{
|
||||
HyperionDaemon::daemon = this;
|
||||
|
||||
@@ -278,7 +278,7 @@ void HyperionDaemon::handleSettingsUpdate(const settings::type &settingsType, co
|
||||
if (level == "silent")
|
||||
Logger::setLogLevel(Logger::OFF);
|
||||
else if (level == "warn")
|
||||
Logger::setLogLevel(Logger::WARNING);
|
||||
Logger::setLogLevel(Logger::LogLevel::WARNING);
|
||||
else if (level == "verbose")
|
||||
Logger::setLogLevel(Logger::INFO);
|
||||
else if (level == "debug")
|
||||
@@ -325,15 +325,19 @@ void HyperionDaemon::handleSettingsUpdate(const settings::type &settingsType, co
|
||||
Error(_log, "grabber device '%s' for type amlogic not found!", QSTRING_CSTR(_grabber_device));
|
||||
}
|
||||
}
|
||||
// x11 -> if DISPLAY is set
|
||||
else if (getenv("DISPLAY") != NULL)
|
||||
{
|
||||
type = "x11";
|
||||
}
|
||||
// qt -> if nothing other applies
|
||||
else
|
||||
{
|
||||
type = "qt";
|
||||
// x11 -> if DISPLAY is set
|
||||
QByteArray envDisplay = qgetenv("DISPLAY");
|
||||
if ( !envDisplay.isEmpty() )
|
||||
{
|
||||
type = "x11";
|
||||
}
|
||||
// qt -> if nothing other applies
|
||||
else
|
||||
{
|
||||
type = "qt";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -230,7 +230,7 @@ int main(int argc, char** argv)
|
||||
if (parser.isSet(versionOption))
|
||||
{
|
||||
std::cout
|
||||
<< "Hyperion Ambilight Deamon (" << getpid() << ")" << std::endl
|
||||
<< "Hyperion Ambilight Deamon" << std::endl
|
||||
<< "\tVersion : " << HYPERION_VERSION << " (" << HYPERION_BUILD_ID << ")" << std::endl
|
||||
<< "\tBuild Time: " << __DATE__ << " " << __TIME__ << std::endl;
|
||||
|
||||
|
Reference in New Issue
Block a user