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()
|
void MainWindow::on_pauseButton_clicked()
|
||||||
{
|
{
|
||||||
if (isPlaying && !isPaused)
|
if (isPlaying && !isPaused && audioPlayer->isPlaying())
|
||||||
{
|
{
|
||||||
// Pause playback
|
// Pause playback
|
||||||
audioPlayer->pause();
|
audioPlayer->pause();
|
||||||
|
|
@ -311,6 +311,7 @@ void MainWindow::on_songListView_doubleClicked(const QModelIndex &index)
|
||||||
|
|
||||||
if (index.column() == 0)
|
if (index.column() == 0)
|
||||||
{
|
{
|
||||||
|
isPaused = false;
|
||||||
if (isPlaying)
|
if (isPlaying)
|
||||||
{
|
{
|
||||||
audioPlayer->stop();
|
audioPlayer->stop();
|
||||||
|
|
@ -318,8 +319,8 @@ void MainWindow::on_songListView_doubleClicked(const QModelIndex &index)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
isPlaying = true;
|
isPlaying = true;
|
||||||
updateControls();
|
|
||||||
}
|
}
|
||||||
|
updateControls();
|
||||||
|
|
||||||
flushGenerationQueue();
|
flushGenerationQueue();
|
||||||
ui->nowPlayingLabel->setText("Now Playing: Waiting for generation...");
|
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->nowPlayingLabel->setText("Now Playing: " + song.caption);
|
||||||
ui->lyricsTextEdit->setPlainText(song.lyrics);
|
ui->lyricsTextEdit->setPlainText(song.lyrics);
|
||||||
ui->jsonTextEdit->setPlainText(song.json);
|
ui->jsonTextEdit->setPlainText(song.json);
|
||||||
|
updateControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::songGenerated(const SongItem& song)
|
void MainWindow::songGenerated(const SongItem& song)
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,9 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pauseButton">
|
<widget class="QPushButton" name="pauseButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Pause</string>
|
<string>Pause</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include "SongItem.h"
|
#include "SongItem.h"
|
||||||
|
|
||||||
SongItem::SongItem(const QString &caption, const QString &lyrics)
|
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();
|
uniqueId = QRandomGenerator::global()->generate64();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue