summaryrefslogtreecommitdiffstats
path: root/noatun/modules/infrared/irprefs.h
blob: 6646456e5e0ea7f26ea555149a97b783f85c725e (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
62
63

#ifndef _IRPREFS_H_
#define _IRPREFS_H_

#include <tqmap.h>
#include <noatun/pref.h>

class TQCheckBox;
class TQListViewItem;
class TDEListView;
class KComboBox;
class KIntSpinBox;
class Lirc;

class IRPrefs : public CModule
{
Q_OBJECT
  
public:
	enum Action
	{
		None, Play, Stop, Pause, Mute,
		Previous, Next, VolumeDown, VolumeUp,
		SeekBackward, SeekForward, ShowPlaylist,
		NextSection, PreviousSection
	};
	
	IRPrefs(TQObject *parent);
	
	virtual void save();

	static const TQString actionName(Action);
	static Action actionFor(const TQString &, const TQString &, int);
	
public slots:
	static Lirc *s_lirc;

private slots:
	virtual void reopen();
	void slotCommandSelected(TQListViewItem *);
	void slotActionActivated(int);
	void slotRepeatToggled(bool);
	void slotIntervalChanged(int);

private:
	static void readConfig();

	TDEListView *m_commands;
	KComboBox *m_action;
	TQCheckBox *m_repeat;
	KIntSpinBox *m_interval;

	struct Command
	{
		Action action;
		int interval;
	};
	static bool s_configRead;
	static TQMap<TQString, Command> s_commands;
};

#endif