vfs: check userland buffers before reading them.
[haiku.git] / src / servers / midi / DeviceWatcher.h
blob9483823a7d1be609d2f79331f02659895f9c9d3e
1 /*
2 * Copyright 2004-2009, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Matthijs Hollemans
7 * Jerome Leveque
8 * Philippe Houdoin
9 */
10 #ifndef DEVICE_WATCHER_H
11 #define DEVICE_WATCHER_H
13 #include <Looper.h>
15 #include "HashMap.h"
16 #include "HashString.h"
18 class BBitmap;
19 class BMidiEndpoint;
20 class DeviceEndpoints;
22 class DeviceWatcher : public BLooper {
23 public:
24 DeviceWatcher();
25 ~DeviceWatcher();
27 void MessageReceived(BMessage* message);
29 status_t Start();
30 status_t Stop();
32 private:
33 static int32 _InitialDevicesScanThread(void* data);
34 void _ScanDevices(const char* path);
35 void _AddDevice(const char* path);
36 void _RemoveDevice(const char* path);
37 void _SetIcons(BMidiEndpoint* endp);
39 typedef HashMap<HashString, DeviceEndpoints*> DeviceEndpointsMap;
40 DeviceEndpointsMap fDeviceEndpointsMap;
42 uint8* fVectorIconData;
43 size_t fVectorIconDataSize;
44 BBitmap* fLargeIcon;
45 BBitmap* fMiniIcon;
48 #endif // DEVICE_WATCHER_H