Commit 4329ed5f authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files
parent 12bd13b2
......@@ -47,7 +47,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize &paradeSize, const QIm
} else {
QImage parade(paradeSize, QImage::Format_ARGB32);
parade.fill(qRgba(0,0,0,0));
parade.fill(Qt::transparent);
QRgb *col;
QPainter davinci(&parade);
......@@ -92,7 +92,6 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize &paradeSize, const QIm
const uint stepsize = 4*accelFactor;
for (uint i = 0, x = 0; i < byteCount; i += stepsize) {
col = (QRgb *)bits;
r = qRed(*col);
g = qGreen(*col);
......
......@@ -912,6 +912,7 @@ void MainWindow::slotUpdateClip(const QString &id)
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>)));
......
......@@ -310,8 +310,9 @@ ProjectList::ProjectList(QWidget *parent) :
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 &)));
......
......@@ -523,6 +523,7 @@ signals:
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
......
......@@ -184,6 +184,7 @@ void ProjectListView::mouseDoubleClickEvent(QMouseEvent * event)
{
QTreeWidgetItem *it = itemAt(event->pos());
if (!it) {
emit pauseMonitor();
emit addClip();
return;
}
......
......@@ -1705,13 +1705,6 @@ void Render::emitFrameUpdated(Mlt::Frame& frame)
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());
}
......
......@@ -37,6 +37,7 @@ AbstractGfxScopeWidget::~AbstractGfxScopeWidget() { }
QImage AbstractGfxScopeWidget::renderScope(uint accelerationFactor)
{
QMutexLocker lock(&m_mutex);
return renderGfxScope(accelerationFactor, m_scopeImage);
}
......@@ -50,8 +51,9 @@ void AbstractGfxScopeWidget::mouseReleaseEvent(QMouseEvent *event)
///// Slots /////
void AbstractGfxScopeWidget::slotRenderZoneUpdated(QImage frame)
void AbstractGfxScopeWidget::slotRenderZoneUpdated(const QImage frame)
{
QMutexLocker lock(&m_mutex);
m_scopeImage = frame;
AbstractScopeWidget::slotRenderZoneUpdated();
}
......
......@@ -45,12 +45,13 @@ protected:
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);
......
......@@ -129,7 +129,7 @@ void ScopeManager::slotDistributeAudio(QVector<int16_t> sampleData, int freq, in
checkActiveAudioScopes();
}
void ScopeManager::slotDistributeFrame(QImage image)
void ScopeManager::slotDistributeFrame(const QImage image)
{
#ifdef DEBUG_SM
qDebug() << "ScopeManager: Starting to distribute frame.";
......@@ -205,8 +205,8 @@ void ScopeManager::slotUpdateActiveRenderer()
// 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);
......
......@@ -115,7 +115,7 @@ private slots:
*/
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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment