Song handling simplification
Add languge field to songs Add lyric display
This commit is contained in:
parent
134e827053
commit
1fec61140c
13 changed files with 384 additions and 231 deletions
|
|
@ -6,6 +6,9 @@
|
|||
#include <QThreadPool>
|
||||
#include <QString>
|
||||
#include <QJsonObject>
|
||||
#include <QMutex>
|
||||
|
||||
#include "SongItem.h"
|
||||
|
||||
class AceStepWorker : public QObject
|
||||
{
|
||||
|
|
@ -14,39 +17,38 @@ public:
|
|||
explicit AceStepWorker(QObject *parent = nullptr);
|
||||
~AceStepWorker();
|
||||
|
||||
void generateSong(const QString &caption, const QString &lyrics, const QString &jsonTemplate,
|
||||
void generateSong(const SongItem& song, const QString &jsonTemplate,
|
||||
const QString &aceStepPath, const QString &qwen3ModelPath,
|
||||
const QString &textEncoderModelPath, const QString &ditModelPath,
|
||||
const QString &vaeModelPath);
|
||||
void cancelGeneration();
|
||||
bool songGenerateing(SongItem* song);
|
||||
|
||||
signals:
|
||||
void songGenerated(const QString &filePath);
|
||||
void songGenerated(const SongItem& song);
|
||||
void generationFinished();
|
||||
void generationError(const QString &error);
|
||||
void progressUpdate(int percent);
|
||||
|
||||
private slots:
|
||||
void workerFinished();
|
||||
void progressUpdate(int percent);
|
||||
|
||||
private:
|
||||
class Worker : public QRunnable {
|
||||
public:
|
||||
Worker(AceStepWorker *parent, const QString &caption, const QString &lyrics, const QString &jsonTemplate,
|
||||
Worker(AceStepWorker *parent, const SongItem& song, const QString &jsonTemplate,
|
||||
const QString &aceStepPath, const QString &qwen3ModelPath,
|
||||
const QString &textEncoderModelPath, const QString &ditModelPath,
|
||||
const QString &vaeModelPath)
|
||||
: parent(parent), caption(caption), lyrics(lyrics), jsonTemplate(jsonTemplate),
|
||||
: parent(parent), song(song), jsonTemplate(jsonTemplate),
|
||||
aceStepPath(aceStepPath), qwen3ModelPath(qwen3ModelPath),
|
||||
textEncoderModelPath(textEncoderModelPath), ditModelPath(ditModelPath),
|
||||
vaeModelPath(vaeModelPath) {}
|
||||
|
||||
void run() override;
|
||||
|
||||
const SongItem& getSong();
|
||||
|
||||
private:
|
||||
AceStepWorker *parent;
|
||||
QString caption;
|
||||
QString lyrics;
|
||||
SongItem song;
|
||||
QString jsonTemplate;
|
||||
QString aceStepPath;
|
||||
QString qwen3ModelPath;
|
||||
|
|
@ -54,7 +56,8 @@ private:
|
|||
QString ditModelPath;
|
||||
QString vaeModelPath;
|
||||
};
|
||||
|
||||
|
||||
QMutex workerMutex;
|
||||
Worker *currentWorker;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue