vfs: check userland buffers before reading them.
[haiku.git] / src / apps / patchbay / MidiEventMeter.h
blob6894693b2f41a12db92cdb7f8c3a2094c1fd1f93
1 /* MidiEventMeter.h
2 * ----------------
3 * A UI widget that measures the amount of MIDI data generated by a
4 * consumer.
6 * Copyright 2013, Haiku, Inc. All rights reserved.
7 * Distributed under the terms of the MIT License.
9 * Revisions by Pete Goodeve
11 * Copyright 1999, Be Incorporated. All Rights Reserved.
12 * This file may be used under the terms of the Be Sample Code License.
14 #ifndef MIDIEVENTMETER_H
15 #define MIDIEVENTMETER_H
17 #include <Point.h>
18 #include <Rect.h>
20 class BMidiProducer;
21 class CountEventConsumer;
22 class BView;
24 class MidiEventMeter
26 public:
27 MidiEventMeter(int32 producerID);
28 ~MidiEventMeter();
30 void Pulse(BView* view);
31 BRect Bounds() const;
32 void Draw(BView* view);
34 private:
35 int32 CalcMeterLevel(int32 eventCount) const;
37 CountEventConsumer* fCounter;
38 int32 fMeterLevel;
41 #endif /* MIDIEVENTMETER_H */