Browse Source

fixes for Qt6 and building without sound

master
Brad Parker 3 years ago
parent
commit
6ced24018d
  1. 4
      frontend/audio.cpp
  2. 6
      reference_frontend.pro

4
frontend/audio.cpp

@ -43,11 +43,15 @@ void MainWindow::audioStateChanged(QAudio::State state) {
#endif
void MainWindow::onAudioSample(int16_t left, int16_t right) {
#ifndef NO_SOUND
m_audioStream->write(reinterpret_cast<const char*>(left), sizeof(int16_t));
m_audioStream->write(reinterpret_cast<const char*>(right), sizeof(int16_t));
#endif
}
void MainWindow::onAudioSampleBatch(const int16_t *data, size_t frames) {
#ifndef NO_SOUND
// each "frame" is two int16_t's (one for each channel of a stereo track)
m_audioStream->write(reinterpret_cast<const char*>(data), frames * sizeof(int16_t) * 2);
#endif
}

6
reference_frontend.pro

@ -16,7 +16,11 @@
TEMPLATE = app
QT += gui widgets
QT += gui widgets opengl
greaterThan(QT_MAJOR_VERSION, 5) {
QT += openglwidgets
}
TARGET = reference_frontend

Loading…
Cancel
Save