To set a transition for any playlist item you should complete the following steps:
- Get the playlist item with PlaylistGetByIndex or PlaylistGetByOffset method.
- Set the properties of transition with the PropsSet method.
To set a transition for the beginning of the item you should use "transition_in" group of properties. For the ending, it is "transition_out".
By default, audio and video transitions are simultaneous. If you want to make a delay or change a time for audio transitions you should set transition_in::audio_time (duration of audio transition) and transition_in::audio_delay (delay before audio transition relative to the video transitions, it is possible to set negative value) properties.
string strPath; MItem pItem; double dblPos; m_objPlaylist.PlaylistGetByIndex(1, out dblPos, out strPath, out pItem); (pItem as IMProps).PropsSet( "transition_in::time", "1.0"); (pItem as IMProps).PropsSet( "transition_in::type", "Pixelate"); (pItem as IMProps).PropsSet( "transition_in::audio_time", "1.0"); (pItem as IMProps).PropsSet( "transition_in::audio_delay", "1.0");
Here you can find a list of available transitions.
if you want to have a transition without in or out points, for example on PlaylistPosSet method you have to specify the
HKEY_CURRENT_USER\SOFTWARE\Medialooks\MPlatform\MPlaylist
setpos_transition = true (by default false)
or via source code
m_objPlaylist.PropsSet("object::setpos_transition", "true");
Note please that they are DirectX transitions and for some of them (ZigZag, Barns, Blinds, Slide, Spiral etc.) the previous and next items are paused during the transition.
Transitions are implemented for files, live sources, background, and breaks.
Transition type | Description |
---|---|
Item1 to Item2 | transition_out of the Item1 is applied if there is no transition_in for the Item2 |
Item to Break | transition_in of the Break is applied if there is no transition_out for the Item |
Break to Item | transition_out of the Break is applied if there is no transition_in for the Item |
Background to Item | transition_in of the Item is applied if there is no transition_out for the Background |
Item to Background | transition_out of the Item is applied if there is no transition_in for the Background |
To mix two playlist items you should set the out-point (or in-point) with the FileInOutSet method with a custom value or with "out = file_duration - transition_time".
Audio transitions settings
As for audio management, there are several additional properties:
(pItem as IMProps).PropsSet("transition_in::audio_time", "2.0"); (pItem as IMProps).PropsSet("transition_out::audio_time", "2.0"); (pItem as IMProps).PropsSet("transition_in::audio_delay", "2.0"); (pItem as IMProps).PropsSet("transition_out:audio_delay", "2.0");
audio_time and audio_delay are required only if you need to shift the start of audio transition relative to video.
For example, if total transition time is 2.0 (transition_out::time=2.0) then by default audio and video do the transition simultaneously: audio with 'fade' and video with the transition you set. Transition starts at the same time for audio and video and continues for 2 seconds.
If you need to change the behavior then you should use audio_time and audio_delay parameters:
- audio_time - makes audio transitions longer or shorter than video transition.
- audio_delay - sets a delay duration for audio transition start.