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

vlcproc.hpp

00001 /*****************************************************************************
00002  * vlcproc.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: vlcproc.hpp 12281 2005-08-20 00:31:27Z dionoea $
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 VLCPROC_HPP
00026 #define VLCPROC_HPP
00027 
00028 #include <set>
00029 
00030 #include "../vars/playlist.hpp"
00031 #include "../vars/playtree.hpp"
00032 #include "../vars/time.hpp"
00033 #include "../vars/volume.hpp"
00034 #include "../utils/var_text.hpp"
00035 #include "../commands/cmd_generic.hpp"
00036 
00037 class OSTimer;
00038 class VarBool;
00039 
00040 
00042 class VlcProc: public SkinObject
00043 {
00044     public:
00047         static VlcProc *instance( intf_thread_t *pIntf );
00048 
00050         static void destroy( intf_thread_t *pIntf );
00051 
00053         Playlist &getPlaylistVar() { return *((Playlist*)m_cPlaylist.get()); }
00054 
00056         Playtree &getPlaytreeVar() { return *((Playtree*)m_cPlaytree.get()); }
00057 
00059         StreamTime &getTimeVar() { return *((StreamTime*)(m_cVarTime.get())); }
00060 
00062         Volume &getVolumeVar() { return *((Volume*)(m_cVarVolume.get())); }
00063 
00065         VarText &getStreamNameVar()
00066            { return *((VarText*)(m_cVarStreamName.get())); }
00067 
00069         VarText &getStreamURIVar()
00070             { return *((VarText*)(m_cVarStreamURI.get())); }
00071 
00073         void registerVoutWindow( void *pVoutWindow );
00074 
00076         void unregisterVoutWindow( void *pVoutWindow );
00077 
00079         bool isVoutUsed() const { return m_pVout != NULL; }
00080 
00083         void dropVout();
00084 
00085     protected:
00086         // Protected because it is a singleton
00087         VlcProc( intf_thread_t *pIntf );
00088         virtual ~VlcProc();
00089 
00090     private:
00092         OSTimer *m_pTimer;
00094         VariablePtr m_cPlaylist;
00096         VariablePtr m_cPlaytree;
00097         VariablePtr m_cVarRandom;
00098         VariablePtr m_cVarLoop;
00099         VariablePtr m_cVarRepeat;
00101         VariablePtr m_cVarTime;
00103         VariablePtr m_cVarVolume;
00105         VariablePtr m_cVarStreamName;
00106         VariablePtr m_cVarStreamURI;
00108         VariablePtr m_cVarMute;
00110         VariablePtr m_cVarPlaying;
00111         VariablePtr m_cVarStopped;
00112         VariablePtr m_cVarPaused;
00113         VariablePtr m_cVarSeekable;
00114 
00116 
00120         set<void *> m_handleSet;
00122         vout_thread_t *m_pVout;
00123 
00131         void manage();
00132 
00134         DEFINE_CALLBACK( VlcProc, Manage );
00135 
00137         void updateStreamName( playlist_t *p_playlist );
00138 
00140         static int onIntfChange( vlc_object_t *pObj, const char *pVariable,
00141                                  vlc_value_t oldVal, vlc_value_t newVal,
00142                                  void *pParam );
00143 
00145         static int onIntfShow( vlc_object_t *pObj, const char *pVariable,
00146                                vlc_value_t oldVal, vlc_value_t newVal,
00147                                void *pParam );
00148 
00150         static int onItemChange( vlc_object_t *pObj, const char *pVariable,
00151                                  vlc_value_t oldVal, vlc_value_t newVal,
00152                                  void *pParam );
00153 
00155         static int onPlaylistChange( vlc_object_t *pObj, const char *pVariable,
00156                                      vlc_value_t oldVal, vlc_value_t newVal,
00157                                      void *pParam );
00158 
00160         static int onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
00161                                  vlc_value_t oldVal, vlc_value_t newVal,
00162                                  void *pParam );
00163 
00165         static void *getWindow( intf_thread_t *pIntf, vout_thread_t *pVout,
00166                                 int *pXHint, int *pYHint,
00167                                 unsigned int *pWidthHint,
00168                                 unsigned int *pHeightHint );
00169 
00171         static void releaseWindow( intf_thread_t *pIntf, void *pWindow );
00172 
00174         static int controlWindow( intf_thread_t *pIntf, void *pWindow,
00175                                   int query, va_list args );
00176 };
00177 
00178 
00179 #endif

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