6 #ifndef GUILIB_GUIMULTIIMAGECONTROL_H
7 #define GUILIB_GUIMULTIIMAGECONTROL_H
12 * Copyright (C) 2005-2013 Team XBMC
15 * This Program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
20 * This Program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with XBMC; see the file COPYING. If not, see
27 * <http://www.gnu.org/licenses/>.
32 #include "utils/Stopwatch.h"
33 #include "utils/Job.h"
34 #include "threads/CriticalSection.h"
40 class CGUIMultiImage : public CGUIControl, public IJobCallback
43 CGUIMultiImage(int parentID, int controlID, float posX, float posY, float width, float height, const CTextureInfo& texture, unsigned int timePerImage, unsigned int fadeTime, bool randomized, bool loop, unsigned int timeToPauseAtEnd);
44 CGUIMultiImage(const CGUIMultiImage &from);
45 virtual ~CGUIMultiImage(void);
46 virtual CGUIMultiImage *Clone() const { return new CGUIMultiImage(*this); };
48 virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
49 virtual void Render();
50 virtual void UpdateVisibility(const CGUIListItem *item = NULL);
51 virtual void UpdateInfo(const CGUIListItem *item = NULL);
52 virtual bool OnAction(const CAction &action);
53 virtual bool OnMessage(CGUIMessage &message);
54 virtual void AllocResources();
55 virtual void FreeResources(bool immediately = false);
56 virtual void DynamicResourceAlloc(bool bOnOff);
57 virtual bool IsDynamicallyAllocated() { return m_bDynamicResourceAlloc; };
58 virtual void SetInvalid();
59 virtual bool CanFocus() const;
60 virtual CStdString GetDescription() const;
62 void SetInfo(const CGUIInfoLabel &info);
63 void SetAspectRatio(const CAspectRatio &ratio);
67 void OnDirectoryLoaded();
70 enum DIRECTORY_STATUS { UNLOADED = 0, LOADING, LOADED, READY };
71 virtual void OnJobComplete(unsigned int jobID, bool success, CJob *job);
73 class CMultiImageJob : public CJob
76 CMultiImageJob(const CStdString &path);
77 virtual bool DoWork();
78 virtual const char *GetType() const { return "multiimage"; };
80 std::vector<CStdString> m_files;
84 CGUIInfoLabel m_texturePath;
85 CStdString m_currentPath;
86 unsigned int m_currentImage;
87 CStopWatch m_imageTimer;
88 unsigned int m_timePerImage;
89 unsigned int m_timeToPauseAtEnd;
93 bool m_bDynamicResourceAlloc;
94 std::vector<CStdString> m_files;
98 CCriticalSection m_section;
99 DIRECTORY_STATUS m_directoryStatus;
100 unsigned int m_jobID;