Commit 948845ec authored by Vivek Yadav's avatar Vivek Yadav
Browse files

merge

parents 9e8f26cc 470c06fc
......@@ -14,5 +14,5 @@
</parameter>
<parameter type="bool" name="av.yuv" default="false">
<name>for YUV color</name>
</parameter>
</parameter>
</effect>
......@@ -23,8 +23,9 @@
</parameter>
<parameter type="constant" name="av.o" max="1" min="0" default="0.75" decimals="2">
<name>Opacity</name>
<parameter type="list" name="av.f" default="hex" paramlist="hex;dec">
</parameter>
<parameter type="list" name="av.f" default="hex" paramlist="hex;dec">
<paramlistdisplay>Hex,Dec</paramlistdisplay>
<name>Format</name>
</parameter>
</parameter>
</effect>
......@@ -4,7 +4,7 @@
<description>Remove blocking artifacts from input video.</description>
<author>libavfilter</author>
<parameter type="list" name="av.filter" default="strong" paramlist="weak;strong">
<paramlistdisplay>All,Y,U,V,Alpha,Red,Green,Blue</paramlistdisplay>
<paramlistdisplay>Weak,Strong</paramlistdisplay>
<name>Filter strength</name>
</parameter>
<parameter type="constant" name="av.block" default="8" min="4" max="512" factor="1">
......
......@@ -4,21 +4,22 @@
<description>Fill borders of the input video, without changing video stream dimensions. Sometimes video can have garbage at the four edges and you may not want to crop video input to keep size multiple of some number</description>
<author>libavfilter</author>
<parameter type="constant" name="av.left" default="0" min="0" max="%width/2" factor="1">
<name>Left</name>
</parameter>
<parameter type="constant" name="av.right" default="0" min="0" max="%width/2" factor="1">
<name>Right</name>
</parameter>
<name>Left</name>
</parameter>
<parameter type="constant" name="av.right" default="0" min="0" max="%width/2" factor="1">
<name>Right</name>
</parameter>
<parameter type="constant" name="av.top" default="0" min="0" max="%height/2" factor="1">
<name>Top</name>
</parameter>
<parameter type="constant" name="av.bottom" default="0" min="0" max="%height/2" factor="1">
<name>Bottom</name>
</parameter>
<parameter type="list" name="av.mode" default="smear" paramlist="smear;mirror;fixed">
<name>Top</name>
</parameter>
<parameter type="constant" name="av.bottom" default="0" min="0" max="%height/2" factor="1">
<name>Bottom</name>
</parameter>
<parameter type="list" name="av.mode" default="smear" paramlist="smear;mirror;fixed">
<paramlistdisplay>Smear,Mirror,Fixed</paramlistdisplay>
<name>Mode</name>
</parameter>
<parameter type="color" name="av.color" default="black">
<name>Color</name>
<name>Mode</name>
</parameter>
<parameter type="color" name="av.color" default="black">
<name>Color</name>
</parameter>
</effect>
......@@ -14,6 +14,6 @@
<name>Strength</name>
</parameter>
<parameter type="switch" name="av.use_bframe_qp" default="0" max="1" min="0">
<name>QP on B-Frames/name>
<name>QP on B-Frames</name>
</parameter>
</effect>
......@@ -9,7 +9,7 @@
<parameter type="constant" name="av.scale_height" default="12" min="0" max="40" factor="1">
<name>Scale height</name>
</parameter>
<parameter type="list" name="av.display_mode" default="parade" paramlist="overlay;stack;parade">
<parameter type="list" name="av.display_mode" default="stack" paramlist="overlay;stack;parade">
<paramlistdisplay>Overlay,Stack,Parade</paramlistdisplay>
<name>Display</name>
</parameter>
......@@ -17,12 +17,11 @@
<paramlistdisplay>Linear,Logarithmic</paramlistdisplay>
<name>Mode</name>
</parameter>
<parameter type="list" name="av.c" default="7" paramlist="0;1;2;3;4;5;6;7;8">
<paramlistdisplay>All,Y,U,YU,V,YV,UV,YUV,Alpha</paramlistdisplay>
<parameter type="list" name="av.c" default="1" paramlist="0;1;2;3;4;5;6;7;8">
<paramlistdisplay>All,Y,U,YU,V,YV,UV,All,Alpha</paramlistdisplay>
<name>Components to display</name>
</parameter>
</parameter>
<parameter type="constant" name="av.f" default="0.7" min="0" max="1" decimals="1">
<parameter type="constant" name="av.f" default="0.7" min="0" max="1" decimals="1">
<name>Foreground Opacity</name>
</parameter>
<parameter type="constant" name="av.b" default="0.5" min="0" max="1" decimals="1">
......
......@@ -16,4 +16,3 @@
<name>Temporal Chroma Strength</name>
</parameter>
</effect>
gi
......@@ -12,4 +12,5 @@
</parameter>
<parameter type="constant" name="av.scale_factor" default="2" min="2" max="4" factor="1">
<name>Scale factor for SRCNN</name>
</parameter>
</effect>
......@@ -10,4 +10,5 @@
<parameter type="list" name="av.out" default="arcd" paramlist="sbsl;sbsr;abl;abr;irl;irr;arbg;argg;arcg;arch;arcc;arcd;agmg;agmh;agmc;agmd;aybg;aybh;aybc;aybd;ml;mr;chl;chr;icl;icr;hdmi">
<paramlistdisplay>side by side parallel,side by side crosseye,above-below left top,above-below right top,interleaved rows (letf top),interleaved rows (right top),anaglyph red/blue gray,anaglyph red/green gray,anaglyph red/cyan gray,anaglyph red/cyan half colored,anaglyph red/cyan color,anaglyph red/cyan dubois,anaglyph green/magenta gray,anaglyph green/magenta half colored,anaglyph green/magenta colored,anaglyph green/magenta dubois,anaglyph yellow/blue gray,anaglyph yellow/blue half colored,anaglyph yellow/blue colored,anaglyph yellow/blue dubois,mono output left,mono output right,checkerboard left eye first,checkerboard right eye first,interleaved columns left eye first,interleaved columns right eye first,HDMI frame pack</paramlistdisplay>
<name>Output format</name>
</effect>
</parameter>
</effect>
......@@ -10,4 +10,5 @@
<parameter type="list" name="av.passthrough" default="none" paramlist="none;portrait;landscape">
<paramlistdisplay>None,Portrait,Landscape</paramlistdisplay>
<name>Override if</name>
</effect>
</parameter>
</effect>
......@@ -42,6 +42,11 @@ BoolParamWidget::BoolParamWidget(std::shared_ptr<AssetParameterModel> model, QMo
// emit the signal of the base class when appropriate
connect(this->m_checkBox, &QCheckBox::stateChanged, this, [this](int state) {
// To represent 'checked' status, Qt uses number '2', but
// the boolean parameters in MLT effects use number '1'
if (state == 2) {
state = 1;
}
emit valueChanged(m_index, QString::number(state), true); });
}
......
......@@ -3715,6 +3715,10 @@ void Bin::showTitleWidget(const std::shared_ptr<ProjectClip> &clip)
newprops.insert(QStringLiteral("kdenlive:duration"), clip->framesToTime(dia_ui.duration()));
}
}
if (clip->clipName().contains(i18n("(copy)"))) {
// We edited a duplicated title clip, update name from new content text
newprops.insert(QStringLiteral("kdenlive:clipname"), dia_ui.titleSuggest());
}
// trigger producer reload
newprops.insert(QStringLiteral("force_reload"), QStringLiteral("2"));
if (!path.isEmpty()) {
......
......@@ -1068,7 +1068,7 @@ void SubtitleModel::switchLocked()
m_subtitleFilter->set("kdenlive:locked", isLocked ? 0 : 1);
// En/disable snapping on lock
std::vector<std::weak_ptr<SnapInterface>> validSnapModels;
/*std::vector<std::weak_ptr<SnapInterface>> validSnapModels;
for (const auto &snapModel : m_regSnaps) {
if (auto ptr = snapModel.lock()) {
validSnapModels.push_back(snapModel);
......@@ -1093,7 +1093,7 @@ void SubtitleModel::switchLocked()
int id = m_selected.takeFirst();
updateSub(id, {SelectedRole});
}
}
}*/
}
......@@ -1117,3 +1117,11 @@ void SubtitleModel::loadProperties(QMap<QString, QString> subProperties)
++i;
}
}
void SubtitleModel::allSnaps(std::vector<int> &snaps)
{
for (const auto &subtitle : m_subtitleList) {
snaps.push_back(subtitle.first.frames(pCore->getCurrentFps()));
snaps.push_back(subtitle.second.second.frames(pCore->getCurrentFps()));
}
}
......@@ -137,6 +137,8 @@ public:
bool isLocked() const;
/** @brief Load some subtitle filter properties from file */
void loadProperties(QMap<QString, QString> subProperties);
/** @brief Add all subtitle items to snaps */
void allSnaps(std::vector<int> &snaps);
public slots:
/** @brief Function that parses through a subtitle file */
......
......@@ -80,6 +80,7 @@ void Core::build(bool isAppImage, const QString &MltPath)
qRegisterMetaType<audioShortVector>("audioShortVector");
qRegisterMetaType<QVector<double>>("QVector<double>");
qRegisterMetaType<QList<QAction*>>("QList<QAction*>");
qRegisterMetaType<MessageType>("MessageType");
qRegisterMetaType<stringMap>("stringMap");
qRegisterMetaType<audioByteArray>("audioByteArray");
......@@ -991,3 +992,9 @@ void Core::temporaryUnplug(QList<int> clipIds, bool hide)
{
pCore->window()->getMainTimeline()->controller()->temporaryUnplug(clipIds, hide);
}
void Core::transcodeFile(const QString url)
{
qDebug()<<"=== TRANSCODING: "<<url;
pCore->window()->slotTranscode({url});
}
......@@ -239,7 +239,8 @@ public:
void temporaryUnplug(QList<int> clipIds, bool hide);
/** @brief Returns the current doc's subtitle model. */
std::shared_ptr<SubtitleModel> getSubtitleModel(bool enforce = false);
/** @brief Transcode a video file. */
void transcodeFile(const QString url);
KSharedDataCache audioThumbCache;
private:
......
......@@ -1101,6 +1101,10 @@ void KdenliveSettingsDialog::updateSettings()
emit pCore->autoScrollChanged();
}
if (m_configTimeline.kcfg_pauseonseek->isChecked() != KdenliveSettings::pauseonseek()) {
KdenliveSettings::setPauseonseek(m_configTimeline.kcfg_pauseonseek->isChecked());
}
// Mimes
if (m_configEnv.kcfg_addedExtensions->text() != KdenliveSettings::addedExtensions()) {
// Update list
......
......@@ -113,6 +113,63 @@ void EffectStackModel::removeCurrentEffect()
}
}
void EffectStackModel::removeAllEffects(Fun &undo, Fun & redo)
{
QWriteLocker locker(&m_lock);
int current = -1;
if (auto srv = m_masterService.lock()) {
current = srv->get_int("kdenlive:activeeffect");
}
while (rootItem->childCount() > 0) {
std::shared_ptr<EffectItemModel> effect = std::static_pointer_cast<EffectItemModel>(rootItem->child(0));
int parentId = -1;
if (auto ptr = effect->parentItem().lock()) parentId = ptr->getId();
Fun local_undo = addItem_lambda(effect, parentId);
Fun local_redo = removeItem_lambda(effect->getId());
local_redo();
UPDATE_UNDO_REDO(local_redo, local_undo, undo, redo);
}
std::unordered_set<int> fadeIns = m_fadeIns;
std::unordered_set<int> fadeOuts = m_fadeOuts;
Fun undo_current = [this, current, fadeIns, fadeOuts]() {
if (auto srv = m_masterService.lock()) {
srv->set("kdenlive:activeeffect", current);
}
m_fadeIns = fadeIns;
m_fadeOuts = fadeOuts;
QVector<int> roles = {TimelineModel::EffectNamesRole};
if (!m_fadeIns.empty()) {
roles << TimelineModel::FadeInRole;
}
if (!m_fadeOuts.empty()) {
roles << TimelineModel::FadeOutRole;
}
emit dataChanged(QModelIndex(), QModelIndex(), roles);
pCore->updateItemKeyframes(m_ownerId);
return true;
};
Fun redo_current = [this]() {
if (auto srv = m_masterService.lock()) {
srv->set("kdenlive:activeeffect", -1);
}
QVector<int> roles = {TimelineModel::EffectNamesRole};
if (!m_fadeIns.empty()) {
roles << TimelineModel::FadeInRole;
}
if (!m_fadeOuts.empty()) {
roles << TimelineModel::FadeOutRole;
}
m_fadeIns.clear();
m_fadeOuts.clear();
emit dataChanged(QModelIndex(), QModelIndex(), roles);
pCore->updateItemKeyframes(m_ownerId);
return true;
};
redo_current();
PUSH_LAMBDA(redo_current, redo);
PUSH_LAMBDA(undo_current, undo);
}
void EffectStackModel::removeEffect(const std::shared_ptr<EffectItemModel> &effect)
{
qDebug() << "* * ** REMOVING EFFECT FROM STACK!!!\n!!!!!!!!!";
......
......@@ -144,6 +144,9 @@ public:
/* @brief Return true if an asset id is already added to this effect stack */
bool hasEffect(const QString &assetId) const;
/* @brief Remove all effects for this stack */
void removeAllEffects(Fun &undo, Fun & redo);
public slots:
/* @brief Delete an effect from the stack */
......
......@@ -419,21 +419,14 @@ bool LoadJob::startJob()
m_producer.reset();
}
qDebug()<<"=== MAX DURATION: "<<INT_MAX<<", DURATION: "<<(INT_MAX / 25 / 60);
QAction *ac = new QAction(i18n("Transcode"), this);
connect(ac, &QAction::triggered, [&]() {
pCore->transcodeFile(m_resource);
});
QList<QAction*>actions = {ac};
QMetaObject::invokeMethod(pCore.get(), "displayBinMessage", Qt::QueuedConnection, Q_ARG(QString, i18n("Cannot get duration for file %1", m_resource)),
Q_ARG(int, (int)KMessageWidget::Warning));
m_errorMessage.append(i18n("ERROR: Could not load clip %1: producer is invalid", m_resource));
return false;
}
if (m_producer->get_length() == INT_MAX && m_producer->get("eof") == QLatin1String("loop")) {
// This is a live source or broken clip
m_done = true;
m_successful = false;
if (m_producer) {
m_producer.reset();
}
qDebug()<<"=== MAX DURATION: "<<INT_MAX<<", DURATION: "<<(INT_MAX / 25 / 60);
QMetaObject::invokeMethod(pCore.get(), "displayBinMessage", Qt::QueuedConnection, Q_ARG(QString, i18n("Cannot get duration for file %1", m_resource)),
Q_ARG(int, (int)KMessageWidget::Warning));
Q_ARG(int, (int)KMessageWidget::Warning), Q_ARG(QList<QAction*>, actions));
m_errorMessage.append(i18n("ERROR: Could not load clip %1: producer is invalid", m_resource));
return false;
}
......
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