Definition at line 381 of file recorder_writer.cpp.
◆ Private()
Definition at line 384 of file recorder_writer.cpp.
387 {}
ThreadCounter & recorderThreads
RecorderWriterManager *const q
◆ clearWriterPool()
| bool RecorderWriterManager::Private::clearWriterPool |
( |
| ) |
|
|
inline |
Definition at line 432 of file recorder_writer.cpp.
433 {
434 bool result = true;
435 bool alreadyWarn = false;
436 bool alreadyErr = false;
438 {
439 el.thread->quit();
441 disconnect(
q, SIGNAL(
startCapturing(
int)), el.writer.get(), SLOT(onCaptureImage(
int)));
442 disconnect(el.writer.get(), SIGNAL(capturingDone(
int,
int)),
q, SLOT(
onCapturingDone(
int,
int)));
443 if (el.thread->isRunning())
444 {
445 if (!alreadyWarn) {
446 warnResources <<
"One of the Recorder WriterPool threads has been blocked and has to be terminated. "
447 << "Thread Name: " << el.thread->objectName();
448 alreadyWarn = true;
449 }
450 el.thread->terminate();
452 {
453 if (!alreadyErr) {
454 errResources <<
"Something odd has been happen. Krita was unable to stop one of the Recorder WriterPool Threads. "
455 << "Thread Name: " << el.thread->objectName();
456 alreadyErr = true;
457 }
458 result = false;
459 }
460 }
461 }
462
465
466 if (!result)
468
469 return result;
470 }
std::atomic_int freeWriterId
void startCapturing(int writerId)
void recorderStopWarning()
void onCapturingDone(int workerId, int status)
constexpr int waitThreadTimeoutMs
References errResources, freeWriterId, RecorderWriterManager::onCapturingDone(), q, RecorderWriterManager::recorderStopWarning(), RecorderWriterManager::startCapturing(), RecorderConst::waitThreadTimeoutMs, warnResources, and writerPool.
◆ enlargeWriterPool()
| void RecorderWriterManager::Private::enlargeWriterPool |
( |
| ) |
|
|
inline |
Definition at line 472 of file recorder_writer.cpp.
473 {
478
479
481
482 auto writerPtr =
writerPool[newWorkerId].writer;
483 auto threadPtr =
writerPool[newWorkerId].thread;
484 threadPtr->setObjectName(QString("Krita-Recorder-WriterPool#%1").arg(newWorkerId));
485 connect(
q, SIGNAL(
startCapturing(
int)), writerPtr.get(), SLOT(onCaptureImage(
int)));
486 connect(writerPtr.get(), SIGNAL(capturingDone(
int,
int)),
q, SLOT(
onCapturingDone(
int,
int)));
487 writerPtr->moveToThread(threadPtr.get());
488 threadPtr->start(QThread::IdlePriority);
489 }
490 }
QPointer< KisCanvas2 > canvas
RecorderWriterSettings settings
References canvas, freeWriterId, ThreadCounter::get(), RecorderWriterManager::onCapturingDone(), outputDir, q, recorderThreads, settings, RecorderWriterManager::startCapturing(), and writerPool.
◆ findLastIndex()
| int RecorderWriterManager::Private::findLastIndex |
( |
const QString & | directory | ) |
|
|
inline |
Definition at line 406 of file recorder_writer.cpp.
407 {
408 QElapsedTimer dbgTimer;
409 dbgTimer.start();
410
411 QDirIterator dirIterator(directory);
414
415 int recordIndex = -1;
416 while (dirIterator.hasNext()) {
417 dirIterator.next();
418
419 const QString &fileName = dirIterator.fileName();
420 const QRegularExpressionMatch &match = snapshotFilePattern.match(fileName);
421 if (match.hasMatch()) {
422 int index = match.captured(1).toInt();
423 if (recordIndex < index)
424 recordIndex = index;
425 }
426 }
427 dbgTools <<
"findLastPartNumber for" << directory <<
": " << dbgTimer.elapsed() <<
"ms";
428
429 return recordIndex;
430 }
QRegularExpression snapshotFilePatternFor(const QString &extension)
References dbgTools, RecorderFormatInfo::fileExtension(), RecorderWriterSettings::format, settings, and RecorderConst::snapshotFilePatternFor().
◆ searchForFreeWriter()
| void RecorderWriterManager::Private::searchForFreeWriter |
( |
| ) |
|
|
inline |
◆ canvas
◆ captureMutex
| QMutex RecorderWriterManager::Private::captureMutex |
◆ enabled
| volatile std::atomic_bool RecorderWriterManager::Private::enabled = false |
◆ freeWriterId
| std::atomic_int RecorderWriterManager::Private::freeWriterId = -1 |
◆ imageModified
| volatile std::atomic_bool RecorderWriterManager::Private::imageModified = false |
◆ interval
| int RecorderWriterManager::Private::interval = 1 |
◆ isActivateBlackTool
| volatile std::atomic_bool RecorderWriterManager::Private::isActivateBlackTool = false |
◆ isForceBlackTool
| volatile std::atomic_bool RecorderWriterManager::Private::isForceBlackTool = false |
◆ outputDir
| QDir RecorderWriterManager::Private::outputDir |
◆ partIndex
| int RecorderWriterManager::Private::partIndex = 0 |
◆ recorderThreads
◆ settings
◆ timer
| QTimer RecorderWriterManager::Private::timer |
◆ toolActivated
| volatile std::atomic_bool RecorderWriterManager::Private::toolActivated = false |
◆ writerPool
| WriterPool RecorderWriterManager::Private::writerPool |
The documentation for this class was generated from the following file: