show infobar when seeking with numbers in movie player
[enigma2.git] / lib / driver / rcconsole.h
1 #ifndef __lib_driver_rcconsole_h
2 #define __lib_driver_rcconsole_h
3
4 #include <termios.h>
5 #include <lib/driver/rc.h>
6
7 class eRCConsoleDriver: public eRCDriver
8 {
9         struct termios ot;
10 protected:
11         int handle;
12         eSocketNotifier *sn;
13         void keyPressed(int);
14 public:
15         eRCConsoleDriver(const char *filename);
16         ~eRCConsoleDriver();
17         void flushBuffer() const
18         {
19                 char data[16];
20                 if (handle != -1)
21                         while ( ::read(handle, data, 16) == 16 );
22         }
23         void lock() const
24         {
25                 if ( sn )
26                         sn->stop();
27         }
28         void unlock() const
29         {
30                 if ( sn )
31                         sn->start();
32         }
33 };
34
35 class eRCConsole: public eRCDevice
36 {
37 public:
38         void handleCode(int code);
39         eRCConsole(eRCDriver *driver);
40         const char *getDescription() const;
41         const char *getKeyDescription(const eRCKey &key) const;
42         int getKeyCompatibleCode(const eRCKey &key) const;
43 };
44
45 #endif