HulaLoop
Simple cross-platform audio loopback and recording.
QMLBridge.h
1 #ifndef QMLBRIDGE_H
2 #define QMLBRIDGE_H
3 
4 #include <QObject>
5 #include <QString>
6 #include <QStringList>
7 
8 #include <hlaudio/hlaudio.h>
9 #include <hlcontrol/hlcontrol.h>
10 
11 namespace hula
12 {
17  class QMLBridge : public QObject {
18  Q_OBJECT
19 
20  private:
21  Transport *transport;
22 
23  public:
24  explicit QMLBridge(QObject *parent = nullptr);
25 
26  Q_INVOKABLE void setActiveInputDevice(QString QDeviceName);
27  Q_INVOKABLE void setActiveOutputDevice(QString QDeviceName);
28  Q_INVOKABLE QString getInputDevices();
29  Q_INVOKABLE QString getOutputDevices();
30 
31  Q_INVOKABLE QString getTransportState() const;
32  Q_INVOKABLE void record();
33  Q_INVOKABLE void stop();
34  Q_INVOKABLE void play();
35  Q_INVOKABLE void pause();
36 
37  Q_INVOKABLE void saveFile(QString dir);
38 
39  Q_INVOKABLE void launchUpdateProcess();
40 
41  signals:
42 
47  void stateChanged();
48  };
49 }
50 
51 #endif // QMLBRIDGE_H
<hlcontrol/hlcontrol.h>
Q_INVOKABLE QString getOutputDevices()
Get the current output devices.
Definition: QMLBridge.cpp:136
Q_INVOKABLE void stop()
Trigger stop in the Transport and update the UI state via signal.
Definition: QMLBridge.cpp:43
Extra class for managing the state of the application and all audio related processes.
Definition: Transport.h:29
QMLBridge(QObject *parent=nullptr)
Construct a new instance of the QMLBridge class.
Definition: QMLBridge.cpp:16
<hlaudio/hlaudio.h>
Q_INVOKABLE void pause()
Trigger pause in the Transport and update the UI state via signal.
Definition: QMLBridge.cpp:61
void stateChanged()
Signal emmitted when the Transport changes states.
Q_INVOKABLE void launchUpdateProcess()
Launch the updater process.
Definition: QMLBridge.cpp:170
Q_INVOKABLE void setActiveInputDevice(QString QDeviceName)
Match a string that the user chose to the input device list and notify the backend.
Definition: QMLBridge.cpp:71
Q_INVOKABLE QString getInputDevices()
Get the current input devices.
Definition: QMLBridge.cpp:115
Q_INVOKABLE void setActiveOutputDevice(QString QDeviceName)
Match a string that the user chose to the output device list and notify the backend.
Definition: QMLBridge.cpp:93
Q_INVOKABLE void play()
Trigger playback in the Transport and update the UI state via signal.
Definition: QMLBridge.cpp:52
Q_INVOKABLE QString getTransportState() const
Return the current state of the Transport instance as a QString.
Definition: QMLBridge.cpp:26
Definition: Controller.h:11
Class for communicating between QML and C++.
Definition: QMLBridge.h:17
Q_INVOKABLE void record()
Trigger record in the Transport and update the UI state via signal.
Definition: QMLBridge.cpp:34
Q_INVOKABLE void saveFile(QString dir)
Get the directory the user wants to save to.
Definition: QMLBridge.cpp:159