xref: /haiku/src/apps/soundrecorder/VUView.h (revision 2ae568931fcac7deb9f1e6ff4e47213fbfe4029b)
1 /*
2  * Copyright 2005, Jérôme Duval. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Inspired by SoundCapture from Be newsletter (Media Kit Basics: Consumers and Producers)
6  */
7 
8 #ifndef VUVIEW_H
9 #define VUVIEW_H
10 
11 #include <Bitmap.h>
12 #include <View.h>
13 
14 
15 class VUView : public BView
16 {
17 public:
18 	VUView(BRect rect, uint32 resizeFlags);
19 	~VUView();
20 	void AttachedToWindow();
21 	void DetachedFromWindow();
22 	void Draw(BRect updateRect);
23 	void ComputeNextLevel(void *data, size_t size);
24 
25 private:
26 	void Run();
27 	void Quit();
28 	static int32 RenderLaunch(void *data);
29 	void RenderLoop();
30 
31 	thread_id fThreadId;
32 	BBitmap *fBitmap;
33 	BView *fBitmapView;
34 	bool fQuitting;
35 	int32 fLevelCount;
36 	int32 *fCurrentLevels;
37 	int32 fChannels;
38 };
39 
40 #endif	/* VUVIEW_H */
41