AudibleT 0.0.1
A real-time A/B/X audio testing tool for subjective assessment of various audio parameters, compatible for general purpose computer as well as embedded systems.
Loading...
Searching...
No Matches
TestingWindow.h
Go to the documentation of this file.
1//=======================================================================
29//=======================================================================
30
31#ifndef TESTINGWINDOW_H
32#define TESTINGWINDOW_H
33
34#include <QElapsedTimer>
35#include <QLabel>
36#include <QPushButton>
37#include <QSpinBox>
38#include <QWidget>
39
40#include "AudioFile.h"
41#include "BaseFilter.h"
42#include "CustomComboBox.h"
43#include "DatabaseManager.h"
44#include "FilterType.h"
45#include "JackWorker.h"
46#include "SessionType.h"
47#include "TrackType.h"
48
58class TestingWindow : public QWidget
59{
60 Q_OBJECT
61public:
62 explicit TestingWindow(QWidget *parent = nullptr);
64
65 QWidget* createWidget();
66
67 void setDatabaseManager(DatabaseManager* manager);
68 void populateAudioFiles();
69
70 void updateSelectedAudioFile(QString filePath);
71 void updateSelectedFilterType(FilterType filterType);
72 void updateFilterParameters(int gain, int cutOffFrequency);
73
74signals:
76
77private:
78 QPushButton* startStopButton;
79 QSpinBox* numberOfTrialsSpinbox;
80 CustomComboBox *trackSelectionDropDown;
81
82 QLabel* attemptCountLabel;
83 QLabel* currentlyPlayinglabel;
84
85 // Database
86 DatabaseManager* dbManager;
87
88 // Threading
89 QThread* workerThread;
90 JackWorker* jackWorker;
91
92 QList<AudioSample> audioFiles;
93
94 AudioFile<float> currentAudioFileData;
95 QString selectedAudioFilePath;
96
97 int selectedAudioFileId;
98
99 FilterType activeFilterType = FilterType::HighShelf;
100 std::shared_ptr<BaseFilter> activeFilter;
101
102 TrackType buttonATrackType;
103 TrackType buttonBTrackType;
104
105 int maxTrialsCount = 5;
106 int currentTrialCursor = 0;
107
108 int gain = 6;
109 int cutOffFrequency = 8000;
110
111 int currentSession = -1;
112
113 QElapsedTimer responseTimer;
114
115private slots:
116 void shuffleTracks(TrackType &buttonATrackType, TrackType &buttonBTrackType);
117 void didSelectAudioFile(AudioSample audioSample);
118 void startPlayingTrackA();
119
120 void showErrorDialog(const QString &message);
121 void showSessionStartConfirmationDialog(const QString &message);
122 void showSessionStopConfirmationDialog(const QString &message);
123 void showSessionEarlyEndConfirmationDialog(const QString &message);
124 void startTestingSessionAction();
125 void stopTestingSessionAction();
126 void startResponseTimer();
127 void restartResponseTimer();
128
129 bool loadSelectedAudioFile(QString filePath);
130};
131
132
133#endif // TESTINGWINDOW_H
134
Definition: AudioFile.h:82
A custom QComboBox with modified popup behavior.
Definition: CustomComboBox.h:40
The DatabaseManager class manages the database operations for the audio testing application.
Definition: DatabaseManager.h:50
The JackWorker class is responsible for managing the Jack audio server and audio client engine.
Definition: JackWorker.h:55
Provides a widget for conducting testing sessions.
Definition: TestingWindow.h:59
void updateSelectedAudioFile(QString filePath)
Updates the selected audio file.
Definition: TestingWindow.cpp:402
void updateFilterParameters(int gain, int cutOffFrequency)
Updates filter parameters.
Definition: TestingWindow.cpp:418
void setDatabaseManager(DatabaseManager *manager)
Sets the database manager.
Definition: TestingWindow.cpp:374
QWidget * createWidget()
Creates the widget for the testing window.
Definition: TestingWindow.cpp:57
void populateAudioFiles()
Populates the list of audio files.
Definition: TestingWindow.cpp:379
void updateSelectedFilterType(FilterType filterType)
Updates the selected filter type.
Definition: TestingWindow.cpp:413
void didChangeTestingSessionState(SessionType sessionType)
Signal emitted when the testing session state changes.
Definition: moc_TestingWindow.cpp:316
~TestingWindow()
Destructor.
Definition: TestingWindow.cpp:52
SessionType
Represents the state of a testing session.
Definition: SessionType.h:41
FilterType
An enumeration of filter types.
Definition: FilterType.h:43
TrackType
Represents the type of audio track.
Definition: TrackType.h:45
Represents an audio sample retrieved from a database.
Definition: AudioSample.h:39