mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
implement set videomode via json api (#457)
* implement set videomode via json api * refactor grabbers: - new base class - move shared code to base class * fix osx * rework all cmakelist files with auto file collection. except leddevices (need further restructuring) * store current video and grabbing mode * add json stuff * remove grabbingmode - we do not want to expose it
This commit is contained in:
@@ -3,46 +3,11 @@
|
||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/hyperion)
|
||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/hyperion)
|
||||
|
||||
SET(Hyperion_HEADERS
|
||||
${CURRENT_HEADER_DIR}/ImageProcessorFactory.h
|
||||
${CURRENT_HEADER_DIR}/ImageToLedsMap.h
|
||||
${CURRENT_HEADER_DIR}/LedString.h
|
||||
FILE ( GLOB Hyperion_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
||||
|
||||
${CURRENT_SOURCE_DIR}/MultiColorAdjustment.h
|
||||
${CURRENT_HEADER_DIR}/MessageForwarder.h
|
||||
|
||||
${CURRENT_HEADER_DIR}/Hyperion.h
|
||||
${CURRENT_HEADER_DIR}/ImageProcessor.h
|
||||
|
||||
${CURRENT_SOURCE_DIR}/LinearColorSmoothing.h
|
||||
${CURRENT_HEADER_DIR}/GrabberWrapper.h
|
||||
${CURRENT_HEADER_DIR}/ComponentRegister.h
|
||||
${CURRENT_HEADER_DIR}/PriorityMuxer.h
|
||||
)
|
||||
|
||||
SET(Hyperion_SOURCES
|
||||
${CURRENT_SOURCE_DIR}/Hyperion.cpp
|
||||
${CURRENT_SOURCE_DIR}/ImageProcessor.cpp
|
||||
${CURRENT_SOURCE_DIR}/ImageProcessorFactory.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedString.cpp
|
||||
${CURRENT_SOURCE_DIR}/PriorityMuxer.cpp
|
||||
|
||||
${CURRENT_SOURCE_DIR}/ImageToLedsMap.cpp
|
||||
${CURRENT_SOURCE_DIR}/MultiColorAdjustment.cpp
|
||||
${CURRENT_SOURCE_DIR}/LinearColorSmoothing.cpp
|
||||
${CURRENT_SOURCE_DIR}/MessageForwarder.cpp
|
||||
${CURRENT_SOURCE_DIR}/GrabberWrapper.cpp
|
||||
${CURRENT_SOURCE_DIR}/ComponentRegister.cpp
|
||||
)
|
||||
|
||||
SET(Hyperion_RESOURCES
|
||||
${CURRENT_SOURCE_DIR}/resource.qrc
|
||||
)
|
||||
|
||||
QT5_ADD_RESOURCES(Hyperion_RESOURCES_RCC ${Hyperion_RESOURCES} OPTIONS "-no-compress")
|
||||
QT5_ADD_RESOURCES(Hyperion_RESOURCES_RCC ${CURRENT_SOURCE_DIR}/resource.qrc OPTIONS "-no-compress")
|
||||
|
||||
add_library(hyperion
|
||||
${Hyperion_HEADERS}
|
||||
${Hyperion_SOURCES}
|
||||
${Hyperion_RESOURCES_RCC}
|
||||
)
|
||||
|
27
libsrc/hyperion/Grabber.cpp
Normal file
27
libsrc/hyperion/Grabber.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <hyperion/Grabber.h>
|
||||
|
||||
|
||||
Grabber::Grabber(QString grabberName, int width, int height, int cropLeft, int cropRight, int cropTop, int cropBottom)
|
||||
: _imageResampler()
|
||||
, _videoMode(VIDEO_2D)
|
||||
, _width(width)
|
||||
, _height(height)
|
||||
, _cropLeft(cropLeft)
|
||||
, _cropRight(cropRight)
|
||||
, _cropTop(cropTop)
|
||||
, _cropBottom(cropBottom)
|
||||
, _log(Logger::getInstance(grabberName))
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
Grabber::~Grabber()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Grabber::setVideoMode(VideoMode mode)
|
||||
{
|
||||
_videoMode = mode;
|
||||
_imageResampler.set3D(_videoMode);
|
||||
}
|
@@ -22,6 +22,9 @@ GrabberWrapper::GrabberWrapper(QString grabberName, const int priority, hyperion
|
||||
|
||||
connect(_hyperion, SIGNAL(imageToLedsMappingChanged(int)), _processor, SLOT(setLedMappingType(int)));
|
||||
connect(_hyperion, SIGNAL(componentStateChanged(hyperion::Components,bool)), this, SLOT(componentStateChanged(hyperion::Components,bool)));
|
||||
connect(_hyperion, SIGNAL(grabbingMode(GrabbingMode)), this, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
connect(_hyperion, SIGNAL(videoMode(VideoMode)), this, SLOT(setVideoMode(VideoMode)));
|
||||
connect(this, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _hyperion, SLOT(setImage(int, const Image<ColorRgb>&, const int)) );
|
||||
connect(&_timer, SIGNAL(timeout()), this, SLOT(action()));
|
||||
}
|
||||
|
||||
|
@@ -400,6 +400,8 @@ Hyperion::Hyperion(const QJsonObject &qjsonConfig, const QString configFile)
|
||||
, _prevCompId(hyperion::COMP_INVALID)
|
||||
, _bonjourBrowser(this)
|
||||
, _bonjourResolver(this)
|
||||
, _videoMode(VIDEO_2D)
|
||||
, _grabbingMode(GRABBINGMODE_INVALID)
|
||||
{
|
||||
|
||||
if (!_raw2ledAdjustment->verifyAdjustments())
|
||||
@@ -802,6 +804,19 @@ void Hyperion::setLedMappingType(int mappingType)
|
||||
emit imageToLedsMappingChanged(mappingType);
|
||||
}
|
||||
|
||||
void Hyperion::setVideoMode(VideoMode mode)
|
||||
{
|
||||
_videoMode = mode;
|
||||
emit videoMode(mode);
|
||||
}
|
||||
|
||||
void Hyperion::setGrabbingMode(GrabbingMode mode)
|
||||
{
|
||||
_grabbingMode = mode;
|
||||
emit grabbingMode(mode);
|
||||
}
|
||||
|
||||
|
||||
void Hyperion::hyperionStateChanged()
|
||||
{
|
||||
if(_fsi_blockTimer.isActive())
|
||||
|
Reference in New Issue
Block a user