* ./modules/*: moved plugins to the new tree. Yet untested builds include
[vlc.git] / modules / gui / beos / MediaControlView.h
1 /*****************************************************************************
2  * MediaControlView.h: beos interface
3  *****************************************************************************
4  * Copyright (C) 1999, 2000, 2001 VideoLAN
5  * $Id: MediaControlView.h,v 1.1 2002/08/04 17:23:43 sam Exp $
6  *
7  * Authors: Tony Castley <tony@castley.net>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23 #define HORZ_SPACE 5.0
24 #define VERT_SPACE 5.0
25
26
27 class TransportButton;
28 class PlayPauseButton;
29 class MediaSlider;
30 class SeekSlider;
31
32 class MediaControlView : public BBox
33 {
34 public:
35     MediaControlView( BRect frame );
36     ~MediaControlView();
37
38     virtual void    MessageReceived(BMessage *message);
39     void            SetProgress(uint64 seek, uint64 size);
40
41     void            SetStatus(int status, int rate); 
42     void            SetEnabled(bool);
43     uint32          GetSeekTo();
44     uint32          GetVolume();
45         sem_id  fScrubSem;
46         bool    fSeeking;
47     
48 private:
49         MediaSlider * p_vol;
50         SeekSlider * p_seek;
51         TransportButton* p_slow;
52         PlayPauseButton* p_play;
53         TransportButton* p_fast;
54         TransportButton* p_stop;
55         TransportButton* p_mute;
56         
57         int current_rate;
58         int current_status;
59 };
60
61 class MediaSlider : public BSlider
62 {
63 public:
64         MediaSlider(BRect frame,
65                                 BMessage *message,
66                                 int32 minValue,
67                                 int32 maxValue);
68         ~MediaSlider();
69         virtual void DrawThumb(void);
70 };
71                                 
72
73 class SeekSlider : public MediaSlider
74 {
75 public:
76         SeekSlider(BRect frame,
77                                 MediaControlView *owner,
78                                 int32 minValue,
79                                 int32 maxValue,
80                                 thumb_style thumbType = B_TRIANGLE_THUMB);
81
82         ~SeekSlider();
83         uint32 seekTo;
84         virtual void MouseDown(BPoint);
85         virtual void MouseUp(BPoint pt);
86         virtual void MouseMoved(BPoint pt, uint32 c, const BMessage *m);
87 private:
88         MediaControlView*       fOwner; 
89         bool fMouseDown;
90 };
91
92