Formats minimally release source files based on former clang-format
This commit is contained in:
387 files changed
+37323
-38074
No files matched your search
+58
-76
@@ -10,122 +10,104 @@ class QWidget;
|
||||
|
||||
namespace TopicEditorBase
|
||||
{
|
||||
class ExportNotifier;
|
||||
class ExportNotifier;
|
||||
}
|
||||
|
||||
namespace TopicReplay
|
||||
{
|
||||
|
||||
class Interface
|
||||
{
|
||||
class Interface
|
||||
{
|
||||
|
||||
public:
|
||||
static QJsonObject timeRange(qint64 start, qint64 end)
|
||||
{
|
||||
return {{QStringLiteral("start"), start}, {QStringLiteral("end"), end}};
|
||||
}
|
||||
static QJsonObject timeRange(qint64 start, qint64 end) { return {{QStringLiteral("start"), start}, {QStringLiteral("end"), end}}; }
|
||||
|
||||
struct SituationReplayTime
|
||||
{
|
||||
int id = 0;
|
||||
int id = 0;
|
||||
|
||||
qint64 topicStart_s = -1;
|
||||
qint64 topicEnd_s = -1;
|
||||
qint64 topicStart_s = -1;
|
||||
qint64 topicEnd_s = -1;
|
||||
|
||||
qint64 replayStart_ms = -1;
|
||||
qint64 replayEnd_ms = -1;
|
||||
double replaySpeedFactor = 1;
|
||||
qint64 replayStart_ms = -1;
|
||||
qint64 replayEnd_ms = -1;
|
||||
double replaySpeedFactor = 1;
|
||||
|
||||
QJsonObject toReplayInformation() const
|
||||
{
|
||||
return {
|
||||
{QStringLiteral("id"), id},
|
||||
{QStringLiteral("timeInPresentation"), timeRange(topicStart_s * 1000, topicEnd_s * 1000)},
|
||||
};
|
||||
}
|
||||
QJsonObject toReplayInformation() const
|
||||
{
|
||||
return {
|
||||
{QStringLiteral("id"), id},
|
||||
{QStringLiteral("timeInPresentation"), timeRange(topicStart_s * 1000, topicEnd_s * 1000)},
|
||||
};
|
||||
}
|
||||
|
||||
QJsonObject toPlaybackTime(double max) const
|
||||
{
|
||||
QJsonObject ret = timeRange(replayStart_ms, std::min(replayEnd_ms * replaySpeedFactor, max));
|
||||
ret[QStringLiteral("replaySpeedFactor")] = replaySpeedFactor;
|
||||
return ret;
|
||||
}
|
||||
QJsonObject toPlaybackTime(double max) const
|
||||
{
|
||||
QJsonObject ret = timeRange(replayStart_ms, std::min(replayEnd_ms * replaySpeedFactor, max));
|
||||
ret[QStringLiteral("replaySpeedFactor")] = replaySpeedFactor;
|
||||
return ret;
|
||||
}
|
||||
|
||||
QJsonObject toJson(double maxReplayEndMs) const
|
||||
{
|
||||
return {
|
||||
{QStringLiteral("playbackTime"), toPlaybackTime(maxReplayEndMs)},
|
||||
{QStringLiteral("replayInformation"), toReplayInformation()},
|
||||
};
|
||||
}
|
||||
QJsonObject toJson(double maxReplayEndMs) const
|
||||
{
|
||||
return {
|
||||
{QStringLiteral("playbackTime"), toPlaybackTime(maxReplayEndMs)},
|
||||
{QStringLiteral("replayInformation"), toReplayInformation()},
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Interface() = default;
|
||||
virtual ~Interface() = default;
|
||||
|
||||
virtual QWidget* createWidget()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
virtual QWidget *createWidget() { return nullptr; }
|
||||
|
||||
virtual bool playbackInit(const QJsonObject& attributes)
|
||||
virtual bool playbackInit(const QJsonObject &attributes)
|
||||
{
|
||||
Q_UNUSED(attributes);
|
||||
return true;
|
||||
Q_UNUSED(attributes);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool playbackStart(int secondsOffset)
|
||||
{
|
||||
Q_UNUSED(secondsOffset);
|
||||
return true;
|
||||
Q_UNUSED(secondsOffset);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool playbackPause()
|
||||
virtual bool playbackPause() { return true; }
|
||||
|
||||
virtual bool playbackStop() { return true; }
|
||||
|
||||
virtual void setExportPlaybackTimes(qint64 startTimeSec, qint64 durationSec, const QVector<SituationReplayTime> &sitReplayTimes)
|
||||
{
|
||||
return true;
|
||||
Q_UNUSED(startTimeSec);
|
||||
Q_UNUSED(durationSec);
|
||||
Q_UNUSED(sitReplayTimes);
|
||||
}
|
||||
|
||||
virtual bool playbackStop()
|
||||
virtual bool exportTopic(const QJsonObject &attributes, const QString &strFolderPath, TopicEditorBase::ExportNotifier *pExportNotifier) = 0;
|
||||
|
||||
virtual QVector<TopicEditorBase::TopicData> additionalTrackEntries(const QJsonObject &attributes) const
|
||||
{
|
||||
return true;
|
||||
Q_UNUSED(attributes);
|
||||
return {};
|
||||
}
|
||||
|
||||
virtual void setExportPlaybackTimes(qint64 startTimeSec, qint64 durationSec,
|
||||
const QVector<SituationReplayTime>& sitReplayTimes)
|
||||
virtual QVector<TopicEditorBase::TopicData> additionalTrackEntries(const QJsonObject &attributes, bool &keepOriginalTopic) const
|
||||
{
|
||||
Q_UNUSED(startTimeSec);
|
||||
Q_UNUSED(durationSec);
|
||||
Q_UNUSED(sitReplayTimes);
|
||||
keepOriginalTopic = true;
|
||||
return additionalTrackEntries(attributes);
|
||||
}
|
||||
|
||||
virtual bool exportTopic(const QJsonObject& attributes, const QString& strFolderPath,
|
||||
TopicEditorBase::ExportNotifier* pExportNotifier) = 0;
|
||||
virtual void setBasePath(const QString &basePath) { Q_UNUSED(basePath); }
|
||||
};
|
||||
|
||||
virtual QVector<TopicEditorBase::TopicData> additionalTrackEntries(const QJsonObject& attributes) const
|
||||
{
|
||||
Q_UNUSED(attributes);
|
||||
return {};
|
||||
}
|
||||
|
||||
virtual QVector<TopicEditorBase::TopicData> additionalTrackEntries(const QJsonObject& attributes,
|
||||
bool& keepOriginalTopic) const
|
||||
{
|
||||
keepOriginalTopic = true;
|
||||
return additionalTrackEntries(attributes);
|
||||
}
|
||||
|
||||
virtual void setBasePath(const QString& basePath)
|
||||
{
|
||||
Q_UNUSED(basePath);
|
||||
}
|
||||
};
|
||||
|
||||
class Factory
|
||||
{
|
||||
class Factory
|
||||
{
|
||||
|
||||
public:
|
||||
virtual ~Factory() = default;
|
||||
virtual Interface* createInterface(TopicEditorBase::TopicType topicType) = 0;
|
||||
};
|
||||
virtual Interface *createInterface(TopicEditorBase::TopicType topicType) = 0;
|
||||
};
|
||||
|
||||
} // namespace TopicReplay
|
||||
Reference in new issue
Block a user