1 /*****************************************************************************
2 * MediaControlView.h: beos interface
3 *****************************************************************************
4 * Copyright (C) 1999, 2000, 2001 VideoLAN
5 * $Id: MediaControlView.h,v 1.2 2002/09/30 18:30:27 titer Exp $
7 * Authors: Tony Castley <tony@castley.net>
8 * Stephan Aßmus <stippi@yellowbites.com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 #ifndef BEOS_MEDIA_CONTROL_VIEW_H
26 #define BEOS_MEDIA_CONTROL_VIEW_H
32 class PlayPauseButton;
34 class TransportButton;
37 class MediaControlView : public BBox
40 MediaControlView( BRect frame );
41 virtual ~MediaControlView();
44 virtual void AttachedToWindow();
45 virtual void FrameResized(float width, float height);
46 virtual void GetPreferredSize(float* width, float* height);
47 virtual void MessageReceived(BMessage* message);
48 virtual void Pulse(); // detect stopped stream
51 void SetProgress(uint64 seek, uint64 size);
53 void SetStatus(int status, int rate);
54 void SetEnabled(bool enable);
55 void SetAudioEnabled(bool enable);
56 uint32 GetSeekTo() const;
57 uint32 GetVolume() const;
58 void SetSkippable(bool backward,
60 void SetMuted(bool mute);
65 void _LayoutControls(BRect frame) const;
66 BRect _MinFrame() const;
67 void _LayoutControl(BView* view,
69 bool resize = false) const;
72 VolumeSlider* fVolumeSlider;
73 SeekSlider* fSeekSlider;
74 TransportButton* fSkipBack;
75 TransportButton* fSkipForward;
76 TransportButton* fRewind;
77 TransportButton* fForward;
78 PlayPauseButton* fPlayPause;
79 TransportButton* fStop;
80 TransportButton* fMute;
84 float fBottomControlHeight;
88 class SeekSlider : public BControl
91 SeekSlider(BRect frame,
93 MediaControlView* owner,
97 virtual ~SeekSlider();
100 virtual void AttachedToWindow();
101 virtual void Draw(BRect updateRect);
102 virtual void MouseDown(BPoint where);
103 virtual void MouseMoved(BPoint where, uint32 transit,
104 const BMessage* dragMessage);
105 virtual void MouseUp(BPoint where);
106 virtual void ResizeToPreferred();
109 void SetPosition(float position);
112 int32 _ValueFor(float x) const;
113 void _StrokeFrame(BRect frame,
122 MediaControlView* fOwner;
128 class VolumeSlider : public BControl
131 VolumeSlider(BRect frame,
135 BMessage* message = NULL,
136 BHandler* target = NULL);
138 virtual ~VolumeSlider();
141 virtual void AttachedToWindow();
142 virtual void SetValue(int32 value);
143 virtual void SetEnabled(bool enable);
144 virtual void Draw(BRect updateRect);
145 virtual void MouseDown(BPoint where);
146 virtual void MouseMoved(BPoint where, uint32 transit,
147 const BMessage* dragMessage);
148 virtual void MouseUp(BPoint where);
151 bool IsValid() const;
152 void SetMuted(bool mute);
156 void _DimBitmap(BBitmap* bitmap);
157 int32 _ValueFor(float xPos) const;
159 BBitmap* fLeftSideBits;
160 BBitmap* fRightSideBits;
168 #endif // BEOS_MEDIA_CONTROL_VIEW_H