Fix audio mixer balance cannot be changed after project opening

Related to #559
parent 67407928
Pipeline #14873 passed with stage
in 27 minutes and 21 seconds
......@@ -243,6 +243,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
emit muteTrack(m_tid, !active);
reset();
}
pCore->setDocumentModified();
updateLabel();
});
......@@ -306,6 +307,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
m_levelFilter->set("disable", value == 60 ? 1 : 0);
m_levels.clear();
m_manager->purgeCache();
pCore->setDocumentModified();
}
});
connect(m_balanceSpin, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [&](int value) {
......@@ -316,6 +318,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
m_balanceFilter->set("disable", value == 0 ? 1 : 0);
m_levels.clear();
m_manager->purgeCache();
pCore->setDocumentModified();
}
});
QVBoxLayout *lay = new QVBoxLayout;
......
......@@ -576,6 +576,11 @@ KdenliveDoc *Core::currentDoc()
return m_projectManager->current();
}
void Core::setDocumentModified()
{
m_projectManager->current()->setModified();;
}
int Core::projectDuration() const
{
if (!m_guiConstructed) {
......
......@@ -93,6 +93,8 @@ public:
ProjectManager *projectManager();
/** @brief Returns a pointer to the current project. */
KdenliveDoc *currentDoc();
/** @brief Set current project modified. */
void setDocumentModified();
/** @brief Returns a pointer to the monitor manager. */
MonitorManager *monitorManager();
/** @brief Returns a pointer to the view of the project bin. */
......
......@@ -470,6 +470,17 @@ void TimelineItemModel::setTrackStackEnabled(int tid, bool enable)
void TimelineItemModel::importTrackEffects(int tid, std::weak_ptr<Mlt::Service> service)
{
std::shared_ptr<TrackModel> track = getTrackById(tid);
std::shared_ptr<Mlt::Tractor> destination = track->getTrackService();
// Audio mixer effects are attached to the Tractor service, while track effects are attached to first playlist service
if (auto ptr = service.lock()) {
for (int i = 0; i < ptr->filter_count(); i++) {
std::unique_ptr<Mlt::Filter> filter(ptr->filter(i));
if (filter->get_int("internal_added") > 0) {
destination->attach(*filter.get());
}
}
}
track->importEffects(std::move(service));
}
......
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