Skip to content

Commit

Permalink
[#934 fixed] Sound is not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Fanda Vacek committed Aug 2, 2023
1 parent 3d86252 commit efc8024
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion libquickevent/libquickeventgui/src/audio/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ void Player::playNext()
}

QString file = m_playlist.dequeue();
m_player->setSource(QUrl::fromLocalFile(file));
if (file.startsWith(':')) {
m_player->setSource(QUrl("qrc" + file));
}
else {
m_player->setSource(QUrl::fromLocalFile(file));
}
m_player->setPosition(0);
m_player->play();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,13 @@ CardReaderWidget::CardReaderWidget(QWidget *parent)
#ifdef QT_DEBUG
{
connect(ui->btTest, &QPushButton::clicked, this, &CardReaderWidget::onTestButtonClicked);
connect(ui->btTestSound, &QPushButton::clicked, this, [this]() {
audioPlayer()->playAlert(quickevent::gui::audio::Player::AlertKind::OperatorWakeUp);
});
}
#else
ui->btTest->hide();
ui->btTestSound->hide();
#endif

connect(getPlugin<CardReaderPlugin>(), &CardReader::CardReaderPlugin::siTaskFinished, this, &CardReaderWidget::onSiTaskFinished);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,17 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btTestSound">
<property name="text">
<string>Test sound</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btTest">
<property name="text">
<string>Test</string>
<string>Test punch</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit efc8024

Please sign in to comment.