1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-07-25 13:24:23 +00:00

Makes an unsuccessful attempt at producing audio.

On the plus side, it does seem successfully to sniff out an appropriate audio format and to communicate mono/stereo onward.
This commit is contained in:
Thomas Harte
2020-06-06 19:19:01 -04:00
parent e47cb91223
commit 378ff39e5e
3 changed files with 50 additions and 2 deletions

View File

@@ -1,7 +1,9 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QAudioOutput>
#include <QMainWindow>
#include <memory>
#include "timer.h"
#include "ui_mainwindow.h"
@@ -13,7 +15,7 @@ QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow {
class MainWindow : public QMainWindow, public Outputs::Speaker::Speaker::Delegate {
Q_OBJECT
void createActions();
@@ -49,6 +51,11 @@ class MainWindow : public QMainWindow {
std::unique_ptr<Machine::DynamicMachine> machine;
std::mutex machineMutex;
std::unique_ptr<QAudioOutput> audioOutput;
QIODevice *audioIODevice = nullptr;
bool audioIs8bit = false, audioIsStereo = false;
void speaker_did_complete_samples(Outputs::Speaker::Speaker *speaker, const std::vector<int16_t> &buffer) override;
bool processEvent(QKeyEvent *);
private slots: