2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
22 #include "IDirectory.h"
23 #include "threads/Thread.h"
24 #include "threads/CriticalSection.h"
25 #include "threads/Event.h"
26 #include "HTSPSession.h"
27 #include "boost/shared_ptr.hpp"
30 class CFileItem; typedef boost::shared_ptr<CFileItem> CFileItemPtr;
34 class CHTSPDirectorySession
38 bool GetEvent(SEvent& event, uint32_t id);
39 SChannels GetChannels();
40 SChannels GetChannels(int tag);
41 SChannels GetChannels(STag &tag);
43 htsmsg_t* ReadResult(htsmsg_t* m);
46 static CHTSPDirectorySession* Acquire(const CURL& url);
47 static void Release(CHTSPDirectorySession* &session);
48 static void CheckIdle(DWORD idle = 60000);
51 CHTSPDirectorySession();
52 ~CHTSPDirectorySession();
54 bool Open(const CURL& url);
58 virtual void Process();
59 CHTSPSession m_session;
63 CCriticalSection m_section;
71 typedef std::map<int, SMessage> SMessages;
80 class CHTSPDirectory : public IDirectory
84 virtual ~CHTSPDirectory(void);
85 virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items);
86 virtual DIR_CACHE_TYPE GetCacheType(const CStdString& strPath) const { return DIR_CACHE_ONCE; };
88 bool GetChannels(const CURL& base, CFileItemList &items);
89 bool GetChannels(const CURL& base, CFileItemList &items, HTSP::SChannels channels, int tag);
90 bool GetTag (const CURL& base, CFileItemList &items);
92 HTSP::CHTSPDirectorySession* m_session;