1 #ifndef SPRINGLOBBY_HEADERGUARD_PLAYBACKTHREAD
2 #define SPRINGLOBBY_HEADERGUARD_PLAYBACKTHREAD
3 
4 #include <wx/string.h>
5 #include "../defines.h"
6 #include <wx/thread.h>
7 #include <wx/event.h>
8 
9 static const wxEventType PlaybacksLoadedEvt = wxNewEventType();
10 
11 
12 template <class PlaybackTabImp >
13 class PlaybackLoader : public wxEvtHandler
14 {
15 protected:
16     class PlaybackLoaderThread : public wxThread
17     {
18         protected:
19             typedef PlaybackLoader<PlaybackTabImp>
20                 ParentType;
21 
22         public:
23             PlaybackLoaderThread();
24             void SetParent( ParentType* parent );
25             void* Entry();
26 
27         protected:
28             ParentType* m_parent;
29     };
30 
31 public:
32     typedef PlaybackTabImp
33         ParentType;
34     typedef typename ParentType::PlaybackType
35         PlaybackType;
36     typedef typename ParentType::ListType
37         ListType;
38     typedef PlaybackLoader<PlaybackTabImp>
39         ThisType;
40     typedef PlaybackLoaderThread
41         ThreadType;
42 
43     static const bool IsReplayType = ParentType::IsReplayType;
44 
45     PlaybackLoader( ParentType* parent );
46     ~PlaybackLoader();
47     void OnComplete();
48     void Run();
49     std::vector<std::string> GetPlaybackFilenames();
50 
51 protected:
52     std::vector<std::string> m_filenames;
53     ParentType* m_parent;
54     ThreadType* m_thread_loader;
55 
56 };
57 
58 #include "playbackthread.cpp"
59 #endif // SPRINGLOBBY_HEADERGUARD_PLAYBACKTHREAD
60 
61 /**
62     This file is part of SpringLobby,
63     Copyright (C) 2007-2011
64 
65     SpringLobby is free software: you can redistribute it and/or modify
66     it under the terms of the GNU General Public License version 2 as published by
67     the Free Software Foundation.
68 
69     SpringLobby is distributed in the hope that it will be useful,
70     but WITHOUT ANY WARRANTY; without even the implied warranty of
71     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
72     GNU General Public License for more details.
73 
74     You should have received a copy of the GNU General Public License
75     along with SpringLobby.  If not, see <http://www.gnu.org/licenses/>.
76 **/
77 
78