* Fix display update when toggling the scaling mode when the video is paused

without disturbing the same thing during normal playback.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27176 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-08-23 14:23:22 +00:00
parent 0650565811
commit 725b24098d
3 changed files with 22 additions and 1 deletions
+4 -1
View File
@@ -888,7 +888,10 @@ Controller::_NotifyMutedChanged(bool muted) const
void
Controller::NotifyPlayModeChanged(int32 mode) const
{
_NotifyPlaybackStateChanged(_PlaybackState(mode));
uint32 state = _PlaybackState(mode);
if (fVideoView)
fVideoView->SetPlaying(state == PLAYBACK_STATE_PLAYING);
_NotifyPlaybackStateChanged(state);
}
+15
View File
@@ -14,6 +14,7 @@
VideoView::VideoView(BRect frame, const char* name, uint32 resizeMask)
: BView(frame, name, resizeMask, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE),
fOverlayMode(false),
fIsPlaying(false),
fGlobalSettingsListener(this)
{
SetViewColor(B_TRANSPARENT_COLOR);
@@ -21,6 +22,7 @@ VideoView::VideoView(BRect frame, const char* name, uint32 resizeMask)
SetHighColor(0, 0, 0);
// create some hopefully sensible default overlay restrictions
// they will be adjusted when overlays are actually used
fOverlayRestrictions.min_width_scale = 0.25;
fOverlayRestrictions.max_width_scale = 8.0;
fOverlayRestrictions.min_height_scale = 0.25;
@@ -61,6 +63,7 @@ VideoView::MessageReceived(BMessage* message)
{
switch (message->what) {
case MSG_OBJECT_CHANGED:
// received from fGlobalSettingsListener
// TODO: find out which object, if we ever watch more than
// the global settings instance...
_AdoptGlobalSettings();
@@ -195,6 +198,14 @@ VideoView::DisableOverlay()
}
void
VideoView::SetPlaying(bool playing)
{
printf("VideoView::SetPlaying(%d)\n", playing);
fIsPlaying = playing;
}
// #pragma mark -
@@ -214,8 +225,12 @@ void
VideoView::_AdoptGlobalSettings()
{
mpSettings settings = Settings::CurrentSettings();
// thread safe
fUseOverlays = settings.useOverlays;
fUseBilinearScaling = settings.scaleBilinear;
if (!fIsPlaying && !fOverlayMode)
Invalidate();
}
+3
View File
@@ -36,6 +36,8 @@ public:
bool IsOverlayActive();
void DisableOverlay();
void SetPlaying(bool playing);
private:
void _DrawBitmap(const BBitmap* bitmap);
void _AdoptGlobalSettings();
@@ -43,6 +45,7 @@ private:
bool fOverlayMode;
overlay_restrictions fOverlayRestrictions;
rgb_color fOverlayKeyColor;
bool fIsPlaying;
ListenerAdapter fGlobalSettingsListener;
bool fUseOverlays;