merged: Platinum from linuxport branches
[xbmc:xbmc-antiquated.git] / xbmc / lib / libUPnP / Platinum / Source / Devices / MediaServer / PltMediaBrowser.h
1 /*****************************************************************\r
2 |\r
3 |   Platinum - AV Media Browser (Media Server Control Point)\r
4 |\r
5 |   Copyright (c) 2004-2008 Sylvain Rebaud\r
6 |   Author: Sylvain Rebaud (sylvain@rebaud.com)\r
7 |\r
8  ****************************************************************/\r
9 \r
10 #ifndef _PLT_MEDIA_BROWSER_H_\r
11 #define _PLT_MEDIA_BROWSER_H_\r
12 \r
13 /*----------------------------------------------------------------------\r
14 |   includes\r
15 +---------------------------------------------------------------------*/\r
16 #include "PltCtrlPoint.h"\r
17 #include "PltMediaItem.h"\r
18 #include "PltMediaBrowserListener.h"\r
19 \r
20 /*----------------------------------------------------------------------\r
21 |   PLT_MediaBrowser class\r
22 +---------------------------------------------------------------------*/\r
23 class PLT_MediaBrowser : public PLT_CtrlPointListener\r
24 {\r
25 public:\r
26     PLT_MediaBrowser(PLT_CtrlPointReference&   ctrl_point, \r
27                      PLT_MediaBrowserListener* listener);\r
28     virtual ~PLT_MediaBrowser();\r
29 \r
30     // PLT_CtrlPointListener methods\r
31     virtual NPT_Result OnDeviceAdded(PLT_DeviceDataReference& device);\r
32     virtual NPT_Result OnDeviceRemoved(PLT_DeviceDataReference& device);\r
33     virtual NPT_Result OnActionResponse(NPT_Result res, PLT_ActionReference& action, void* userdata);\r
34     virtual NPT_Result OnEventNotify(PLT_Service* service, NPT_List<PLT_StateVariable*>* vars);\r
35 \r
36     // ContentDirectory service\r
37     NPT_Result Browse(\r
38         PLT_DeviceDataReference& device, \r
39         const char*              object_id, \r
40         NPT_UInt32               start_index,\r
41         NPT_UInt32               count,\r
42         bool                     browse_metadata = false,\r
43         const char*              filter = "*",\r
44         const char*              sort_criteria = "",\r
45         void*                    userdata = NULL);\r
46 \r
47     // accessor methods\r
48     const NPT_Lock<PLT_DeviceDataReferenceList>& GetMediaServers() { \r
49         return m_MediaServers; \r
50     }\r
51 \r
52 protected:\r
53     // ContentDirectory service responses\r
54     virtual NPT_Result OnBrowseResponse(\r
55         NPT_Result               res, \r
56         PLT_DeviceDataReference& device, \r
57         PLT_ActionReference&     action, \r
58         void*                    userdata);\r
59 \r
60 protected:\r
61     PLT_CtrlPointReference                m_CtrlPoint;\r
62     PLT_MediaBrowserListener*             m_Listener;\r
63     NPT_Lock<PLT_DeviceDataReferenceList> m_MediaServers;\r
64 };\r
65 \r
66 #endif /* _PLT_MEDIA_BROWSER_H_ */\r