1 /* 2 * Copyright © 2006-2009 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 7 8 9 #include <View.h> 10 11 #include "ListenerAdapter.h" 12 #include "VideoTarget.h" 13 14 15 class VideoView : public BView, public VideoTarget { 16 public: 17 VideoView(BRect frame, const char* name, 18 uint32 resizeMask); 19 virtual ~VideoView(); 20 21 // BView interface 22 virtual void Draw(BRect updateRect); 23 virtual void MessageReceived(BMessage* message); 24 virtual void Pulse(); 25 virtual void MouseMoved(BPoint where, uint32 transit, 26 const BMessage* dragMessage = NULL); 27 28 // VideoTarget interface 29 virtual void SetBitmap(const BBitmap* bitmap); 30 31 // VideoView 32 void GetOverlayScaleLimits(float* minScale, 33 float* maxScale) const; 34 35 void OverlayScreenshotPrepare(); 36 void OverlayScreenshotCleanup(); 37 38 bool UseOverlays() const; 39 bool IsOverlayActive(); 40 void DisableOverlay(); 41 42 void SetPlaying(bool playing); 43 void SetFullscreen(bool fullScreen); 44 45 private: 46 void _DrawBitmap(const BBitmap* bitmap); 47 void _AdoptGlobalSettings(); 48 49 bool fOverlayMode; 50 overlay_restrictions fOverlayRestrictions; 51 rgb_color fOverlayKeyColor; 52 bool fIsPlaying; 53 bool fIsFullscreen; 54 bigtime_t fLastMouseMove; 55 56 ListenerAdapter fGlobalSettingsListener; 57 bool fUseOverlays; 58 bool fUseBilinearScaling; 59 }; 60 61 #endif // VIDEO_VIEW_H 62