Commit f1d9994f authored by Thomas Nigro's avatar Thomas Nigro

Add Force Landscape setting

parent ed5fb2cb
......@@ -55,6 +55,7 @@ namespace VLC_WinRT.ViewModels.Settings
private string _subtitlesEncodingValue;
private bool _lastFmIsConnected = false;
private bool _hardwareAcceleration;
private bool _forceLandscape;
private bool _richAnimations;
private List<KeyboardAction> _keyboardActions;
private List<string> _subtitlesEncodingValues;
......@@ -551,6 +552,28 @@ namespace VLC_WinRT.ViewModels.Settings
}
}
public bool ForceLandscape
{
get
{
var force = ApplicationSettingsHelper.ReadSettingsValue(nameof(ForceLandscape));
if (force == null)
{
_forceLandscape = true;
}
else
{
_forceLandscape = (bool) force;
}
return _forceLandscape;
}
set
{
ApplicationSettingsHelper.SaveSettingsValue(nameof(ForceLandscape), value);
SetProperty(ref _forceLandscape, value);
}
}
public bool RichAnimations
{
get
......
......@@ -21,6 +21,7 @@ using Windows.Storage.AccessCache;
using Windows.UI.Xaml;
using libVLCX;
using System.Diagnostics;
using Windows.Graphics.Display;
using Windows.UI.Xaml.Media;
using VLC_WinRT.Commands.VideoPlayer;
using VLC_WinRT.Model;
......@@ -155,6 +156,10 @@ namespace VLC_WinRT.ViewModels.VideoVM
// re-mark the task as completed.
Locator.MediaPlaybackViewModel.ContinueIndexing = new TaskCompletionSource<bool>();
Locator.Slideshow.IsPaused = true;
if (Locator.SettingsVM.ForceLandscape)
{
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
}
}
public void OnNavigatedFrom()
......@@ -168,6 +173,7 @@ namespace VLC_WinRT.ViewModels.VideoVM
Locator.VideoVm.IsVideoPlayerSubtitlesSettingsVisible = false;
Locator.VideoVm.IsVideoPlayerVolumeSettingsVisible = false;
Locator.Slideshow.IsPaused = false;
DisplayInformation.AutoRotationPreferences = DisplayOrientations.None;
}
public async Task<bool> TryUseSubtitleFromFolder()
......
......@@ -43,6 +43,10 @@
<Run Text="{Binding Source={StaticResource Strings}, Path=HardwareDecodingDescription}" />
<Run Text="{Binding Source={StaticResource Strings}, Path=NeedRestart}" />
</TextBlock>
<ToggleSwitch Header="{Binding Source={StaticResource Strings}, Path=ForceLandscape}"
IsOn="{Binding ForceLandscape, Mode=TwoWay}"
Margin="-6,0,0,0" />
<ToggleSwitch Tag="WindowsOnly"
Header="{Binding Source={StaticResource Strings}, Path=VideoPlaybackInBackground}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment