diff --git a/src/AceStepWorker.cpp b/src/AceStepWorker.cpp index 837247b..6dce972 100644 --- a/src/AceStepWorker.cpp +++ b/src/AceStepWorker.cpp @@ -109,8 +109,6 @@ bool AceStep::requestGeneration(SongItem song, QString requestTemplate, QString if (!song.vocalLanguage.isEmpty()) requestObj["vocal_language"] = song.vocalLanguage; - requestObj["use_cot_caption"] = song.cotCaption; - // Write the request file QFile requestFileHandle(request.requestFilePath); if (!requestFileHandle.open(QIODevice::WriteOnly | QIODevice::Text)) @@ -124,7 +122,7 @@ bool AceStep::requestGeneration(SongItem song, QString requestTemplate, QString QStringList qwen3Args; qwen3Args << "--request" << request.requestFilePath; - qwen3Args << "--lm" << qwen3ModelPath; + qwen3Args << "--model" << qwen3ModelPath; progressUpdate(30); @@ -180,7 +178,7 @@ void AceStep::qwenProcFinished(int code, QProcess::ExitStatus status) // Step 2: Run ace-synth to generate audio QStringList ditVaeArgs; ditVaeArgs << "--request"<(song.uniqueId); - songObj["use_cot_caption"] = song.cotCaption; + songObj["uniqueId"] = static_cast(song.uniqueId); // Store as qint64 for JSON compatibility songsArray.append(songObj); } @@ -780,20 +779,31 @@ bool MainWindow::loadPlaylistFromJson(const QString &filePath, QList & SongItem song; if (songObj.contains("caption")) + { song.caption = songObj["caption"].toString(); + } if (songObj.contains("lyrics")) + { song.lyrics = songObj["lyrics"].toString(); + } + // Load vocalLanguage if present if (songObj.contains("vocalLanguage")) + { song.vocalLanguage = songObj["vocalLanguage"].toString(); + } + // Load uniqueId if present (for backward compatibility) if (songObj.contains("uniqueId")) + { song.uniqueId = static_cast(songObj["uniqueId"].toInteger()); + } else + { + // Generate new ID for old playlists without uniqueId song.uniqueId = QRandomGenerator::global()->generate64(); - - song.cotCaption = songObj["use_cot_caption"].toBool(true); + } songs.append(song); } diff --git a/src/SongDialog.cpp b/src/SongDialog.cpp index 6f5db6b..c63b171 100644 --- a/src/SongDialog.cpp +++ b/src/SongDialog.cpp @@ -5,16 +5,21 @@ #include "ui_SongDialog.h" #include -SongDialog::SongDialog(QWidget *parent, const QString &caption, const QString &lyrics, const QString &vocalLanguage, bool cotEnabled) +SongDialog::SongDialog(QWidget *parent, const QString &caption, const QString &lyrics, const QString &vocalLanguage) : QDialog(parent), ui(new Ui::SongDialog) { ui->setupUi(this); - ui->captionEdit->setPlainText(caption); - ui->lyricsEdit->setPlainText(lyrics); - - ui->checkBoxEnhanceCaption->setChecked(cotEnabled); + // Set initial values if provided + if (!caption.isEmpty()) + { + ui->captionEdit->setPlainText(caption); + } + if (!lyrics.isEmpty()) + { + ui->lyricsEdit->setPlainText(lyrics); + } // Setup vocal language combo box ui->vocalLanguageCombo->addItem("--", ""); // Unset @@ -105,11 +110,6 @@ QString SongDialog::getVocalLanguage() const return ui->vocalLanguageCombo->currentData().toString(); } -bool SongDialog::getCotEnabled() const -{ - return ui->checkBoxEnhanceCaption->isChecked(); -} - void SongDialog::on_okButton_clicked() { // Validate that caption is not empty diff --git a/src/SongDialog.h b/src/SongDialog.h index 7230814..9090663 100644 --- a/src/SongDialog.h +++ b/src/SongDialog.h @@ -20,13 +20,12 @@ class SongDialog : public QDialog public: explicit SongDialog(QWidget *parent = nullptr, const QString &caption = "", const QString &lyrics = "", - const QString &vocalLanguage = "", bool cotEnabled = true); + const QString &vocalLanguage = ""); ~SongDialog(); QString getCaption() const; QString getLyrics() const; QString getVocalLanguage() const; - bool getCotEnabled() const; private slots: void on_okButton_clicked(); diff --git a/src/SongDialog.ui b/src/SongDialog.ui index 8c0710a..efedda8 100644 --- a/src/SongDialog.ui +++ b/src/SongDialog.ui @@ -1,112 +1,109 @@ - - SongDialog - - - - 0 - 0 - 500 - 410 - - - - Song Details - - - - - - 0 - - - - - Caption: - - - Qt::AlignmentFlag::AlignTop - - - - - - - Enhance Caption - - - true - - - - - - - - - - - - Lyrics (optional): - - - Qt::AlignmentFlag::AlignTop - - - - - - - - - - Vocal Language: - - - Qt::AlignmentFlag::AlignTop - - - - - - - true - - - - - - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - OK - - - - - - - Cancel - - - - - - - - - - + + SongDialog + + + + 0 + 0 + 500 + 400 + + + + Song Details + + + + + + Caption: + + + Qt::AlignTop + + + + + + + Enter song caption (e.g., "Upbeat pop rock anthem with driving electric guitars") + + + 80 + + + + + + + Lyrics (optional): + + + Qt::AlignTop + + + + + + + Enter lyrics or leave empty for instrumental music + + + 150 + + + + + + + Vocal Language: + + + Qt::AlignTop + + + + + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + \ No newline at end of file diff --git a/src/SongItem.h b/src/SongItem.h index 7084e0f..71f7af8 100644 --- a/src/SongItem.h +++ b/src/SongItem.h @@ -16,11 +16,10 @@ public: uint64_t uniqueId; QString file; QString vocalLanguage; - bool cotCaption; QString json; inline SongItem(const QString &caption = "", const QString &lyrics = "") - : caption(caption), lyrics(lyrics), cotCaption(true) + : caption(caption), lyrics(lyrics) { // Generate a unique ID using a cryptographically secure random number uniqueId = QRandomGenerator::global()->generate64();