diff --git a/src/AceStepWorker.cpp b/src/AceStepWorker.cpp index 7626070..837247b 100644 --- a/src/AceStepWorker.cpp +++ b/src/AceStepWorker.cpp @@ -109,6 +109,8 @@ 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)) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e79bb47..d2dd51d 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -698,7 +698,8 @@ bool MainWindow::savePlaylistToJson(const QString &filePath, const QList(song.uniqueId); // Store as qint64 for JSON compatibility + songObj["uniqueId"] = static_cast(song.uniqueId); + songObj["use_cot_caption"] = song.cotCaption; songsArray.append(songObj); } @@ -779,31 +780,20 @@ 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 c63b171..6f5db6b 100644 --- a/src/SongDialog.cpp +++ b/src/SongDialog.cpp @@ -5,21 +5,16 @@ #include "ui_SongDialog.h" #include -SongDialog::SongDialog(QWidget *parent, const QString &caption, const QString &lyrics, const QString &vocalLanguage) +SongDialog::SongDialog(QWidget *parent, const QString &caption, const QString &lyrics, const QString &vocalLanguage, bool cotEnabled) : QDialog(parent), ui(new Ui::SongDialog) { ui->setupUi(this); - // Set initial values if provided - if (!caption.isEmpty()) - { - ui->captionEdit->setPlainText(caption); - } - if (!lyrics.isEmpty()) - { - ui->lyricsEdit->setPlainText(lyrics); - } + ui->captionEdit->setPlainText(caption); + ui->lyricsEdit->setPlainText(lyrics); + + ui->checkBoxEnhanceCaption->setChecked(cotEnabled); // Setup vocal language combo box ui->vocalLanguageCombo->addItem("--", ""); // Unset @@ -110,6 +105,11 @@ 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 9090663..7230814 100644 --- a/src/SongDialog.h +++ b/src/SongDialog.h @@ -20,12 +20,13 @@ class SongDialog : public QDialog public: explicit SongDialog(QWidget *parent = nullptr, const QString &caption = "", const QString &lyrics = "", - const QString &vocalLanguage = ""); + const QString &vocalLanguage = "", bool cotEnabled = true); ~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 efedda8..8c0710a 100644 --- a/src/SongDialog.ui +++ b/src/SongDialog.ui @@ -1,109 +1,112 @@ - - 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 + + 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 + + + + + + + + + + diff --git a/src/SongItem.h b/src/SongItem.h index 71f7af8..7084e0f 100644 --- a/src/SongItem.h +++ b/src/SongItem.h @@ -16,10 +16,11 @@ public: uint64_t uniqueId; QString file; QString vocalLanguage; + bool cotCaption; QString json; inline SongItem(const QString &caption = "", const QString &lyrics = "") - : caption(caption), lyrics(lyrics) + : caption(caption), lyrics(lyrics), cotCaption(true) { // Generate a unique ID using a cryptographically secure random number uniqueId = QRandomGenerator::global()->generate64();