Compare commits
3 commits
4cacaa04e4
...
6be80f1d5c
| Author | SHA1 | Date | |
|---|---|---|---|
| 6be80f1d5c | |||
| 6ef8591769 | |||
| 9e0b8b4197 |
3 changed files with 8 additions and 3 deletions
|
|
@ -242,7 +242,7 @@ void MainWindow::on_playButton_clicked()
|
|||
|
||||
void MainWindow::on_pauseButton_clicked()
|
||||
{
|
||||
if (isPlaying && !isPaused)
|
||||
if (isPlaying && !isPaused && audioPlayer->isPlaying())
|
||||
{
|
||||
// Pause playback
|
||||
audioPlayer->pause();
|
||||
|
|
@ -311,6 +311,7 @@ void MainWindow::on_songListView_doubleClicked(const QModelIndex &index)
|
|||
|
||||
if (index.column() == 0)
|
||||
{
|
||||
isPaused = false;
|
||||
if (isPlaying)
|
||||
{
|
||||
audioPlayer->stop();
|
||||
|
|
@ -318,8 +319,8 @@ void MainWindow::on_songListView_doubleClicked(const QModelIndex &index)
|
|||
else
|
||||
{
|
||||
isPlaying = true;
|
||||
updateControls();
|
||||
}
|
||||
updateControls();
|
||||
|
||||
flushGenerationQueue();
|
||||
ui->nowPlayingLabel->setText("Now Playing: Waiting for generation...");
|
||||
|
|
@ -407,6 +408,7 @@ void MainWindow::playSong(const SongItem& song)
|
|||
ui->nowPlayingLabel->setText("Now Playing: " + song.caption);
|
||||
ui->lyricsTextEdit->setPlainText(song.lyrics);
|
||||
ui->jsonTextEdit->setPlainText(song.json);
|
||||
updateControls();
|
||||
}
|
||||
|
||||
void MainWindow::songGenerated(const SongItem& song)
|
||||
|
|
|
|||
|
|
@ -178,6 +178,9 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pauseButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Pause</string>
|
||||
</property>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "SongItem.h"
|
||||
|
||||
SongItem::SongItem(const QString &caption, const QString &lyrics)
|
||||
: caption(caption), lyrics(lyrics), cotCaption(true)
|
||||
: caption(caption), lyrics(lyrics), cotCaption(true), bpm(0)
|
||||
{
|
||||
uniqueId = QRandomGenerator::global()->generate64();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue