btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / apps / mediaplayer / interface / DurationView.h
blob63e40bd4970eb24f0e32b4d51a3d94ab1836f71b
1 /*
2 * Copyright 2010, Stephan Aßmus <superstippi@gmx.de>.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef DURATION_VIEW_H
6 #define DURATION_VIEW_H
9 #include <String.h>
10 #include <StringView.h>
13 class DurationView : public BStringView {
14 public:
15 DurationView(const char* name);
17 // BStringView interface
18 virtual void AttachedToWindow();
19 virtual void MouseDown(BPoint where);
20 virtual void MessageReceived(BMessage* message);
21 virtual BSize MinSize();
22 virtual BSize MaxSize();
24 // DurationView
25 void Update(bigtime_t position, bigtime_t duration);
27 enum {
28 kTimeElapsed = 0,
29 kTimeToFinish,
30 kDuration,
32 kLastMode
35 void SetMode(uint32 mode);
36 uint32 Mode() const
37 { return fMode; }
39 void SetSymbolScale(float scale);
41 private:
42 void _Update();
43 void _UpdateTextColor();
44 void _GenerateString(bigtime_t duration);
46 private:
47 uint32 fMode;
48 bigtime_t fPosition;
49 bigtime_t fDuration;
50 bigtime_t fDisplayDuration;
54 #endif // DURATION_VIEW_H