Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e60407a
clazy: qstringliterals, casts, signals/slots, pass by ref
zomfg Nov 20, 2020
fc1adb1
clazy: signals/slots, devices, assert fixes
zomfg Nov 21, 2020
8e0cd7c
drgb/virtual devices: const& loop
zomfg Nov 21, 2020
8ab6a7a
clazy: msvc
zomfg Nov 21, 2020
fe825d5
clazy: minor qmake fixes
zomfg Nov 22, 2020
343961a
clazy: msvc casts
zomfg Nov 22, 2020
3c264a4
clazy: mixed const iters
zomfg Nov 23, 2020
b058416
clazy: some reserve()
zomfg Nov 23, 2020
79bab0b
clazy: signals/slots
zomfg Nov 23, 2020
5055d07
clazy: c++17
zomfg Nov 23, 2020
b464611
clazy: new connects
zomfg Nov 23, 2020
515f8eb
clazy: d3d10grabber: new connects
zomfg Nov 23, 2020
8a820c5
clazy: windows sound manager: new connect
zomfg Nov 23, 2020
3b2511d
qmake c++17
zomfg Nov 23, 2020
6c25f8a
clazy: qtsingleapplication new connects
zomfg Nov 24, 2020
bd0724f
clazy: const-char-pointer
zomfg Nov 24, 2020
99319ed
clazy: chrono-literals
zomfg Nov 24, 2020
0e052bd
clazy: more chrono literals
zomfg Nov 24, 2020
35077ba
clazy: settings window: new connects
zomfg Nov 24, 2020
f1f89ca
settings window: less strict system locale
zomfg Nov 24, 2020
d17bf00
clazy: lightpack application / grab manager: new connects
zomfg Nov 24, 2020
b34645b
qdesktopwidget includes
zomfg Nov 24, 2020
e5e29eb
clazy: new connects
zomfg Nov 24, 2020
0a6d3f9
qdesktopwidget include
zomfg Nov 24, 2020
273bf0e
clazy: device: bad emits
zomfg Nov 25, 2020
f13864f
clazy: Q_DISABLE_COPY
zomfg Nov 25, 2020
5c6ad8c
qt includes
zomfg Nov 25, 2020
82a22a9
blue light default ctor
zomfg Nov 25, 2020
d4fe3d3
remaining QDesktopWidgets
zomfg Nov 25, 2020
2095a6c
unused qtmetaobject
zomfg Nov 25, 2020
2d13fdf
clazy: qstrings
zomfg Nov 25, 2020
3daa730
liquid color gen size cast
zomfg Nov 25, 2020
e64c8dc
qt6: include Plugin (does not like fw declaration)
zomfg Nov 25, 2020
920662c
qt6: nativeEventFilter signature
zomfg Nov 25, 2020
62a8ab4
qt6: regexp class
zomfg Nov 25, 2020
43dd05c
qt6: qchecksum
zomfg Nov 25, 2020
a2a6517
qt6: text codec
zomfg Nov 25, 2020
f04668a
clazy: short qstringliterals with args
zomfg Nov 26, 2020
a56bd84
warls / dnrgb: save and use processed colors for diffs
zomfg Nov 29, 2020
cb5a594
clazy: config device power page: qstringliterals
zomfg Nov 29, 2020
e83a308
clazy: comments
zomfg Dec 4, 2020
a3d3f4f
qmake: check for pkg-config
zomfg Dec 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Software/build-config.prf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exists(build-vars.prf) {
#------------------------------------------------------------------------------
# Parsing configuration
#------------------------------------------------------------------------------
win32: {
win32 {
# Target architecture
QMAKE_TARGET.arch = $$TARGET_ARCH
_TARGET_ARCH = $$(TARGET_ARCH)
Expand Down
6 changes: 3 additions & 3 deletions Software/build-vars.prf.default
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#------------------------------------------------------------------------------
# General
#------------------------------------------------------------------------------
win32: {
win32 {
# Set this to -Win32 for 32-bit
OPENSSL_DIR = "C:\\OpenSSL-Win64\\bin"
# Set this to run without openssl. The updatecheck won't work.
Expand Down Expand Up @@ -47,8 +47,8 @@ macx {
# DEFINES += SAVE_FRAME_TO_FILE

# CONFIG += debug
# QMAKE_CC += clang
# QMAKE_CXX += clang++
# QMAKE_CC = clang
# QMAKE_CXX = clang++
# QMAKE_CFLAGS_DEBUG += -ggdb
# QMAKE_CFLAGS_RELEASE += -march=native
# QMAKE_CXXFLAGS_DEBUG += -ggdb
Expand Down
8 changes: 4 additions & 4 deletions Software/common/WinDXUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ UINT GetDxgiPresentOffset(HWND hwnd) {

#ifndef NO_QT
char buf[100];
sprintf(buf, "presentFuncPtr=%x", presentFuncPtr);
sprintf(buf, "presentFuncPtr=%llx", presentFuncPtr);
DEBUG_MID_LEVEL << Q_FUNC_INFO << buf;
#endif

Expand Down Expand Up @@ -227,7 +227,7 @@ UINT GetD3D9PresentOffset(HWND hWnd){
uintptr_t presentFuncPtr = pvtbl[D3D9_PRESENT_FUNC_ORD];
#ifndef NO_QT
char buf[100];
sprintf(buf, "presentFuncPtr=%x", presentFuncPtr);
sprintf(buf, "presentFuncPtr=%llx", presentFuncPtr);
DEBUG_MID_LEVEL << Q_FUNC_INFO << buf;
#endif

Expand Down Expand Up @@ -306,7 +306,7 @@ UINT GetD3D9SCPresentOffset(HWND hWnd){
uintptr_t presentFuncPtr = pvtbl[D3D9_SCPRESENT_FUNC_ORD];
#ifndef NO_QT
char buf[100];
sprintf(buf, "presentFuncPtr=%x", presentFuncPtr);
sprintf(buf, "presentFuncPtr=%llx", presentFuncPtr);
DEBUG_MID_LEVEL << Q_FUNC_INFO << buf;
#endif

Expand Down Expand Up @@ -387,7 +387,7 @@ UINT GetD3D9ResetOffset(HWND hWnd){
uintptr_t resetFuncPtr = pvtbl[D3D9_RESET_FUNC_ORD];
#ifndef NO_QT
char buf[100];
sprintf(buf, "resetFuncPtr=%x", resetFuncPtr);
sprintf(buf, "resetFuncPtr=%llx", resetFuncPtr);
DEBUG_MID_LEVEL << Q_FUNC_INFO << buf;
#endif

Expand Down
31 changes: 16 additions & 15 deletions Software/grab/D3D10Grabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

#include <QObject>
#include <QThread>
#include <QApplication>
#include <QDesktopWidget>
#include <QScreen>
#include <QGuiApplication>
#include <QMessageBox>
#include <cstdlib>
#include <stdio.h>
Expand Down Expand Up @@ -77,7 +77,7 @@ namespace {

const unsigned kBytesPerPixel = 4;

D3D10GrabberWorker::D3D10GrabberWorker(QObject *parent, LPSECURITY_ATTRIBUTES lpsa) :
D3D10GrabberWorker::D3D10GrabberWorker(QObject *parent, LPSECURITY_ATTRIBUTES lpsa) :
QObject(parent),
m_lpsa(lpsa)
{
Expand Down Expand Up @@ -171,7 +171,7 @@ namespace {
if (m_libraryInjector) {
m_libraryInjector->Release();
CoUninitialize();
}
}
}

void D3D10GrabberInjector::infectCleanDxProcesses() {
Expand Down Expand Up @@ -366,19 +366,20 @@ class D3D10GrabberImpl: public QObject
}
m_worker->moveToThread(m_workerThread.data());
m_workerThread->start();
connect(m_worker.data(), SIGNAL(frameGrabbed()), this, SIGNAL(frameGrabbed()), Qt::QueuedConnection);
connect(m_worker.data(), &D3D10GrabberWorker::frameGrabbed, this, &D3D10GrabberImpl::frameGrabbed, Qt::QueuedConnection);
QMetaObject::invokeMethod(m_worker.data(), "runLoop", Qt::QueuedConnection);

using namespace std::chrono_literals;
m_processesScanAndInfectTimer.reset(new QTimer(this));
m_processesScanAndInfectTimer->setInterval(5000);
m_processesScanAndInfectTimer->setInterval(5s);
m_processesScanAndInfectTimer->setSingleShot(false);
connect(m_processesScanAndInfectTimer.data(), SIGNAL(timeout()), m_injector.data(), SLOT(infectCleanDxProcesses()));
connect(m_processesScanAndInfectTimer.data(), &QTimer::timeout, m_injector.data(), &D3D10GrabberInjector::infectCleanDxProcesses);
m_processesScanAndInfectTimer->start();

m_checkIfFrameGrabbedTimer.reset(new QTimer());
m_checkIfFrameGrabbedTimer.reset(new QTimer(this));
m_checkIfFrameGrabbedTimer->setSingleShot(false);
m_checkIfFrameGrabbedTimer->setInterval(1000);
connect(m_checkIfFrameGrabbedTimer.data(), SIGNAL(timeout()), SLOT(handleIfFrameGrabbed()));
m_checkIfFrameGrabbedTimer->setInterval(1s);
connect(m_checkIfFrameGrabbedTimer.data(), &QTimer::timeout, this, &D3D10GrabberImpl::handleIfFrameGrabbed);
m_checkIfFrameGrabbedTimer->start();
m_isInited = true;
return m_isInited;
Expand Down Expand Up @@ -610,7 +611,7 @@ private slots:
m_injectorThread->wait();


disconnect(this, SLOT(handleIfFrameGrabbed()));
disconnect(this, &D3D10GrabberImpl::handleIfFrameGrabbed, nullptr, nullptr);
freeIPC();
CoUninitialize();
m_isInited = false;
Expand Down Expand Up @@ -648,18 +649,18 @@ D3D10Grabber::D3D10Grabber(QObject *parent, GrabberContext *context, GetHwndCall

void D3D10Grabber::init() {
m_impl->init();
connect(m_impl.data(), SIGNAL(frameGrabbed()), this, SLOT(grab()));
connect(m_impl.data(), &D3D10GrabberImpl::frameGrabbed, this, &D3D10Grabber::grab);
_screensWithWidgets.clear();
GrabbedScreen grabbedScreen;
grabbedScreen.screenInfo.handle = reinterpret_cast<void *>(QApplication::desktop()->primaryScreen());
grabbedScreen.screenInfo.rect = QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen());
grabbedScreen.screenInfo.handle = QGuiApplication::primaryScreen();// unused?
grabbedScreen.screenInfo.rect = QGuiApplication::primaryScreen()->geometry();
_screensWithWidgets.append(grabbedScreen);

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

Expand Down
2 changes: 1 addition & 1 deletion Software/grab/DDuplGrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ GrabResult DDuplGrabber::grabScreens()
// in theory, DXGI_ERROR_INVALID_CALL is returned if the frame was not released
// it also happens in conjunction with secure desktop (even though the frame was properly released)
m_state = LostAccess;
DEBUG_LOW_LEVEL << Q_FUNC_INFO << "Lost Access to desktop" << screen.screenInfo.handle << ":" << (void*)(0xffffffff & hr) << ", requesting realloc";
DEBUG_LOW_LEVEL << Q_FUNC_INFO << "Lost Access to desktop" << screen.screenInfo.handle << ":" << IntToPtr(0xffffffff & hr) << ", requesting realloc";
return GrabResultFrameNotReady;
}
else if (FAILED(hr))
Expand Down
2 changes: 1 addition & 1 deletion Software/grab/GrabberBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ GrabberBase::GrabberBase(QObject *parent, GrabberContext *grabberContext) : QObj
m_timer->stop();
m_timer.reset(new QTimer(this));
m_timer->setTimerType(Qt::PreciseTimer);
connect(m_timer.data(), SIGNAL(timeout()), this, SLOT(grab()));
connect(m_timer.data(), &QTimer::timeout, this, &GrabberBase::grab);
}

void GrabberBase::setGrabInterval(int msec)
Expand Down
5 changes: 2 additions & 3 deletions Software/grab/grab.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ QT += widgets
DESTDIR = ../lib
TARGET = grab
TEMPLATE = lib
CONFIG += staticlib
CONFIG += staticlib c++17

include(../build-config.prf)

Expand All @@ -27,7 +27,6 @@ QMAKE_CFLAGS = $$(CFLAGS)
QMAKE_CXXFLAGS = $$(CXXFLAGS)
QMAKE_LFLAGS = $$(LDFLAGS)

QMAKE_CXXFLAGS += -std=c++17
CONFIG(clang) {
QMAKE_CXXFLAGS += -stdlib=libc++
LIBS += -stdlib=libc++
Expand All @@ -44,7 +43,7 @@ unix:!macx {

# Mac platform
macx {
contains(DEFINES, MAC_OS_CG_GRAB_SUPPORT) || contains(DEFINES, MAC_OS_AV_GRAB_SUPPORT) {
contains(DEFINES, MAC_OS_CG_GRAB_SUPPORT) | contains(DEFINES, MAC_OS_AV_GRAB_SUPPORT) {
GRABBERS_HEADERS += include/MacOSGrabberBase.hpp
GRABBERS_SOURCES += MacOSGrabberBase.mm
}
Expand Down
5 changes: 3 additions & 2 deletions Software/grab/include/BlueLightReduction.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#pragma once
#include <QList>
#include <QRgb>
#include <cassert>

namespace BlueLightReduction
{
class Client
{
Q_DISABLE_COPY(Client)
public:
static bool isSupported() { assert(("BlueLightReduction::isSupported() is not implemented", false)); return false; }
static bool isSupported() { Q_ASSERT_X(false, "BlueLightReduction::isSupported()", "not implemented"); return false; }
virtual void apply(QList<QRgb>& colors, const double gamma = 1.2) = 0;
virtual ~Client() = default;
Client() = default;
};

Client* create();
Expand Down
10 changes: 3 additions & 7 deletions Software/grab/include/GrabberBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,21 @@ class GrabberBase : public QObject

virtual const char * name() const = 0;

public slots:
virtual void startGrabbing();
virtual void stopGrabbing();
virtual bool isGrabbingStarted() const;
virtual void setGrabInterval(int msec);
public slots:

virtual void setGrabInterval(int msec);
virtual void grab();

protected slots:
protected:
/*!
Grabs screens and saves them to \a GrabberBase#_screensWithWidgets field. Called by
\a GrabberBase#grab() slot. Needs to be implemented in derived classes.
\return GrabResult
*/
virtual GrabResult grabScreens() = 0;

/*!
* Frees unnecessary resources and allocates needed ones based on \a ScreenInfo
* \param grabScreens
Expand All @@ -121,10 +120,7 @@ protected slots:
* \return
*/
virtual QList< ScreenInfo > * screensWithWidgets(QList< ScreenInfo > * result, const QList<GrabWidget *> &grabWidgets) = 0;

virtual bool isReallocationNeeded(const QList< ScreenInfo > &grabScreens) const;

protected:
const GrabbedScreen * screenOfRect(const QRect &rect) const;

signals:
Expand Down
2 changes: 1 addition & 1 deletion Software/grab/include/GrabberContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class GrabberContext {
}

void releaseAllBufs() {
for (QList<AllocatedBuf*>::const_iterator iter = _allocatedBufs.cbegin(); iter != _allocatedBufs.end(); ++iter) {
for (QList<AllocatedBuf*>::const_iterator iter = _allocatedBufs.cbegin(); iter != _allocatedBufs.cend(); ++iter) {
(*iter)->isAvail = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Software/hooks/hooks.pro
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ LIBS += -ldxguid
QMAKE_LFLAGS_EXCEPTIONS_ON -= -mthreads
QMAKE_CXXFLAGS_EXCEPTIONS_ON -= -mthreads

CONFIG += c++17
CONFIG -= rtti

DEFINES += HOOKSDLL_EXPORTS UNICODE
Expand All @@ -43,7 +44,6 @@ CONFIG(msvc) {
# Place *.lib and *.exp files in ../lib
QMAKE_LFLAGS += /INCREMENTAL:NO /IMPLIB:..\\lib\\$(TargetName).lib
} else {
QMAKE_CXXFLAGS += -std=c++11
QMAKE_LFLAGS += -static
}

Expand Down
2 changes: 1 addition & 1 deletion Software/hooks/hooks32.pro
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ LIBS += -ldxguid
QMAKE_LFLAGS_EXCEPTIONS_ON -= -mthreads
QMAKE_CXXFLAGS_EXCEPTIONS_ON -= -mthreads

CONFIG += c++17
CONFIG -= rtti

DEFINES += HOOKSDLL_EXPORTS UNICODE
Expand All @@ -49,7 +50,6 @@ CONFIG(msvc) {
# Place *.lib and *.exp files in ../lib
QMAKE_LFLAGS += /INCREMENTAL:NO /IMPLIB:..\\lib\\$(TargetName).lib
} else {
QMAKE_CXXFLAGS += -std=c++11
QMAKE_LFLAGS += -static
}

Expand Down
2 changes: 1 addition & 1 deletion Software/math/math.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
DESTDIR = ../lib
TARGET = prismatik-math
TEMPLATE = lib
CONFIG += staticlib
CONFIG += staticlib c++17

include(../build-config.prf)

Expand Down
5 changes: 5 additions & 0 deletions Software/src/AbstractLedDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
#include "PrismatikMath.hpp"
#include "Settings.hpp"

void AbstractLedDevice::setUsbPowerLedDisabled(bool isDisabled) {
Q_UNUSED(isDisabled);
emit commandCompleted(true);
}

void AbstractLedDevice::setGamma(double value, bool updateColors) {
m_gamma = value;
if (updateColors)
Expand Down
10 changes: 5 additions & 5 deletions Software/src/AbstractLedDevice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class AbstractLedDevice : public QObject
public:
AbstractLedDevice(QObject * parent) : QObject(parent) {}
virtual ~AbstractLedDevice(){}
virtual QString name() const = 0;
virtual int defaultLedsCount() = 0;
virtual int maxLedsCount() = 0;

signals:
void openDeviceSuccess(bool isSuccess);
Expand All @@ -56,7 +59,6 @@ class AbstractLedDevice : public QObject
void colorsUpdated(QList<QRgb> colors);

public slots:
virtual const QString name() const = 0;
virtual void open() = 0;
virtual void close() = 0;
virtual void setColors(const QList<QRgb> & colors) = 0;
Expand All @@ -75,16 +77,14 @@ public slots:
virtual void setDitheringEnabled(bool value, bool updateColors = true);
virtual void setLedMilliAmps(const int value, const bool updateColors = true);
virtual void setPowerSupplyAmps(const double value, const bool updateColors = true);
virtual void setColorSequence(QString value) = 0;
virtual void setColorSequence(const QString& value) = 0;
virtual void setLuminosityThreshold(int value, bool updateColors = true);
virtual void setMinimumLuminosityThresholdEnabled(bool value, bool updateColors = true);
virtual void updateWBAdjustments(); // Reads from settings
virtual void updateWBAdjustments(const QList<WBAdjustment> &coefs, bool updateColors = true);
virtual void requestFirmwareVersion() = 0;
virtual void updateDeviceSettings();

virtual int maxLedsCount() = 0;
virtual int defaultLedsCount() = 0;

/*!
\obsolete only form compatibility with Lightpack ver.<=5.5 hardware
Expand All @@ -93,7 +93,7 @@ public slots:
virtual void setColorDepth(int value) = 0;


virtual void setUsbPowerLedDisabled(bool isDisabled) { Q_UNUSED(isDisabled) emit commandCompleted(true); };
virtual void setUsbPowerLedDisabled(bool isDisabled);

protected:
virtual void applyColorModifications(const QList<QRgb> & inColors, QList<StructRgb> & outColors);
Expand Down
Loading