xref: /haiku/src/apps/patchbay/MidiEventMeter.h (revision a3e794ae459fec76826407f8ba8c94cd3535f128)
1 /* MidiEventMeter.h
2  * ----------------
3  * A UI widget that measures the amount of MIDI data generated by a
4  * consumer.
5  *
6  * Copyright 2013, Haiku, Inc. All rights reserved.
7  * Distributed under the terms of the MIT License.
8  *
9  * Revisions by Pete Goodeve
10  *
11  * Copyright 1999, Be Incorporated.   All Rights Reserved.
12  * This file may be used under the terms of the Be Sample Code License.
13  */
14 #ifndef MIDIEVENTMETER_H
15 #define MIDIEVENTMETER_H
16 
17 #include <Point.h>
18 #include <Rect.h>
19 
20 class BMidiProducer;
21 class CountEventConsumer;
22 class BView;
23 
24 class MidiEventMeter
25 {
26 public:
27 	MidiEventMeter(int32 producerID);
28 	~MidiEventMeter();
29 
30 	void Pulse(BView* view);
31 	BRect Bounds() const;
32 	void Draw(BView* view);
33 
34 private:
35 	int32 CalcMeterLevel(int32 eventCount) const;
36 
37 	CountEventConsumer* fCounter;
38 	int32 fMeterLevel;
39 };
40 
41 #endif /* MIDIEVENTMETER_H */
42