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

mcallegari / qlcplus / 19144422256

06 Nov 2025 05:33PM UTC coverage: 34.256% (-0.1%) from 34.358%
19144422256

push

github

mcallegari
Back to 5.1.0 debug

17718 of 51723 relevant lines covered (34.26%)

19528.23 hits per line

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

0.0
/ui/src/virtualconsole/vccuelistproperties.cpp
1
/*
2
  Q Light Controller
3
  vccuelistproperties.cpp
4

5
  Copyright (c) Heikki Junnila
6

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

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

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

20
#include <QAction>
21

22
#include "vccuelistproperties.h"
23
#include "inputselectionwidget.h"
24
#include "functionselection.h"
25
#include "vccuelist.h"
26
#include "doc.h"
27

28
VCCueListProperties::VCCueListProperties(VCCueList* cueList, Doc* doc)
×
29
    : QDialog(cueList)
30
    , m_doc(doc)
×
31
{
32
    Q_ASSERT(doc != NULL);
×
33
    Q_ASSERT(cueList != NULL);
×
34
    m_cueList = cueList;
×
35

36
    setupUi(this);
×
37

38
    QAction* action = new QAction(this);
×
39
    action->setShortcut(QKeySequence(QKeySequence::Close));
×
40
    connect(action, SIGNAL(triggered(bool)), this, SLOT(reject()));
×
41
    addAction(action);
×
42

43
    /************************************************************************
44
     * Cues page
45
     ************************************************************************/
46

47
    /* Name */
48
    m_nameEdit->setText(cueList->caption());
×
49
    m_nameEdit->setSelection(0, cueList->caption().length());
×
50

51
    /* Chaser */
52
    m_chaserId = cueList->chaserID();
×
53
    updateChaserName();
×
54

55
    /* Next/Prev behavior */
56
    m_nextPrevBehaviorCombo->setCurrentIndex(m_cueList->nextPrevBehavior());
×
57

58
    /* Connections */
59
    connect(m_chaserAttachButton, SIGNAL(clicked()), this, SLOT(slotChaserAttachClicked()));
×
60
    connect(m_chaserDetachButton, SIGNAL(clicked()), this, SLOT(slotChaserDetachClicked()));
×
61

62
    /************************************************************************
63
     * Play/Stop Cue List page
64
     ************************************************************************/
65

66
    m_playInputWidget = new InputSelectionWidget(m_doc, this);
×
67
    m_playInputWidget->setTitle(tr("Play/Pause control"));
×
68
    m_playInputWidget->setCustomFeedbackVisibility(true);
×
69
    m_playInputWidget->setKeySequence(m_cueList->playbackKeySequence());
×
70
    m_playInputWidget->setInputSource(m_cueList->inputSource(VCCueList::playbackInputSourceId));
×
71
    m_playInputWidget->setWidgetPage(m_cueList->page());
×
72
    m_playInputWidget->show();
×
73
    m_playbackLayout->addWidget(m_playInputWidget);
×
74

75
    m_stopInputWidget = new InputSelectionWidget(m_doc, this);
×
76
    m_stopInputWidget->setTitle(tr("Stop control"));
×
77
    m_stopInputWidget->setCustomFeedbackVisibility(true);
×
78
    m_stopInputWidget->setKeySequence(m_cueList->stopKeySequence());
×
79
    m_stopInputWidget->setInputSource(m_cueList->inputSource(VCCueList::stopInputSourceId));
×
80
    m_stopInputWidget->setWidgetPage(m_cueList->page());
×
81
    m_stopInputWidget->show();
×
82
    m_stopLayout->addWidget(m_stopInputWidget);
×
83

84
    /************************************************************************
85
     * Next Cue page
86
     ************************************************************************/
87

88
    m_nextInputWidget = new InputSelectionWidget(m_doc, this);
×
89
    m_nextInputWidget->setCustomFeedbackVisibility(true);
×
90
    m_nextInputWidget->setKeySequence(m_cueList->nextKeySequence());
×
91
    m_nextInputWidget->setInputSource(m_cueList->inputSource(VCCueList::nextInputSourceId));
×
92
    m_nextInputWidget->setWidgetPage(m_cueList->page());
×
93
    m_nextInputWidget->show();
×
94
    m_nextLayout->addWidget(m_nextInputWidget);
×
95

96
    /************************************************************************
97
     * Previous Cue page
98
     ************************************************************************/
99

100
    m_prevInputWidget = new InputSelectionWidget(m_doc, this);
×
101
    m_prevInputWidget->setCustomFeedbackVisibility(true);
×
102
    m_prevInputWidget->setKeySequence(m_cueList->previousKeySequence());
×
103
    m_prevInputWidget->setInputSource(m_cueList->inputSource(VCCueList::previousInputSourceId));
×
104
    m_prevInputWidget->setWidgetPage(m_cueList->page());
×
105
    m_prevInputWidget->show();
×
106
    m_previousLayout->addWidget(m_prevInputWidget);
×
107

108
    /************************************************************************
109
     * Crossfade Cue List page
110
     ************************************************************************/
111

112
    if (cueList->sideFaderMode() == VCCueList::Steps)
×
113
        m_stepsRadio->setChecked(true);
×
114
    else if (cueList->sideFaderMode() == VCCueList::Crossfade)
×
115
        m_crossFadeRadio->setChecked(true);
×
116

117
    m_crossfadeInputWidget = new InputSelectionWidget(m_doc, this);
×
118
    m_crossfadeInputWidget->setTitle(tr("External Input"));
×
119
    m_crossfadeInputWidget->setKeyInputVisibility(false);
×
120
    m_crossfadeInputWidget->setInputSource(m_cueList->inputSource(VCCueList::sideFaderInputSourceId));
×
121
    m_crossfadeInputWidget->setWidgetPage(m_cueList->page());
×
122
    m_crossfadeInputWidget->show();
×
123
    m_crossFadeLayout->addWidget(m_crossfadeInputWidget);
×
124

125
    /* Playback layout */
126
    connect(m_play_stop_pause, SIGNAL(clicked(bool)), this, SLOT(slotPlaybackLayoutChanged()));
×
127
    connect(m_play_pause_stop, SIGNAL(clicked(bool)), this, SLOT(slotPlaybackLayoutChanged()));
×
128

129
    if (m_cueList->playbackLayout() == VCCueList::PlayStopPause)
×
130
        m_play_stop_pause->setChecked(true);
×
131
    else
132
        m_play_pause_stop->setChecked(true);
×
133
}
×
134

135
VCCueListProperties::~VCCueListProperties()
×
136
{
137
}
×
138

139
void VCCueListProperties::accept()
×
140
{
141
    /* Name */
142
    m_cueList->setCaption(m_nameEdit->text());
×
143

144
    /* Chaser */
145
    m_cueList->setChaser(m_chaserId);
×
146

147
    /* Playback layout */
148
    if (m_play_stop_pause->isChecked())
×
149
        m_cueList->setPlaybackLayout(VCCueList::PlayStopPause);
×
150
    else
151
        m_cueList->setPlaybackLayout(VCCueList::PlayPauseStop);
×
152

153
    /* Next/Prev behavior */
154
    m_cueList->setNextPrevBehavior(VCCueList::NextPrevBehavior(m_nextPrevBehaviorCombo->currentIndex()));
×
155

156
    /* Key sequences */
157
    m_cueList->setNextKeySequence(m_nextInputWidget->keySequence());
×
158
    m_cueList->setPreviousKeySequence(m_prevInputWidget->keySequence());
×
159
    m_cueList->setPlaybackKeySequence(m_playInputWidget->keySequence());
×
160
    m_cueList->setStopKeySequence(m_stopInputWidget->keySequence());
×
161

162
    /* Input sources */
163
    m_cueList->setInputSource(m_nextInputWidget->inputSource(), VCCueList::nextInputSourceId);
×
164
    m_cueList->setInputSource(m_prevInputWidget->inputSource(), VCCueList::previousInputSourceId);
×
165
    m_cueList->setInputSource(m_playInputWidget->inputSource(), VCCueList::playbackInputSourceId);
×
166
    m_cueList->setInputSource(m_stopInputWidget->inputSource(), VCCueList::stopInputSourceId);
×
167
    m_cueList->setInputSource(m_crossfadeInputWidget->inputSource(), VCCueList::sideFaderInputSourceId);
×
168

169
    if (m_noneRadio->isChecked())
×
170
        m_cueList->setSideFaderMode(VCCueList::None);
×
171
    else if (m_stepsRadio->isChecked())
×
172
        m_cueList->setSideFaderMode(VCCueList::Steps);
×
173
    else
174
        m_cueList->setSideFaderMode(VCCueList::Crossfade);
×
175

176
    QDialog::accept();
×
177
}
×
178

179
void VCCueListProperties::slotTabChanged()
×
180
{
181
    m_playInputWidget->stopAutoDetection();
×
182
    m_stopInputWidget->stopAutoDetection();
×
183
    m_nextInputWidget->stopAutoDetection();
×
184
    m_prevInputWidget->stopAutoDetection();
×
185

186
    m_crossfadeInputWidget->stopAutoDetection();
×
187
}
×
188

189
/****************************************************************************
190
 * Cues
191
 ****************************************************************************/
192

193
void VCCueListProperties::slotChaserAttachClicked()
×
194
{
195
    FunctionSelection fs(this, m_doc);
×
196
    fs.setMultiSelection(false);
×
197
    fs.setFilter(Function::ChaserType | Function::SequenceType, true);
×
198
    if (fs.exec() == QDialog::Accepted && fs.selection().size() > 0)
×
199
    {
200
        m_chaserId = fs.selection().first();
×
201
        updateChaserName();
×
202
    }
203
}
×
204

205
void VCCueListProperties::slotChaserDetachClicked()
×
206
{
207
    m_chaserId = Function::invalidId();
×
208
    updateChaserName();
×
209
}
×
210

211
void VCCueListProperties::slotPlaybackLayoutChanged()
×
212
{
213
    if (m_play_pause_stop->isChecked())
×
214
    {
215
        m_playInputWidget->setTitle(tr("Play/Pause control"));
×
216
        m_stopInputWidget->setTitle(tr("Stop control"));
×
217
    }
218
    else
219
    {
220
        m_playInputWidget->setTitle(tr("Play/Stop control"));
×
221
        m_stopInputWidget->setTitle(tr("Pause control"));
×
222
    }
223
}
×
224

225
void VCCueListProperties::updateChaserName()
×
226
{
227
    Function* function = m_doc->function(m_chaserId);
×
228
    if (function == NULL)
×
229
        m_chaserEdit->setText(tr("No function"));
×
230
    else
231
        m_chaserEdit->setText(function->name());
×
232
}
×
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