MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / setUsbCaptureEnable

Method setUsbCaptureEnable

sources/base/VideoControl.cpp:127–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void VideoControl::setUsbCaptureEnable(bool enable)
128{
129 if (_usbCaptEnabled != enable)
130 {
131 if (enable)
132 {
133 _hyperhdr->registerInput(_usbCaptPrio, hyperhdr::COMP_VIDEOGRABBER, "System", _usbCaptName);
134 connect(GlobalSignals::getInstance(), &GlobalSignals::SignalNewVideoImage, this, &VideoControl::handleIncomingUsbImage, static_cast<Qt::ConnectionType>(Qt::DirectConnection | Qt::UniqueConnection));
135 }
136 else
137 {
138 disconnect(GlobalSignals::getInstance(), &GlobalSignals::SignalNewVideoImage, this, &VideoControl::handleIncomingUsbImage);
139 _hyperhdr->clear(_usbCaptPrio);
140 _usbInactiveTimer->stop();
141 }
142
143 _usbCaptEnabled = enable;
144 _hyperhdr->setNewComponentState(hyperhdr::COMP_VIDEOGRABBER, enable);
145 emit GlobalSignals::getInstance()->SignalRequestComponent(hyperhdr::COMP_VIDEOGRABBER, int(_hyperhdr->getInstanceIndex()), enable);
146 }
147}
148
149void VideoControl::handleSettingsUpdate(settings::type type, const QJsonDocument& config)
150{

Callers 1

setSignalStateByCECMethod · 0.80

Calls 4

registerInputMethod · 0.45
clearMethod · 0.45
stopMethod · 0.45
setNewComponentStateMethod · 0.45

Tested by

no test coverage detected