Commit 3c3f11f3 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '1912'

parents c26ef97b ba4adf7c
Pipeline #11402 passed with stage
in 15 minutes
......@@ -193,7 +193,7 @@ QString ProjectClip::getXmlProperty(const QDomElement &producer, const QString &
return value;
}
void ProjectClip::updateAudioThumbnail(QList<double> audioLevels)
void ProjectClip::updateAudioThumbnail(const QVector<double> audioLevels)
{
audioFrameCache = audioLevels;
m_audioThumbCreated = true;
......
......@@ -168,7 +168,7 @@ public:
/** Cache for every audio Frame with 10 Bytes */
/** format is frame -> channel ->bytes */
QList<double> audioFrameCache;
QVector<double> audioFrameCache;
bool audioThumbCreated() const;
void setWaitingStatus(const QString &id);
......@@ -244,7 +244,7 @@ protected:
public slots:
/* @brief Store the audio thumbnails once computed. Note that the parameter is a value and not a reference, fill free to use it as a sink (use std::move to
* avoid copy). */
void updateAudioThumbnail(QList<double> audioLevels);
void updateAudioThumbnail(const QVector<double> audioLevels);
/** @brief Delete the proxy file */
void deleteProxy();
......
......@@ -348,7 +348,7 @@ std::shared_ptr<ProjectClip> ProjectItemModel::getClipByBinID(const QString &bin
return nullptr;
}
const QList<double> ProjectItemModel::getAudioLevelsByBinID(const QString &binId)
const QVector<double> ProjectItemModel::getAudioLevelsByBinID(const QString &binId)
{
READ_LOCK();
if (binId.contains(QLatin1Char('_'))) {
......@@ -360,7 +360,7 @@ const QList<double> ProjectItemModel::getAudioLevelsByBinID(const QString &binId
return std::static_pointer_cast<ProjectClip>(c)->audioFrameCache;
}
}
return QList<double>();
return QVector<double>();
}
bool ProjectItemModel::hasClip(const QString &binId)
......
......@@ -68,7 +68,7 @@ public:
/** @brief Returns a clip from the hierarchy, given its id */
std::shared_ptr<ProjectClip> getClipByBinID(const QString &binId);
/** @brief Returns audio levels for a clip from its id */
const QList <double>getAudioLevelsByBinID(const QString &binId);
const QVector <double>getAudioLevelsByBinID(const QString &binId);
/** @brief Returns a list of clips using the given url */
QStringList getClipByUrl(const QFileInfo &url) const;
......
......@@ -374,7 +374,7 @@ bool AudioThumbJob::commitResult(Fun &undo, Fun &redo)
if (!m_successful) {
return false;
}
QList <double>old = m_binClip->audioFrameCache;
QVector <double>old = m_binClip->audioFrameCache;
QImage oldImage = m_binClip->thumbnail(m_thumbSize.width(), m_thumbSize.height()).toImage();
QImage result = ThumbnailCache::get()->getAudioThumbnail(m_clipId);
......
......@@ -72,6 +72,6 @@ private:
bool m_done{false}, m_successful{false};
int m_channels, m_frequency, m_lengthInFrames, m_audioStream;
QList <double>m_audioLevels;
QVector <double>m_audioLevels;
std::unique_ptr<QProcess> m_ffmpegProcess;
};
......@@ -517,16 +517,6 @@ Fun ClipModel::useTimewarpProducer_lambda(double speed)
};
}
QVariant ClipModel::getAudioWaveform()
{
READ_LOCK();
std::shared_ptr<ProjectClip> binClip = pCore->projectItemModel()->getClipByBinID(m_binClipId);
if (binClip) {
return QVariant::fromValue(binClip->audioFrameCache);
}
return QVariant();
}
const QString &ClipModel::binId() const
{
return m_binClipId;
......
......@@ -113,9 +113,6 @@ public:
*/
int getPlaytime() const override;
/** @brief Returns audio cache data from bin clip to display audio thumbs */
QVariant getAudioWaveform();
/** @brief Returns the bin clip's id */
const QString &binId() const;
......
......@@ -90,7 +90,7 @@ Rectangle {
}
} else if (wheel.modifiers & Qt.ShiftModifier) {
// Vertical scroll
var newScroll = Math.min(scrollView.flickableItem.contentY - wheel.angleDelta.y, trackHeaders.height - tracksArea.height + scrollView.__horizontalScrollBar.height + cornerstone.height)
var newScroll = Math.min(scrollView.flickableItem.contentY - wheel.angleDelta.y, trackHeaders.height - tracksArea.height + scrollView.__horizontalScrollBar.height + ruler.height)
scrollView.flickableItem.contentY = Math.max(newScroll, 0)
} else {
// Horizontal scroll
......@@ -732,17 +732,12 @@ Rectangle {
Row {
Column {
id: headerContainer
width: headerWidth
z: 1
Rectangle {
id: cornerstone
property bool selected: false
Item {
// Padding between toolbar and track headers.
width: headerWidth
width: parent.width
height: ruler.height
color: 'transparent' //selected? shotcutBlue : activePalette.window
border.color: selected? 'red' : 'transparent'
border.width: selected? 1 : 0
z: 1
Button {
text: parent.width > metrics.boundingRect.width * 1.4 ? metrics.text : "M"
anchors.fill: parent
......@@ -765,16 +760,18 @@ Rectangle {
// Non-slider scroll area for the track headers.
id: headerFlick
contentY: scrollView.flickableItem.contentY
width: headerWidth
height: 100
width: parent.width
y: ruler.height
height: root.height - ruler.height
interactive: false
clip: true
MouseArea {
width: trackHeaders.width
height: trackHeaders.height
acceptedButtons: Qt.NoButton
onWheel: {
var newScroll = Math.min(scrollView.flickableItem.contentY - wheel.angleDelta.y, height - tracksArea.height + scrollView.__horizontalScrollBar.height + cornerstone.height)
var newScroll = Math.min(scrollView.flickableItem.contentY - wheel.angleDelta.y, height - tracksArea.height + scrollView.__horizontalScrollBar.height + ruler.height)
scrollView.flickableItem.contentY = Math.max(newScroll, 0)
}
}
......@@ -871,8 +868,9 @@ Rectangle {
id: tracksArea
property real clickX
property real clickY
width: root.width - headerWidth
width: root.width - root.headerWidth
height: root.height
x: root.headerWidth
// This provides continuous scrubbing and scimming at the left/right edges.
hoverEnabled: true
acceptedButtons: Qt.RightButton | Qt.LeftButton | Qt.MidButton
......
......@@ -203,7 +203,7 @@ signals:
void audioChannelsChanged();
private:
QList<double> m_audioLevels;
QVector<double> m_audioLevels;
int m_inPoint;
int m_outPoint;
QString m_binId;
......
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