-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmainwindow.h
144 lines (112 loc) · 3.51 KB
/
mainwindow.h
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QThread>
#include <QDateTime>
#include <QSettings>
#include <QProcess>
#include <QDir>
#include <QUdpSocket>
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QGraphicsProxyWidget>
#include <QMovie>
#include <QGraphicsOpacityEffect>
#include <QByteArray>
#include <QNetworkInterface>
#include <QFileDialog>
#include <QFontDialog>
#include <QGlib/Connect>
#include <QGst/Parse>
#include <QGst/Pipeline>
#include <QGst/Bus>
#include <QGst/Message>
#include "nanoKontrol2.h"
#include "cambox.h"
#include "jackthread.h"
#include "audioappsrc.h"
#include "videoappsrc.h"
#include "camconnectdialog.h"
#include "videoadjustmentdialog.h"
#include "videoeffectdialog.h"
namespace Ui {
class MainWindow;
}
struct camBoxMgmtData {
QGraphicsPixmapItem* pixmapItem;
QGraphicsOpacityEffect* opacityEffect;
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
JackThread* worker;
QDateTime startUp;
public slots:
void handleMidiEvent(char c0, char c1, char c2);
private slots:
// UI events
void textButtonToggled(bool checked);
void logoButtonToggled(bool checked);
void clockDisplayCheckboxToggled(bool checked);
void selectNewLogoFile();
void editTextFont();
void selectNewTextBackground();
void updateClockDisplay();
// Events by CamBoxes (and VideoPlayer maybe)
void fadeMeInHandler(bool fadeOutOthers = true, MediaSourceBase *sourceOverride = NULL);
void newOpacityHandler(qreal newValue);
void newVolumeHandler(qreal newValue);
void newPrelistenHandler(bool newState);
void newVideoFrame(QImage image);
void loopChangedHandler(bool newState);
void stateChangedHandler(QGst::State newState);
void playButtonBlinkTimerTimeout();
// UDP stuff
void newNotifyDatagram();
void broadcastSourceInfo();
void startCam(CamBox* cam, QHostAddress host, quint16 port);
// Audio and Video stuff
void prepareAudioData(uint length, char* data);
void prepareVideoData(uint length, char* data);
void encoderSliderValueChanged(int value);
void setEncoderBitrate(QString encoderName, int bitrate);
protected:
bool eventFilter(QObject *obj, QEvent *ev);
private:
Ui::MainWindow *ui;
QProcess* process;
QStringList arguments;
QList<CamBox*> allCamBoxes;
QList<MediaSourceBase*> allSources;
QList<QUdpSocket*> notifySockets;
QString rawvideocaps;
QString rawaudiocaps;
QGst::PipelinePtr outputPipe;
AudioAppSrc* audioSrc_main;
AudioAppSrc* audioSrc_monitor;
VideoAppSrc* videoSrc;
QGraphicsScene scene;
QLabel* logoLabel;
QGraphicsProxyWidget* logoItem;
QGraphicsOpacityEffect logoOpacityEffect;
QFont textFont;
QLabel* textSpriteLabel;
QGraphicsProxyWidget* textSpriteItem;
QGraphicsOpacityEffect textSpriteOpacityEffect;
QGraphicsTextItem* textItem;
QGraphicsTextItem* clockDisplayTextItem;
QTimer clockDisplayTimer;
CamConnectDialog* camConnectDialog;
VideoAdjustmentDialog* videoAdjustmentDialog;
VideoEffectDialog* videoEffectDialog;
QTimer playButtonBlinkTimer;
bool playButtonLEDState;
void onBusMessage(const QGst::MessagePtr & message);
void processNotifyDatagram(QByteArray datagram, QHostAddress senderHost, quint16 senderPort);
void setOnAirLED(MediaSourceBase *boxObject, bool newState);
void setLed(unsigned char num, bool newState);
};
#endif // MAINWINDOW_H