hyperion.ng
bonjourbrowserwrapper.h
1 #pragma once
2 // qt incl
3 #include <QObject>
4 #include <QMap>
5 #include <QHostInfo>
6 
7 #include <bonjour/bonjourrecord.h>
8 
11 class QTimer;
12 
13 class BonjourBrowserWrapper : public QObject
14 {
15  Q_OBJECT
16 private:
17  friend class HyperionDaemon;
22  BonjourBrowserWrapper(QObject * parent = 0);
23 
24 public:
25 
29  bool browseForServiceType(const QString &serviceType);
33  QMap<QString,BonjourRecord> getAllServices() { return _hyperionSessions; };
34 
35  static BonjourBrowserWrapper* instance;
36  static BonjourBrowserWrapper* getInstance(){ return instance; };
37 
38 signals:
42  void browserChange(const QMap<QString,BonjourRecord>& bRegisters);
43 
44 private:
46  QMap< QString, BonjourServiceBrowser* > _browsedServices;
48  BonjourServiceResolver* _bonjourResolver;
49 
50  // contains all current active service sessions
51  QMap<QString,BonjourRecord> _hyperionSessions;
52 
53  QString _bonjourCurrentServiceToResolve;
55  QTimer* _timerBonjourResolver;
56 
57 private slots:
60  void currentBonjourRecordsChanged(const QList<BonjourRecord> &list);
62  void bonjourRecordResolved(const QHostInfo &hostInfo, int port);
63 
67  void bonjourResolve();
68 };
Definition: bonjourserviceresolver.h:43
Definition: bonjourbrowserwrapper.h:13
QMap< QString, BonjourRecord > getAllServices()
Get all available sessions.
Definition: bonjourbrowserwrapper.h:33
Definition: hyperiond.h:67
void browserChange(const QMap< QString, BonjourRecord > &bRegisters)
Emits whenever a change happend.
bool browseForServiceType(const QString &serviceType)
Browse for a service.
Definition: bonjourbrowserwrapper.cpp:31
Definition: bonjourservicebrowser.h:42