* 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:
@@ -888,7 +888,10 @@ Controller::_NotifyMutedChanged(bool muted) const
|
|||||||
void
|
void
|
||||||
Controller::NotifyPlayModeChanged(int32 mode) const
|
Controller::NotifyPlayModeChanged(int32 mode) const
|
||||||
{
|
{
|
||||||
_NotifyPlaybackStateChanged(_PlaybackState(mode));
|
uint32 state = _PlaybackState(mode);
|
||||||
|
if (fVideoView)
|
||||||
|
fVideoView->SetPlaying(state == PLAYBACK_STATE_PLAYING);
|
||||||
|
_NotifyPlaybackStateChanged(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
VideoView::VideoView(BRect frame, const char* name, uint32 resizeMask)
|
VideoView::VideoView(BRect frame, const char* name, uint32 resizeMask)
|
||||||
: BView(frame, name, resizeMask, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE),
|
: BView(frame, name, resizeMask, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE),
|
||||||
fOverlayMode(false),
|
fOverlayMode(false),
|
||||||
|
fIsPlaying(false),
|
||||||
fGlobalSettingsListener(this)
|
fGlobalSettingsListener(this)
|
||||||
{
|
{
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewColor(B_TRANSPARENT_COLOR);
|
||||||
@@ -21,6 +22,7 @@ VideoView::VideoView(BRect frame, const char* name, uint32 resizeMask)
|
|||||||
SetHighColor(0, 0, 0);
|
SetHighColor(0, 0, 0);
|
||||||
|
|
||||||
// create some hopefully sensible default overlay restrictions
|
// create some hopefully sensible default overlay restrictions
|
||||||
|
// they will be adjusted when overlays are actually used
|
||||||
fOverlayRestrictions.min_width_scale = 0.25;
|
fOverlayRestrictions.min_width_scale = 0.25;
|
||||||
fOverlayRestrictions.max_width_scale = 8.0;
|
fOverlayRestrictions.max_width_scale = 8.0;
|
||||||
fOverlayRestrictions.min_height_scale = 0.25;
|
fOverlayRestrictions.min_height_scale = 0.25;
|
||||||
@@ -61,6 +63,7 @@ VideoView::MessageReceived(BMessage* message)
|
|||||||
{
|
{
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case MSG_OBJECT_CHANGED:
|
case MSG_OBJECT_CHANGED:
|
||||||
|
// received from fGlobalSettingsListener
|
||||||
// TODO: find out which object, if we ever watch more than
|
// TODO: find out which object, if we ever watch more than
|
||||||
// the global settings instance...
|
// the global settings instance...
|
||||||
_AdoptGlobalSettings();
|
_AdoptGlobalSettings();
|
||||||
@@ -195,6 +198,14 @@ VideoView::DisableOverlay()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
VideoView::SetPlaying(bool playing)
|
||||||
|
{
|
||||||
|
printf("VideoView::SetPlaying(%d)\n", playing);
|
||||||
|
fIsPlaying = playing;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
@@ -214,8 +225,12 @@ void
|
|||||||
VideoView::_AdoptGlobalSettings()
|
VideoView::_AdoptGlobalSettings()
|
||||||
{
|
{
|
||||||
mpSettings settings = Settings::CurrentSettings();
|
mpSettings settings = Settings::CurrentSettings();
|
||||||
|
// thread safe
|
||||||
|
|
||||||
fUseOverlays = settings.useOverlays;
|
fUseOverlays = settings.useOverlays;
|
||||||
fUseBilinearScaling = settings.scaleBilinear;
|
fUseBilinearScaling = settings.scaleBilinear;
|
||||||
|
|
||||||
|
if (!fIsPlaying && !fOverlayMode)
|
||||||
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ public:
|
|||||||
bool IsOverlayActive();
|
bool IsOverlayActive();
|
||||||
void DisableOverlay();
|
void DisableOverlay();
|
||||||
|
|
||||||
|
void SetPlaying(bool playing);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _DrawBitmap(const BBitmap* bitmap);
|
void _DrawBitmap(const BBitmap* bitmap);
|
||||||
void _AdoptGlobalSettings();
|
void _AdoptGlobalSettings();
|
||||||
@@ -43,6 +45,7 @@ private:
|
|||||||
bool fOverlayMode;
|
bool fOverlayMode;
|
||||||
overlay_restrictions fOverlayRestrictions;
|
overlay_restrictions fOverlayRestrictions;
|
||||||
rgb_color fOverlayKeyColor;
|
rgb_color fOverlayKeyColor;
|
||||||
|
bool fIsPlaying;
|
||||||
|
|
||||||
ListenerAdapter fGlobalSettingsListener;
|
ListenerAdapter fGlobalSettingsListener;
|
||||||
bool fUseOverlays;
|
bool fUseOverlays;
|
||||||
|
|||||||
Reference in New Issue
Block a user