Display nice hover audio thumbnail preview in clip monitor when seeking

Fix monitor switching sometimes leaving monitor blank
parent be3caaa3
......@@ -72,7 +72,7 @@ include(CheckIncludeFiles)
check_include_files(malloc.h HAVE_MALLOC_H)
check_include_files(pthread.h HAVE_PTHREAD_H)
find_package(Qt5 CONFIG REQUIRED Core DBus Test Widgets Script Svg)
find_package(Qt5 CONFIG REQUIRED Core DBus Test Widgets Script Svg Quick)
find_package(KF5 5.15 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config ConfigWidgets
DBusAddons KIO WidgetsAddons Plotting NotifyConfig NewStuff XmlGui Notifications GuiAddons TextWidgets IconThemes DocTools Crash OPTIONAL_COMPONENTS FileMetaData)
......
......@@ -20,6 +20,7 @@ install(FILES
kdenliveeffectscategory.rc
kdenlivetranscodingrc
kdenlivemonitor.qml
kdenliveclipmonitor.qml
kdenlivemonitoreffectscene.qml
kdenlivemonitorcornerscene.qml
kdenlivemonitorsplit.qml
......
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtQuick 2.0
import AudioThumb 1.0
Item {
id: root
objectName: "root"
// default size, but scalable by user
height: 300; width: 400
property string comment
property point center
property double scale
signal editCurrentMarker()
QmlAudioThumb {
id: audioThumb
objectName: "audiothumb"
property bool stateVisible: true
anchors {
left: parent.left
bottom: parent.bottom
}
height: parent.height / 6
//font.pixelSize * 3
width: parent.width
states: [
State { when: audioThumb.stateVisible;
PropertyChanges { target: audioThumb; opacity: 1.0 } },
State { when: !audioThumb.stateVisible;
PropertyChanges { target: audioThumb; opacity: 0.0 } }
]
transitions: [ Transition {
NumberAnimation { property: "opacity"; duration: 500}
} ]
MouseArea {
hoverEnabled: true
onExited: audioThumb.stateVisible = false
onEntered: audioThumb.stateVisible = true
acceptedButtons: Qt.NoButton
anchors.fill: parent
}
}
TextField {
id: marker
objectName: "markertext"
activeFocusOnPress: true
onEditingFinished: {
root.comment = marker.displayText
marker.focus = false
root.editCurrentMarker()
}
anchors {
right: parent.right
bottom: parent.bottom
rightMargin: 4
bottomMargin: 4
}
textColor: "white"
visible: text != ""
style: TextFieldStyle {
background: Rectangle {
color: "#ffff0000"
radius: 5
}
}
font.pointSize: root.height / 35
}
}
......@@ -12,8 +12,8 @@ Item {
property point center
property double scale
signal editCurrentMarker()
TextField {
TextField {
id: marker
objectName: "markertext"
activeFocusOnPress: true
......@@ -34,7 +34,7 @@ Item {
visible: text != ""
style: TextFieldStyle {
background: Rectangle {
color: "#ffff0000"
color: "#ff0000ff"
radius: 5
}
}
......
......@@ -107,6 +107,7 @@ add_subdirectory(utils)
add_subdirectory(onmonitoritems/rotoscoping)
add_subdirectory(mltcontroller)
add_subdirectory(bin)
add_subdirectory(qml)
list(APPEND kdenlive_SRCS
colortools.cpp
......
......@@ -434,6 +434,7 @@ Bin::Bin(QWidget* parent) :
m_logAction->setCheckable(false);
connect(m_logAction, SIGNAL(triggered()), this, SLOT(slotShowJobLog()));
connect(this, SIGNAL(requesteInvalidRemoval(QString,QUrl)), this, SLOT(slotQueryRemoval(QString,QUrl)));
connect(this, &Bin::refreshAudioThumbs, this, &Bin::doRefreshAudioThumbs);
}
Bin::~Bin()
......@@ -827,6 +828,7 @@ void Bin::setMonitor(Monitor *monitor)
{
m_monitor = monitor;
connect(m_monitor, SIGNAL(addClipToProject(QUrl)), this, SLOT(slotAddClipToProject(QUrl)));
connect(m_monitor, SIGNAL(requestAudioThumb(QString)), this, SLOT(slotSendAudioThumb(QString)));
connect(m_monitor, SIGNAL(refreshCurrentClip()), this, SLOT(slotOpenCurrent()));
connect(m_monitor, SIGNAL(updateClipMarker(QString, QList<CommentedTime>)), this, SLOT(slotAddClipMarker(QString,QList<CommentedTime>)));
connect(this, SIGNAL(openClip(ClipController*,int,int)), m_monitor, SLOT(slotOpenClip(ClipController*,int,int)));
......@@ -1952,7 +1954,19 @@ void Bin::refreshClip(const QString &id)
{
emit clipNeedsReload(id, false);
if (m_monitor->activeClipId() == id)
m_monitor->refreshMonitor();
m_monitor->refreshMonitorIfActive();
}
void Bin::emitRefreshAudioThumbs(const QString &id)
{
emit refreshAudioThumbs(id);
}
void Bin::doRefreshAudioThumbs(const QString &id)
{
if (m_monitor->activeClipId() == id) {
slotSendAudioThumb(id);
}
}
void Bin::refreshClipMarkers(const QString &id)
......@@ -2119,7 +2133,7 @@ void Bin::removeEffect(const QString &id, const QDomElement &effect)
ProjectClip *currentItem = m_rootFolder->clip(id);
if (!currentItem) return;
currentItem->removeEffect(effect.attribute(QStringLiteral("kdenlive_ix")).toInt());
m_monitor->refreshMonitor();
m_monitor->refreshMonitorIfActive();
}
void Bin::addEffect(const QString &id, QDomElement &effect)
......@@ -2128,7 +2142,7 @@ void Bin::addEffect(const QString &id, QDomElement &effect)
if (!currentItem) return;
currentItem->addEffect(m_monitor->profileInfo(), effect);
emit masterClipUpdated(currentItem->controller(), m_monitor);
m_monitor->refreshMonitor();
m_monitor->refreshMonitorIfActive();
}
void Bin::editMasterEffect(ClipController *ctl)
......@@ -2959,7 +2973,7 @@ void Bin::slotDisableEffects(bool disable)
{
m_rootFolder->disableEffects(disable);
pCore->projectManager()->disableBinEffects(disable);
m_monitor->refreshMonitor();
m_monitor->refreshMonitorIfActive();
}
void Bin::setBinEffectsDisabledStatus(bool disabled)
......@@ -3017,3 +3031,12 @@ void Bin::refreshProxySettings()
if (!toProxy.isEmpty()) m_doc->slotProxyCurrentItem(true, toProxy);
}
}
void Bin::slotSendAudioThumb(QString id)
{
ProjectClip *clip = m_rootFolder->clip(id);
if (clip && clip->audioThumbCreated()) {
m_monitor->prepareAudioThumb(clip->audioChannels(), clip->audioFrameCache);
}
}
......@@ -466,6 +466,8 @@ public:
void refreshProxySettings();
/** @brief A clip is ready, update its info panel if displayed. */
void emitRefreshPanel(const QString &id);
/** @brief Audio thumbs just finished creating, update on monitor display. */
void emitRefreshAudioThumbs(const QString &id);
private slots:
void slotAddClip();
......@@ -513,6 +515,9 @@ private slots:
void slotRenameFolder();
void slotCreateAudioThumbs();
void doRefreshPanel(const QString &id);
/** @brief Send audio thumb data to monitor for display. */
void slotSendAudioThumb(QString id);
void doRefreshAudioThumbs(const QString &id);
public slots:
void slotThumbnailReady(const QString &id, const QImage &img, bool fromFile = false);
......@@ -671,6 +676,8 @@ signals:
void clipNameChanged(const QString &);
/** @brief A clip was updated, request panel update. */
void refreshPanel(const QString &id);
/** @brief A clip audio data was updated, request refresh. */
void refreshAudioThumbs(const QString &id);
};
......
......@@ -127,9 +127,9 @@ QString ProjectClip::getXmlProperty(const QDomElement &producer, const QString &
void ProjectClip::updateAudioThumbnail(QVariantList audioLevels)
{
////qDebug() << "CLIPBASE RECIEDVED AUDIO DATA*********************************************";
audioFrameCache = audioLevels;
m_controller->audioThumbCreated = true;
bin()->emitRefreshAudioThumbs(m_id);
emit gotAudioData();
}
......@@ -827,7 +827,7 @@ void ProjectClip::slotCreateAudioThumbs()
QString clipHash = hash();
if (clipHash.isEmpty()) return;
QString audioPath = bin()->projectFolder().path() + "/thumbs/" + clipHash + "_audio.png";
double lengthInFrames = prod->get_playtime();
int lengthInFrames = prod->get_playtime();
int frequency = audioInfo->samplingRate();
if (frequency <= 0) frequency = 48000;
int channels = audioInfo->channels();
......@@ -859,6 +859,7 @@ void ProjectClip::slotCreateAudioThumbs()
if (!audioProducer->is_valid()) {
return;
}
audioProducer->set("video_index", "-1");
Mlt::Filter chans(*prod->profile(), "audiochannels");
Mlt::Filter converter(*prod->profile(), "audioconvert");
Mlt::Filter levels(*prod->profile(), "audiolevel");
......@@ -866,7 +867,6 @@ void ProjectClip::slotCreateAudioThumbs()
audioProducer->attach(converter);
audioProducer->attach(levels);
audioProducer->set("video_index", "-1");
int last_val = 0;
emit updateJobStatus(AbstractClipJob::THUMBJOB, JobWaiting, 0);//, i18n("Creating audio thumbnails"));
double framesPerSecond = audioProducer->get_fps();
......@@ -875,9 +875,10 @@ void ProjectClip::slotCreateAudioThumbs()
for (int i = 0; i < channels; i++) {
keys << "meta.media.audio_level." + QString::number(i);
}
for (int z = (int) frame; z < (int)(frame + lengthInFrames) && !abortAudioThumb; ++z) {
int val = (int)((z - frame) / (frame + lengthInFrames) * 100.0);
if (last_val != val && val > 1) {
int val = 0;
for (int z = 0;z < lengthInFrames && !abortAudioThumb; ++z) {
val = (int)(z / lengthInFrames * 100.0);
if (last_val != val) {
emit updateJobStatus(AbstractClipJob::THUMBJOB, JobWorking, val);
last_val = val;
}
......
......@@ -43,12 +43,6 @@ enum MonitorId {
};
const int DefaultThumbHeight = 100;
/*
const QString clipMonitor("clipMonitor");
const QString recordMonitor("recordMonitor");
const QString projectMonitor("projectMonitor");
const QString stopmotionMonitor("stopmotionMonitor");
*/
}
......
......@@ -60,7 +60,7 @@ void DvdWizardChapters::stopMonitor()
void DvdWizardChapters::refreshMonitor()
{
if (m_monitor) m_monitor->refreshMonitor();
if (m_monitor) m_monitor->refreshMonitorIfActive();
}
void DvdWizardChapters::slotUpdateChaptersList()
......@@ -181,7 +181,7 @@ void DvdWizardChapters::setVobFiles(DVDFORMAT format, const QStringList &movies,
adjustSize();
updateGeometry();
slotUpdateChaptersList();
m_monitor->refreshMonitor();
m_monitor->refreshMonitorIfActive();
}
QMap <QString, QString> DvdWizardChapters::chaptersData() const
......
......@@ -571,7 +571,7 @@ void EffectStackView2::slotUpdateEffectState(bool disable, int index, MonitorSce
break;
case MASTER_CLIP:
m_masterclipref->changeEffectState(QList <int>() << index, disable);
m_effectMetaInfo.monitor->refreshMonitor();
m_effectMetaInfo.monitor->refreshMonitorIfActive();
break;
default:
// timeline clip effect
......@@ -739,7 +739,7 @@ void EffectStackView2::slotUpdateEffectParams(const QDomElement &old, const QDom
}
else if (m_status == MASTER_CLIP) {
m_masterclipref->updateEffect(m_effectMetaInfo.monitor->profileInfo(), e, ix);
m_effectMetaInfo.monitor->refreshMonitor();
m_effectMetaInfo.monitor->refreshMonitorIfActive();
}
QTimer::singleShot(200, this, SLOT(slotCheckWheelEventFilter()));
}
......
......@@ -1629,8 +1629,8 @@ void MainWindow::connectDocument()
//pCore->monitorManager()->activateMonitor(Kdenlive::ClipMonitor, true);
// set tool to select tool
m_buttonSelectTool->setChecked(true);
connect(m_projectMonitorDock, SIGNAL(visibilityChanged(bool)), m_projectMonitor, SLOT(refreshMonitor(bool)), Qt::UniqueConnection);
connect(m_clipMonitorDock, SIGNAL(visibilityChanged(bool)), m_clipMonitor, SLOT(refreshMonitor(bool)), Qt::UniqueConnection);
connect(m_projectMonitorDock, SIGNAL(visibilityChanged(bool)), m_projectMonitor, SLOT(slotRefreshMonitor(bool)), Qt::UniqueConnection);
connect(m_clipMonitorDock, SIGNAL(visibilityChanged(bool)), m_clipMonitor, SLOT(slotRefreshMonitor(bool)), Qt::UniqueConnection);
}
void MainWindow::slotZoneMoved(int start, int end)
......
......@@ -28,6 +28,7 @@
#include <mlt++/Mlt.h>
#include "glwidget.h"
#include "core.h"
#include "qml/qmlaudiothumb.h"
#include "kdenlivesettings.h"
#include "mltcontroller/bincontroller.h"
//#include "qmltypes/qmlutilities.h"
......@@ -92,6 +93,7 @@ GLWidget::GLWidget(QObject *parent)
qRegisterMetaType<Mlt::Frame>("Mlt::Frame");
qRegisterMetaType<SharedFrame>("SharedFrame");
qmlRegisterType<QmlAudioThumb>("AudioThumb", 1, 0, "QmlAudioThumb");
setPersistentOpenGLContext(true);
setPersistentSceneGraph(true);
setClearBeforeRendering(false);
......@@ -1349,3 +1351,40 @@ void FrameRenderer::cleanup()
}
}
void GLWidget::setAudioThumb(int channels, QVariantList audioCache)
{
if (rootObject()) {
QmlAudioThumb *audioThumbDisplay = rootObject()->findChild<QmlAudioThumb *>("audiothumb");
if (audioThumbDisplay) {
QImage img(width(), height() / 6, QImage::Format_ARGB32_Premultiplied);
img.fill(Qt::transparent);
if (!audioCache.isEmpty() && channels > 0) {
int audioLevelCount = audioCache.count() - 1;
// simplified audio
QPainter painter(&img);
QRectF mappedRect(0, 0, img.width(), img.height());
int channelHeight = mappedRect.height();
QPainterPath positiveChannelPath;
double scale = (double) width() / audioLevelCount * channels;
int offset = 1;
if (scale < 1) {
offset = (int) (1.0 / scale);
}
positiveChannelPath.moveTo(0, mappedRect.bottom());
for (int i = 0; i < audioLevelCount; i += offset) {
double value = audioCache.at(qMin(i * channels, audioLevelCount)).toDouble() / 256;
for (int channel = 1; channel < channels; channel ++) {
value = qMax(value, audioCache.at(qMin(i * channels + channel, audioLevelCount)).toDouble() / 256);
}
positiveChannelPath.lineTo(i * scale, mappedRect.bottom() - (value * channelHeight));
}
positiveChannelPath.lineTo(mappedRect.right(), mappedRect.bottom());
painter.setPen(Qt::NoPen);
painter.setBrush(QBrush(QColor(80, 80, 150, 200)));
painter.drawPath(positiveChannelPath);
painter.end();
}
audioThumbDisplay->setImage(img);
}
}
}
......@@ -91,6 +91,7 @@ public:
void lockMonitor();
void releaseMonitor();
int realTime() const;
void setAudioThumb(int channels = 0, QVariantList audioCache = QList<QVariant>());
protected:
void mouseReleaseEvent(QMouseEvent * event);
......
......@@ -28,6 +28,7 @@
#include "kdenlivesettings.h"
#include "timeline/abstractclipitem.h"
#include "timeline/clip.h"
#include "qml/qmlaudiothumb.h"
#include "dialogs/profilesdialog.h"
#include "doc/kthumb.h"
#include "utils/KoIconUtils.h"
......@@ -141,7 +142,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
glayout->setSpacing(0);
glayout->setContentsMargins(0, 0, 0, 0);
// Create QML OpenGL widget
m_glMonitor = new GLWidget();
m_glMonitor = new GLWidget;
connect(m_glMonitor, SIGNAL(passKeyEvent(QKeyEvent*)), this, SLOT(doKeyPressEvent(QKeyEvent*)));
m_videoWidget = QWidget::createWindowContainer(qobject_cast<QWindow*>(m_glMonitor));
m_videoWidget->setAcceptDrops(true);
......@@ -149,7 +150,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
m_videoWidget->installEventFilter(leventEater);
connect(leventEater, &QuickEventEater::addEffect, this, &Monitor::slotAddEffect);
QuickMonitorEventEater *monitorEventEater = new QuickMonitorEventEater(m_glWidget);
QuickMonitorEventEater *monitorEventEater = new QuickMonitorEventEater(this);
m_glWidget->installEventFilter(monitorEventEater);
connect(monitorEventEater, SIGNAL(doKeyPressEvent(QKeyEvent*)), this, SLOT(doKeyPressEvent(QKeyEvent*)));
......@@ -174,9 +175,10 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
if (KdenliveSettings::displayMonitorInfo()) {
// Load monitor overlay qml
m_glMonitor->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("kdenlivemonitor.qml"))));
m_glMonitor->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, m_id == Kdenlive::ClipMonitor ? QStringLiteral("kdenliveclipmonitor.qml") : QStringLiteral("kdenlivemonitor.qml"))));
m_rootItem = m_glMonitor->rootObject();
m_markerItem = m_rootItem->childItems().first();
m_markerItem = m_rootItem->findChild<QQuickItem *>("markertext");
m_glMonitor->setAudioThumb();
QObject::connect(m_rootItem, SIGNAL(editCurrentMarker()), this, SLOT(slotEditInlineMarker()), Qt::UniqueConnection);
}
connect(m_glMonitor, SIGNAL(showContextMenu(QPoint)), this, SLOT(slotShowMenu(QPoint)));
......@@ -351,7 +353,7 @@ void Monitor::slotGetCurrentImage()
{
m_monitorManager->activateMonitor(m_id, true);
m_glMonitor->sendFrameForAnalysis = true;
refreshMonitor();
refreshMonitorIfActive();
// Update analysis state
QTimer::singleShot(500, m_monitorManager, SIGNAL(checkScopes()));
}
......@@ -713,11 +715,15 @@ void Monitor::slotSwitchFullScreen(bool minimizeOnly)
screen = i;
}
}
QmlAudioThumb *audioThumbDisplay = m_glMonitor->rootObject()->findChild<QmlAudioThumb *>("audiothumb");
if (audioThumbDisplay) audioThumbDisplay->setProperty("stateVisible", false);
m_glWidget->setParent(QApplication::desktop()->screen(screen));
m_glWidget->move(QApplication::desktop()->screenGeometry(screen).bottomLeft());
m_glWidget->showFullScreen();
} else {
m_glWidget->showNormal();
QmlAudioThumb *audioThumbDisplay = m_glMonitor->rootObject()->findChild<QmlAudioThumb *>("audiothumb");
if (audioThumbDisplay) audioThumbDisplay->setProperty("stateVisible", true);
QVBoxLayout *lay = (QVBoxLayout *) layout();
lay->insertWidget(0, m_glWidget, 10);
}
......@@ -774,6 +780,20 @@ void Monitor::slotStartDrag()
drag->start(Qt::MoveAction);
}
void Monitor::enterEvent(QEvent * event)
{
QmlAudioThumb *audioThumbDisplay = m_glMonitor->rootObject()->findChild<QmlAudioThumb *>("audiothumb");
if (audioThumbDisplay) audioThumbDisplay->setProperty("stateVisible", true);
QWidget::enterEvent(event);
}
void Monitor::leaveEvent(QEvent * event)
{
QmlAudioThumb *audioThumbDisplay = m_glMonitor->rootObject()->findChild<QmlAudioThumb *>("audiothumb");
if (audioThumbDisplay) audioThumbDisplay->setProperty("stateVisible", false);
QWidget::leaveEvent(event);
}
// virtual
void Monitor::mouseMoveEvent(QMouseEvent *event)
{
......@@ -967,7 +987,7 @@ void Monitor::checkOverlay()
}
if (overlayText != m_markerItem->property("text")) {
m_markerItem->setProperty("text", overlayText);
m_rootItem->setVisible(!overlayText.isEmpty());
m_markerItem->setVisible(!overlayText.isEmpty());
}
}
......@@ -1130,10 +1150,16 @@ void Monitor::start()
}
}
void Monitor::refreshMonitor(bool visible)
void Monitor::slotRefreshMonitor(bool visible)
{
if (visible && isActive()) {
m_glMonitor->raise();
if (visible) {
slotActivateMonitor(true);
}
}
void Monitor::refreshMonitorIfActive()
{
if (isActive() && render) {
render->doRefresh();
}
}
......@@ -1250,10 +1276,12 @@ void Monitor::slotOpenClip(ClipController *controller, int in, int out)
m_ruler->setZone(in, out);
setClipZone(QPoint(in, out));
}
emit requestAudioThumb(controller->clipId());
//hasEffects = controller->hasEffects();
}
else {
render->setProducer(NULL, -1, isActive());
m_glMonitor->setAudioThumb();
//hasEffects = false;
}
}
......@@ -1426,7 +1454,7 @@ void Monitor::slotShowEffectScene(MonitorSceneType sceneType, bool temporary)
if (!temporary) m_lastMonitorSceneType = sceneType;
if (sceneType == MonitorSceneGeometry) {
if (!m_rootItem || m_rootItem->objectName() != QLatin1String("rooteffectscene")) {
m_glMonitor->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("kdenlivemonitoreffectscene.qml"))));
m_glMonitor->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, m_id == Kdenlive::ClipMonitor ? QStringLiteral("kdenliveclipmonitor.qml") : QStringLiteral("kdenlivemonitor.qml"))));
m_rootItem = m_glMonitor->rootObject();
QObject::connect(m_rootItem, SIGNAL(addKeyframe()), this, SIGNAL(addKeyframe()), Qt::UniqueConnection);
QObject::connect(m_rootItem, SIGNAL(seekToKeyframe()), this, SLOT(slotSeekToKeyFrame()), Qt::UniqueConnection);
......@@ -1685,10 +1713,11 @@ void Monitor::loadMasterQml()
// Root scene is already active
return;
}
m_glMonitor->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("kdenlivemonitor.qml"))));
m_glMonitor->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, m_id == Kdenlive::ClipMonitor ? QStringLiteral("kdenliveclipmonitor.qml") : QStringLiteral("kdenlivemonitor.qml"))));
m_glMonitor->slotShowEffectScene(MonitorSceneNone);
m_rootItem = m_glMonitor->rootObject();
m_markerItem = m_rootItem->childItems().first();
m_markerItem = m_rootItem->findChild<QQuickItem *>("markertext");
m_glMonitor->setAudioThumb();
QObject::connect(m_rootItem, SIGNAL(editCurrentMarker()), this, SLOT(slotEditInlineMarker()), Qt::UniqueConnection);
}
......@@ -1781,3 +1810,7 @@ void Monitor::slotEditInlineMarker()
}
}
void Monitor::prepareAudioThumb(int channels, QVariantList &audioCache)
{
m_glMonitor->setAudioThumb(channels, audioCache);
}
\ No newline at end of file
......@@ -139,6 +139,9 @@ public:
void refreshIcons();
/** @brief Enable or disable the effect compare feature depending on effects presence */
void enableCompare(int effectsCount);
/** @brief Send audio thumb data to qml for on monitor display */
void prepareAudioThumb(int channels, QVariantList &audioCache);
void refreshMonitorIfActive();
protected:
void mousePressEvent(QMouseEvent * event);
......@@ -154,6 +157,8 @@ protected:
* Ctrl + wheel moves by a second, without Ctrl it moves by a single frame. */
void wheelEvent(QWheelEvent * event);
void mouseMoveEvent(QMouseEvent *event);
void enterEvent(QEvent * event);
void leaveEvent(QEvent * event);
virtual QStringList mimeTypes() const;
private:
......@@ -248,7 +253,7 @@ public slots:
void slotOpenClip(ClipController *controller, int in = -1, int out = -1);
/** @brief Seek clip monitor to a requested position. */
void slotSeekController(ClipController *controller, int pos);
void refreshMonitor(bool visible = true);
void slotRefreshMonitor(bool visible);
void slotSeek(int pos);
void stop();
void start();
......@@ -315,6 +320,7 @@ signals:
void updateClipMarker(QString, QList<CommentedTime>);
/** @brief Update the text of a timeline guide. */
void updateGuide(int, QString);
void requestAudioThumb(QString);
};
#endif
......@@ -242,8 +242,8 @@ void MonitorManager::slotRefreshCurrentMonitor(const QString &id)
{
// Clip producer was modified, check if clip is currently displayed in clip monitor
m_clipMonitor->reloadProducer(id);
if (m_activeMonitor == m_clipMonitor) m_clipMonitor->refreshMonitor();
else m_projectMonitor->refreshMonitor();
if (m_activeMonitor == m_clipMonitor) m_clipMonitor->refreshMonitorIfActive();
else m_projectMonitor->refreshMonitorIfActive();
}
void MonitorManager::slotUpdateAudioMonitoring()
......
......@@ -647,6 +647,6 @@ void ProjectManager::slotDisableTimelineEffects(bool disable)
}
m_trackView->disableTimelineEffects(disable);
pCore->window()->m_effectStack->disableTimelineEffects(disable);
pCore->monitorManager()->projectMonitor()->refreshMonitor();
pCore->monitorManager()->projectMonitor()->refreshMonitorIfActive();
}