new option minimum-aspect-ratio-audio
This commit is contained in:
@@ -36,9 +36,10 @@ namespace mpvnet
|
||||
public static int StartThreshold { get; set; } = 1500;
|
||||
public static int RecentCount { get; set; } = 15;
|
||||
|
||||
public static float AutofitAudio { get; set; } = 0.8f;
|
||||
public static float AutofitAudio { get; set; } = 0.7f;
|
||||
public static float AutofitImage { get; set; } = 0.8f;
|
||||
public static float MinimumAspectRatio { get; set; }
|
||||
public static float MinimumAspectRatioAudio { get; set; }
|
||||
public static float QuickBookmark { get; set; }
|
||||
|
||||
public static Extension Extension { get; set; }
|
||||
@@ -252,6 +253,7 @@ namespace mpvnet
|
||||
case "light-theme": LightTheme = value.Trim('\'', '"'); return true;
|
||||
case "media-info": MediaInfo = value == "yes"; return true;
|
||||
case "minimum-aspect-ratio": MinimumAspectRatio = value.ToFloat(); return true;
|
||||
case "minimum-aspect-ratio-audio": MinimumAspectRatioAudio = value.ToFloat(); return true;
|
||||
case "process-instance": ProcessInstance = value; return true;
|
||||
case "queue": Queue = value == "yes"; return true;
|
||||
case "recent-count": RecentCount = value.ToInt(); return true;
|
||||
|
||||
@@ -420,7 +420,7 @@ help = <int> Initial window height in percent for image files. Default: 80
|
||||
name = autofit-audio
|
||||
file = mpvnet
|
||||
filter = Screen
|
||||
help = <int> Initial window height in percent for audio files. Default: 80
|
||||
help = <int> Initial window height in percent for audio files. Default: 70
|
||||
|
||||
[setting]
|
||||
name = autofit-smaller
|
||||
@@ -463,7 +463,13 @@ option = no
|
||||
name = minimum-aspect-ratio
|
||||
file = mpvnet
|
||||
filter = Screen
|
||||
help = <float> Minimum aspect ratio, if the AR is smaller than the defined value then the window AR is set to 16/9. This avoids a square window for Music with cover art. Default: 0 (mpv.net specific option)
|
||||
help = <float> Minimum aspect ratio of the window. Useful to force a wider window and therefore a larger OSC. (mpv.net specific option)
|
||||
|
||||
[setting]
|
||||
name = minimum-aspect-ratio-audio
|
||||
file = mpvnet
|
||||
filter = Screen
|
||||
help = Same as minimum-aspect-ratio but used for audio files.
|
||||
|
||||
[setting]
|
||||
name = remember-window-position
|
||||
|
||||
@@ -437,11 +437,14 @@ namespace mpvnet
|
||||
if (Core.IsAudio) autoFitHeight = Convert.ToInt32(workingArea.Height * App.AutofitAudio);
|
||||
if (Core.IsImage) autoFitHeight = Convert.ToInt32(workingArea.Height * App.AutofitImage);
|
||||
|
||||
if (Core.VideoSize.Height == 0 || Core.VideoSize.Width == 0 ||
|
||||
Core.VideoSize.Width / (float)Core.VideoSize.Height < App.MinimumAspectRatio)
|
||||
|
||||
if (Core.VideoSize.Height == 0 || Core.VideoSize.Width == 0)
|
||||
Core.VideoSize = new Size((int)(autoFitHeight * (16 / 9f)), autoFitHeight);
|
||||
|
||||
float minAspectRatio = Core.IsAudio ? App.MinimumAspectRatioAudio : App.MinimumAspectRatio;
|
||||
|
||||
if (minAspectRatio != 0 && Core.VideoSize.Width / (float)Core.VideoSize.Height < minAspectRatio)
|
||||
Core.VideoSize = new Size((int)(autoFitHeight * minAspectRatio), autoFitHeight);
|
||||
|
||||
Size videoSize = Core.VideoSize;
|
||||
|
||||
int height = videoSize.Height;
|
||||
|
||||
Reference in New Issue
Block a user