Fix path of audio thumb for monitor overlay

parent da07c913
Pipeline #10117 passed with stage
in 19 minutes and 15 seconds
......@@ -310,7 +310,7 @@ void MonitorProxy::setClipProperties(ClipType::ProducerType type, bool hasAV, co
}
}
void MonitorProxy::setAudioThumb(const QString thumbPath)
void MonitorProxy::setAudioThumb(const QUrl thumbPath)
{
m_audioThumb = thumbPath;
emit audioThumbChanged();
......
......@@ -28,6 +28,7 @@
#include "definitions.h"
#include <QImage>
#include <QUrl>
#include <QObject>
class GLWidget;
......@@ -42,7 +43,7 @@ class MonitorProxy : public QObject
Q_PROPERTY(int zoneOut READ zoneOut WRITE setZoneOut NOTIFY zoneChanged)
Q_PROPERTY(int rulerHeight READ rulerHeight NOTIFY rulerHeightChanged)
Q_PROPERTY(QString markerComment READ markerComment NOTIFY markerCommentChanged)
Q_PROPERTY(QString audioThumb MEMBER m_audioThumb NOTIFY audioThumbChanged)
Q_PROPERTY(QUrl audioThumb MEMBER m_audioThumb NOTIFY audioThumbChanged)
Q_PROPERTY(int overlayType READ overlayType WRITE setOverlayType NOTIFY overlayTypeChanged)
/** @brief: Returns true if current clip in monitor has Audio and Video
* */
......@@ -91,7 +92,7 @@ public:
Q_INVOKABLE QString toTimecode(int frames) const;
Q_INVOKABLE double fps() const;
void setClipProperties(ClipType::ProducerType type, bool hasAV, const QString clipName);
void setAudioThumb(const QString thumbPath = QString());
void setAudioThumb(const QUrl thumbPath = QUrl());
signals:
void positionChanged();
......@@ -121,7 +122,7 @@ private:
int m_zoneIn;
int m_zoneOut;
bool m_hasAV;
QString m_audioThumb;
QUrl m_audioThumb;
QString m_markerComment;
QString m_clipName;
int m_clipType;
......
......@@ -134,16 +134,16 @@ QImage ThumbnailCache::getAudioThumbnail(const QString &binId, bool volatileOnly
return QImage();
}
const QString ThumbnailCache::getAudioThumbPath(const QString &binId) const
const QUrl ThumbnailCache::getAudioThumbPath(const QString &binId) const
{
QMutexLocker locker(&m_mutex);
bool ok = false;
auto key = getAudioKey(binId, &ok);
QDir thumbFolder = getDir(true, &ok);
if (ok && thumbFolder.exists(key)) {
return QStringLiteral("file://") + thumbFolder.absoluteFilePath(key);
return QUrl::fromLocalFile(thumbFolder.absoluteFilePath(key));
}
return QString();
return QUrl();
}
QImage ThumbnailCache::getThumbnail(const QString &binId, int pos, bool volatileOnly) const
......
......@@ -23,6 +23,7 @@
#include "definitions.h"
#include <QDir>
#include <QUrl>
#include <QImage>
#include <QMutex>
#include <memory>
......@@ -60,7 +61,7 @@ public:
*/
QImage getThumbnail(const QString &binId, int pos, bool volatileOnly = false) const;
QImage getAudioThumbnail(const QString &binId, bool volatileOnly = false) const;
const QString getAudioThumbPath(const QString &binId) const;
const QUrl getAudioThumbPath(const QString &binId) const;
/* @brief Get a given thumbnail from the cache
@param binId is the id of the queried clip
......
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