ctrl_video.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * ctrl_video.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2004 the VideoLAN team
00005  * $Id: 2f9a19bb0bd323cfea1b0b2222ee49d2884ad980 $
00006  *
00007  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License along
00020  * with this program; if not, write to the Free Software Foundation, Inc.,
00021  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef CTRL_VIDEO_HPP
00025 #define CTRL_VIDEO_HPP
00026 
00027 #include "ctrl_generic.hpp"
00028 #include "../utils/position.hpp"
00029 #include "../src/vout_window.hpp"
00030 #include <vlc_vout.h>
00031 
00032 
00033 /// Control video
00034 class CtrlVideo: public CtrlGeneric
00035 {
00036 public:
00037     CtrlVideo( intf_thread_t *pIntf, GenericLayout &rLayout,
00038                bool autoResize, const UString &rHelp, VarBool *pVisible );
00039     virtual ~CtrlVideo();
00040 
00041     /// Handle an event on the control
00042     virtual void handleEvent( EvtGeneric &rEvent );
00043 
00044     /// Check whether coordinates are inside the control
00045     virtual bool mouseOver( int x, int y ) const;
00046 
00047     /// Callback for layout resize
00048     virtual void onResize();
00049 
00050     /// Called when the Position is set
00051     virtual void onPositionChange();
00052 
00053     /// Draw the control on the given graphics
00054     virtual void draw( OSGraphics &rImage, int xDest, int yDest );
00055 
00056     /// Get the type of control (custom RTTI)
00057     virtual string getType() const { return "video"; }
00058 
00059     /// Method called when visibility or ActiveLayout is updated
00060     virtual void onUpdate( Subject<VarBool> &rVariable , void* );
00061 
00062     // Attach a voutWindow to a Video Control
00063     void attachVoutWindow( VoutWindow* pVoutWindow,
00064                            int width = -1, int height = -1 );
00065 
00066     // Detach a voutWindow from a Video Control
00067     void detachVoutWindow( );
00068 
00069     // Get TopWindow associated with the video control
00070     virtual TopWindow* getWindow() { return CtrlGeneric::getWindow(); }
00071 
00072     // Get the VoutWindow associated with the video control
00073     virtual VoutWindow* getVoutWindow() { return m_pVoutWindow; }
00074 
00075     /// Set the position and the associated layout of the control
00076     virtual void setLayout( GenericLayout *pLayout,
00077                             const Position &rPosition );
00078     virtual void unsetLayout();
00079 
00080     // resize the video Control
00081     virtual void resizeControl( int width, int height );
00082 
00083     // Is this control useable (visibility requirements)
00084     virtual bool isUseable() { return m_bIsUseable; }
00085 
00086     // Is this control used
00087     virtual bool isUsed() { return m_pVoutWindow ? true : false; }
00088 
00089 private:
00090     /// Associated layout
00091     GenericLayout &m_rLayout;
00092 
00093     /// Autoresize parameter
00094     bool m_bAutoResize;
00095 
00096     /// Difference between layout size and video size
00097     int m_xShift, m_yShift;
00098 
00099     /// Is the video Control useable
00100     bool m_bIsUseable;
00101 
00102     /// Vout window
00103     VoutWindow *m_pVoutWindow;
00104 };
00105 
00106 #endif

Generated on Tue May 25 08:04:58 2010 for VLC by  doxygen 1.5.6