rename current text effect to textlegacy

This commit is contained in:
itsmattkc
2021-10-25 14:54:48 -07:00
parent e12e5db760
commit 4ed9ba5475
5 changed files with 26 additions and 32 deletions
+2 -2
View File
@@ -35,7 +35,7 @@
#include "generator/polygon/polygon.h"
#include "generator/shape/shapenode.h"
#include "generator/solid/solid.h"
#include "generator/text/text.h"
#include "generator/text/textlegacy.h"
#include "filter/blur/blur.h"
#include "filter/mosaic/mosaicfilternode.h"
#include "filter/stroke/stroke.h"
@@ -215,7 +215,7 @@ Node *NodeFactory::CreateFromFactoryIndex(const NodeFactory::InternalID &id)
case kStrokeFilter:
return new StrokeFilterNode();
case kTextGenerator:
return new TextGenerator();
return new TextGeneratorLegacy();
case kCrossDissolveTransition:
return new CrossDissolveTransition();
case kDipToColorTransition:
+2 -2
View File
@@ -16,7 +16,7 @@
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/generator/text/text.h
node/generator/text/text.cpp
node/generator/text/textlegacy.cpp
node/generator/text/textlegacy.h
PARENT_SCOPE
)
@@ -18,7 +18,7 @@
***/
#include "text.h"
#include "textlegacy.h"
#include <QAbstractTextDocumentLayout>
#include <QTextDocument>
@@ -31,14 +31,14 @@ enum TextVerticalAlign {
kVerticalAlignBottom,
};
const QString TextGenerator::kTextInput = QStringLiteral("text_in");
const QString TextGenerator::kHtmlInput = QStringLiteral("html_in");
const QString TextGenerator::kColorInput = QStringLiteral("color_in");
const QString TextGenerator::kVAlignInput = QStringLiteral("valign_in");
const QString TextGenerator::kFontInput = QStringLiteral("font_in");
const QString TextGenerator::kFontSizeInput = QStringLiteral("font_size_in");
const QString TextGeneratorLegacy::kTextInput = QStringLiteral("text_in");
const QString TextGeneratorLegacy::kHtmlInput = QStringLiteral("html_in");
const QString TextGeneratorLegacy::kColorInput = QStringLiteral("color_in");
const QString TextGeneratorLegacy::kVAlignInput = QStringLiteral("valign_in");
const QString TextGeneratorLegacy::kFontInput = QStringLiteral("font_in");
const QString TextGeneratorLegacy::kFontSizeInput = QStringLiteral("font_size_in");
TextGenerator::TextGenerator()
TextGeneratorLegacy::TextGeneratorLegacy()
{
AddInput(kTextInput, NodeValue::kText, tr("Sample Text"));
@@ -53,32 +53,27 @@ TextGenerator::TextGenerator()
AddInput(kFontSizeInput, NodeValue::kFloat, 72.0f);
}
Node *TextGenerator::copy() const
QString TextGeneratorLegacy::Name() const
{
return new TextGenerator();
return tr("Text (Legacy)");
}
QString TextGenerator::Name() const
{
return tr("Text");
}
QString TextGenerator::id() const
QString TextGeneratorLegacy::id() const
{
return QStringLiteral("org.olivevideoeditor.Olive.textgenerator");
}
QVector<Node::CategoryID> TextGenerator::Category() const
QVector<Node::CategoryID> TextGeneratorLegacy::Category() const
{
return {kCategoryGenerator};
}
QString TextGenerator::Description() const
QString TextGeneratorLegacy::Description() const
{
return tr("Generate rich text.");
}
void TextGenerator::Retranslate()
void TextGeneratorLegacy::Retranslate()
{
SetInputName(kTextInput, tr("Text"));
SetInputName(kHtmlInput, tr("Enable HTML"));
@@ -89,7 +84,7 @@ void TextGenerator::Retranslate()
SetComboBoxStrings(kVAlignInput, {tr("Top"), tr("Center"), tr("Bottom")});
}
void TextGenerator::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
void TextGeneratorLegacy::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
{
GenerateJob job;
job.InsertValue(value);
@@ -100,7 +95,7 @@ void TextGenerator::Value(const NodeValueRow &value, const NodeGlobals &globals,
}
}
void TextGenerator::GenerateFrame(FramePtr frame, const GenerateJob& job) const
void TextGeneratorLegacy::GenerateFrame(FramePtr frame, const GenerateJob& job) const
{
// This could probably be more optimized, but for now we use Qt to draw to a QImage.
// QImages only support integer pixels and we use float pixels, so what we do here is draw onto
@@ -25,15 +25,14 @@
namespace olive {
class TextGenerator : public Node
class TextGeneratorLegacy : public Node
{
Q_OBJECT
public:
TextGenerator();
TextGeneratorLegacy();
NODE_DEFAULT_DESTRUCTOR(TextGenerator)
virtual Node* copy() const override;
NODE_DEFAULT_DESTRUCTOR(TextGeneratorLegacy)
NODE_COPY_FUNCTION(TextGeneratorLegacy)
virtual QString Name() const override;
virtual QString id() const override;
+2 -2
View File
@@ -24,7 +24,7 @@
#include "node/factory.h"
#include "node/generator/shape/shapenode.h"
#include "node/generator/solid/solid.h"
#include "node/generator/text/text.h"
#include "node/generator/text/textlegacy.h"
#include "widget/timelinewidget/timelinewidget.h"
#include "widget/timelinewidget/undo/timelineundopointer.h"
@@ -138,7 +138,7 @@ void AddTool::MouseRelease(TimelineViewMouseEvent *event)
break;
case olive::Tool::kAddableTitle:
{
node_to_add = new TextGenerator();
node_to_add = new TextGeneratorLegacy();
break;
}
case olive::Tool::kAddableBars: