Merged in f5soh/librepilot/LP-575_fedora_package (pull request #491)
[librepilot.git] / ground / gcs / src / libs / gstreamer / devicemonitor.h
blobe86679746b9c3244270c665b05718438760bade0
1 /**
2 ******************************************************************************
4 * @file devicemonitor.h
5 * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2017.
6 * @brief
7 * @see The GNU Public License (GPL) Version 3
8 * @defgroup
9 * @{
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #ifndef DEVICEMONITOR_H_
28 #define DEVICEMONITOR_H_
30 #include "gst_global.h"
32 #include <QObject>
34 typedef struct _GstDeviceMonitor GstDeviceMonitor;
36 class Device {
37 public:
38 Device(QString displayName, QString deviceClass) : m_displayName(displayName), m_deviceClass(deviceClass)
40 QString displayName() const
42 return m_displayName;
44 QString deviceClass() const
46 return m_deviceClass;
48 private:
49 QString m_displayName;
50 QString m_deviceClass;
53 class GST_LIB_EXPORT DeviceMonitor : public QObject {
54 Q_OBJECT
55 public:
56 DeviceMonitor(QObject *parent = NULL);
57 virtual ~DeviceMonitor();
59 QList<Device> devices() const;
61 signals:
62 void deviceAdded(QString name);
63 void deviceRemoved(QString name);
65 private:
66 GstDeviceMonitor *monitor;
68 private slots:
69 void device_added(QString name);
70 void device_removed(QString name);
73 #endif /* DEVICEMONITOR_H_ */