-
Notifications
You must be signed in to change notification settings - Fork 0
/
a2dpsource.h
55 lines (37 loc) · 1.31 KB
/
a2dpsource.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
#ifndef A2DPSOURCE_H
#define A2DPSOURCE_H
#include <QThread>
#include <QtDBus>
#define DEVICE_IFZ "org.bluez.Device1"
typedef QMap<QString, QVariantMap> InterfaceList;
typedef QMap<QDBusObjectPath, InterfaceList> ManagedObjectList;
Q_DECLARE_METATYPE(InterfaceList)
Q_DECLARE_METATYPE(ManagedObjectList)
#define A2DP_CODEC_SBC 0x00
#define A2DP_CODEC_MPEG12 0x01
#define A2DP_CODEC_MPEG24 0x02
#define A2DP_CODEC_ATRAC 0x03
// sink and source uuid and endpoints
#define A2DP_SINK_UUID "0000110b-0000-1000-8000-00805f9b34fb"
#define A2DP_SINK_ENDPOINT "/MediaEndpoint/A2DPSink" // bt --> alsa (sink for bt)
#define A2DP_SOURCE_UUID "0000110a-0000-1000-8000-00805f9b34fb"
#define A2DP_SOURCE_ENDPOINT "/MediaEndpoint/A2DPSource" // alsa --> bt (source for bt)
#include "bluetooth/bluez/device1_bluez5_p.h"
#include "bluetooth/bluez/adapter1_bluez5_p.h"
class A2DPSourceThread: public QThread
{
Q_OBJECT
public:
A2DPSourceThread();
protected:
virtual void run();
public slots:
void onPropertyChanged(QString,QVariantMap,QStringList);
private:
ManagedObjectList m_mapBluezObjects;
QList<OrgBluezDevice1Interface *> m_lDevices;
OrgBluezAdapter1Interface * m_pAdapter;
void connect(QString path);
void registerEndPoint();
};
#endif // A2DPSOURCE_H