24 files changed
+719
-115
No files matched your search
@@ -1,4 +1,4 @@
|
||||
#region license
|
||||
#region license
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
@@ -101,6 +101,7 @@ namespace VocaluxeLib
|
||||
|
||||
switch (aspect)
|
||||
{
|
||||
case EAspect.Automatic:
|
||||
case EAspect.Crop:
|
||||
if (boundsAspectRatio >= aspectRatio)
|
||||
{
|
||||
@@ -138,7 +139,12 @@ namespace VocaluxeLib
|
||||
}
|
||||
break;
|
||||
case EAspect.LetterBox:
|
||||
if (boundsAspectRatio <= aspectRatio)
|
||||
if (boundsAspectRatio == aspectRatio) // Pillarbox
|
||||
{
|
||||
scaledWidth = bounds.W * 0.77f;
|
||||
scaledHeight = bounds.W / aspectRatio;
|
||||
}
|
||||
else if (boundsAspectRatio < aspectRatio)
|
||||
{
|
||||
scaledWidth = bounds.W;
|
||||
scaledHeight = bounds.W / aspectRatio;
|
||||
@@ -306,4 +312,4 @@ namespace VocaluxeLib
|
||||
return bmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,7 @@ namespace VocaluxeLib
|
||||
#region Fonts
|
||||
public enum EAspect
|
||||
{
|
||||
Automatic,
|
||||
Crop,
|
||||
LetterBox,
|
||||
Stretch,
|
||||
@@ -436,4 +437,4 @@ namespace VocaluxeLib
|
||||
TR_USERROLE_PROFILEEDITOR = 32
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ namespace VocaluxeLib.Log
|
||||
{
|
||||
if (i >= propertyValues.Length)
|
||||
return match.Value;
|
||||
return propertyValues[i++].ToString();
|
||||
return "\"" + propertyValues[i++] + "\"";
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +288,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
public void LeaveSelectedCategory()
|
||||
{
|
||||
_LeaveCategory();
|
||||
// Stefan1200: This was implemented with the pull request #359 and is the reason for the bug described in issue #390.
|
||||
// Currently disabled until we know if this is still needed or we find a better solution!
|
||||
// _LeaveCategory();
|
||||
}
|
||||
|
||||
public virtual void UnloadSkin() {}
|
||||
@@ -425,4 +427,4 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
#endregion ThemeEdit
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -511,7 +511,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
_TextBG.Draw();
|
||||
|
||||
CTextureRef vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null;
|
||||
CTextureRef vidtex = null;
|
||||
if (CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
|
||||
vidtex = (CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null);
|
||||
|
||||
if (vidtex != null)
|
||||
{
|
||||
@@ -592,13 +594,28 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
private void _UpdateList(bool force = false)
|
||||
{
|
||||
bool isInCategory = CBase.Songs.IsInCategory();
|
||||
int itemCount = isInCategory ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories();
|
||||
int halfListLength = _ListLength / 2;
|
||||
int offset;
|
||||
|
||||
if (_SelectionNr < _Offset && _SelectionNr >= 0)
|
||||
offset = _SelectionNr;
|
||||
{
|
||||
if (_SelectionNr - halfListLength >= 0)
|
||||
offset = _SelectionNr - halfListLength;
|
||||
else
|
||||
offset = 0;
|
||||
}
|
||||
else if (_SelectionNr >= _Offset + _ListLength)
|
||||
offset = _SelectionNr - _ListLength + 1;
|
||||
{
|
||||
if (_SelectionNr + halfListLength > itemCount)
|
||||
offset = itemCount - _ListLength;
|
||||
else
|
||||
offset = _SelectionNr - halfListLength;
|
||||
}
|
||||
else
|
||||
offset = _Offset;
|
||||
|
||||
_UpdateList(offset, force);
|
||||
}
|
||||
|
||||
@@ -653,4 +670,4 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
base.LoadSkin();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -485,7 +485,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
_TextBG.Draw();
|
||||
|
||||
CTextureRef vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null;
|
||||
CTextureRef vidtex = null;
|
||||
if (CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
|
||||
vidtex = (CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null);
|
||||
|
||||
if (vidtex != null)
|
||||
{
|
||||
@@ -608,4 +610,4 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
Init();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ namespace VocaluxeLib.Songs
|
||||
public readonly List<string> BackgroundFileNames = new List<string>();
|
||||
public string VideoFileName = String.Empty;
|
||||
|
||||
public EAspect VideoAspect = EAspect.Crop;
|
||||
public EAspect VideoAspect = EAspect.Automatic;
|
||||
|
||||
public bool NotesLoaded { get; private set; }
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ namespace VocaluxeLib.Utils.Player
|
||||
|
||||
if (_Video != null || !SongHasVideo)
|
||||
return;
|
||||
|
||||
string videoFilePath = Path.Combine(_Song.Folder, _Song.VideoFileName);
|
||||
_Video = CBase.Video.Load(videoFilePath);
|
||||
if (_Video == null)
|
||||
@@ -175,4 +176,4 @@ namespace VocaluxeLib.Utils.Player
|
||||
_CloseVideo();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user