1 #ifndef _CAM_ROSTER_H 2 #define _CAM_ROSTER_H 3 4 #include <image.h> 5 #include <support/Vector.h> 6 #include <usb/USBRoster.h> 7 #include <Locker.h> 8 9 class WebCamMediaAddOn; 10 class CamDevice; 11 class CamDeviceAddon; 12 13 namespace Z { 14 namespace USB { 15 class BUSBDevice; 16 } 17 } 18 19 using Z::USB::BUSBDevice; 20 21 class CamRoster : public BUSBRoster 22 { 23 public: 24 CamRoster(WebCamMediaAddOn* _addon); 25 virtual ~CamRoster(); 26 virtual status_t DeviceAdded(BUSBDevice* _device); 27 virtual void DeviceRemoved(BUSBDevice* _device); 28 29 uint32 CountCameras(); 30 bool Lock(); 31 void Unlock(); 32 // those must be called with Lock() 33 CamDevice* CameraAt(int32 index); 34 35 36 37 private: 38 status_t LoadInternalAddons(); 39 status_t LoadExternalAddons(); 40 41 BLocker fLocker; 42 WebCamMediaAddOn* fAddon; 43 B::Support:: 44 BVector<CamDeviceAddon*> fCamerasAddons; 45 B::Support:: 46 BVector<CamDevice*> fCameras; 47 }; 48 49 #endif 50