} else {
QImage parade(paradeSize, QImage::Format_ARGB32);
- parade.fill(qRgba(0,0,0,0));
+ parade.fill(Qt::transparent);
QRgb *col;
QPainter davinci(¶de);
const uint stepsize = 4*accelFactor;
for (uint i = 0, x = 0; i < byteCount; i += stepsize) {
-
col = (QRgb *)bits;
r = qRed(*col);
g = qGreen(*col);
void MainWindow::slotConnectMonitors()
{
m_projectList->setRenderer(m_projectMonitor->render);
+ connect(m_projectList, SIGNAL(pauseMonitor()), m_monitorManager, SLOT(slotPause()));
connect(m_projectList, SIGNAL(deleteProjectClips(QStringList, QMap<QString, QString>)), this, SLOT(slotDeleteProjectClips(QStringList, QMap<QString, QString>)));
connect(m_projectList, SIGNAL(showClipProperties(DocClipBase *)), this, SLOT(slotShowClipProperties(DocClipBase *)));
connect(m_projectList, SIGNAL(showClipProperties(QList <DocClipBase *>, QMap<QString, QString>)), this, SLOT(slotShowClipProperties(QList <DocClipBase *>, QMap<QString, QString>)));
connect(m_listView, SIGNAL(projectModified()), this, SIGNAL(projectModified()));
connect(m_listView, SIGNAL(itemSelectionChanged()), this, SLOT(slotClipSelected()));
connect(m_listView, SIGNAL(focusMonitor()), this, SIGNAL(raiseClipMonitor()));
- connect(m_listView, SIGNAL(pauseMonitor()), this, SLOT(slotPauseMonitor()));
+ connect(m_listView, SIGNAL(pauseMonitor()), this, SIGNAL(pauseMonitor()));
connect(m_listView, SIGNAL(requestMenu(const QPoint &, QTreeWidgetItem *)), this, SLOT(slotContextMenu(const QPoint &, QTreeWidgetItem *)));
+ connect(m_listView, SIGNAL(addClip()), this, SIGNAL(pauseMonitor()));
connect(m_listView, SIGNAL(addClip()), this, SLOT(slotAddClip()));
connect(m_listView, SIGNAL(addClip(const QList <QUrl>, const QString &, const QString &)), this, SLOT(slotAddClip(const QList <QUrl>, const QString &, const QString &)));
connect(this, SIGNAL(addClip(const QString, const QString &, const QString &)), this, SLOT(slotAddClip(const QString, const QString &, const QString &)));
void checkJobProcess();
/** @brief A Filter Job produced results, send them back to the clip. */
void gotFilterJobResults(const QString &id, int startPos, int track, const QString &filterName, stringMap params);
+ void pauseMonitor();
};
#endif
{
QTreeWidgetItem *it = itemAt(event->pos());
if (!it) {
+ emit pauseMonitor();
emit addClip();
return;
}
const uchar* image = frame.get_image(format, width, height);
QImage qimage(width, height, QImage::Format_ARGB32_Premultiplied);
memcpy(qimage.scanLine(0), image, width * height * 4);
-
- /*mlt_image_format format = mlt_image_rgb24;
- int width = 0;
- int height = 0;
- const uchar* image = frame.get_image(format, width, height);
- QImage qimage(width, height, QImage::Format_RGB888);
- memcpy(qimage.bits(), image, width * height * 3);*/
emit frameUpdated(qimage.rgbSwapped());
}
QImage AbstractGfxScopeWidget::renderScope(uint accelerationFactor)
{
+ QMutexLocker lock(&m_mutex);
return renderGfxScope(accelerationFactor, m_scopeImage);
}
///// Slots /////
-void AbstractGfxScopeWidget::slotRenderZoneUpdated(QImage frame)
+void AbstractGfxScopeWidget::slotRenderZoneUpdated(const QImage frame)
{
+ QMutexLocker lock(&m_mutex);
m_scopeImage = frame;
AbstractScopeWidget::slotRenderZoneUpdated();
}
private:
QImage m_scopeImage;
+ QMutex m_mutex;
public slots:
/** @brief Must be called when the active monitor has shown a new frame.
This slot must be connected in the implementing class, it is *not*
done in this abstract class. */
- void slotRenderZoneUpdated(QImage);
+ void slotRenderZoneUpdated(const QImage);
protected slots:
virtual void slotAutoRefreshToggled(bool autoRefresh);
checkActiveAudioScopes();
}
-void ScopeManager::slotDistributeFrame(QImage image)
+void ScopeManager::slotDistributeFrame(const QImage image)
{
#ifdef DEBUG_SM
qDebug() << "ScopeManager: Starting to distribute frame.";
// Connect new renderer
if (m_lastConnectedRenderer != NULL) {
- b &= connect(m_lastConnectedRenderer, SIGNAL(frameUpdated(QImage)),
- this, SLOT(slotDistributeFrame(QImage)), Qt::UniqueConnection);
+ b &= connect(m_lastConnectedRenderer, SIGNAL(frameUpdated(const QImage)),
+ this, SLOT(slotDistributeFrame(const QImage)), Qt::UniqueConnection);
b &= connect(m_lastConnectedRenderer, SIGNAL(audioSamplesSignal(QVector<int16_t>,int,int,int)),
this, SLOT(slotDistributeAudio(QVector<int16_t>,int,int,int)), Qt::UniqueConnection);
Q_ASSERT(b);
*/
void slotCheckActiveScopes();
- void slotDistributeFrame(QImage image);
+ void slotDistributeFrame(const QImage image);
void slotDistributeAudio(QVector<int16_t> sampleData, int freq, int num_channels, int num_samples);
/**
Allows a scope to explicitly request a new frame, even if the scope's autoRefresh is disabled.