Skip to content

Commit 49f0493

Browse files
committed
Merge remote-tracking branch 'origin/pr/413'
# Conflicts: # Software/src/GrabWidget.cpp # Software/src/LedDeviceManager.cpp # Software/src/LightpackApplication.cpp # Software/src/src.pro # Software/src/wizard/ConfigureUdpDevicePage.cpp # Software/src/wizard/MonitorConfigurationPage.cpp # Software/src/wizard/SelectDevicePage.cpp
2 parents a7f4fb8 + a3d3f4f commit 49f0493

File tree

107 files changed

+1856
-1934
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1856
-1934
lines changed

Software/build-config.prf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exists(build-vars.prf) {
77
#------------------------------------------------------------------------------
88
# Parsing configuration
99
#------------------------------------------------------------------------------
10-
win32: {
10+
win32 {
1111
# Target architecture
1212
QMAKE_TARGET.arch = $$TARGET_ARCH
1313
_TARGET_ARCH = $$(TARGET_ARCH)

Software/build-vars.prf.default

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#------------------------------------------------------------------------------
55
# General
66
#------------------------------------------------------------------------------
7-
win32: {
7+
win32 {
88
# Set this to -Win32 for 32-bit
99
OPENSSL_DIR = "C:\\OpenSSL-Win64\\bin"
1010
# Set this to run without openssl. The updatecheck won't work.
@@ -47,8 +47,8 @@ macx {
4747
# DEFINES += SAVE_FRAME_TO_FILE
4848

4949
# CONFIG += debug
50-
# QMAKE_CC += clang
51-
# QMAKE_CXX += clang++
50+
# QMAKE_CC = clang
51+
# QMAKE_CXX = clang++
5252
# QMAKE_CFLAGS_DEBUG += -ggdb
5353
# QMAKE_CFLAGS_RELEASE += -march=native
5454
# QMAKE_CXXFLAGS_DEBUG += -ggdb

Software/common/WinDXUtils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ UINT GetDxgiPresentOffset(HWND hwnd) {
146146

147147
#ifndef NO_QT
148148
char buf[100];
149-
sprintf(buf, "presentFuncPtr=%x", presentFuncPtr);
149+
sprintf(buf, "presentFuncPtr=%llx", presentFuncPtr);
150150
DEBUG_MID_LEVEL << Q_FUNC_INFO << buf;
151151
#endif
152152

@@ -227,7 +227,7 @@ UINT GetD3D9PresentOffset(HWND hWnd){
227227
uintptr_t presentFuncPtr = pvtbl[D3D9_PRESENT_FUNC_ORD];
228228
#ifndef NO_QT
229229
char buf[100];
230-
sprintf(buf, "presentFuncPtr=%x", presentFuncPtr);
230+
sprintf(buf, "presentFuncPtr=%llx", presentFuncPtr);
231231
DEBUG_MID_LEVEL << Q_FUNC_INFO << buf;
232232
#endif
233233

@@ -306,7 +306,7 @@ UINT GetD3D9SCPresentOffset(HWND hWnd){
306306
uintptr_t presentFuncPtr = pvtbl[D3D9_SCPRESENT_FUNC_ORD];
307307
#ifndef NO_QT
308308
char buf[100];
309-
sprintf(buf, "presentFuncPtr=%x", presentFuncPtr);
309+
sprintf(buf, "presentFuncPtr=%llx", presentFuncPtr);
310310
DEBUG_MID_LEVEL << Q_FUNC_INFO << buf;
311311
#endif
312312

@@ -387,7 +387,7 @@ UINT GetD3D9ResetOffset(HWND hWnd){
387387
uintptr_t resetFuncPtr = pvtbl[D3D9_RESET_FUNC_ORD];
388388
#ifndef NO_QT
389389
char buf[100];
390-
sprintf(buf, "resetFuncPtr=%x", resetFuncPtr);
390+
sprintf(buf, "resetFuncPtr=%llx", resetFuncPtr);
391391
DEBUG_MID_LEVEL << Q_FUNC_INFO << buf;
392392
#endif
393393

Software/grab/D3D10Grabber.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333

3434
#include <QObject>
3535
#include <QThread>
36-
#include <QApplication>
37-
#include <QDesktopWidget>
36+
#include <QScreen>
37+
#include <QGuiApplication>
3838
#include <QMessageBox>
3939
#include <cstdlib>
4040
#include <stdio.h>
@@ -77,7 +77,7 @@ namespace {
7777

7878
const unsigned kBytesPerPixel = 4;
7979

80-
D3D10GrabberWorker::D3D10GrabberWorker(QObject *parent, LPSECURITY_ATTRIBUTES lpsa) :
80+
D3D10GrabberWorker::D3D10GrabberWorker(QObject *parent, LPSECURITY_ATTRIBUTES lpsa) :
8181
QObject(parent),
8282
m_lpsa(lpsa)
8383
{
@@ -171,7 +171,7 @@ namespace {
171171
if (m_libraryInjector) {
172172
m_libraryInjector->Release();
173173
CoUninitialize();
174-
}
174+
}
175175
}
176176

177177
void D3D10GrabberInjector::infectCleanDxProcesses() {
@@ -366,19 +366,20 @@ class D3D10GrabberImpl: public QObject
366366
}
367367
m_worker->moveToThread(m_workerThread.data());
368368
m_workerThread->start();
369-
connect(m_worker.data(), SIGNAL(frameGrabbed()), this, SIGNAL(frameGrabbed()), Qt::QueuedConnection);
369+
connect(m_worker.data(), &D3D10GrabberWorker::frameGrabbed, this, &D3D10GrabberImpl::frameGrabbed, Qt::QueuedConnection);
370370
QMetaObject::invokeMethod(m_worker.data(), "runLoop", Qt::QueuedConnection);
371371

372+
using namespace std::chrono_literals;
372373
m_processesScanAndInfectTimer.reset(new QTimer(this));
373-
m_processesScanAndInfectTimer->setInterval(5000);
374+
m_processesScanAndInfectTimer->setInterval(5s);
374375
m_processesScanAndInfectTimer->setSingleShot(false);
375-
connect(m_processesScanAndInfectTimer.data(), SIGNAL(timeout()), m_injector.data(), SLOT(infectCleanDxProcesses()));
376+
connect(m_processesScanAndInfectTimer.data(), &QTimer::timeout, m_injector.data(), &D3D10GrabberInjector::infectCleanDxProcesses);
376377
m_processesScanAndInfectTimer->start();
377378

378-
m_checkIfFrameGrabbedTimer.reset(new QTimer());
379+
m_checkIfFrameGrabbedTimer.reset(new QTimer(this));
379380
m_checkIfFrameGrabbedTimer->setSingleShot(false);
380-
m_checkIfFrameGrabbedTimer->setInterval(1000);
381-
connect(m_checkIfFrameGrabbedTimer.data(), SIGNAL(timeout()), SLOT(handleIfFrameGrabbed()));
381+
m_checkIfFrameGrabbedTimer->setInterval(1s);
382+
connect(m_checkIfFrameGrabbedTimer.data(), &QTimer::timeout, this, &D3D10GrabberImpl::handleIfFrameGrabbed);
382383
m_checkIfFrameGrabbedTimer->start();
383384
m_isInited = true;
384385
return m_isInited;
@@ -610,7 +611,7 @@ private slots:
610611
m_injectorThread->wait();
611612

612613

613-
disconnect(this, SLOT(handleIfFrameGrabbed()));
614+
disconnect(this, &D3D10GrabberImpl::handleIfFrameGrabbed, nullptr, nullptr);
614615
freeIPC();
615616
CoUninitialize();
616617
m_isInited = false;
@@ -648,18 +649,18 @@ D3D10Grabber::D3D10Grabber(QObject *parent, GrabberContext *context, GetHwndCall
648649

649650
void D3D10Grabber::init() {
650651
m_impl->init();
651-
connect(m_impl.data(), SIGNAL(frameGrabbed()), this, SLOT(grab()));
652+
connect(m_impl.data(), &D3D10GrabberImpl::frameGrabbed, this, &D3D10Grabber::grab);
652653
_screensWithWidgets.clear();
653654
GrabbedScreen grabbedScreen;
654-
grabbedScreen.screenInfo.handle = reinterpret_cast<void *>(QApplication::desktop()->primaryScreen());
655-
grabbedScreen.screenInfo.rect = QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen());
655+
grabbedScreen.screenInfo.handle = QGuiApplication::primaryScreen();// unused?
656+
grabbedScreen.screenInfo.rect = QGuiApplication::primaryScreen()->geometry();
656657
_screensWithWidgets.append(grabbedScreen);
657658

658659
if (!WinUtils::IsUserAdmin()) {
659660
qWarning() << Q_FUNC_INFO << "DX hooking is enabled but application not running elevated";
660661
// Do not show the message box during initialization (creating a unwanted message loop)
661662
// Show as soon as the message loop is established
662-
QTimer::singleShot(0, this, SLOT(showAdminMessage()));
663+
QTimer::singleShot(0, this, &D3D10Grabber::showAdminMessage);
663664
}
664665
}
665666

Software/grab/DDuplGrabber.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ GrabResult DDuplGrabber::grabScreens()
618618
// in theory, DXGI_ERROR_INVALID_CALL is returned if the frame was not released
619619
// it also happens in conjunction with secure desktop (even though the frame was properly released)
620620
m_state = LostAccess;
621-
DEBUG_LOW_LEVEL << Q_FUNC_INFO << "Lost Access to desktop" << screen.screenInfo.handle << ":" << (void*)(0xffffffff & hr) << ", requesting realloc";
621+
DEBUG_LOW_LEVEL << Q_FUNC_INFO << "Lost Access to desktop" << screen.screenInfo.handle << ":" << IntToPtr(0xffffffff & hr) << ", requesting realloc";
622622
return GrabResultFrameNotReady;
623623
}
624624
else if (FAILED(hr))

Software/grab/GrabberBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ GrabberBase::GrabberBase(QObject *parent, GrabberContext *grabberContext) : QObj
6060
m_timer->stop();
6161
m_timer.reset(new QTimer(this));
6262
m_timer->setTimerType(Qt::PreciseTimer);
63-
connect(m_timer.data(), SIGNAL(timeout()), this, SLOT(grab()));
63+
connect(m_timer.data(), &QTimer::timeout, this, &GrabberBase::grab);
6464
}
6565

6666
void GrabberBase::setGrabInterval(int msec)

Software/grab/grab.pro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ QT += widgets
99
DESTDIR = ../lib
1010
TARGET = grab
1111
TEMPLATE = lib
12-
CONFIG += staticlib
12+
CONFIG += staticlib c++17
1313

1414
include(../build-config.prf)
1515

@@ -27,7 +27,6 @@ QMAKE_CFLAGS = $$(CFLAGS)
2727
QMAKE_CXXFLAGS = $$(CXXFLAGS)
2828
QMAKE_LFLAGS = $$(LDFLAGS)
2929

30-
QMAKE_CXXFLAGS += -std=c++17
3130
CONFIG(clang) {
3231
QMAKE_CXXFLAGS += -stdlib=libc++
3332
LIBS += -stdlib=libc++
@@ -44,7 +43,7 @@ unix:!macx {
4443

4544
# Mac platform
4645
macx {
47-
contains(DEFINES, MAC_OS_CG_GRAB_SUPPORT) || contains(DEFINES, MAC_OS_AV_GRAB_SUPPORT) {
46+
contains(DEFINES, MAC_OS_CG_GRAB_SUPPORT) | contains(DEFINES, MAC_OS_AV_GRAB_SUPPORT) {
4847
GRABBERS_HEADERS += include/MacOSGrabberBase.hpp
4948
GRABBERS_SOURCES += MacOSGrabberBase.mm
5049
}

Software/grab/include/BlueLightReduction.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
#pragma once
22
#include <QList>
33
#include <QRgb>
4-
#include <cassert>
54

65
namespace BlueLightReduction
76
{
87
class Client
98
{
9+
Q_DISABLE_COPY(Client)
1010
public:
11-
static bool isSupported() { assert(("BlueLightReduction::isSupported() is not implemented", false)); return false; }
11+
static bool isSupported() { Q_ASSERT_X(false, "BlueLightReduction::isSupported()", "not implemented"); return false; }
1212
virtual void apply(QList<QRgb>& colors, const double gamma = 1.2) = 0;
1313
virtual ~Client() = default;
14+
Client() = default;
1415
};
1516

1617
Client* create();

Software/grab/include/GrabberBase.hpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,21 @@ class GrabberBase : public QObject
9191

9292
virtual const char * name() const = 0;
9393

94-
public slots:
9594
virtual void startGrabbing();
9695
virtual void stopGrabbing();
9796
virtual bool isGrabbingStarted() const;
98-
virtual void setGrabInterval(int msec);
97+
public slots:
9998

99+
virtual void setGrabInterval(int msec);
100100
virtual void grab();
101101

102-
protected slots:
102+
protected:
103103
/*!
104104
Grabs screens and saves them to \a GrabberBase#_screensWithWidgets field. Called by
105105
\a GrabberBase#grab() slot. Needs to be implemented in derived classes.
106106
\return GrabResult
107107
*/
108108
virtual GrabResult grabScreens() = 0;
109-
110109
/*!
111110
* Frees unnecessary resources and allocates needed ones based on \a ScreenInfo
112111
* \param grabScreens
@@ -121,10 +120,7 @@ protected slots:
121120
* \return
122121
*/
123122
virtual QList< ScreenInfo > * screensWithWidgets(QList< ScreenInfo > * result, const QList<GrabWidget *> &grabWidgets) = 0;
124-
125123
virtual bool isReallocationNeeded(const QList< ScreenInfo > &grabScreens) const;
126-
127-
protected:
128124
const GrabbedScreen * screenOfRect(const QRect &rect) const;
129125

130126
signals:

Software/grab/include/GrabberContext.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class GrabberContext {
7979
}
8080

8181
void releaseAllBufs() {
82-
for (QList<AllocatedBuf*>::const_iterator iter = _allocatedBufs.cbegin(); iter != _allocatedBufs.end(); ++iter) {
82+
for (QList<AllocatedBuf*>::const_iterator iter = _allocatedBufs.cbegin(); iter != _allocatedBufs.cend(); ++iter) {
8383
(*iter)->isAvail = true;
8484
}
8585
}

0 commit comments

Comments
 (0)