summaryrefslogtreecommitdiff
path: root/fmrxproxy.h
blob: de16df65779221cd7020c899b9b26a5eec6046b8 (plain)
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
#ifndef FMRXPROXY_H
#define FMRXPROXY_H

#include <QtCore/QObject>
#include <QtCore/QString>
#include <dbus/dbus.h>

/** This is the Proxy class that connects to the D-Bus service. */

class FmRxProxy : public QObject
{
    Q_OBJECT
public:
    explicit FmRxProxy(QObject *parent = 0);
	~FmRxProxy();

	int Connect();
	void Tune(double frequency);
	void SearchBackward();
	void SearchForward();

signals:
	void Tuned(double frequency);
	void Stopped();
	void SignalLevelChanged(ushort level);
	void PiReceived(ushort pi);
	void PsReceived(const QString &ps);
	void RtReceived(const QString &rt);

private:
	DBusConnection *m_conn;

	static DBusHandlerResult bus_message_filter(DBusConnection *conn,
		DBusMessage *m, void *user_data);

};

#endif // FMRXPROXY_H