-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
69 lines (61 loc) · 2.37 KB
/
Copy pathmainwindow.h
File metadata and controls
69 lines (61 loc) · 2.37 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QHBoxLayout>
#include "audio.h"
/*
* File: mainwindow.h
* Description:
* This header file defines the 'MainWindow' class, which provides the main UI for the
* application. It inherits from QMainWindow and creates two instances of the 'Audio'
* class to represent dual Audio widgets. It uses a vertical layout (QVBoxLayout) for
* organization and embeds the Audio widgets.
*
* Purpose:
* - Serves as primary UI, enabling interactions with audio playback
* - Organizes main layout within a 'QVBoxLayout'
* - Initializes and manages child components for the two Audio objects
*
* Key Members:
* - 'QVBoxLayout *mainLayout': Vertical layout for arranging UI elements (audio players)
* - 'Audio *audio1': First audio player widget
* - 'Audio *audio2': Second audio player widget
*
* Public Methods:
* - 'MainWindow(QWidget *parent = nullptr)': Constructor to initialize main window layout
* - '~MainWindow()': Destructor to clean resources
*
* Slots:
* - 'void audio2ConnectAllowed(bool secondAudioExists)': emits a signal that the first audio
* can enable the align audio checkbox if there is a second audio available
* - 'void audio2Connect(bool connectAudios)': connects or disconnects the controls for the first audio
* to the second
* - 'void handleEndOfAudio2(bool disc)': connects/disconnects the second audio playing from the first incase the
* audios are two different sizes or are played simultaniously from different position and the second ends before
* the first.
* Signals:
* - 'void disableAudio2(bool disableAudio)': sends a signal to enable/disable audio2 controls when the audio1 controls have taken over
* - 'void canEnableAudioAlignment(bool enable)': signal that the checkbox for aligning audio can be enabled on audio1 if audio2 exists
*
* References:
* -...
*/
class MainWindow : public QMainWindow
{
Q_OBJECT
QVBoxLayout *mainLayout;
Audio *audio1;
Audio *audio2;
bool connected;
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
public slots:
void audio2ConnectAllowed(bool secondAudioExists);
void audio2Connect(bool connectAudios);
void handleEndOfAudio2(bool disc);
signals:
void disableAudio2(bool disableAudio);
void canEnableAudioAlignment(bool enable);
};
#endif // MAINWINDOW_H