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

Don't allow typewriter effect on clip other than text (caused a freeze)

parent ba91915e
<!DOCTYPE kpartgui>
<effect tag="typewriter" id="typewriter" type="video" unique="1">
<effect tag="typewriter" id="typewriter" type="text" unique="1">
<name>TypeWriter</name>
<description>Typewriter effect v0.3.3</description>
<author>Rafal Lalik</author>
......
......@@ -87,7 +87,7 @@ enum EditMode { NormalEdit = 0, OverwriteEdit = 1, InsertEdit = 2 };
namespace AssetListType {
Q_NAMESPACE
enum AssetType { Preferred, Video, Audio, Custom, CustomAudio, Favorites, AudioComposition, VideoShortComposition, VideoComposition, AudioTransition, VideoTransition, Hidden = -1 };
enum AssetType { Preferred, Video, Audio, Custom, CustomAudio, Favorites, AudioComposition, VideoShortComposition, VideoComposition, AudioTransition, VideoTransition, Text, Hidden = -1 };
Q_ENUM_NS(AssetType)
}
......
......@@ -152,6 +152,8 @@ void EffectsRepository::parseCustomAssetFile(const QString &file_name, std::unor
}
file.close();
}
} else if (type == QLatin1String("text")) {
result.type = AssetListType::AssetType::Text;
}
customAssets[result.id] = result;
}
......
......@@ -728,6 +728,9 @@ bool ClipModel::addEffect(const QString &effectId)
} else if (m_currentState == PlaylistState::AudioOnly) {
return false;
}
if (type == AssetListType::AssetType::Text && m_clipType != ClipType::Text) {
return false;
}
m_effectStack->appendEffect(effectId, true);
return true;
}
......
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