00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
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