| 46 | #endif |
| 47 | |
| 48 | GrabManager::GrabManager(QWidget *parent) : QObject(parent) |
| 49 | { |
| 50 | DEBUG_LOW_LEVEL << Q_FUNC_INFO; |
| 51 | |
| 52 | qRegisterMetaType<GrabResult>("GrabResult"); |
| 53 | |
| 54 | m_parentWidget = parent; |
| 55 | |
| 56 | m_timerGrab = new QTimer(this); |
| 57 | m_timeEval = new TimeEvaluations(); |
| 58 | |
| 59 | m_fpsMs = 0; |
| 60 | |
| 61 | m_grabberContext = new GrabberContext(); |
| 62 | |
| 63 | m_isSendDataOnlyIfColorsChanged = Settings::isSendDataOnlyIfColorsChanges(); |
| 64 | |
| 65 | // m_grabbersThread = new QThread(); |
| 66 | initGrabbers(); |
| 67 | m_grabber = queryGrabber(Settings::getGrabberType()); |
| 68 | |
| 69 | m_timerUpdateFPS = new QTimer(this); |
| 70 | connect(m_timerUpdateFPS, SIGNAL(timeout()), this, SLOT(timeoutUpdateFPS())); |
| 71 | m_timerUpdateFPS->setSingleShot(false); |
| 72 | m_timerUpdateFPS->start(500); |
| 73 | |
| 74 | m_isPauseGrabWhileResizeOrMoving = false; |
| 75 | m_isGrabWidgetsVisible = false; |
| 76 | |
| 77 | initColorLists(MaximumNumberOfLeds::Default); |
| 78 | initLedWidgets(MaximumNumberOfLeds::Default); |
| 79 | |
| 80 | // connect(m_timerGrab, SIGNAL(timeout()), this, SLOT(handleGrabbedColors())); |
| 81 | connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(scaleLedWidgets(int))); |
| 82 | connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(onScreenCountChanged(int))); |
| 83 | |
| 84 | updateScreenGeometry(); |
| 85 | |
| 86 | settingsProfileChanged(Settings::getCurrentProfileName()); |
| 87 | |
| 88 | |
| 89 | DEBUG_LOW_LEVEL << Q_FUNC_INFO << "initialized"; |
| 90 | } |
| 91 | |
| 92 | GrabManager::~GrabManager() |
| 93 | { |