setup electron app with boilerplate

This commit is contained in:
talksik
2026-02-19 19:41:26 -08:00
parent fc6a5e43db
commit 1f249c47a6
5174 changed files with 8743 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
#ifndef MEDIAPARTICLEGENERATOR_H
#define MEDIAPARTICLEGENERATOR_H
#include <QObject>
class Store;
QT_BEGIN_NAMESPACE
class QNetworkAccessManager;
class QFile;
class QNetworkReply;
QT_END_NAMESPACE
class MediaParticleGenerator : public QObject
{
Q_OBJECT
public:
explicit MediaParticleGenerator(Store *, QObject *parent = nullptr);
bool isGenerating() const;
public slots:
void generate(const QUrl &url, const QString &mimeType, const QString &networkId, qint64 durationMs, const QString &streamId);
signals:
void isGeneratingChanged();
void errorOccurred(const QString &message);
void complete();
private:
bool m_isGenerating = false;
void setGenerating(bool generating);
Store *m_store;
QNetworkAccessManager *m_qnam;
void onUploadUrlReceived(const QJsonDocument &response);
void onUploadComplete();
/// Does not support cancelling in flight, but will clean up after completion or error
void cleanup();
struct UploadInfo
{
QString networkId;
QString streamId;
QString mimeType;
qint64 durationMs;
QFile *file = nullptr;
QString objectId;
QString uploadUrl;
qint64 bytes;
};
UploadInfo *m_uploadInfo = nullptr;
};
#endif //MEDIAPARTICLEGENERATOR_H