New Text source

Initial implementation of Text Source, displaying free text or subtitle file. support for Pango font description and formatting tags via gstreamer textoverlay plugin. Saving and loading in XML, GUI for creation (in patterns) and for editing.
This commit is contained in:
Bruno Herbelin
2023-11-12 01:15:54 +01:00
parent f497da7967
commit d39064b209
28 changed files with 1141 additions and 19 deletions

View File

@@ -40,6 +40,7 @@
#include "NetworkSource.h"
#include "SrtReceiverSource.h"
#include "MultiFileSource.h"
#include "TextSource.h"
#include "Session.h"
#include "BaseToolkit.h"
#include "SystemToolkit.h"
@@ -499,3 +500,32 @@ void InfoVisitor::visit (SrtReceiverSource& s)
information_ = oss.str();
current_id_ = s.id();
}
void InfoVisitor::visit (TextSource& s)
{
if (current_id_ == s.id())
return;
std::ostringstream oss;
TextContents *ptn = s.contents();
if (ptn) {
if (ptn->failed())
oss << ptn->description() << std::endl << ptn->log();
else {
if (brief_) {
oss << "RGBA, " << ptn->width() << " x " << ptn->height();
}
else {
oss << (ptn->isSubtitle() ? "Subtitle " : "Free text") << std::endl;
oss << "RGBA" << std::endl;
oss << ptn->width() << " x " << ptn->height();
}
}
}
else
oss << "Undefined";
information_ = oss.str();
current_id_ = s.id();
}