Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

x11_timer.hpp

00001 /*****************************************************************************
00002  * x11_timer.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: x11_timer.hpp 12208 2005-08-15 15:58:39Z asmax $
00006  *
00007  * Authors: Cyril Deguet     <[email protected]>
00008  *          Olivier Teulière <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef X11_TIMER_HPP
00026 #define X11_TIMER_HPP
00027 
00028 #include "../src/os_timer.hpp"
00029 
00030 #include <list>
00031 
00032 // Forward declaration
00033 class X11TimerLoop;
00034 class CmdGeneric;
00035 
00036 
00037 // X11 specific timer
00038 class X11Timer: public OSTimer
00039 {
00040     public:
00041         X11Timer( intf_thread_t *pIntf, CmdGeneric &rCmd );
00042         virtual ~X11Timer();
00043 
00046         virtual void start( int delay, bool oneShot );
00047 
00049         virtual void stop();
00050 
00051         mtime_t getNextDate() const;
00052 
00055         bool execute();
00056 
00057     private:
00059         CmdGeneric &m_rCommand;
00061         X11TimerLoop *m_pTimerLoop;
00063         mtime_t m_interval;
00065         mtime_t m_nextDate;
00067         bool m_oneShot;
00068 };
00069 
00070 
00072 class X11TimerLoop: public SkinObject
00073 {
00074     public:
00077         X11TimerLoop( intf_thread_t *pIntf, int connectionNumber );
00078         virtual ~X11TimerLoop();
00079 
00081         void addTimer( X11Timer &rTimer );
00082 
00084         void removeTimer( X11Timer &rTimer );
00085 
00087         void waitNextTimer();
00088 
00089     private:
00091         int m_connectionNumber;
00093         list<X11Timer*> m_timers;
00094 
00097         bool sleep( int delay );
00098 };
00099 
00100 
00101 #endif

Generated on Tue Dec 20 10:14:44 2005 for vlc-0.8.4a by  doxygen 1.4.2