blob: 4c811bbc27f3f4a69dca1ad7f4139e37347f2ae3 (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
/***************************************************************************
lmsensorsalarms.h - description
-------------------
begin : Wed Nov 14 2001
copyright : (C) 2001 by Miguel Novas
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef LMSENSORSALARMS_H
#define LMSENSORSALARMS_H
#include <qobject.h>
#include <qstring.h>
#include "lmsensors.h"
/**
*@author Miguel Novas
*/
class LMSensorsAlarms : public QObject {
Q_OBJECT
public:
enum Actions { acNothing, acSound, acCommand };
LMSensorsAlarms(LMSensors *sensors, QObject *parent=0, const char *name=0);
~LMSensorsAlarms();
static int readAlarm(const char *name);
static QString readAlarmSound(const char *name);
static void writeAlarm(const char *name, int alarm);
static QString readAlarmCommand(const char *name);
static void writeAlarmCommand(const char *name, const QString &cmd);
static void writeAlarmSound(const char *name, const QString &cmd);
static void runSensorCommand(const char *name,const char *value, const char *cmd);
static void playSound(const char *sound);
public slots:
void setValueChanged(Sensor *);
private:
int sensorCount;
QString soundPlay;
static void runCommand(const char *str);
void timerEvent( QTimerEvent * );
};
#endif
|