Commit 3c17c4ee authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix audio mixer balance cannot be changed after project opening

Related to #559
parent 81f67bd9
...@@ -243,6 +243,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag) ...@@ -243,6 +243,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
emit muteTrack(m_tid, !active); emit muteTrack(m_tid, !active);
reset(); reset();
} }
pCore->setDocumentModified();
updateLabel(); updateLabel();
}); });
...@@ -306,6 +307,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag) ...@@ -306,6 +307,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
m_levelFilter->set("disable", value == 60 ? 1 : 0); m_levelFilter->set("disable", value == 60 ? 1 : 0);
m_levels.clear(); m_levels.clear();
m_manager->purgeCache(); m_manager->purgeCache();
pCore->setDocumentModified();
} }
}); });
connect(m_balanceSpin, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [&](int value) { 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) ...@@ -316,6 +318,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackTag)
m_balanceFilter->set("disable", value == 0 ? 1 : 0); m_balanceFilter->set("disable", value == 0 ? 1 : 0);
m_levels.clear(); m_levels.clear();
m_manager->purgeCache(); m_manager->purgeCache();
pCore->setDocumentModified();
} }
}); });
QVBoxLayout *lay = new QVBoxLayout; QVBoxLayout *lay = new QVBoxLayout;
......
...@@ -549,6 +549,11 @@ KdenliveDoc *Core::currentDoc() ...@@ -549,6 +549,11 @@ KdenliveDoc *Core::currentDoc()
return m_projectManager->current(); return m_projectManager->current();
} }
void Core::setDocumentModified()
{
m_projectManager->current()->setModified();;
}
int Core::projectDuration() const int Core::projectDuration() const
{ {
if (!m_guiConstructed) { if (!m_guiConstructed) {
......
...@@ -93,6 +93,8 @@ public: ...@@ -93,6 +93,8 @@ public:
ProjectManager *projectManager(); ProjectManager *projectManager();
/** @brief Returns a pointer to the current project. */ /** @brief Returns a pointer to the current project. */
KdenliveDoc *currentDoc(); KdenliveDoc *currentDoc();
/** @brief Set current project modified. */
void setDocumentModified();
/** @brief Returns a pointer to the monitor manager. */ /** @brief Returns a pointer to the monitor manager. */
MonitorManager *monitorManager(); MonitorManager *monitorManager();
/** @brief Returns a pointer to the view of the project bin. */ /** @brief Returns a pointer to the view of the project bin. */
......
...@@ -482,6 +482,17 @@ void TimelineItemModel::setTrackStackEnabled(int tid, bool enable) ...@@ -482,6 +482,17 @@ void TimelineItemModel::setTrackStackEnabled(int tid, bool enable)
void TimelineItemModel::importTrackEffects(int tid, std::weak_ptr<Mlt::Service> service) void TimelineItemModel::importTrackEffects(int tid, std::weak_ptr<Mlt::Service> service)
{ {
std::shared_ptr<TrackModel> track = getTrackById(tid); 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)); 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