Ejemplo n.º 1
0
void PlaybackController::exportFrame(int count)
{
	Q_ASSERT(count>0);
	if(m_exporter) {
		QImage img = m_canvas->toImage();
		if(!img.isNull()) {
			Q_ASSERT(m_exporterReady);
			m_exporterReady = false;
			emit canSaveFrameChanged();
			m_exporter->saveFrame(img, count);
		}
	}
}
Ejemplo n.º 2
0
void PlaybackController::exportFrame(int count)
{
	if(count<1)
		count = 1;

	if(m_exporter) {
		QImage img = m_canvas->toImage();
		if(!img.isNull()) {
			Q_ASSERT(m_exporterReady);
			m_exporterReady = false;
			emit canSaveFrameChanged(canSaveFrame());
			m_exporter->saveFrame(img, count);
		}
	} else {
		qWarning("exportFrame(%d): exported not active!", count);
	}
}
Ejemplo n.º 3
0
void PlaybackController::exporterReady()
{
	m_exporterReady = true;
	emit exportedFrame();

	// Stop exporting after saving the last frame
	if(m_reader->isEof()) {
		m_exporter->finish();
	}
	// Tried to proceed to next frame while exporter was busy
	else if(m_waitedForExporter) {
		m_waitedForExporter = false;
		nextCommand();
	}

	emit canSaveFrameChanged();
}
Ejemplo n.º 4
0
void PlaybackController::startVideoExport(VideoExporter *exporter)
{
	Q_ASSERT(!m_exporter);
	Q_ASSERT(exporter);
	m_exporter = exporter;
	m_exporter->setParent(this);

	m_exporterReady = false;
	m_waitedForExporter = false;

	connect(m_exporter, &VideoExporter::exporterReady, this, &PlaybackController::exporterReady, Qt::QueuedConnection);
	connect(m_exporter, SIGNAL(exporterError(QString)), this, SLOT(exporterError(QString)), Qt::QueuedConnection);
	connect(m_exporter, SIGNAL(exporterFinished()), this, SLOT(exporterFinished()), Qt::QueuedConnection);

	m_exporter->start();
	emit exportStarted();
	emit canSaveFrameChanged(canSaveFrame());
}