diff options
author | gnapheus <j.welker@gmx.net> | 2008-12-13 17:53:32 +0100 |
---|---|---|
committer | gnapheus <j.welker@gmx.net> | 2008-12-13 17:53:32 +0100 |
commit | 8ddb3741814e896158208bfff5575794486f5d79 (patch) | |
tree | 3cb8215f9b0df3ee14fea474001e5a2eab96b209 /MouseMateMonitor.c | |
parent | 3cdb11a7adb49e3041d1a546b6f87a340433837c (diff) | |
download | vdr-plugin-mousemate-8ddb3741814e896158208bfff5575794486f5d79.tar.gz vdr-plugin-mousemate-8ddb3741814e896158208bfff5575794486f5d79.tar.bz2 |
Initial commit of version 0.1.6
Diffstat (limited to 'MouseMateMonitor.c')
-rw-r--r-- | MouseMateMonitor.c | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/MouseMateMonitor.c b/MouseMateMonitor.c new file mode 100644 index 0000000..2793230 --- /dev/null +++ b/MouseMateMonitor.c @@ -0,0 +1,157 @@ +/* + * mousemate plugin for VDR + * + * MouseMate.c - MouseMate context monitor class + * + * + * This code is distributed under the terms and conditions of the + * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details. + */ + +#include "MouseMateMonitor.h" +#include "MouseMate.h" + +cMouseMateMonitor:: cMouseMateMonitor(void) +:menu(false), +replay(false), +DVD(false), +MP3(false), +CDDA(false), +IMAGE(false) +{ +} + + +cMouseMateMonitor:: ~cMouseMateMonitor() +{ +} + + +int cMouseMateMonitor::GetContext(const bool toggle) +{ + if (!toggle) + { + if (menu) + { + #ifdef DEBUG + dsyslog("mousemate: Context=Menu DVD=%i MP3=%i CDDA=%i IMAGE=%i\n",DVD,MP3,CDDA,IMAGE); + #endif + return kContextMenu; + } + if (replay) + { + #ifdef DEBUG + dsyslog("mousemate: Context=Replay DVD=%i MP3=%i CDDA=%i IMAGE=%i\n",DVD,MP3,CDDA,IMAGE); + #endif + if (DVD && MouseMateSetup.dvdsensitive) + return kContextReplayDVD; + if (MP3&& MouseMateSetup.mp3sensitive) + return kContextReplayMP3; + if (CDDA&& MouseMateSetup.cddasensitive) + return kContextReplayCDDA; + if (IMAGE&& MouseMateSetup.imagesensitive) + return kContextReplayIMAGE; + + return kContextReplay; + } + #ifdef DEBUG + dsyslog("mousemate: Context=Normal DVD=%i MP3=%i CDDA=%i IMAGE=%i\n",DVD, MP3,CDDA, IMAGE); + #endif + return kContextNormal; + } + else + { + if (menu) + { + #ifdef DEBUG + dsyslog("mousemate: Context=MenuAlt DVD=%i MP3=%i CDDA=%i IMAGE=%i\n",DVD,MP3,CDDA,IMAGE); + #endif + return kContextMenuAlt; + } + if (replay) + { + #ifdef DEBUG + dsyslog("mousemate: Context=ReplayAlt DVD=%i MP3=%i CDDA=%i IMAGE=%i\n", DVD,MP3,CDDA,IMAGE); + #endif + if (DVD && MouseMateSetup.dvdsensitive) + return kContextReplayDVDAlt; + if (MP3&& MouseMateSetup.mp3sensitive) + return kContextReplayMP3Alt; + if (CDDA&& MouseMateSetup.cddasensitive) + return kContextReplayCDDAAlt; + if (IMAGE&& MouseMateSetup.imagesensitive) + return kContextReplayIMAGEAlt; + return kContextReplayAlt; + } + #ifdef DEBUG + dsyslog("mousemate: Context=NormalAlt DVD=%i MP3=%i CDDA=%i IMAGE=%i\n",DVD, MP3,CDDA, IMAGE); + #endif + return kContextNormalAlt; + } + +} + + +void cMouseMateMonitor::Replaying(const cControl *Control, const char *Name, const char *FileName, bool On) +{ + if (On) + { + replay=true; + if (!strcmp(Name,"DVD")) + DVD=true; + if (!strcmp(Name,"MP3")) + MP3=true; + if (!strcmp(Name,"cdda")) + CDDA=true; + if (!strcmp(Name,"image")) + IMAGE=true; + } + else + { + DVD=false; + MP3=false; + CDDA=false; + IMAGE=false; + replay=false; + } + #ifdef DEBUG + dsyslog("mousemate: %s is %i\n", Name, On); + dsyslog("mousemate: Replaying DVD %i MP3: %i CDDA: %i IMAGE: %i\n",DVD, MP3,CDDA, IMAGE); + #endif +} + + +void cMouseMateMonitor::OsdClear(void) +{ + menu =false; +} + + +void cMouseMateMonitor::OsdTitle(const char *Title) +{ + menu = true; +} + + +void cMouseMateMonitor::OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue) +{ + menu = true; +} + + +void cMouseMateMonitor::OsdItem(const char *Text, int Index) +{ + menu = true; +} + + +void cMouseMateMonitor::OsdCurrentItem(const char *Text) +{ + menu = true; +} + + +void cMouseMateMonitor::OsdTextItem(const char *Text, bool Scroll) +{ + menu = true; +} |