34 #define BLACKLIST QStringLiteral("") 96 QStringLiteral(
" subgraph cluster_2 {\r\n" 97 " label = \"%1\";\r\n" 99 " fillcolor=\"grey95\";\r\n").arg(tr(
"Outputs"));
103 Data->append(
" }\r\n\r\n");
121 QStringList outputsfortype;
126 if (!outputsfortype.isEmpty())
127 result.insert(TorcCoreUtils::EnumToLowerString<TorcOutput::Type>(static_cast<TorcOutput::Type>(type)), outputsfortype);
134 return TorcCoreUtils::EnumList<TorcOutput::Type>();
148 LOG(VB_GENERAL, LOG_WARNING, QStringLiteral(
"Already have output named %1 - ignoring").arg(Output->
GetUniqueId()));
154 LOG(VB_GENERAL, LOG_INFO, QStringLiteral(
"Registered output %1").arg(Output->
GetUniqueId()));
169 LOG(VB_GENERAL, LOG_WARNING, QStringLiteral(
"Output %1 not recognised - cannot remove").arg(Output->
GetUniqueId()));
173 LOG(VB_GENERAL, LOG_INFO, QStringLiteral(
"Output %1 deregistered").arg(Output->
GetUniqueId()));
183 QVariantMap::const_iterator i = Details.constBegin();
184 for ( ; i != Details.constEnd(); ++i)
190 QVariantMap devices = i.value().toMap();
191 QVariantMap::const_iterator j = devices.constBegin();
192 for ( ; j != devices.constEnd(); ++j)
195 QString group = j.key();
199 if (!network && !constant)
202 QVariantMap details = j.value().toMap();
203 QVariantMap::const_iterator it = details.constBegin();
204 for ( ; it != details.constEnd(); ++it)
208 if (it.key() == TorcCoreUtils::EnumToLowerString<TorcOutput::Type>(
static_cast<TorcOutput::Type>(type)))
210 QVariantMap input = it.value().toMap();
211 QString defaultvalue = network ? input.value(QStringLiteral(
"default")).toString() : input.value(QStringLiteral(
"value")).toString();
212 QString uniqueid = input.value(QStringLiteral(
"name"), QStringLiteral(
"Error")).toString();
215 double defaultdouble = defaultvalue.toDouble(&ok);
241 LOG(VB_GENERAL, LOG_ERR, QStringLiteral(
"Cannot create constant button input"));
248 m_createdOutputs.insert(uniqueid, newoutput);
259 QMap<QString,TorcOutput*>::const_iterator it2 = m_createdOutputs.constBegin();
260 for ( ; it2 != m_createdOutputs.constEnd(); ++it2)
262 it2.value()->DownRef();
265 m_createdOutputs.clear();
virtual void Graph(QByteArray *Data)
virtual TorcOutput::Type GetType(void)=0
void Graph(QByteArray *Data)
#define NETWORK_DEVICE_STRING
virtual bool DownRef(void)
QVariantMap GetOutputList(void)
Return a map of known outputs.
#define OUTPUTS_DIRECTORY
QStringList GetOutputTypes(void)
void HandleSubscriberDeleted(QObject *Subscriber)
QReadWriteLock m_httpServiceLock
QString GetUIName(void) override
#define LOG(_MASK_, _LEVEL_, _STRING_)
void OutputsChanged(void)
void SubscriberDeleted(QObject *Subscriber)
QReadWriteLock m_handlerLock
void Destroy(void) override
void RemoveOutput(TorcOutput *Output)
void Create(const QVariantMap &Details) override
#define CONSTANT_DEVICE_STRING
TorcOutputs()
TorcOutputs contains the master record of known outputs.
void AddOutput(TorcOutput *Output)
QString GetUniqueId(void)