Skip to content

Commit ee80494

Browse files
committed
Updating to v3.3.6
Implements seek within the current buffered queue (requested feature #66) Changes the default Config.Demuxer.BufferDuration from 5 seconds to 5 minutes Introduces Config.Player.IdleFps (default 60) which fixes performance issues with the Renderer Exposes Player.PanXOffset and Player.PanYOffset to allow moving the Pan Minor Seek / ReSync improvements Fixes GPU adapter LUID for x86 platforms (it was always 0) FlyleafLib.Controls.WPF: Adds Selection Range for the current buffered duration FlyleafLib.Controls.WPF: Changes Slider's Height and Thumb to make possible to seek more easier and closer to it even with the mouse FlyleafLib.Controls.WPF: Implements Pan Drag Move in combination with Zoom (keybindings ctrl+mousewheel for zoom, ctrl+mousemove for drag, ctrl+0 for reset)
1 parent c7afe5f commit ee80494

13 files changed

Lines changed: 149 additions & 159 deletions

File tree

FlyleafLib.Controls.WPF/Converters.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,25 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
138138
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
139139
=> throw new NotImplementedException();
140140
}
141+
142+
public class SumConverter : IMultiValueConverter
143+
{
144+
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
145+
{
146+
double sum = 0;
147+
148+
if (values == null) return sum;
149+
150+
foreach (object value in values)
151+
{
152+
if (value == System.Windows.DependencyProperty.UnsetValue) continue;
153+
sum += (double)value;
154+
}
155+
156+
return sum;
157+
}
158+
159+
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
160+
=> throw new NotImplementedException();
161+
}
141162
}

FlyleafLib.Controls.WPF/Flyleaf.xaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,14 @@
111111

112112
<!--Current Time | Slider | Duration-->
113113
<TextBlock Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Player.CurTime, Converter={StaticResource TicksToTime}}"/>
114-
<Slider Grid.Column="1" Style="{DynamicResource FlyleafSlider}" Focusable="False" Margin="10,0,10,0" VerticalAlignment="Center" Value="{Binding Player.CurTime, Mode=TwoWay, Converter={StaticResource TicksToSeconds}}" Maximum="{Binding Player.Duration, Converter={StaticResource TicksToSeconds}}"/>
114+
<Slider Grid.Column="1" IsSelectionRangeEnabled="True" SelectionStart="{Binding RelativeSource={RelativeSource Self}, Path=Value, Mode=OneWay}" Style="{DynamicResource FlyleafSlider}" Focusable="False" Margin="10,0,10,0" VerticalAlignment="Center" Value="{Binding Player.CurTime, Mode=TwoWay, Converter={StaticResource TicksToSeconds}}" Maximum="{Binding Player.Duration, Converter={StaticResource TicksToSeconds}}">
115+
<Slider.SelectionEnd>
116+
<MultiBinding Converter="{StaticResource SumConverter}">
117+
<Binding Path="SelectionStart" RelativeSource="{RelativeSource Self}" Mode="OneWay"/>
118+
<Binding Path="Player.BufferedDuration" Converter="{StaticResource TicksToSeconds}" Mode="OneWay"/>
119+
</MultiBinding>
120+
</Slider.SelectionEnd>
121+
</Slider>
115122
<TextBlock Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Player.Duration, Converter={StaticResource TicksToTime}}"/>
116123
</Grid>
117124

FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks>net5.0-windows;net472</TargetFrameworks>
55
<UseWindowsForms>true</UseWindowsForms>
66
<UseWPF>true</UseWPF>
7-
<Version>1.1.9</Version>
7+
<Version>1.1.10</Version>
88
<Authors>SuRGeoNix</Authors>
99
<Copyright>SuRGeoNix © 2021</Copyright>
1010
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
@@ -13,16 +13,17 @@
1313
<PackageIconUrl />
1414
<PackageTags>flyleaf flyleaflib video audio media player element control</PackageTags>
1515
<Description>WPF Media Player Control/Element (based on FlyleafLib)</Description>
16-
<PackageReleaseNotes>Adds YT-DLP subtitles inputs
17-
Adds YT-DLP protocol info</PackageReleaseNotes>
18-
<AssemblyVersion>1.1.9.0</AssemblyVersion>
19-
<FileVersion>1.1.9.0</FileVersion>
16+
<PackageReleaseNotes>
17+
Adds Selection Range for the current buffered duration
18+
Changes Slider's Height and Thumb to make possible to seek more easier and closer to it even with the mouse
19+
Implements Pan Drag Move in combination with Zoom (keybindings ctrl+mousewheel for zoom, ctrl+mousemove for drag, ctrl+0 for reset)
20+
</PackageReleaseNotes>
2021
</PropertyGroup>
2122

2223
<ItemGroup>
2324
<PackageReference Include="Dragablz" Version="0.0.3.223" />
24-
<PackageReference Include="MaterialDesignColors" Version="2.0.2-ci2657" />
25-
<PackageReference Include="MaterialDesignThemes" Version="4.2.0-ci2657" />
25+
<PackageReference Include="MaterialDesignColors" Version="2.0.3-ci8" />
26+
<PackageReference Include="MaterialDesignThemes" Version="4.2.1-ci8" />
2627
<PackageReference Include="WpfColorFontDialog" Version="1.0.8" />
2728
</ItemGroup>
2829

FlyleafLib.Controls.WPF/MainDictionary.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,6 @@
7575
<flwpf:VolumeToLevelsConverter x:Key="VolumeToLevels"/>
7676
<flwpf:QualityToLevelsConverter x:Key="QualityToLevels"/>
7777
<flwpf:CheckNullConverter x:Key="CheckNull"/>
78+
<flwpf:SumConverter x:Key="SumConverter"/>
7879

7980
</ResourceDictionary>

FlyleafLib.Controls.WPF/Sliders.xaml

Lines changed: 4 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -28,125 +28,18 @@
2828
</Style>
2929

3030
<ControlTemplate x:Key="MaterialDesignSliderThumb" TargetType="{x:Type Thumb}">
31-
<ControlTemplate.Resources>
32-
<Storyboard x:Key="ShowFocusVisualStoryboard">
33-
<DoubleAnimation Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="Opacity" To="0.15" Duration="0" />
34-
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
35-
<EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0" />
36-
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1">
37-
<EasingDoubleKeyFrame.EasingFunction>
38-
<SineEase EasingMode="EaseInOut" />
39-
</EasingDoubleKeyFrame.EasingFunction>
40-
</EasingDoubleKeyFrame>
41-
</DoubleAnimationUsingKeyFrames>
42-
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
43-
<EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0" />
44-
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1">
45-
<EasingDoubleKeyFrame.EasingFunction>
46-
<SineEase EasingMode="EaseInOut" />
47-
</EasingDoubleKeyFrame.EasingFunction>
48-
</EasingDoubleKeyFrame>
49-
</DoubleAnimationUsingKeyFrames>
50-
</Storyboard>
51-
<Storyboard x:Key="HideFocusVisualStoryboard">
52-
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="Opacity">
53-
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="0.15" />
54-
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0">
55-
<EasingDoubleKeyFrame.EasingFunction>
56-
<SineEase EasingMode="EaseInOut" />
57-
</EasingDoubleKeyFrame.EasingFunction>
58-
</EasingDoubleKeyFrame>
59-
</DoubleAnimationUsingKeyFrames>
60-
<DoubleAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
61-
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0" />
62-
</DoubleAnimationUsingKeyFrames>
63-
<DoubleAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
64-
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0" />
65-
</DoubleAnimationUsingKeyFrames>
66-
</Storyboard>
67-
</ControlTemplate.Resources>
68-
<Grid x:Name="thumbGrid" Height="16" Width="14">
69-
<Ellipse
70-
x:Name="halo"
71-
Width="32"
72-
Height="32"
73-
Margin="-24"
74-
Fill="{TemplateBinding Foreground}"
75-
Opacity="0" />
76-
<Ellipse
77-
x:Name="focusedHalo"
78-
Width="32"
79-
Height="32"
80-
Margin="-24"
81-
Fill="{TemplateBinding Foreground}"
82-
Opacity="0.15"
83-
RenderTransformOrigin="0.5,0.5">
84-
<Ellipse.RenderTransform>
85-
<ScaleTransform ScaleX="0" ScaleY="0" />
86-
</Ellipse.RenderTransform>
87-
</Ellipse>
31+
<Grid x:Name="thumbGrid" Height="10" Width="8">
8832
<AdornerDecorator>
8933
<AdornerDecorator.CacheMode>
9034
<BitmapCache SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
9135
</AdornerDecorator.CacheMode>
9236
<Ellipse
9337
x:Name="grip"
94-
Fill="{TemplateBinding Foreground}"
38+
Fill="{DynamicResource MaterialDesignBody}"
9539
Effect="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Slider}, Path=(wpf:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}"
9640
Margin="-1,0" />
9741
</AdornerDecorator>
9842
</Grid>
99-
<ControlTemplate.Triggers>
100-
<DataTrigger Binding="{Binding Orientation, RelativeSource={RelativeSource FindAncestor, AncestorType=Track}}" Value="{x:Static Orientation.Vertical}">
101-
<Setter TargetName="thumbGrid" Property="Height" Value="18" />
102-
<Setter TargetName="thumbGrid" Property="Width" Value="20" />
103-
<Setter TargetName="grip" Property="Margin" Value="0,-1" />
104-
</DataTrigger>
105-
<Trigger Property="IsMouseOver" Value="true">
106-
<Trigger.EnterActions>
107-
<BeginStoryboard>
108-
<Storyboard>
109-
<DoubleAnimation Storyboard.TargetName="halo" Storyboard.TargetProperty="Opacity" To="0.15" Duration="0:0:0.2" />
110-
</Storyboard>
111-
</BeginStoryboard>
112-
</Trigger.EnterActions>
113-
<Trigger.ExitActions>
114-
<BeginStoryboard>
115-
<Storyboard>
116-
<DoubleAnimation Storyboard.TargetName="halo" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.2" />
117-
</Storyboard>
118-
</BeginStoryboard>
119-
</Trigger.ExitActions>
120-
</Trigger>
121-
<DataTrigger Value="True">
122-
<DataTrigger.Binding>
123-
<MultiBinding Converter="{StaticResource BooleanAllConverter}">
124-
<Binding Path="IsFocused" RelativeSource="{RelativeSource FindAncestor, AncestorType=Slider}" />
125-
<Binding Path="(wpf:SliderAssist.OnlyShowFocusVisualWhileDragging)" RelativeSource="{RelativeSource FindAncestor, AncestorType=Slider}" Converter="{StaticResource InvertBooleanConverter}" />
126-
</MultiBinding>
127-
</DataTrigger.Binding>
128-
<DataTrigger.EnterActions>
129-
<BeginStoryboard Storyboard="{StaticResource ShowFocusVisualStoryboard}" />
130-
</DataTrigger.EnterActions>
131-
<DataTrigger.ExitActions>
132-
<BeginStoryboard Storyboard="{StaticResource HideFocusVisualStoryboard}" />
133-
</DataTrigger.ExitActions>
134-
</DataTrigger>
135-
<DataTrigger Value="True">
136-
<DataTrigger.Binding>
137-
<MultiBinding Converter="{StaticResource BooleanAllConverter}">
138-
<Binding Path="IsDragging" RelativeSource="{RelativeSource Self}" />
139-
<Binding Path="(wpf:SliderAssist.OnlyShowFocusVisualWhileDragging)" RelativeSource="{RelativeSource FindAncestor, AncestorType=Slider}" />
140-
</MultiBinding>
141-
</DataTrigger.Binding>
142-
<DataTrigger.EnterActions>
143-
<BeginStoryboard Storyboard="{StaticResource ShowFocusVisualStoryboard}" />
144-
</DataTrigger.EnterActions>
145-
<DataTrigger.ExitActions>
146-
<BeginStoryboard Storyboard="{StaticResource HideFocusVisualStoryboard}" />
147-
</DataTrigger.ExitActions>
148-
</DataTrigger>
149-
</ControlTemplate.Triggers>
15043
</ControlTemplate>
15144

15245
<ControlTemplate x:Key="MaterialDesignSliderHorizontal" TargetType="{x:Type Slider}">
@@ -164,13 +57,13 @@
16457
</Grid.RowDefinitions>
16558
<TickBar x:Name="TopTick" Fill="{TemplateBinding Foreground}" Height="4" Margin="0,0,0,2" Placement="Top" Grid.Row="0" Visibility="Collapsed" />
16659
<TickBar x:Name="BottomTick" Fill="{TemplateBinding Foreground}" Height="4" Margin="0,2,0,0" Placement="Bottom" Grid.Row="2" Visibility="Collapsed"/>
167-
<Rectangle Grid.Row="1" Fill="{TemplateBinding Foreground}" Height="3" Opacity="0.38" VerticalAlignment="Center" RadiusX="2" RadiusY="2" />
60+
<Rectangle Grid.Row="1" Fill="{TemplateBinding Foreground}" Height="6" Opacity="0.38" VerticalAlignment="Center" RadiusX="2" RadiusY="2" />
16861
<Border
16962
x:Name="activeTrack"
17063
Grid.Row="1"
17164
Background="{TemplateBinding Foreground}"
17265
CornerRadius="3,0,0,3"
173-
Height="4"
66+
Height="7"
17467
Width="{Binding DecreaseRepeatButton.ActualWidth, ElementName=PART_Track}"
17568
HorizontalAlignment="Left"
17669
VerticalAlignment="Center" />

FlyleafLib/Config.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ public DemuxerConfig Clone()
162162
/// <summary>
163163
/// List of FFmpeg formats to be excluded from interrupts
164164
/// </summary>
165-
public List<string> ExcludeInterruptFmts { get; set; } = new List<string>() { "rtsp" };
165+
public List<string> ExcludeInterruptFmts{ get; set; } = new List<string>() { "rtsp" };
166166

167167
/// <summary>
168168
/// Maximum allowed duration ticks for buffering
169169
/// </summary>
170-
public long BufferDuration {// get; set; } = 5 * 1000 * 10000;
170+
public long BufferDuration {
171171
get => _BufferDuration;
172172
set
173173
{
@@ -176,7 +176,7 @@ public DemuxerConfig Clone()
176176
player.Config.Player.MinBufferDuration = value;
177177
}
178178
}
179-
long _BufferDuration = 5 * 1000 * 10000;
179+
long _BufferDuration = 5 * 60 * (long)1000 * 10000;
180180

181181
/// <summary>
182182
/// Maximum allowed errors before stopping
@@ -265,7 +265,7 @@ public class DecoderConfig : NotifyPropertyChanged
265265
/// <summary>
266266
/// Maximum subtitle frames to be decoded
267267
/// </summary>
268-
public int MaxSubsFrames { get; set; } = 10;
268+
public int MaxSubsFrames { get; set; } = 2;
269269

270270
/// <summary>
271271
/// Maximum allowed errors before stopping

FlyleafLib/FlyleafLib.csproj

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,22 @@
88
<PackageIconUrl />
99
<RepositoryUrl></RepositoryUrl>
1010
<Description>Media Player .NET Library for WPF/WinForms (based on FFmpeg/DirectX)</Description>
11-
<Version>3.3.5</Version>
11+
<Version>3.3.6</Version>
1212
<Authors>SuRGeoNix</Authors>
1313
<Copyright>SuRGeoNix © 2021</Copyright>
1414
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
1515
<PackageProjectUrl>https://github.com/SuRGeoNix/Flyleaf</PackageProjectUrl>
1616
<PackageTags>flyleaf flyleaflib video audio media player engine framework download extract ffmpeg vortice directx</PackageTags>
1717
<IncludeSymbols>true</IncludeSymbols>
1818
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
19-
<PackageReleaseNotes>Updating to v3.3.5
20-
21-
Plugins: New SubtitlesConverter plugin which supports advanced encoding detection (based on Mozilla implementation)
22-
Plugins: Adds NET Framework support
23-
BitSwarm: Fixes #87 (frame drops) by updating to v2.4.1
24-
YT-DLP: Fixes HasAudio/HasVideo, single format and downloader's speed issues
25-
Player: Fixes AudioPlayer null reference (while sets volume/mute before initialization)
26-
Player(AVS): Fixes transition issues between AudioOnly to Video
27-
Player(AVS): Allows AudioOnly in case Video fails/not exists
28-
Subtitles: Fixes an issue that would drop next subtitles frames while pause/play or buffering
29-
Renderer: Fixes a crashing issue with x86 platforms
30-
DXCompiler: Ensures is fully optimized
31-
DXCompiler: Uses best profiles (eg. vs/ps_5_0) based on current OS
32-
DXSwapChain: Improves GPU performance by chaning SwapEffect to Discard instead of FlipSequential and BufferCount from 3 to 1
33-
TakeSnapshot: Improves Speed and Performance</PackageReleaseNotes>
34-
<AssemblyVersion>3.3.5.0</AssemblyVersion>
35-
<FileVersion>3.3.5.0</FileVersion>
19+
<PackageReleaseNotes>
20+
Implements seek within the current buffered queue (requested feature #66)
21+
Changes the default Config.Demuxer.BufferDuration from 5 seconds to 5 minutes
22+
Introduces Config.Player.IdleFps (default 60) which fixes performance issues with the Renderer
23+
Exposes Player.PanXOffset and Player.PanYOffset to allow moving the Pan
24+
Minor Seek / ReSync improvements
25+
Fixes GPU adapter LUID for x86 platforms (it was always 0)
26+
</PackageReleaseNotes>
3627
</PropertyGroup>
3728

3829
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

FlyleafLib/FlyleafLib.xml

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)