86 lines
2.5 KiB
C++
Executable File
86 lines
2.5 KiB
C++
Executable File
/**
|
|
* Settings for VideoOverlayManagement
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by hjl, SLSE, 2016-06-30
|
|
*/
|
|
|
|
#include "settings.h"
|
|
|
|
#include <QtCore/QSettings>
|
|
#include <nglsettings/nglsettings_settings.h>
|
|
#include <nglsettings/nglsettings_connections.h>
|
|
#include <ngltools/ngltools_filesystem.h>
|
|
|
|
namespace VideoOverlayManagement
|
|
{
|
|
class NGLSettingsClass : public NGL::Settings
|
|
{
|
|
public:
|
|
NGLSettingsClass()
|
|
: NGL::Settings(s_iniFile.isEmpty() ? NGL::findProjectConfigFile() : s_iniFile)
|
|
{}
|
|
static void setIniFile(const QString &fn)
|
|
{
|
|
s_iniFile = fn;
|
|
}
|
|
static QString s_iniFile;
|
|
};
|
|
QString NGLSettingsClass::s_iniFile;
|
|
Q_GLOBAL_STATIC(NGLSettingsClass, s)
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
QString Settings::getAvsHostname()
|
|
{
|
|
return NGL::Connections::hostName(NGL::Connections::eConnection::AVS_AVA);
|
|
}
|
|
//---------------------------------------------------------------------
|
|
|
|
quint16 Settings::getAvsAvaPort()
|
|
{
|
|
return NGL::Connections::port(NGL::Connections::eConnection::AVS_AVA);
|
|
}
|
|
//---------------------------------------------------------------------
|
|
|
|
quint16 Settings::getAvsKeepAliveTriggerRequestTime()
|
|
{
|
|
// Info: AVS schickt alle 20 sec '298 KEEPALIVE' aufgrund eines KEEPALIVE Requesttrigger aus MainHandler!
|
|
quint16 keepAliveTriggerRequestTime = settings()->settings()->value(QLatin1String("zwav_connection/keepAliveTriggerRequestTime"), 1000 * 20).toUInt();
|
|
return keepAliveTriggerRequestTime;
|
|
}
|
|
//---------------------------------------------------------------------
|
|
|
|
quint16 Settings::getAvsKeepAliveTime()
|
|
{
|
|
// Mit dieser Timeoutzeit wird beim Ausbleiben von '298 KEEPALIVE' der Fehlerfall dedektiert.
|
|
quint16 keepAliveTime = settings()->settings()->value(QLatin1String("zwav_connection/keepAliveTime"), 1000 * 25).toUInt();
|
|
return keepAliveTime;
|
|
}
|
|
//---------------------------------------------------------------------
|
|
|
|
QString Settings::getOverlayTemplateName()
|
|
{
|
|
return QLatin1String("bottomcenter");
|
|
}
|
|
//---------------------------------------------------------------------
|
|
|
|
QString Settings::getContextName()
|
|
{
|
|
// ToDo: Nach Umstellung von AVS den 'EXCON' Namen 'ex_' verwenden!
|
|
return QLatin1String("uebung_");
|
|
}
|
|
//---------------------------------------------------------------------
|
|
NGL::Settings *Settings::settings()
|
|
{
|
|
return s();
|
|
}
|
|
//---------------------------------------------------------------------
|
|
void Settings::setIniFile(const QString &ini)
|
|
{
|
|
NGLSettingsClass::setIniFile(ini);
|
|
}
|
|
|
|
} // namespace VideoOverlayManagement
|