xref: /haiku/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h (revision 02af02f93ae67777d65cce1eda1c5f21aaed3446)
1 /*
2  * Copyright 2004-2008, François Revol, <revol@free.fr>.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _CAM_ROSTER_H
6 #define _CAM_ROSTER_H
7 
8 #include <image.h>
9 #include <List.h>
10 #include <Locker.h>
11 
12 #include "CamDevice.h"
13 
14 class WebCamMediaAddOn;
15 class CamDeviceAddon;
16 
17 class CamRoster : public BUSBRoster {
18 public:
19 						CamRoster(WebCamMediaAddOn* _addon);
20 	virtual				~CamRoster();
21 	virtual status_t	DeviceAdded(BUSBDevice* _device);
22 	virtual void		DeviceRemoved(BUSBDevice* _device);
23 
24 			uint32		CountCameras();
25 			bool		Lock();
26 			void		Unlock();
27 	// those must be called with Lock()
28 			CamDevice*	CameraAt(int32 index);
29 
30 
31 
32 private:
33 			status_t	LoadInternalAddons();
34 			status_t	LoadExternalAddons();
35 
36 	BLocker				fLocker;
37 	WebCamMediaAddOn*	fAddon;
38 	BList			fCamerasAddons;
39 	BList			fCameras;
40 };
41 
42 #endif
43