• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mcallegari / qlcplus / 28807794184

06 Jul 2026 04:42PM UTC coverage: 35.285% (+1.1%) from 34.233%
28807794184

push

github

mcallegari
qmlui: VC Speed dial tap button can tap global BPM

18560 of 52600 relevant lines covered (35.29%)

40987.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

49.4
/plugins/interfaces/qlcioplugin.cpp
1
/*
2
  Q Light Controller Plus
3
  qlcioplugin.cpp
4

5
  Copyright (c) Heikki Junnila
6
                Massimo Callegari
7

8
  Licensed under the Apache License, Version 2.0 (the "License");
9
  you may not use this file except in compliance with the License.
10
  You may obtain a copy of the License at
11

12
      http://www.apache.org/licenses/LICENSE-2.0.txt
13

14
  Unless required by applicable law or agreed to in writing, software
15
  distributed under the License is distributed on an "AS IS" BASIS,
16
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
  See the License for the specific language governing permissions and
18
  limitations under the License.
19
*/
20

21
#include "qlcioplugin.h"
22
#include <QDebug>
23

24
/*************************************************************************
25
 * Outputs
26
 *************************************************************************/
27

28
bool QLCIOPlugin::openOutput(quint32 output, quint32 universe)
×
29
{
30
    Q_UNUSED(universe)
31
    Q_UNUSED(output)
32
    return false;
×
33
}
34

35
void QLCIOPlugin::closeOutput(quint32 output, quint32 universe)
×
36
{
37
    Q_UNUSED(output)
38
    Q_UNUSED(universe)
39
}
×
40

41
QStringList QLCIOPlugin::outputs()
×
42
{
43
    return QStringList();
×
44
}
45

46
QStringList QLCIOPlugin::outputsUID()
×
47
{
48
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
49
    return QStringList(outputs().count(), QString());
×
50
#else
51
    QStringList result;
52
    for (int i = 0; i < outputs().count(); i++)
53
        result << QString();
54
    return result;
55
#endif
56
}
57

58
QString QLCIOPlugin::outputInfo(quint32 output)
×
59
{
60
    Q_UNUSED(output)
61
    return QString();
×
62
}
63

64
void QLCIOPlugin::writeUniverse(quint32 universe, quint32 output, const QByteArray &data, bool dataChanged)
×
65
{
66
    Q_UNUSED(universe)
67
    Q_UNUSED(output)
68
    Q_UNUSED(data)
69
    Q_UNUSED(dataChanged)
70
}
×
71

72
/*************************************************************************
73
 * Inputs
74
 *************************************************************************/
75

76
bool QLCIOPlugin::openInput(quint32 input, quint32 universe)
×
77
{
78
    Q_UNUSED(input)
79
    Q_UNUSED(universe)
80
    return false;
×
81
}
82

83
void QLCIOPlugin::closeInput(quint32 input, quint32 universe)
×
84
{
85
    Q_UNUSED(input)
86
    Q_UNUSED(universe)
87
}
×
88

89
QStringList QLCIOPlugin::inputs()
×
90
{
91
    return QStringList();
×
92
}
93

94
QStringList QLCIOPlugin::inputsUID()
×
95
{
96
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
97
    return QStringList(inputs().count(), QString());
×
98
#else
99
    QStringList result;
100
    for (int i = 0; i < inputs().count(); i++)
101
        result << QString();
102
    return result;
103
#endif
104
}
105

106
QString QLCIOPlugin::inputInfo(quint32 input)
×
107
{
108
    Q_UNUSED(input)
109
    return QString();
×
110
}
111

112
void QLCIOPlugin::sendFeedBack(quint32 universe, quint32 inputLine,
×
113
                               quint32 channel, uchar value, const QVariant &params)
114
{
115
    Q_UNUSED(universe)
116
    Q_UNUSED(inputLine)
117
    Q_UNUSED(channel)
118
    Q_UNUSED(value)
119
    Q_UNUSED(params)
120
}
×
121

122
/*************************************************************************
123
 * Configure
124
 *************************************************************************/
125

126
void QLCIOPlugin::configure()
×
127
{
128
}
×
129

130
bool QLCIOPlugin::canConfigure() const
×
131
{
132
    return false;
×
133
}
134

135
void QLCIOPlugin::setParameter(quint32 universe, quint32 line,
305✔
136
                               Capability type, QString name, QVariant value)
137
{
138
    if (m_universesMap.contains(universe) == false)
305✔
139
        return;
×
140

141
    qDebug() << "[QLCIOPlugin] set parameter:" << universe << line << name << value;
305✔
142

143
    if (type == Input && m_universesMap[universe].inputLine == line)
305✔
144
        m_universesMap[universe].inputParameters[name] = value;
1✔
145
    else if (type == Output && m_universesMap[universe].outputLine == line)
304✔
146
        m_universesMap[universe].outputParameters[name] = value;
304✔
147
}
148

149
void QLCIOPlugin::unSetParameter(quint32 universe, quint32 line, QLCIOPlugin::Capability type, QString name)
150✔
150
{
151
    if (m_universesMap.contains(universe) == false)
150✔
152
        return;
×
153

154
    qDebug() << "[QLCIOPlugin] unset parameter:" << universe << line << name;
150✔
155

156
    if (type == Input && m_universesMap[universe].inputLine == line)
150✔
157
    {
158
        if (m_universesMap[universe].inputParameters.contains(name))
×
159
            m_universesMap[universe].inputParameters.take(name);
×
160
    }
161
    else if (type == Output && m_universesMap[universe].outputLine == line)
150✔
162
    {
163
        if (m_universesMap[universe].outputParameters.contains(name))
150✔
164
            m_universesMap[universe].outputParameters.take(name);
×
165
    }
166
}
167

168
QMap<QString, QVariant> QLCIOPlugin::getParameters(quint32 universe, quint32 line, QLCIOPlugin::Capability type) const
3✔
169
{
170
    if (m_universesMap.contains(universe) == false)
3✔
171
        return QMap<QString, QVariant>();
×
172

173
    if (type == Input && m_universesMap[universe].inputLine == line)
3✔
174
        return m_universesMap[universe].inputParameters;
3✔
175
    else if (type == Output && m_universesMap[universe].outputLine == line)
×
176
        return m_universesMap[universe].outputParameters;
×
177

178
    return QMap<QString, QVariant>();
×
179
}
180

181
void QLCIOPlugin::addToMap(quint32 universe, quint32 line,
178✔
182
                           QLCIOPlugin::Capability type)
183
{
184
    PluginUniverseDescriptor desc;
178✔
185

186
    if (m_universesMap.contains(universe))
178✔
187
        desc = m_universesMap[universe];
22✔
188
    else
189
    {
190
        // initialize a new descriptor
191
        desc.inputLine = UINT_MAX;
156✔
192
        desc.outputLine = UINT_MAX;
156✔
193
    }
194

195
    if (type == Input)
178✔
196
    {
197
        desc.inputLine = line;
9✔
198
    }
199
    else if (type == Output)
169✔
200
    {
201
        desc.outputLine = line;
169✔
202
    }
203
    qDebug() << "[QLCIOPlugin] setting lines:" << universe << desc.inputLine << desc.outputLine;
178✔
204
    m_universesMap[universe] = desc;
178✔
205
}
178✔
206

207
void QLCIOPlugin::removeFromMap(quint32 universe, quint32 line, QLCIOPlugin::Capability type)
150✔
208
{
209
    if (m_universesMap.contains(universe) == false)
150✔
210
        return;
147✔
211

212
    if (type == Input && m_universesMap[universe].inputLine == line)
3✔
213
    {
214
        m_universesMap[universe].inputLine = UINT_MAX;
×
215
        m_universesMap[universe].inputParameters.clear();
×
216
        return;
×
217
    }
218
    else if (type == Output && m_universesMap[universe].outputLine == line)
3✔
219
    {
220
        m_universesMap[universe].outputLine = UINT_MAX;
1✔
221
        m_universesMap[universe].outputParameters.clear();
1✔
222
        return;
1✔
223
    }
224

225
    // check if we can completely remove this entry
226
    if (m_universesMap[universe].inputLine == UINT_MAX &&
4✔
227
        m_universesMap[universe].outputLine == UINT_MAX)
2✔
228
    {
229
        m_universesMap.take(universe);
1✔
230
    }
231
}
232

233
/*************************************************************************
234
 * RDM
235
 *************************************************************************/
236

237
bool QLCIOPlugin::sendRDMCommand(quint32 universe, quint32 line, uchar command, QVariantList params)
×
238
{
239
    Q_UNUSED(universe)
240
    Q_UNUSED(line)
241
    Q_UNUSED(command)
242
    Q_UNUSED(params)
243

244
    return false;
×
245
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc