void Filepath::GetCorrectPath(const tstring & path, tstring & correct_path, DirectoryMode mode) { switch(mode) { case DirectoryMode::assets: correct_path = Filepath(path).GetAssetsPath(); break; case DirectoryMode::internal: correct_path = Filepath(path).GetInternalPath(); break; case DirectoryMode::external: correct_path = Filepath(path).GetExternalPath(); break; default: correct_path = path; break; } }
//------------------------------------------------------------------------------------------- // //------------------------------------------------------------------------------------------- void tScreenShot::CaptureScreenShotInternal() { if ( !EnoughFreeSpace() ) { return; } QImage screenShot = halScreenShot(); QString filepath = Filepath(); screenShot.save( filepath ); QString notification( QString( "Screen captured: %1" ).arg( filepath ) ); //.section( '/', -1 ) ) ); qDebug() << notification; }
#include "Kommon/StringUtils.h" #include <chrono> #include <thread> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/highgui/highgui.hpp> class VideoFromFileNodeType : public NodeType { public: VideoFromFileNodeType() #ifdef QT_DEBUG : _videoPath("video-4.mkv") #else : _videoPath(Filepath("")) #endif , _startFrame(0U) , _endFrame(0U) , _frameInterval(0U) , _ignoreFps(false) , _forceGrayscale(false) { addOutput("Output", ENodeFlowDataType::Image); addProperty("Video path", _videoPath) .setUiHints("filter:Video files (*.mkv *.mp4 *.avi *.flv)"); addProperty("Start frame", _startFrame) .setValidator(make_validator<MinPropertyValidator<int>>(0)) .setUiHints("min:0"); addProperty("End frame", _endFrame) .setValidator(make_validator<MinPropertyValidator<int>>(0))