Added Pexels and ShaderToy API
This commit is contained in:
@@ -13,9 +13,22 @@ add_library(
|
||||
ShaderPackModel.cpp
|
||||
AudioModel.cpp
|
||||
AudioImageProvider.cpp
|
||||
AudioImageProvider.h
|
||||
ShaderPackMetadata.h
|
||||
ShaderPackMetadata.cpp
|
||||
GeometryProvider.cpp
|
||||
GeometryProvider.h
|
||||
PexelsImageMetadata.h
|
||||
PexelsImageSearch.h
|
||||
PexelsImageSearch.cpp
|
||||
PexelsVideoMetadata.h
|
||||
PexelsVideoModel.h
|
||||
PexelsVideoModel.cpp
|
||||
PexelsVideoSearch.h
|
||||
PexelsVideoSearch.cpp
|
||||
ShaderToyMetadata.h
|
||||
ShaderToySearchModel.h
|
||||
ShaderToySearchModel.cpp
|
||||
ShaderToyAPI.h
|
||||
PexelsAPI.h
|
||||
)
|
||||
|
||||
qt_add_qml_module(
|
||||
@@ -34,6 +47,21 @@ qt_add_qml_module(
|
||||
AudioModel.cpp
|
||||
AudioImageProvider.cpp
|
||||
ShaderPackMetadata.cpp
|
||||
GeometryProvider.cpp
|
||||
GeometryProvider.h
|
||||
PexelsImageMetadata.h
|
||||
PexelsImageSearch.h
|
||||
PexelsImageSearch.cpp
|
||||
PexelsVideoMetadata.h
|
||||
PexelsVideoModel.h
|
||||
PexelsVideoModel.cpp
|
||||
PexelsVideoSearch.h
|
||||
PexelsVideoSearch.cpp
|
||||
ShaderToyMetadata.h
|
||||
ShaderToySearchModel.h
|
||||
ShaderToySearchModel.cpp
|
||||
ShaderToyAPI.h
|
||||
PexelsAPI.h
|
||||
NO_GENERATE_PLUGIN_SOURCE
|
||||
)
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
#include "AudioModel.h"
|
||||
#include "AudioImageProvider.h"
|
||||
#include "ShaderPackModel.h"
|
||||
#include "PexelsVideoSearch.h"
|
||||
#include "PexelsImageSearch.h"
|
||||
#include "ShaderToySearchModel.h"
|
||||
#include "GeometryProvider.h"
|
||||
#include "Komplex_global.h"
|
||||
|
||||
AudioModel *komplexAudioSingletonProvider(QQmlEngine *engine, QJSEngine *scriptEngine)
|
||||
@@ -28,12 +32,26 @@ public:
|
||||
{
|
||||
Q_ASSERT(QLatin1String(uri) == QLatin1String("com.github.digitalartifex.komplex"));
|
||||
|
||||
char *stUri = new char[std::strlen(uri) + std::strlen(".ShaderToy")];
|
||||
std::sprintf(stUri, "%s.ShaderToy", uri);
|
||||
|
||||
char *pvUri = new char[std::strlen(uri) + std::strlen(".Pexels.Video")];
|
||||
std::sprintf(pvUri, "%s.Pexels.Video", uri);
|
||||
|
||||
char *piUri = new char[std::strlen(uri) + std::strlen(".Pexels.Image")];
|
||||
std::sprintf(piUri, "%s.Pexels.Image", uri);
|
||||
|
||||
qmlRegisterSingletonType<AudioModel*>(uri, 1, 0, "AudioModel", komplexAudioSingletonProvider);
|
||||
qmlRegisterType<ShaderPackModel>(uri, 1, 0, "ShaderPackModel");
|
||||
qmlRegisterType<GeometryProvider>(uri, 1, 0, "GeometryProvider");
|
||||
qmlRegisterType<ShaderToySearchModel>(stUri, 1, 0, "SearchModel");
|
||||
qmlRegisterType<PexelsVideoSearchModel>(pvUri, 1, 0, "SearchModel");
|
||||
qmlRegisterType<PexelsImageSearchModel>(piUri, 1, 0, "SearchModel");
|
||||
}
|
||||
|
||||
void unregisterTypes() override
|
||||
{
|
||||
AudioModel::stopCapture();
|
||||
}
|
||||
|
||||
void initializeEngine(QQmlEngine *engine, const char *uri) override
|
||||
|
||||
@@ -2,3 +2,6 @@ module com.github.digitalartifex.komplex
|
||||
plugin komplex
|
||||
classname AudioModel
|
||||
classname ShaderPackModel
|
||||
classname PexelsImageSearchModel
|
||||
classname PexelsVideoSearchModel
|
||||
classname ShaderToySearchModel
|
||||
Reference in New Issue
Block a user