summaryrefslogtreecommitdiffstats
path: root/beos/liblayout/MVolume.h
blob: 9d70b795558569aa91aca34c15546b75a5143c72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef _MVOLUME_H
#define _MVOLUME_H

#include "layout.h"
#include <Control.h>

#if __POWERPC__
#pragma simple_class_byval off
#endif

class IMPEXPLIBLAYOUT MVolume : public MView, public BControl
{
	public:		MVolume(BHandler*);
				MVolume(BMessage*);
				virtual ~MVolume();
				virtual long Archive(BMessage *archive, bool deep=true) const;
				static BArchivable *Instantiate(BMessage *archive);

				virtual	minimax	layoutprefs();
				BRect layout(BRect);
				virtual void	AttachedToWindow();
				virtual void DetachedFromWindow();
				virtual void Draw(BRect);
				virtual void DrawVolume(void);
						float Volume();
						void SetVolume(float vol);
				virtual void MouseDown(BPoint);
				virtual void KeyDown(const char *bytes, int32 numbytes);

	private:	float volume;
				BHandler *target;
				BPoint lastvoldot;
				BPoint clickpoint;
				thread_id mousethread;
				bool ispressed;
				// moved into private area 21-6-98
				static	long _mousetracker(void *arg);
						void _MouseTracker();
				// added 21-6-98
						void _PUMouseTracker();
};

inline float MVolume::Volume()
{
	return volume;
}

#endif