#include <QtCore/QObject>
+class QTimer;
+
class SpeedAlarm : public QObject
{
Q_OBJECT
public:
+ ~SpeedAlarm();
+ static int const ALARM_INTERVAL = 15;
static SpeedAlarm& instance();
void start();
void end();
+signals:
+ void speedExceedChanged(bool exceeded);
+
public slots:
void loadConfig();
private slots:
void onDataUpdated();
+ void playAlarmSound();
private:
SpeedAlarm();
+ void startAlarmTimer();
bool loaded_;
QString soundFile_;
- int threshold_;
+ double threshold_;
bool enabled_;
bool isOver_;
+ QTimer* timer_;
};
#endif