Update timeline audio thumbs when data is ready

parent aefe065f
......@@ -178,8 +178,10 @@ void ProjectClip::updateAudioThumbnail(QVariantList audioLevels)
{
std::swap(audioFrameCache, audioLevels); // avoid second copy
m_audioThumbCreated = true;
if (auto ptr = m_model.lock()) emit std::static_pointer_cast<ProjectItemModel>(ptr)->refreshAudioThumbs(m_binId);
emit gotAudioData();
if (auto ptr = m_model.lock()) {
emit std::static_pointer_cast<ProjectItemModel>(ptr)->refreshAudioThumbs(m_binId);
}
updateTimelineClips({TimelineModel::AudioLevelsRole});
}
bool ProjectClip::audioThumbCreated() const
......
......@@ -237,7 +237,6 @@ private:
signals:
void producerChanged(const QString &, const std::shared_ptr<Mlt::Producer> &);
void gotAudioData();
void refreshPropertiesPanel();
void refreshAnalysisPanel();
void refreshClipDisplay();
......
......@@ -234,7 +234,7 @@ bool AudioThumbJob::startJob()
return true;
}
m_binClip = pCore->projectItemModel()->getClipByBinID(m_clipId);
if (m_binClip->audioChannels() == 0) {
if (m_binClip->audioChannels() == 0 || m_binClip->audioThumbCreated()) {
// nothing to do
m_done = true;
return true;
......
......@@ -107,7 +107,7 @@ ClipItem::ClipItem(ProjectClip *clip, const ItemInfo &info, double fps, double s
} else if (m_clipType == Audio) {
m_baseColor = QColor(141, 215, 166);
}
connect(m_binClip, &ProjectClip::gotAudioData, this, &ClipItem::slotGotAudioData);
//connect(m_binClip, &ProjectClip::gotAudioData, this, &ClipItem::slotGotAudioData);
m_paintColor = m_baseColor;
}
......
......@@ -114,6 +114,12 @@ Column{
value: model.fadeOut
when: loader.status == Loader.Ready && !loader.item.isComposition
}
Binding {
target: loader.item
property: "audioLevels"
value: model.audioLevels
when: loader.status == Loader.Ready && !loader.item.isComposition
}
Binding {
target: loader.item
property: "showKeyframes"
......@@ -205,7 +211,6 @@ Column{
item.binId= model.binId
item.isComposition= model.isComposition
if (!model.isComposition) {
item.audioLevels= model.audioLevels
item.isAudio= model.audio
item.markers= model.markers
item.hasAudio = model.hasAudio
......
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