AnnotationModel::AnnotationModel(QObject *parent) : QAbstractListModel{parent} {}
void AnnotationModel::setAnnotations(
- const PlayerFeaturePlauginInterface::AnnotationList &data) {
+ const PlayerFeaturePluginInterface::AnnotationList &data) {
beginResetModel();
m_data = data;
endResetModel();
if (!index.isValid())
return {};
- const PlayerFeaturePlauginInterface::Annotation &annotation =
+ const PlayerFeaturePluginInterface::Annotation &annotation =
m_data.at(index.row());
switch (role) {
case Qt::DisplayRole:
explicit AnnotationModel(QObject *parent = nullptr);
- void setAnnotations(const PlayerFeaturePlauginInterface::AnnotationList &);
+ void setAnnotations(const PlayerFeaturePluginInterface::AnnotationList &);
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex &parent = QModelIndex{}) const override;
QVariant data(const QModelIndex &index, int role) const override;
private:
- PlayerFeaturePlauginInterface::AnnotationList m_data;
+ PlayerFeaturePluginInterface::AnnotationList m_data;
};
#endif // ANNOTATIONMODEL_H
class Player : public QObject,
public PlayerPluginInterface,
public PlayerRendererInterface,
- public PlayerFeaturePlauginInterface {
+ public PlayerFeaturePluginInterface {
Q_OBJECT
Q_PROPERTY(QUrl currentSource READ currentSource WRITE load NOTIFY
currentSourceChanged)
FeaturePluginInstance *
FeatureAnnoations::createInstance(QObject *instance,
- PlayerFeaturePlauginInterface *interface) {
+ PlayerFeaturePluginInterface *interface) {
if (!valid)
throw std::exception{"Network failed to initialize"};
return new FeatureAnnoationsInstance(instance, interface);
}
FeatureAnnoationsInstance::FeatureAnnoationsInstance(
- QObject *instance, PlayerFeaturePlauginInterface *player, QObject *)
+ QObject *instance, PlayerFeaturePluginInterface *player, QObject *)
: FeaturePluginInstance{instance, player} {
qCDebug(annotationsCategory) << "Registering with instance" << instance;
qCDebug(annotationsVerboseCategory) << "Starting annotation detection...";
auto future = QtConcurrent::run(
- [](QImage image) -> PlayerFeaturePlauginInterface::AnnotationList {
+ [](QImage image) -> PlayerFeaturePluginInterface::AnnotationList {
try {
const int maxHeight{600};
if (image.size().height() > maxHeight)
// dlib::save_bmp(img, "testimage.bmp");
auto dets = net(img);
- PlayerFeaturePlauginInterface::AnnotationList al;
+ PlayerFeaturePluginInterface::AnnotationList al;
for (auto &&d : dets)
- al << PlayerFeaturePlauginInterface::Annotation{
+ al << PlayerFeaturePluginInterface::Annotation{
static_cast<double>(d.rect.left()) / image.size().width(),
static_cast<double>(d.rect.top()) / image.size().height(),
static_cast<double>(d.rect.right() - d.rect.left()) /
FeatureAnnoations(QObject *parent = nullptr);
FeaturePluginInstance *
- createInstance(QObject *instance, PlayerFeaturePlauginInterface *) override;
+ createInstance(QObject *instance, PlayerFeaturePluginInterface *) override;
};
class FeatureAnnoationsInstance : public QObject, public FeaturePluginInstance {
Q_OBJECT
public:
- FeatureAnnoationsInstance(QObject *instance, PlayerFeaturePlauginInterface *, QObject *parent = nullptr);
+ FeatureAnnoationsInstance(QObject *instance, PlayerFeaturePluginInterface *, QObject *parent = nullptr);
private slots:
void onFrameChanged(const QImage &);
double m_duration;
QTimer m_fpsTimer;
int m_fpsCounter = 0;
- QFutureWatcher<PlayerFeaturePlauginInterface::AnnotationList> m_watcher;
+ QFutureWatcher<PlayerFeaturePluginInterface::AnnotationList> m_watcher;
};
#endif // FeatureAnnoations_H
FeaturePluginInstance *
FeatureLocalMyList::createInstance(QObject *instance,
- PlayerFeaturePlauginInterface *interface) {
+ PlayerFeaturePluginInterface *interface) {
return new FeatureLocalMyListInstance(instance, interface);
}
}
FeatureLocalMyListInstance::FeatureLocalMyListInstance(
- QObject *instance, PlayerFeaturePlauginInterface *player, QObject *parent)
+ QObject *instance, PlayerFeaturePluginInterface *player, QObject *parent)
: FeaturePluginInstance{instance, player} {
Q_UNUSED(parent);
qCDebug(lmlCategory) << "Registering with instance" << instance;
FeatureLocalMyList(QObject *parent = nullptr);
FeaturePluginInstance *
- createInstance(QObject *instance, PlayerFeaturePlauginInterface *) override;
+ createInstance(QObject *instance, PlayerFeaturePluginInterface *) override;
};
class FeatureLocalMyListInstance : public QObject, public FeaturePluginInstance {
Q_OBJECT
public:
- FeatureLocalMyListInstance(QObject *instance, PlayerFeaturePlauginInterface *, QObject *parent = nullptr);
+ FeatureLocalMyListInstance(QObject *instance, PlayerFeaturePluginInterface *, QObject *parent = nullptr);
private slots:
void sourceChanged(const QUrl &source);
virtual ~FeaturePluginInstance() = default;
FeaturePluginInstance(QObject *player,
- PlayerFeaturePlauginInterface *interface)
+ PlayerFeaturePluginInterface *interface)
: m_player{player}, m_playerInterface{interface} {}
protected:
QObject *m_player;
- PlayerFeaturePlauginInterface *m_playerInterface;
+ PlayerFeaturePluginInterface *m_playerInterface;
};
class FeaturePluginBase {
virtual ~FeaturePluginBase() = default;
virtual FeaturePluginInstance *
- createInstance(QObject *instance, PlayerFeaturePlauginInterface *) = 0;
+ createInstance(QObject *instance, PlayerFeaturePluginInterface *) = 0;
};
#define ANIPLAYER_FEATURE_PLUGIN_INTERFACE_IID \
#include <QString>
#include <QList>
-class PlayerFeaturePlauginInterface {
+class PlayerFeaturePluginInterface {
public:
struct Annotation {
double x;
using AnnotationList = QList<Annotation>;
- virtual ~PlayerFeaturePlauginInterface() = default;
+ virtual ~PlayerFeaturePluginInterface() = default;
virtual void featureShowStatusMessage(const QString &message) = 0;