summaryrefslogtreecommitdiff
path: root/slideshow/source/engine
diff options
context:
space:
mode:
Diffstat (limited to 'slideshow/source/engine')
-rw-r--r--slideshow/source/engine/transitions/slidetransitionfactory.cxx115
-rw-r--r--slideshow/source/engine/transitions/transitionfactorytab.cxx14
2 files changed, 119 insertions, 10 deletions
diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
index 4a8e674c2559..76996a6098c5 100644
--- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx
+++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
@@ -474,6 +474,89 @@ void FadingSlideChange::performOut(
}
}
+class CutSlideChange : public SlideChangeBase
+{
+public:
+ /** Create a new SlideChanger, for the given leaving and
+ entering slides, which applies a cut effect.
+ */
+ CutSlideChange(
+ boost::optional<SlideSharedPtr> const & leavingSlide,
+ const SlideSharedPtr& pEnteringSlide,
+ const RGBColor& rFadeColor,
+ const SoundPlayerSharedPtr& pSoundPlayer,
+ const UnoViewContainer& rViewContainer,
+ ScreenUpdater& rScreenUpdater,
+ EventMultiplexer& rEventMultiplexer )
+ : SlideChangeBase( leavingSlide,
+ pEnteringSlide,
+ pSoundPlayer,
+ rViewContainer,
+ rScreenUpdater,
+ rEventMultiplexer ),
+ maFadeColor( rFadeColor ),
+ mbFirstTurn( true )
+ {}
+
+ virtual void performIn(
+ const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
+ const ViewEntry& rViewEntry,
+ const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas,
+ double t );
+
+ virtual void performOut(
+ const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
+ const ViewEntry& rViewEntry,
+ const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas,
+ double t );
+
+private:
+ RGBColor maFadeColor;
+ bool mbFirstTurn;
+};
+
+void CutSlideChange::performIn(
+ const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
+ const ViewEntry& /*rViewEntry*/,
+ const ::cppcanvas::CanvasSharedPtr& /*rDestinationCanvas*/,
+ double t )
+{
+ ENSURE_OR_THROW(
+ rSprite,
+ "CutSlideChange::performIn(): Invalid sprite" );
+
+ // After 2/3rd of the active time, display new slide
+ rSprite->setAlpha( t > 2/3.0 ? 1.0 : 0.0 );
+}
+
+void CutSlideChange::performOut(
+ const ::cppcanvas::CustomSpriteSharedPtr& rSprite,
+ const ViewEntry& rViewEntry,
+ const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas,
+ double t )
+{
+ ENSURE_OR_THROW(
+ rSprite,
+ "CutSlideChange::performOut(): Invalid sprite" );
+ ENSURE_OR_THROW(
+ rDestinationCanvas,
+ "FadingSlideChange::performOut(): Invalid dest canvas" );
+
+ if( mbFirstTurn )
+ {
+ mbFirstTurn = false;
+
+ // clear page to given fade color. 'Leaving' slide is
+ // painted atop of that
+ fillPage( rDestinationCanvas,
+ getEnteringSlideSizePixel( rViewEntry.mpView ),
+ maFadeColor );
+ }
+
+ // Until 1/3rd of the active time, display old slide.
+ rSprite->setAlpha( t > 1/3.0 ? 0.0 : 1.0 );
+}
+
class MovingSlideChange : public SlideChangeBase
{
/// Direction vector for leaving slide,
@@ -1008,6 +1091,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition(
pSoundPlayer );
}
+ case animations::TransitionType::BARWIPE:
case animations::TransitionType::FADE:
{
// black page:
@@ -1039,16 +1123,27 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition(
"SlideTransitionFactory::createSlideTransition(): Unknown FADE subtype" );
}
- return NumberAnimationSharedPtr(
- new FadingSlideChange(
- leavingSlide,
- pEnteringSlide,
- comphelper::make_optional(
- rTransitionFadeColor),
- pSoundPlayer,
- rViewContainer,
- rScreenUpdater,
- rEventMultiplexer ));
+ if( nTransitionType == animations::TransitionType::FADE )
+ return NumberAnimationSharedPtr(
+ new FadingSlideChange(
+ leavingSlide,
+ pEnteringSlide,
+ comphelper::make_optional(
+ rTransitionFadeColor),
+ pSoundPlayer,
+ rViewContainer,
+ rScreenUpdater,
+ rEventMultiplexer ));
+ else
+ return NumberAnimationSharedPtr(
+ new CutSlideChange(
+ leavingSlide,
+ pEnteringSlide,
+ rTransitionFadeColor,
+ pSoundPlayer,
+ rViewContainer,
+ rScreenUpdater,
+ rEventMultiplexer ));
}
}
}
diff --git a/slideshow/source/engine/transitions/transitionfactorytab.cxx b/slideshow/source/engine/transitions/transitionfactorytab.cxx
index 50222d9c72e6..a59c6051aa5e 100644
--- a/slideshow/source/engine/transitions/transitionfactorytab.cxx
+++ b/slideshow/source/engine/transitions/transitionfactorytab.cxx
@@ -2016,6 +2016,20 @@ static const TransitionInfo lcl_transitionInfo[] =
true, // 'out' by parameter sweep inversion
false // scale isotrophically to target size
},
+ // this is the cut through black fade (does not fade, but does a
+ // hard cut)
+ {
+ animations::TransitionType::BARWIPE,
+ animations::TransitionSubType::FADEOVERCOLOR,
+ TransitionInfo::TRANSITION_SPECIAL,
+ // TODO(F2): Setup parameters
+ 0.0, // no rotation
+ 1.0, // no scaling
+ 1.0, // no scaling
+ TransitionInfo::REVERSEMETHOD_IGNORE,
+ true, // 'out' by parameter sweep inversion
+ false // scale isotrophically to target size
+ },
{
// mapped to RandomWipe: