~ubuntu-branches/ubuntu/maverick/vlc/maverick

« back to all changes in this revision

Viewing changes to modules/gui/beos/MediaControlView.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-09-17 21:56:14 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20080917215614-tj0vx8xzd57e52t8
Tags: 0.9.2-1ubuntu1
* New Upstream Release, exception granted by
    - dktrkranz, norsetto, Hobbsee (via irc). LP: #270404

Changes done in ubuntu:

* add libxul-dev to build-depends
* make sure that vlc is build against libxul in configure. This doesn't
  change anything in the package, but makes it more robust if building
  in an 'unclean' chroot or when modifying the package.
* debian/control: make Vcs-* fields point to the motumedia branch
* add libx264-dev and libass-dev to build-depends
  LP: #210354, #199870
* actually enable libass support by passing --enable-libass to configure
* enable libdca: add libdca-dev to build depends and --enable-libdca
* install the x264 plugin.

Changes already in the pkg-multimedia branch in debian:

* don't install usr/share/vlc/mozilla in debian/mozilla-plugin-vlc.install  
* new upstream .desktop file now registers flash video mimetype LP: #261567
* add Xb-Npp-Applications to mozilla-plugin-vlc
* remove duplicate entries in debian/vlc-nox.install

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * MediaControlView.h: beos interface
3
3
 *****************************************************************************
4
4
 * Copyright (C) 1999, 2000, 2001 the VideoLAN team
5
 
 * $Id: 92b1d2a8f91221515186648ec09ef3acebc3eb88 $
 
5
 * $Id$
6
6
 *
7
7
 * Authors: Tony Castley <tony@castley.net>
8
8
 *          Stephan Aßmus <stippi@yellowbites.com>
38
38
class MediaControlView : public BBox
39
39
{
40
40
 public:
41
 
                                                                MediaControlView( intf_thread_t * p_intf, BRect frame );
42
 
        virtual                                         ~MediaControlView();
43
 
 
44
 
                                                                // BBox
45
 
        virtual void                            AttachedToWindow();
46
 
        virtual void                            FrameResized(float width, float height);
47
 
        virtual void                            GetPreferredSize(float* width, float* height);
48
 
        virtual void                            MessageReceived(BMessage* message);
49
 
        virtual void                            Pulse(); // detect stopped stream
50
 
 
51
 
                                                                // MediaControlView
52
 
                        void                            SetProgress( float position );
53
 
 
54
 
                        void                            SetStatus(int status, int rate); 
55
 
                        void                            SetEnabled(bool enable);
56
 
                        void                            SetAudioEnabled(bool enable);
57
 
                        uint32                          GetVolume() const;
58
 
                        void                            SetSkippable(bool backward,
59
 
                                                                                         bool forward);
60
 
                        void                            SetMuted(bool mute);
61
 
    
 
41
                                MediaControlView( intf_thread_t * p_intf, BRect frame );
 
42
    virtual                        ~MediaControlView();
 
43
 
 
44
                                // BBox
 
45
    virtual    void                AttachedToWindow();
 
46
    virtual    void                FrameResized(float width, float height);
 
47
    virtual    void                GetPreferredSize(float* width, float* height);
 
48
    virtual    void                MessageReceived(BMessage* message);
 
49
    virtual    void                Pulse(); // detect stopped stream
 
50
 
 
51
                                // MediaControlView
 
52
            void                SetProgress( float position );
 
53
 
 
54
            void                SetStatus(int status, int rate);
 
55
            void                SetEnabled(bool enable);
 
56
            void                SetAudioEnabled(bool enable);
 
57
            uint32                GetVolume() const;
 
58
            void                SetSkippable(bool backward,
 
59
                                             bool forward);
 
60
            void                SetMuted(bool mute);
 
61
 
62
62
 private:
63
 
                        void                            _LayoutControls(BRect frame) const;
64
 
                        BRect                           _MinFrame() const;
65
 
                        void                            _LayoutControl(BView* view,
66
 
                                                                                           BRect frame,
67
 
                                                                                           bool resizeWidth = false,
68
 
                                                                                           bool resizeHeight = false) const;
69
 
 
70
 
                        intf_thread_t *     p_intf;
71
 
 
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;
81
 
                        PositionInfoView*   fPositionInfo;
82
 
 
83
 
                        int                                     fCurrentRate;
84
 
                        int                                     fCurrentStatus;
85
 
                        float                           fBottomControlHeight;
86
 
                        BRect                           fOldBounds;
87
 
                        bool                fIsEnabled;
88
 
                        
 
63
            void                _LayoutControls(BRect frame) const;
 
64
            BRect                _MinFrame() const;
 
65
            void                _LayoutControl(BView* view,
 
66
                                               BRect frame,
 
67
                                               bool resizeWidth = false,
 
68
                                               bool resizeHeight = false) const;
 
69
 
 
70
            intf_thread_t *     p_intf;
 
71
 
 
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;
 
81
            PositionInfoView*   fPositionInfo;
 
82
 
 
83
            int                    fCurrentRate;
 
84
            int                    fCurrentStatus;
 
85
            float                fBottomControlHeight;
 
86
            BRect                fOldBounds;
 
87
            bool                fIsEnabled;
 
88
            
89
89
};
90
90
 
91
91
class SeekSlider : public BControl
92
92
{
93
93
 public:
94
 
                                                                SeekSlider(intf_thread_t * p_intf,
95
 
                                                                           BRect frame,
96
 
                                                                                   const char* name,
97
 
                                                                                   MediaControlView* owner );
98
 
 
99
 
        virtual                                         ~SeekSlider();
100
 
 
101
 
                                                                // BControl
102
 
        virtual void                            AttachedToWindow();
103
 
        virtual void                            Draw(BRect updateRect);
104
 
        virtual void                            MouseDown(BPoint where);
105
 
        virtual void                            MouseMoved(BPoint where, uint32 transit,
106
 
                                                                                   const BMessage* dragMessage);
107
 
        virtual void                            MouseUp(BPoint where);
108
 
        virtual void                            ResizeToPreferred();
109
 
 
110
 
                                                                // SeekSlider
111
 
                        void                            SetPosition(float position);
 
94
                                SeekSlider(intf_thread_t * p_intf,
 
95
                                           BRect frame,
 
96
                                           const char* name,
 
97
                                           MediaControlView* owner );
 
98
 
 
99
    virtual                        ~SeekSlider();
 
100
 
 
101
                                // BControl
 
102
    virtual    void                AttachedToWindow();
 
103
    virtual void                Draw(BRect updateRect);
 
104
    virtual    void                MouseDown(BPoint where);
 
105
    virtual    void                MouseMoved(BPoint where, uint32 transit,
 
106
                                           const BMessage* dragMessage);
 
107
    virtual    void                MouseUp(BPoint where);
 
108
    virtual    void                ResizeToPreferred();
 
109
 
 
110
                                // SeekSlider
 
111
            void                SetPosition(float position);
112
112
 
113
113
private:
114
 
                        int32                           _ValueFor(float x) const;
115
 
                        void                            _StrokeFrame(BRect frame,
116
 
                                                                                         rgb_color left,
117
 
                                                                                         rgb_color top,
118
 
                                                                                         rgb_color right,
119
 
                                                                                         rgb_color bottom);
 
114
            int32                _ValueFor(float x) const;
 
115
            void                _StrokeFrame(BRect frame,
 
116
                                             rgb_color left,
 
117
                                             rgb_color top,
 
118
                                             rgb_color right,
 
119
                                             rgb_color bottom);
120
120
 
121
121
            intf_thread_t     * p_intf;
122
 
                        MediaControlView*       fOwner; 
123
 
                        bool                            fTracking;
 
122
            MediaControlView*    fOwner;    
 
123
            bool                fTracking;
124
124
};
125
125
 
126
126
class VolumeSlider : public BControl
127
127
{
128
128
 public:
129
 
                                                                VolumeSlider(BRect frame,
130
 
                                                                                         const char* name,
131
 
                                                                                         int32 minValue,
132
 
                                                                                         int32 maxValue,
133
 
                                                                                         BMessage* message = NULL,
134
 
                                                                                         BHandler* target = NULL);
135
 
 
136
 
        virtual                                         ~VolumeSlider();
137
 
 
138
 
                                                                // BControl
139
 
        virtual void                            AttachedToWindow();
140
 
        virtual void                            SetValue(int32 value);
141
 
        virtual void                            SetEnabled(bool enable);
142
 
        virtual void                            Draw(BRect updateRect);
143
 
        virtual void                            MouseDown(BPoint where);
144
 
        virtual void                            MouseMoved(BPoint where, uint32 transit,
145
 
                                                                                   const BMessage* dragMessage);
146
 
        virtual void                            MouseUp(BPoint where);
147
 
 
148
 
                                                                // VolumeSlider
149
 
                        bool                            IsValid() const;
150
 
                        void                            SetMuted(bool mute);
 
129
                                VolumeSlider(BRect frame,
 
130
                                             const char* name,
 
131
                                             int32 minValue,
 
132
                                             int32 maxValue,
 
133
                                             BMessage* message = NULL,
 
134
                                             BHandler* target = NULL);
 
135
 
 
136
    virtual                        ~VolumeSlider();
 
137
 
 
138
                                // BControl
 
139
    virtual    void                AttachedToWindow();
 
140
    virtual    void                SetValue(int32 value);
 
141
    virtual void                SetEnabled(bool enable);
 
142
    virtual void                Draw(BRect updateRect);
 
143
    virtual void                MouseDown(BPoint where);
 
144
    virtual    void                MouseMoved(BPoint where, uint32 transit,
 
145
                                           const BMessage* dragMessage);
 
146
    virtual    void                MouseUp(BPoint where);
 
147
 
 
148
                                // VolumeSlider
 
149
            bool                IsValid() const;
 
150
            void                SetMuted(bool mute);
151
151
 
152
152
 private:
153
 
                        void                            _MakeBitmaps();
154
 
                        void                            _DimBitmap(BBitmap* bitmap);
155
 
                        int32                           _ValueFor(float xPos) const;
 
153
            void                _MakeBitmaps();
 
154
            void                _DimBitmap(BBitmap* bitmap);
 
155
            int32                _ValueFor(float xPos) const;
156
156
 
157
 
                        BBitmap*                        fLeftSideBits;
158
 
                        BBitmap*                        fRightSideBits;
159
 
                        BBitmap*                        fKnobBits;
160
 
                        bool                            fTracking;
161
 
                        bool                            fMuted;
162
 
                        int32                           fMinValue;
163
 
                        int32                           fMaxValue;
 
157
            BBitmap*            fLeftSideBits;
 
158
            BBitmap*            fRightSideBits;
 
159
            BBitmap*            fKnobBits;
 
160
            bool                fTracking;
 
161
            bool                fMuted;
 
162
            int32                fMinValue;
 
163
            int32                fMaxValue;
164
164
};
165
165
 
166
166
class PositionInfoView : public BView
167
167
{
168
168
 public:
169
 
                                                                PositionInfoView( BRect frame,
170
 
                                                                                                  const char* name,
171
 
                                                                                                  intf_thread_t *p_intf );
172
 
        virtual                                         ~PositionInfoView();
173
 
 
174
 
                                                                // BView
175
 
        virtual void                            Draw( BRect updateRect );
176
 
        virtual void                            ResizeToPreferred();
177
 
        virtual void                            GetPreferredSize( float* width,
178
 
                                                                                                  float* height );
179
 
        virtual void                            Pulse();
180
 
 
181
 
                                                                // PositionInfoView
182
 
        enum
183
 
        {
184
 
                MODE_SMALL,
185
 
                MODE_BIG,
186
 
        };
187
 
 
188
 
                        void                            SetMode( uint32 mode );
189
 
                        void                            GetBigPreferredSize( float* width,
190
 
                                                                                                         float* height );
191
 
 
192
 
                        void                            SetFile( int32 index, int32 size );
193
 
                        void                            SetTitle( int32 index, int32 size );
194
 
                        void                            SetChapter( int32 index, int32 size );
195
 
                        void                            SetTime( int32 seconds );
196
 
                        void                            SetTime( const char* string );
 
169
                                PositionInfoView( BRect frame,
 
170
                                                  const char* name,
 
171
                                                  intf_thread_t *p_intf );
 
172
    virtual                        ~PositionInfoView();
 
173
 
 
174
                                // BView
 
175
    virtual    void                Draw( BRect updateRect );
 
176
    virtual    void                ResizeToPreferred();
 
177
    virtual    void                GetPreferredSize( float* width,
 
178
                                                  float* height );
 
179
    virtual    void                Pulse();
 
180
 
 
181
                                // PositionInfoView
 
182
    enum
 
183
    {
 
184
        MODE_SMALL,
 
185
        MODE_BIG,
 
186
    };
 
187
 
 
188
            void                SetMode( uint32 mode );
 
189
            void                GetBigPreferredSize( float* width,
 
190
                                                     float* height );
 
191
 
 
192
            void                SetFile( int32 index, int32 size );
 
193
            void                SetTitle( int32 index, int32 size );
 
194
            void                SetChapter( int32 index, int32 size );
 
195
            void                SetTime( int32 seconds );
 
196
            void                SetTime( const char* string );
197
197
 private:
198
 
                        void                            _InvalidateContents( uint32 which = 0 );
199
 
                        void                            _MakeString( BString& into,
200
 
                                                                                         int32 index,
201
 
                                                                                         int32 maxIndex ) const;
202
 
//                      void                            _DrawAlignedString( const char* string,
203
 
//                                                                                                      BRect frame,
204
 
//                                                                                                      alignment mode = B_ALIGN_LEFT );
205
 
 
206
 
                        uint32                          fMode;
207
 
                        int32                           fCurrentFileIndex;
208
 
                        int32                           fCurrentFileSize;
209
 
                        int32                           fCurrentTitleIndex;
210
 
                        int32                           fCurrentTitleSize;
211
 
                        int32                           fCurrentChapterIndex;
212
 
                        int32                           fCurrentChapterSize;
213
 
 
214
 
                        int32                           fSeconds;
215
 
                        BString                         fTimeString;
216
 
                        bigtime_t                       fLastPulseUpdate;
217
 
                        float                           fStackedWidthCache;
218
 
                        float                           fStackedHeightCache;
219
 
                        
220
 
                        intf_thread_t *     p_intf;
221
 
                        
 
198
            void                _InvalidateContents( uint32 which = 0 );
 
199
            void                _MakeString( BString& into,
 
200
                                             int32 index,
 
201
                                             int32 maxIndex ) const;
 
202
//            void                _DrawAlignedString( const char* string,
 
203
//                                                    BRect frame,
 
204
//                                                    alignment mode = B_ALIGN_LEFT );
 
205
 
 
206
            uint32                fMode;
 
207
            int32                fCurrentFileIndex;
 
208
            int32                fCurrentFileSize;
 
209
            int32                fCurrentTitleIndex;
 
210
            int32                fCurrentTitleSize;
 
211
            int32                fCurrentChapterIndex;
 
212
            int32                fCurrentChapterSize;
 
213
 
 
214
            int32                fSeconds;
 
215
            BString                fTimeString;
 
216
            bigtime_t            fLastPulseUpdate;
 
217
            float                fStackedWidthCache;
 
218
            float                fStackedHeightCache;
 
219
            
 
220
            intf_thread_t *     p_intf;
 
221
            
222
222
};
223
223
 
224
 
#endif  // BEOS_MEDIA_CONTROL_VIEW_H
 
224
#endif    // BEOS_MEDIA_CONTROL_VIEW_H