1 /*****************************************************************************
2 * VideoWindow.h: BeOS video window class prototype
3 *****************************************************************************
4 * Copyright (C) 1999, 2000, 2001 the VideoLAN team
7 * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
8 * Tony Castley <tcastley@mail.powerup.com.au>
9 * Richard Shepherd <richard@rshepherd.demon.co.uk>
10 * Stephan Aßmus <stippi@yellowbites.com>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
27 #ifndef BEOS_VIDEO_WINDOW_H
28 #define BEOS_VIDEO_WINDOW_H
37 typedef struct colorcombo
46 colorcombo colspace[]=
48 {B_YCbCr420, "B_YCbCr420", VLC_FOURCC('I','4','2','0'), 3, 2},
49 {B_YUV422, "B_YUV422", VLC_FOURCC('Y','4','2','2'), 3, 2},
50 {B_YCbCr422, "B_YCbCr422", VLC_FOURCC('Y','U','Y','2'), 3, 2},
51 {B_RGB32, "B_RGB32", VLC_FOURCC('R','V','3','2'), 1, 4},
52 {B_RGB16, "B_RGB16", VLC_FOURCC('R','V','1','6'), 1, 2}
61 VideoSettings( const VideoSettings& clone );
62 virtual ~VideoSettings();
64 static VideoSettings* DefaultSettings();
74 void SetVideoSize( uint32_t mode );
75 inline uint32_t VideoSize() const
76 { return fVideoSize; }
79 FLAG_CORRECT_RATIO = 0x0001,
80 FLAG_SYNC_RETRACE = 0x0002,
81 FLAG_ON_TOP_ALL = 0x0004,
82 FLAG_FULL_SCREEN = 0x0008,
85 inline void SetFlags( uint32_t flags )
87 inline void AddFlags( uint32_t flags )
89 inline void ClearFlags( uint32_t flags )
91 inline bool HasFlags( uint32_t flags ) const
92 { return fFlags & flags; }
93 inline uint32_t Flags() const
97 VideoSettings(); // reserved for default settings
99 static VideoSettings fDefaultSettings;
107 class VLCView : public BView
110 VLCView( BRect bounds, vout_thread_t *p_vout );
113 virtual void AttachedToWindow();
114 virtual void MouseDown(BPoint where);
115 virtual void MouseUp(BPoint where);
116 virtual void MouseMoved(BPoint where, uint32 transit,
117 const BMessage* dragMessage);
118 virtual void Pulse();
119 virtual void Draw(BRect updateRect);
122 vout_thread_t *p_vout;
124 bigtime_t fLastMouseMovedTime;
127 bool fIgnoreDoubleClick;
131 class VideoWindow : public BWindow
134 VideoWindow(int v_width,
137 vout_thread_t *p_vout);
138 virtual ~VideoWindow();
141 virtual void MessageReceived(BMessage* message);
142 virtual void Zoom(BPoint origin,
143 float width, float height);
144 virtual void FrameResized(float width, float height);
145 virtual void FrameMoved(BPoint origin);
146 virtual void ScreenChanged(BRect frame,
148 virtual void WindowActivated(bool active);
151 void drawBuffer(int bufferIndex);
153 void ToggleInterfaceShowing();
154 void SetInterfaceShowing(bool showIt);
156 void SetCorrectAspectRatio(bool doIt);
157 bool CorrectAspectRatio() const;
158 void ToggleFullScreen();
159 void SetFullScreen(bool doIt);
160 bool IsFullScreen() const;
161 void SetOnTop(bool doIt);
162 bool IsOnTop() const;
163 void SetSyncToRetrace(bool doIt);
164 bool IsSyncedToRetrace() const;
165 inline status_t InitCheck() const
166 { return fInitStatus; }
169 // this is the hook controling direct screen connection
170 int32_t i_width; // aspect corrected bitmap size
172 BRect winSize; // current window size
174 // BBitmap *overlaybitmap;
177 volatile bool teardownwindow;
178 thread_id fDrawThreadID;
184 status_t _AllocateBuffers(int width,
188 void _BlankBitmap(BBitmap* bitmap) const;
189 void _SetVideoSize(uint32_t mode);
190 void _SetToSettings();
192 vout_thread_t *p_vout;
194 int32_t fTrueWidth; // incomming bitmap size
196 window_feel fCachedFeel;
197 bool fInterfaceShowing;
198 status_t fInitStatus;
199 VideoSettings* fSettings;
202 #endif // BEOS_VIDEO_WINDOW_H