-
Notifications
You must be signed in to change notification settings - Fork 1
/
window.h
104 lines (91 loc) · 2.56 KB
/
window.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
#ifndef WINDOW_H
#define WINDOW_H
#include <QWidget>
#include <QPushButton>
#include <QAudioInput>
#include <QFile>
#include <QLabel>
#include <QRadioButton>
#include <QCamera>
#include <QVideoWidget>
#include <QMovie>
#include <QGroupBox>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QMediaPlayer>
#include <QAudioOutput>
#include <QBluetoothDeviceDiscoveryAgent>
#include <QLowEnergyController>
#include <QBluetoothUuid>
#include <QLowEnergyService>
class Window : public QWidget
{
Q_OBJECT
public:
explicit Window(QWidget *parent = 0);
signals:
void counterReached();
void stateChanged(QAudio::State newState);
void startFlight();
void searchAgain();
void confirmCamshift();
private slots:
void stopRecording();
void startRecording();
void startFlightResponder();
void searchAgainResponder();
void confirmCamshiftResponder();
void handleStateChanged(QAudio::State newState);
void valueChanged(QPixmap newValue);
void delay( int millisecondsToWait );
QString sphinx_test();
void addDevice(const QBluetoothDeviceInfo&);
void deviceConnected();
void disconnectFromDevice();
void deviceDisconnected();
void errorReceived(QLowEnergyController::Error);
void serviceDiscovered(const QBluetoothUuid &gatt);
void serviceScanDone();
void serviceStateChanged(QLowEnergyService::ServiceState);
void dropMarker();
void changeStatusSlot(QString status);
private:
int m_counter;
QPushButton *m_button;
QPushButton *search_again_button;
QPushButton *start_flight_button;
QPushButton *start_recording_button;
QPushButton *confirm_object_button;
QPushButton *confirm_camshift_button;
QAudioInput* audio;
QFile destinationFile;
QLabel *stream_label;
QLabel *speech_to_text;
QLabel *speech_to_text_title;
QLabel *confirm_object_title;
QRadioButton *radio_yes;
QRadioButton *radio_no;
QLabel *flight_status_label;
QLabel *loading_gif_label;
QCamera *camera;
QVideoWidget * video_widget;
QMovie *loading_movie;
QGroupBox *speech_to_text_box;
QGroupBox *flight_status_box;
QGroupBox *stream_box;
QVBoxLayout *vbox;
QGridLayout *grid;
QLabel *title;
QMediaPlayer *player;
QAudioOutput *audio_output;
QFile inputFile;
QPushButton *drop_marker_button;
// Bluetooth stuff
QBluetoothDeviceDiscoveryAgent *m_deviceDiscoveryAgent;
QLowEnergyController *m_control;
bool foundDevice = false;
int uart_command = 0;
QLowEnergyService *m_service;
public slots:
};
#endif // WINDOW_H