mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
- Fixed some spelling errors in 'newplugin' (thanks to Ville Skyttä). - Fixed a busy loop in fast forward if the next video data file is missing (thanks to Reinhard Nissl). - Fixed handling frequencies in NitFilter::Process() (thanks to Anssi Hannula). - Fixed a race condition with signal handlers at program exit (thanks to Udo Richter). - Non-primary devices in Transfer mode are now also used for recording (thanks to Anssi Hannula). - Fixed handling ChannelUp/Down keys if there is currently a replay running (thanks to Marco Schlüßler). - The new SVDRP command REMO can be used to turn VDR's remote control off and on in case other programs need to be controlled (based on patches from Krzysztof Parma and Helmut Auer). - Increased the maximum number of CA system ids to cope with the AlphaCrypt CAM's version 3.11 firmware. - Fixed getting the code setting from the locale (thanks to Matthias Schwarzott). - Implemented support for Freetype fonts (based on a patch from Alexander Riedel). The font names and sizes can be adjusted in the "Setup/OSD" menu. Note that VDR now requires freetype fonts to be installed in /usr/share/fonts/truetype. - If the OSD device in use has at least 8bpp bitmap depth and this is also used by the current skin, Freetype fonts are displayed "anti-aliased". The new setup parameter "OSD/Anti-alias" can be used to turn this off. - The new function cOsd::SetAntiAliasGranularity() can be used to help the OSD in managing the available color palette entries when doing anti-aliasing. Skins that use 8bpp bitmaps can call this function with the maximum number of colors used, and the maximum number of color combinations. The OSD will then evenly split the available palette entries between the various colors combinations, so that fonts can be "anti-aliased". By default a total of 10 colors and 10 combinations is assumed. - The pixel fonts have been completely removed from the VDR source. - VDR is now "UTF-8 aware". It handles strings according to the character encoding used on the user's system. All internationalization strings and incoming SI data are converted to the system encoding. - Plugins that handle strings need to be aware that on systems with UTF-8 encoding a "character symbol" may consist of more than a single byte in memory. The functions and macros named Utf8...() can be used to handle strings without needing to care about the underlying character encoding (see tools.h for details). - Even though the weekdays of repeating timers are presented to the user as UTF-8 characters in the OSD, the timers.conf file and the SVDRP timer commands still use single byte characters ("MTWTFSS") to make sure this information is handled correctly between systems with different character encodings. - Added a missing i18n string for "CAM" in the Turkish OSD texts. - Improved editing strings that are too long to fit into the editable area. - Changes to the OSD settings in the "Setup/OSD" menu now immediately take effect when the "Ok" key is pressed.
120 lines
3.3 KiB
C++
120 lines
3.3 KiB
C++
/*
|
|
* remote.h: General Remote Control handling
|
|
*
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
* how to reach the author.
|
|
*
|
|
* $Id: remote.h 1.40 2007/04/30 12:37:37 kls Exp $
|
|
*/
|
|
|
|
#ifndef __REMOTE_H
|
|
#define __REMOTE_H
|
|
|
|
#include <stdio.h>
|
|
#include <termios.h>
|
|
#include <time.h>
|
|
#include "keys.h"
|
|
#include "thread.h"
|
|
#include "tools.h"
|
|
|
|
class cRemote : public cListObject {
|
|
private:
|
|
enum { MaxKeys = 2 * MAXKEYSINMACRO };
|
|
static eKeys keys[MaxKeys];
|
|
static int in;
|
|
static int out;
|
|
static cTimeMs repeatTimeout;
|
|
static cRemote *learning;
|
|
static char *unknownCode;
|
|
static cMutex mutex;
|
|
static cCondVar keyPressed;
|
|
static time_t lastActivity;
|
|
static const char *keyMacroPlugin;
|
|
static const char *callPlugin;
|
|
static bool enabled;
|
|
char *name;
|
|
protected:
|
|
cRemote(const char *Name);
|
|
const char *GetSetup(void);
|
|
void PutSetup(const char *Setup);
|
|
bool Put(uint64_t Code, bool Repeat = false, bool Release = false);
|
|
bool Put(const char *Code, bool Repeat = false, bool Release = false);
|
|
public:
|
|
virtual ~cRemote();
|
|
virtual bool Ready(void) { return true; }
|
|
virtual bool Initialize(void);
|
|
const char *Name(void) { return name; }
|
|
static void SetLearning(cRemote *Learning) { learning = Learning; }
|
|
static bool IsLearning() { return learning != NULL; }
|
|
static bool Enabled(void) { return enabled; }
|
|
static void SetEnabled(bool Enabled) { enabled = Enabled; }
|
|
static void Clear(void);
|
|
static bool Put(eKeys Key, bool AtFront = false);
|
|
static bool PutMacro(eKeys Key);
|
|
static bool CallPlugin(const char *Plugin);
|
|
///< Initiates calling the given plugin's main menu function.
|
|
///< The Plugin parameter is the name of the plugin, and must be
|
|
///< a static string. Returns true if the plugin call was successfully
|
|
///< initiated (the actual call to the plugin's main menu function
|
|
///< will take place some time later, during the next execution
|
|
///< of VDR's main loop). If there is already a plugin call pending
|
|
///< false will be returned and the caller should try again later.
|
|
static const char *GetPlugin(void);
|
|
///< Returns the name of the plugin that was set with a previous
|
|
///< call to PutMacro() or CallPlugin(). The internally stored pointer to the
|
|
///< plugin name will be reset to NULL by this call.
|
|
static bool HasKeys(void);
|
|
static eKeys Get(int WaitMs = 1000, char **UnknownCode = NULL);
|
|
static time_t LastActivity(void) { return lastActivity; }
|
|
///< Absolute time when last key was delivered by Get().
|
|
};
|
|
|
|
class cRemotes : public cList<cRemote> {};
|
|
|
|
extern cRemotes Remotes;
|
|
|
|
enum eKbdFunc {
|
|
kfNone,
|
|
kfF1 = 0x100,
|
|
kfF2,
|
|
kfF3,
|
|
kfF4,
|
|
kfF5,
|
|
kfF6,
|
|
kfF7,
|
|
kfF8,
|
|
kfF9,
|
|
kfF10,
|
|
kfF11,
|
|
kfF12,
|
|
kfUp,
|
|
kfDown,
|
|
kfLeft,
|
|
kfRight,
|
|
kfHome,
|
|
kfEnd,
|
|
kfPgUp,
|
|
kfPgDown,
|
|
kfIns,
|
|
kfDel,
|
|
};
|
|
|
|
class cKbdRemote : public cRemote, private cThread {
|
|
private:
|
|
static bool kbdAvailable;
|
|
static bool rawMode;
|
|
struct termios savedTm;
|
|
virtual void Action(void);
|
|
int ReadKey(void);
|
|
uint64_t ReadKeySequence(void);
|
|
int MapCodeToFunc(uint64_t Code);
|
|
public:
|
|
cKbdRemote(void);
|
|
virtual ~cKbdRemote();
|
|
static bool KbdAvailable(void) { return kbdAvailable; }
|
|
static uint64_t MapFuncToCode(int Func);
|
|
static void SetRawMode(bool RawMode);
|
|
};
|
|
|
|
#endif //__REMOTE_H
|