mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
bfb9a08c80
* std::string -> qstring part 1 * more string migration * more string migration ... * ... * more qstring mogrations add sysinfo via json * remove unneccessary includes * integrate sysinfo into webui
38 lines
771 B
C++
38 lines
771 B
C++
|
|
// Hyperion-AmLogic includes
|
|
#include "FramebufferWrapper.h"
|
|
|
|
FramebufferWrapper::FramebufferWrapper(const QString & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz) :
|
|
_timer(this),
|
|
_grabber(device,grabWidth, grabHeight)
|
|
{
|
|
_timer.setSingleShot(false);
|
|
_timer.setInterval(updateRate_Hz);
|
|
|
|
// Connect capturing to the timeout signal of the timer
|
|
connect(&_timer, SIGNAL(timeout()), this, SLOT(capture()));
|
|
}
|
|
|
|
const Image<ColorRgb> & FramebufferWrapper::getScreenshot()
|
|
{
|
|
capture();
|
|
return _screenshot;
|
|
}
|
|
|
|
void FramebufferWrapper::start()
|
|
{
|
|
_timer.start();
|
|
}
|
|
|
|
void FramebufferWrapper::stop()
|
|
{
|
|
_timer.stop();
|
|
}
|
|
|
|
void FramebufferWrapper::capture()
|
|
{
|
|
_grabber.grabFrame(_screenshot);
|
|
|
|
emit sig_screenshot(_screenshot);
|
|
}
|