-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmainwindow.h
More file actions
42 lines (36 loc) · 1.12 KB
/
mainwindow.h
File metadata and controls
42 lines (36 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "ui_mainwindow.h"
#include <QMediaDevices>
#include <QAudioDevice>
#include <QMainWindow>
#include <memory> //for std::unique_ptr
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent, const char *config_file);
~MainWindow() noexcept override;
private slots:
void closeEvent(QCloseEvent *ev) override;
void toggleRecording();
void deviceChanged() const;
void checkAudioFormat(bool showModal);
private:
// Audio device handling
[[nodiscard]] QAudioDevice currentDevice() const;
void setFmt(const QAudioFormat &fmt) const;
[[nodiscard]] QAudioFormat selectedAudioFormat() const;
// void updateSampleRates();
// function for loading / saving the config file
QString find_config_file(const char *filename);
void load_config(const QString &filename) const;
void save_config(const QString &filename) const;
std::unique_ptr<class LslPusher> reader;
std::unique_ptr<class QAudioSource> audiosrc;
std::unique_ptr<Ui::MainWindow> ui; // window pointer
QList<QAudioDevice> devices;
};
#endif // MAINWINDOW_H