repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / mediaplayer / VideoView.h
blobfa8f753216bf4314ce00ef810cecdc16c7714480
1 /*
2 * Copyright 2006-2010 Stephan Aßmus <superstippi@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT license.
4 */
5 #ifndef VIDEO_VIEW_H
6 #define VIDEO_VIEW_H
9 #include <View.h>
11 #include "ListenerAdapter.h"
12 #include "VideoTarget.h"
15 enum {
16 M_HIDE_FULL_SCREEN_CONTROLS = 'hfsc'
20 class SubtitleBitmap;
23 class VideoView : public BView, public VideoTarget {
24 public:
25 VideoView(BRect frame, const char* name,
26 uint32 resizeMask);
27 virtual ~VideoView();
29 // BView interface
30 virtual void Draw(BRect updateRect);
31 virtual void MessageReceived(BMessage* message);
32 virtual void Pulse();
33 virtual void MouseMoved(BPoint where, uint32 transit,
34 const BMessage* dragMessage = NULL);
36 // VideoTarget interface
37 virtual void SetBitmap(const BBitmap* bitmap);
39 // VideoView
40 void GetOverlayScaleLimits(float* minScale,
41 float* maxScale) const;
43 void OverlayScreenshotPrepare();
44 void OverlayScreenshotCleanup();
46 bool UseOverlays() const;
47 bool IsOverlayActive();
48 void DisableOverlay();
50 void SetPlaying(bool playing);
51 void SetFullscreen(bool fullScreen);
52 void SetFullscreenControlsVisible(bool visible);
53 void SetVideoFrame(const BRect& frame);
55 void SetSubTitle(const char* text);
56 void SetSubTitleMaxBottom(float bottom);
58 private:
59 void _DrawBitmap(const BBitmap* bitmap);
60 void _DrawSubtitle();
61 void _AdoptGlobalSettings();
62 void _SetOverlayMode(bool overlayMode);
63 void _LayoutSubtitle();
65 private:
66 BRect fVideoFrame;
67 bool fOverlayMode;
68 overlay_restrictions fOverlayRestrictions;
69 rgb_color fOverlayKeyColor;
70 bool fIsPlaying;
71 bool fIsFullscreen;
72 bool fFullscreenControlsVisible;
73 bool fFirstPulseAfterFullscreen;
74 uint8 fSendHideCounter;
75 bigtime_t fLastMouseMove;
77 SubtitleBitmap* fSubtitleBitmap;
78 BRect fSubtitleFrame;
79 float fSubtitleMaxButtom;
80 bool fHasSubtitle;
81 bool fSubtitleChanged;
83 // Settings values:
84 ListenerAdapter fGlobalSettingsListener;
85 bool fUseOverlays;
86 bool fUseBilinearScaling;
87 uint32 fSubtitlePlacement;
90 #endif // VIDEO_VIEW_H