summaryrefslogtreecommitdiff
path: root/control-image.h
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2005-07-19 15:09:05 +0000
committerAndreas Brachold <vdr07@deltab.de>2005-07-19 15:09:05 +0000
commitf897f2aa7055c493db6391c50c8d19da970078e8 (patch)
treed13a515b24c149d7da4e9828cc9e9c73d4916f00 /control-image.h
downloadvdr-plugin-image-f897f2aa7055c493db6391c50c8d19da970078e8.tar.gz
vdr-plugin-image-f897f2aa7055c493db6391c50c8d19da970078e8.tar.bz2
Initial import with release 0.2.3
Diffstat (limited to 'control-image.h')
-rw-r--r--control-image.h169
1 files changed, 169 insertions, 0 deletions
diff --git a/control-image.h b/control-image.h
new file mode 100644
index 0000000..a09c02f
--- /dev/null
+++ b/control-image.h
@@ -0,0 +1,169 @@
+/*
+ * Image plugin to VDR (C++)
+ *
+ * (C) 2004 Andreas Brachold <vdr04 -at- deltab.de>
+ * based on (C) 2003 Kai Tobias Burwieck <kai -at- burwieck.net>
+ *
+ * This code 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.
+ *
+ * This code is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
+ */
+
+// --- cImageControl ---------------------------------------------------------
+
+#ifndef ___DVB_IMAGE_CONTROL_H
+#define ___DVB_IMAGE_CONTROL_H
+
+#include <vdr/player.h>
+#if VDRVERSNUM >= 10307
+#include <vdr/osdbase.h>
+#endif
+
+class cImagePlayer;
+class cImageMenuCommands;
+
+class cImageControl
+ : public cControl
+{
+ /** All supported Replaymodes */
+ enum ePlayMode { ePlayModeNormal, ePlayModeZoom, ePlayModeJump };
+ /** All supported OSD Modes */
+ enum eOSDStatusMode { eDisplayNothing, eDisplayModeOnly,
+ eDisplayProgress
+ };
+ /** All move directions to navigate inside zoomed image */
+ enum eDirection {eLeft = 1,eRight,eUp,eDown};
+
+ /** Our one and only Imageplayer, don't rename it see cControl */
+ cImagePlayer *player;
+ /** Interface to Menu with Usercommands*/
+ cImageMenuCommands *m_pImageMenu;
+ /** Current playing mode (Jump <-> Normal <-> Zoom) */
+ ePlayMode m_ePlayMode;
+ /** Remember the active Slideshow mode before Jump or Zoom used */
+ bool m_bSlideShowBefore;
+ /** What should on OSD visable (Nothing <-> ModeOnly <-> Progress) */
+ eOSDStatusMode m_eOSDStatusVisable;
+ /** Who was OSD Interface open (Nothing <-> ModeOnly <-> Progress) */
+ eOSDStatusMode m_eOSDStatusIsOpen;
+ /** View our picture in a slideshow */
+ bool m_bSlideShowActiv;
+ /** date at image was open*/
+ time_t m_tStarted;
+ /** Last Message for Statusmonitor */
+ static char* m_szLastShowStatusMsg;
+#if VDRVERSNUM >= 10307
+ /** Display replayprogress*/
+ cSkinDisplayReplay *m_pDisplayReplay;
+ /** Faked Marks for Images*/
+ cMarks m_Marks;
+#endif
+
+ /** zoom factor on zoom mode */
+ int m_nZoomFactor;
+ /** minimum zoom factor (1... */
+ int m_nZoomMin;
+ /** maximum value move steps on zoom on width */
+ int m_nMaxStepX;
+ /** maximum value move steps on zoom on height */
+ int m_nMaxStepY;
+ /** current value move steps on zoom on width, 0 is center*/
+ int m_nMoveStepX;
+ /** current value move steps on zoom on height, 0 is center*/
+ int m_nMoveStepY;
+ /** How may pixel are outside screen after zoom, on width */
+ int m_nZoomXMax;
+ /** How may pixel are outside screen after zoom, on height */
+ int m_nZoomYMax;
+ /** real image pixel width*/
+ int m_nRealImageWidth;
+ /** real image pixel height*/
+ int m_nRealImageHeight;
+
+ char zoom_command[20];
+
+private:
+ void ShowOSD(void);
+ void HideOSD(void);
+ void ShowMode(void);
+#if VDRVERSNUM < 10307
+ void DisplayAtBottom(const char *s);
+#endif
+ void ShowProgress(void);
+ /** Send Message if changed to any statusmonitor */
+ void ShowStatusMsg();
+
+ void PictureZoomInitial(void);
+
+ void ProcessKeyBeginJump();
+ void ProcessKeyBeginZoom();
+
+ /** Deliver the Status of running convert-script */
+ bool IsConvertRunning() const;
+ /** Deliver the current number of viewed Image */
+ int ImageCurrent(void) const;
+ /** Deliver the total number of viewed Image */
+ int ImageTotal(void) const;
+ /** Deliver the filename from the current number of viewed Image */
+ const char* FileName() const;
+
+ /** Check if key for pluginstop was processed*/
+ eOSState ProcessKeyStopped();
+ /** Toogle between all supported OSD Modes */
+ void ToogleShowMode(void);
+ /** Toogle between Play and Stop of the current SlideShow */
+ void ToogleSlideShowActiv(void);
+
+ /** Zoom inside a image*/
+ void ZoomIn();
+ /** Zoom outside a image*/
+ void ZoomOut();
+ /** Navigate inside a zoomed image */
+ void MoveZoomWindow(eDirection nDirection);
+
+ eOSState ProcessKeyPlayMode(eKeys nKey);
+ eOSState ProcessKeyJumpMode(eKeys nKey);
+ eOSState ProcessKeyZoomMode(eKeys nKey);
+ eOSState ProcessKeyCommands(eKeys nKey);
+
+ void NextImage(int Step);
+ void PrevImage(int Step);
+ void GotoImage(int Pict);
+ void RFlipImage(void);
+ void LFlipImage(void);
+ void OriginalImage(bool bCached);
+ void ConvertZoom();
+ void ConvertJump(int Step);
+
+ void IncSlideTime(void);
+ void DecSlideTime(void);
+
+ bool CheckAccess() const;
+private:
+ cImageControl(cSlideShow * pNewSlideShow);
+public:
+ virtual ~ cImageControl();
+
+ static void SetSlideShow(cSlideShow * pNewSlideShow);
+
+ virtual eOSState ProcessKey(eKeys Key);
+ virtual void Hide(void);
+ virtual void Show(void);
+
+protected:
+ void SlideImage();
+ void Stop(void);
+};
+
+#endif //___DVB_IMAGE_CONTROL_H