Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix movit GPU cannot be enabled

parent db7058e5
......@@ -2,7 +2,7 @@
<effect tag="movit.lift_gamma_gain" id="movit.lift_gamma_gain">
<name>Lift/gamma/gain (GPU)</name>
<author>Steinar H. Gunderson</author>
<parameter type="double" name="lift_r" default="0" min="0" max="500" factor="100">
<parameter type="colorwheel" name="lift_r" default="0" min="0" max="500" factor="100">
<name>Lift: Red</name>
</parameter>
<parameter type="double" name="lift_g" default="0" min="0" max="500" factor="100">
......
......@@ -78,7 +78,7 @@ protected:
void parseBlackList(const QString &path);
void init();
virtual Mlt::Properties *retrieveListFromMlt() = 0;
virtual Mlt::Properties *retrieveListFromMlt() const = 0;
virtual void parseFavorites() = 0;
/* @brief Parse some info from a mlt structure
......
......@@ -51,7 +51,7 @@ void AssetParameterView::setModel(const std::shared_ptr<AssetParameterModel> &mo
m_model->prepareKeyframes();
const QString paramTag = model->getAssetId();
connect(m_model.get(), &AssetParameterModel::dataChanged, this, &AssetParameterView::refresh);
if (paramTag == QStringLiteral("lift_gamma_gain")) {
if (paramTag.endsWith(QStringLiteral("lift_gamma_gain"))) {
// Special case, the colorwheel widget manages several parameters
QModelIndex index = model->index(0, 0);
auto w = AbstractParamWidget::construct(model, index, frameSize, this);
......
......@@ -56,7 +56,7 @@ EffectsRepository::EffectsRepository()
}
}
Mlt::Properties *EffectsRepository::retrieveListFromMlt()
Mlt::Properties *EffectsRepository::retrieveListFromMlt() const
{
return pCore->getMltRepository()->filters();
}
......@@ -182,6 +182,19 @@ Mlt::Filter *EffectsRepository::getEffect(const QString &effectId) const
return filter;
}
bool EffectsRepository::hasInternalEffect(const QString &effectId) const
{
// Retrieve the list of MLT's available assets.
QScopedPointer<Mlt::Properties> assets(retrieveListFromMlt());
int max = assets->count();
for (int i = 0; i < max; ++i) {
if (assets->get_name(i) == effectId) {
return true;
}
}
return false;
}
QPair <QString, QString> EffectsRepository::reloadCustom(const QString &path)
{
std::unordered_map<QString, Info> customAssets;
......
......@@ -47,6 +47,8 @@ public:
/* @brief returns a fresh instance of the given effect */
Mlt::Filter *getEffect(const QString &effectId) const;
/* @brief returns true if an effect exists in MLT (bypasses the blacklist/metadata parsing) */
bool hasInternalEffect(const QString &effectId) const;
void setFavorite(const QString &id, bool favorite) override;
QPair <QString, QString> reloadCustom(const QString &path);
......@@ -55,7 +57,7 @@ protected:
EffectsRepository();
/* Retrieves the list of all available effects from Mlt*/
Mlt::Properties *retrieveListFromMlt() override;
Mlt::Properties *retrieveListFromMlt() const override;
/* Retrieves the list of favorite effects */
void parseFavorites() override;
......
......@@ -218,9 +218,7 @@ void MainWindow::init()
KdenliveSettings::setDefault_profile(QStringLiteral("atsc_1080p_25"));
}
m_gpuAllowed = EffectsRepository::get()->exists(QStringLiteral("glsl.manager"));
// initEffects::parseEffectFiles(pCore->getMltRepository());
// initEffects::parseCustomEffectsFile();
m_gpuAllowed = EffectsRepository::get()->hasInternalEffect(QStringLiteral("glsl.manager"));
m_shortcutRemoveFocus = new QShortcut(QKeySequence(QStringLiteral("Esc")), this);
connect(m_shortcutRemoveFocus, &QShortcut::activated, this, &MainWindow::slotRemoveFocus);
......
......@@ -54,7 +54,7 @@ TransitionsRepository::TransitionsRepository()
}
}
Mlt::Properties *TransitionsRepository::retrieveListFromMlt()
Mlt::Properties *TransitionsRepository::retrieveListFromMlt() const
{
return pCore->getMltRepository()->transitions();
}
......
......@@ -60,7 +60,7 @@ protected:
TransitionsRepository();
/* Retrieves the list of all available effects from Mlt*/
Mlt::Properties *retrieveListFromMlt() override;
Mlt::Properties *retrieveListFromMlt() const override;
/* Retrieves the list of favorite effects */
void parseFavorites() override;
......
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