2 * Copyright 2005, Jérôme Duval. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Inspired by SoundCapture from Be newsletter (Media Kit Basics: Consumers and Producers)
14 class SliderOffscreenView
: public BView
{
17 SliderOffscreenView(BRect frame
, const char *name
);
18 virtual ~SliderOffscreenView();
21 BBitmap leftBitmap
, rightBitmap
;
22 BBitmap leftThumbBitmap
, rightThumbBitmap
;
31 class TrackSlider
: public BControl
34 TrackSlider(BRect rect
, const char* title
, BMessage
*msg
, uint32 resizeFlags
);
36 void AttachedToWindow();
37 virtual void Draw(BRect
);
38 virtual void MouseMoved(BPoint point
, uint32 transit
, const BMessage
*message
);
39 virtual void MouseUp(BPoint point
);
40 virtual void MouseDown(BPoint point
);
41 void SetMainTime(bigtime_t timestamp
, bool reset
);
42 void SetTotalTime(bigtime_t timestamp
, bool reset
);
43 bigtime_t
* MainTime() { return &fMainTime
; };
44 bigtime_t
RightTime() { return fRightTime
; };
45 bigtime_t
LeftTime() { return fLeftTime
; };
47 virtual void FrameResized(float width
, float height
);
49 void _DrawCounter(bigtime_t timestamp
, float position
, bool isTracking
);
50 void _DrawMarker(float position
);
51 void _TimeToString(bigtime_t timestamp
, char *string
);
52 void _UpdatePosition(BPoint point
);
68 SliderOffscreenView
*fBitmapView
;
73 #endif /* TRACKSLIDER_H */