File: audiomanager.h

package info (click to toggle)
openterface-qt 0.1.0%2Bds-1
  • links: PTS
  • area: main
  • in suites: experimental
  • size: 1,444 kB
  • sloc: cpp: 9,552; sh: 127; python: 57; ansic: 4; makefile: 4
file content (35 lines) | stat: -rw-r--r-- 743 bytes parent folder | download
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
#ifndef AUDIOMANAGER_H
#define AUDIOMANAGER_H

#include <QObject>
#include <QAudioDevice>
#include <QMediaDevices>
#include <QLoggingCategory>
#include <QTimer>

class AudioThread;

Q_DECLARE_LOGGING_CATEGORY(log_core_host_audio)

class AudioManager : public QObject {
    Q_OBJECT

public:
    explicit AudioManager(QObject *parent = nullptr);
    ~AudioManager();

    void initializeAudio();
    void disconnect();

private slots:
    void handleAudioError(const QString& error);

private:
    QAudioDevice findUvcCameraAudioDevice(QString deviceName);
    QAudioDevice findSystemAudioOuptutDevice(QString deviceName);
    void fadeInVolume(int timeout, int durationInSeconds);

    AudioThread* m_audioThread;
};

#endif // AUDIOMANAGER_H