Merge branch 'develop' into rap

This commit is contained in:
Gary Kertopermono committed 2021-06-28 10:44:22 +02:00
commit 612c18326d
46 files changed
+1632 -319

No files matched your search

+8 -3
View File
@@ -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,7 @@ namespace VocaluxeLib
}
break;
case EAspect.LetterBox:
if (boundsAspectRatio <= aspectRatio)
if (boundsAspectRatio < aspectRatio)
{
scaledWidth = bounds.W;
scaledHeight = bounds.W / aspectRatio;
@@ -149,6 +150,10 @@ namespace VocaluxeLib
scaledWidth = bounds.H * aspectRatio;
}
break;
case EAspect.PillarBox:
scaledWidth = bounds.W * 0.77f;
scaledHeight = bounds.W / aspectRatio;
break;
default:
return bounds;
}
@@ -306,4 +311,4 @@ namespace VocaluxeLib
return bmp;
}
}
}
}
+3 -1
View File
@@ -64,8 +64,10 @@ namespace VocaluxeLib
#region Fonts
public enum EAspect
{
Automatic,
Crop,
LetterBox,
PillarBox,
Stretch,
Zoom1,
Zoom2
@@ -438,4 +440,4 @@ namespace VocaluxeLib
TR_USERROLE_PROFILEEDITOR = 32
// ReSharper restore InconsistentNaming
}
}
}
+4 -4
View File
@@ -171,10 +171,10 @@ namespace VocaluxeLib
public static SRectF Scale(this SRectF rect, float scale)
{
return new SRectF(
rect.X - rect.W * (scale - 1f),
rect.Y - rect.H * (scale - 1f),
rect.W + 2 * rect.W * (scale - 1f),
rect.H + 2 * rect.H * (scale - 1f),
rect.X - rect.W * (scale - 1f) * 0.5f,
rect.Y - rect.H * (scale - 1f) * 0.5f,
rect.W * scale,
rect.H * scale,
rect.Z);
}
+2 -1
View File
@@ -304,6 +304,7 @@ namespace VocaluxeLib
{
bool Exists(int playlistID);
string GetName(int playlistID);
List<int> GetIds();
List<string> GetNames();
void SetName(int playlistID, string name);
@@ -336,4 +337,4 @@ namespace VocaluxeLib
bool IsPlaying();
float GetLength();
}
}
}
+1 -1
View File
@@ -198,7 +198,7 @@ namespace VocaluxeLib.Log
{
if (i >= propertyValues.Length)
return match.Value;
return propertyValues[i++].ToString();
return "\"" + propertyValues[i++] + "\"";
});
}
+10 -1
View File
@@ -100,6 +100,8 @@ namespace VocaluxeLib.Menu
protected int NumMinMedleySongs = 3;
protected int NumMaxMedleySongs = 10;
private List<int> _PlaylistIDs;
public override void Init()
{
base.Init();
@@ -188,6 +190,8 @@ namespace VocaluxeLib.Menu
_SelectSlides[_SelectSlideSorting].AddValue(ss.ToString());
_SelectSlides[_SelectSlidePlaylist].Clear();
_SelectSlides[_SelectSlidePlaylist].NumVisible = 1; // Make sure that only one playlist at a time will be displayed (or the names overlap)
_PlaylistIDs = CBase.Playlist.GetIds();
List<string> playlists = CBase.Playlist.GetNames();
for (int i = 0; i < playlists.Count; i++)
{
@@ -220,7 +224,12 @@ namespace VocaluxeLib.Menu
_SongMode = _SelectSlides[_SelectSlideSongMode].Selection;
_Source = _SelectSlides[_SelectSlideSource].Selection;
NumMedleySongs = NumMinMedleySongs + _SelectSlides[_SelectSlideNumMedleySongs].Selection;
Playlist = _SelectSlides[_SelectSlidePlaylist].Selection;
int playlistSelection = _SelectSlides[_SelectSlidePlaylist].Selection;
if (playlistSelection >= 0 && playlistSelection < _PlaylistIDs.Count)
Playlist = _PlaylistIDs[playlistSelection];
else
Playlist = -1;
if (_SelectSlides[_SelectSlideSorting].Selection != _Sorting)
{
+31
View File
@@ -81,6 +81,7 @@ namespace VocaluxeLib.Menu
public SThemeButton ButtonPlaylistSave;
public SThemeButton ButtonPlaylistDelete;
public SThemeButton ButtonPlaylistSing;
public SThemeButton ButtonPlaylistList;
public SThemeSelectSlide SelectSlideGameMode;
}
@@ -163,6 +164,7 @@ namespace VocaluxeLib.Menu
private readonly CButton _ButtonPlaylistSave;
private readonly CButton _ButtonPlaylistDelete;
private readonly CButton _ButtonPlaylistSing;
private readonly CButton _ButtonPlaylistList;
private readonly CText _Text1;
private readonly CSelectSlide _SelectSlideGameMode;
private readonly CStatic _StaticPlaylistHeader;
@@ -235,6 +237,7 @@ namespace VocaluxeLib.Menu
_ButtonPlaylistDelete = new CButton(_PartyModeID);
_ButtonPlaylistSave = new CButton(_PartyModeID);
_ButtonPlaylistSing = new CButton(_PartyModeID);
_ButtonPlaylistList = new CButton(_PartyModeID);
_SelectSlideGameMode = new CSelectSlide(_PartyModeID);
Visible = false;
@@ -254,6 +257,7 @@ namespace VocaluxeLib.Menu
_ButtonPlaylistDelete = new CButton(_Theme.ButtonPlaylistDelete, _PartyModeID);
_ButtonPlaylistSave = new CButton(_Theme.ButtonPlaylistSave, _PartyModeID);
_ButtonPlaylistSing = new CButton(_Theme.ButtonPlaylistSing, _PartyModeID);
_ButtonPlaylistList = new CButton(_Theme.ButtonPlaylistList, _PartyModeID);
_SelectSlideGameMode = new CSelectSlide(_Theme.SelectSlideGameMode, _PartyModeID);
_AddStatic(_StaticPlaylistFooter);
@@ -263,6 +267,7 @@ namespace VocaluxeLib.Menu
_AddButton(_ButtonPlaylistDelete);
_AddButton(_ButtonPlaylistSave);
_AddButton(_ButtonPlaylistSing);
_AddButton(_ButtonPlaylistList);
Visible = false;
Selected = false;
@@ -279,6 +284,7 @@ namespace VocaluxeLib.Menu
_Theme.ButtonPlaylistClose = (SThemeButton)_ButtonPlaylistClose.GetTheme();
_Theme.ButtonPlaylistSave = (SThemeButton)_ButtonPlaylistSave.GetTheme();
_Theme.ButtonPlaylistDelete = (SThemeButton)_ButtonPlaylistDelete.GetTheme();
_Theme.ButtonPlaylistList = (SThemeButton)_ButtonPlaylistList.GetTheme();
}
public void UpdateGame()
@@ -321,6 +327,7 @@ namespace VocaluxeLib.Menu
_ButtonPlaylistName.UnloadSkin();
_ButtonPlaylistSave.UnloadSkin();
_ButtonPlaylistSing.UnloadSkin();
_ButtonPlaylistList.UnloadSkin();
_StaticPlaylistFooter.UnloadSkin();
_StaticPlaylistHeader.UnloadSkin();
@@ -342,6 +349,7 @@ namespace VocaluxeLib.Menu
_ButtonPlaylistName.LoadSkin();
_ButtonPlaylistSave.LoadSkin();
_ButtonPlaylistSing.LoadSkin();
_ButtonPlaylistList.LoadSkin();
_StaticPlaylistFooter.LoadSkin();
_StaticPlaylistHeader.LoadSkin();
@@ -640,6 +648,8 @@ namespace VocaluxeLib.Menu
_StartPlaylistSongs();
else if (_ButtonPlaylistSave.Selected)
CBase.Playlist.Save(ActivePlaylistID);
else if (isButtonPlaylistListSelected())
return false; // Currently CScreenSong do this event!
else if (_ButtonPlaylistDelete.Selected)
{
CBase.Playlist.Delete(ActivePlaylistID);
@@ -672,6 +682,11 @@ namespace VocaluxeLib.Menu
return true;
}
public bool isButtonPlaylistListSelected()
{
return _ButtonPlaylistList.Selected;
}
private void _SetSelectionToLastEntry()
{
if (_PlaylistElementContents.Count == 0)
@@ -781,6 +796,8 @@ namespace VocaluxeLib.Menu
//LB actions
if (mouseEvent.LB)
{
if (isButtonPlaylistListSelected())
return false; // Currently CScreenSong do this event!
if (_CurrentPlaylistElement != -1)
{
CBase.Playlist.GetSong(ActivePlaylistID, _CurrentPlaylistElement + _Offset).GameMode =
@@ -972,6 +989,11 @@ namespace VocaluxeLib.Menu
return false;
}
public bool isPlaylistNameEditMode()
{
return _EditMode == EEditMode.PlaylistName;
}
private void _PrepareList()
{
_PlaylistElements.Clear();
@@ -1166,6 +1188,15 @@ namespace VocaluxeLib.Menu
_CompleteRect.W = _ButtonPlaylistDelete.Rect.W + _ButtonPlaylistDelete.Rect.X - _CompleteRect.X;
if (_ButtonPlaylistDelete.Rect.Y + _ButtonPlaylistDelete.Rect.H > _CompleteRect.Y + _CompleteRect.H)
_CompleteRect.H = _ButtonPlaylistDelete.Rect.H + _ButtonPlaylistDelete.Rect.Y - _CompleteRect.Y;
//ButtonPlaylistList
if (_ButtonPlaylistList.Rect.X < _CompleteRect.X)
_CompleteRect.X = _ButtonPlaylistList.Rect.X;
if (_ButtonPlaylistList.Rect.Y < _CompleteRect.Y)
_CompleteRect.Y = _ButtonPlaylistList.Rect.Y;
if (_ButtonPlaylistList.Rect.W + _ButtonPlaylistList.Rect.X > _CompleteRect.W + _CompleteRect.X)
_CompleteRect.W = _ButtonPlaylistList.Rect.W + _ButtonPlaylistList.Rect.X - _CompleteRect.X;
if (_ButtonPlaylistList.Rect.Y + _ButtonPlaylistList.Rect.H > _CompleteRect.Y + _CompleteRect.H)
_CompleteRect.H = _ButtonPlaylistList.Rect.H + _ButtonPlaylistList.Rect.Y - _CompleteRect.Y;
}
#region ThemeEdit
@@ -64,6 +64,7 @@ namespace VocaluxeLib.Menu.SongMenu
public SThemeText TextArtist;
public SThemeText TextTitle;
public SThemeText TextSongLength;
public SThemeText TextSongYear;
public SThemeStatic StaticCoverBig;
public SThemeStatic StaticTextBG;
@@ -113,6 +114,7 @@ namespace VocaluxeLib.Menu.SongMenu
public SThemeText TextArtist;
public SThemeText TextTitle;
public SThemeText TextSongLength;
public SThemeText TextSongYear;
public SThemeStatic StaticCoverBig;
public SThemeStatic StaticTextBG;
@@ -223,7 +225,7 @@ namespace VocaluxeLib.Menu.SongMenu
EScreen check = CBase.Graphics.GetNextScreenType();
if (CBase.Graphics.GetNextScreenType() == EScreen.Sing)
_ResetPreview(false);
else if (CBase.Graphics.GetNextScreenType() != EScreen.Names || CBase.Config.GetBackgroundMusicStatus() == EBackgroundMusicOffOn.TR_CONFIG_OFF)
else if ((CBase.Graphics.GetNextScreenType() != EScreen.Names && CBase.Graphics.GetNextScreenType() != EScreen.Highscore) || CBase.Config.GetBackgroundMusicStatus() == EBackgroundMusicOffOn.TR_CONFIG_OFF)
_ResetPreview();
}
@@ -291,7 +293,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() {}
@@ -428,4 +432,4 @@ namespace VocaluxeLib.Menu.SongMenu
}
#endregion ThemeEdit
}
}
}
+66 -8
View File
@@ -44,6 +44,7 @@ namespace VocaluxeLib.Menu.SongMenu
private readonly CText _Artist;
private readonly CText _Title;
private readonly CText _SongLength;
private readonly CText _SongYear;
private float _SpaceW;
private float _SpaceH;
@@ -119,6 +120,7 @@ namespace VocaluxeLib.Menu.SongMenu
_Artist = new CText(_Theme.SongMenuList.TextArtist, _PartyModeID);
_Title = new CText(_Theme.SongMenuList.TextTitle, _PartyModeID);
_SongLength = new CText(_Theme.SongMenuList.TextSongLength, _PartyModeID);
_SongYear = new CText(_Theme.SongMenuList.TextSongYear, _PartyModeID);
_CoverBig = new CStatic(_Theme.SongMenuList.StaticCoverBig, _PartyModeID);
_TextBG = new CStatic(_Theme.SongMenuList.StaticTextBG, _PartyModeID);
_DuetIcon = new CStatic(_Theme.SongMenuList.StaticDuetIcon, _PartyModeID);
@@ -126,13 +128,14 @@ namespace VocaluxeLib.Menu.SongMenu
_VideoIcon = new CStatic(_Theme.SongMenuList.StaticVideoIcon, _PartyModeID);
_MedleyCalcIcon = new CStatic(_Theme.SongMenuList.StaticMedleyCalcIcon, _PartyModeID);
_MedleyTagIcon = new CStatic(_Theme.SongMenuList.StaticMedleyTagIcon, _PartyModeID);
_SubElements.AddRange(new IMenuElement[] {_Artist, _Title, _SongLength, _DuetIcon, _RapIcon, _VideoIcon, _MedleyCalcIcon, _MedleyTagIcon});
_SubElements.AddRange(new IMenuElement[] {_Artist, _Title, _SongLength, _SongYear, _DuetIcon, _RapIcon, _VideoIcon, _MedleyCalcIcon, _MedleyTagIcon});
}
private void _ReadSubTheme()
{
_Theme.SongMenuList.TextArtist = (SThemeText)_Artist.GetTheme();
_Theme.SongMenuList.TextSongLength = (SThemeText)_SongLength.GetTheme();
_Theme.SongMenuList.TextSongYear = (SThemeText)_SongYear.GetTheme();
_Theme.SongMenuList.TextTitle = (SThemeText)_Title.GetTheme();
_Theme.SongMenuList.StaticCoverBig = (SThemeStatic)_CoverBig.GetTheme();
_Theme.SongMenuList.StaticDuetIcon = (SThemeStatic)_DuetIcon.GetTheme();
@@ -176,12 +179,12 @@ namespace VocaluxeLib.Menu.SongMenu
for (int i = 0; i < _ListLength; i++)
{
//Create Cover
var rect = new SRectF(Rect.X + (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
var rect = new SRectF(Rect.X, Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
var tile = new CStatic(_PartyModeID, _CoverBGTexture, _Color, rect);
_Tiles.Add(tile);
//Create text
var textRect = new SRectF(MaxRect.X + 2 * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _ListTextWidth, _TileH, Rect.Z);
var textRect = new SRectF(MaxRect.X + (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _ListTextWidth, _TileH, Rect.Z);
CText text = new CText(textRect.X, textRect.Y, textRect.Z,
textRect.H, textRect.W, EAlignment.Left, EStyle.Normal,
"Normal", _Artist.Color, "");
@@ -220,6 +223,7 @@ namespace VocaluxeLib.Menu.SongMenu
_Artist.Text = String.Empty;
_Title.Text = String.Empty;
_SongLength.Text = String.Empty;
_SongYear.Text = String.Empty;
_DuetIcon.Visible = false;
_RapIcon.Visible = false;
_VideoIcon.Visible = false;
@@ -249,6 +253,7 @@ namespace VocaluxeLib.Menu.SongMenu
_CoverBig.Texture = song.CoverTextureBig;
_Artist.Text = song.Artist;
_Title.Text = song.Title;
_SongYear.Text = song.Year;
_DuetIcon.Visible = song.IsDuet;
_RapIcon.Visible = song.IsRap;
_VideoIcon.Visible = song.VideoFileName != "";
@@ -349,19 +354,53 @@ namespace VocaluxeLib.Menu.SongMenu
break;
case Keys.PageUp:
if (catChangePossible)
if (catChangePossible && CBase.Songs.IsInCategory() && (keyEvent.Mod == EModifier.Ctrl || keyEvent.Mod == EModifier.Alt))
{
_PrevCategory();
keyEvent.Handled = true;
}
else if (moveAllowed)
{
if ((_SelectionNr - _ListLength) <= 0)
_SelectionNr = 0;
else
_SelectionNr = _SelectionNr - _ListLength;
keyEvent.Handled = true;
}
break;
case Keys.PageDown:
if (catChangePossible)
if (catChangePossible && CBase.Songs.IsInCategory() && (keyEvent.Mod == EModifier.Ctrl || keyEvent.Mod == EModifier.Alt))
{
_NextCategory();
keyEvent.Handled = true;
}
else if (moveAllowed)
{
int maxCount_PageDown = (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && !CBase.Songs.IsInCategory() ? CBase.Songs.GetNumCategories() : CBase.Songs.GetNumSongsVisible());
if ((_SelectionNr + _ListLength) >= maxCount_PageDown)
_SelectionNr = maxCount_PageDown - 1;
else
_SelectionNr = _SelectionNr + _ListLength;
keyEvent.Handled = true;
}
break;
case Keys.Home:
if (moveAllowed)
{
_SelectionNr = 0;
keyEvent.Handled = true;
}
break;
case Keys.End:
int maxCount_End = (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && !CBase.Songs.IsInCategory() ? CBase.Songs.GetNumCategories() : CBase.Songs.GetNumSongsVisible());
if (moveAllowed)
{
_SelectionNr = maxCount_End - 1;
keyEvent.Handled = true;
}
break;
case Keys.Left:
@@ -599,13 +638,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);
}
@@ -629,7 +683,11 @@ namespace VocaluxeLib.Menu.SongMenu
{
CSong currentSong = CBase.Songs.GetVisibleSong(i + offset);
_Tiles[i].Texture = currentSong.CoverTextureSmall;
_Texts[i].Text = currentSong.Artist + " - " + currentSong.Title;
if (CBase.Config.GetSongSorting() == ESongSorting.TR_CONFIG_TITLE_LETTER)
_Texts[i].Text = currentSong.Title + " - " + currentSong.Artist;
else
_Texts[i].Text = currentSong.Artist + " - " + currentSong.Title;
}
else
{
@@ -43,6 +43,7 @@ namespace VocaluxeLib.Menu.SongMenu
private CText _Artist;
private CText _Title;
private CText _SongLength;
private CText _SongYear;
private int _NumW;
private int _NumH;
@@ -114,6 +115,7 @@ namespace VocaluxeLib.Menu.SongMenu
_Artist = new CText(_Theme.SongMenuTileBoard.TextArtist, _PartyModeID);
_Title = new CText(_Theme.SongMenuTileBoard.TextTitle, _PartyModeID);
_SongLength = new CText(_Theme.SongMenuTileBoard.TextSongLength, _PartyModeID);
_SongYear = new CText(_Theme.SongMenuTileBoard.TextSongYear, _PartyModeID);
_CoverBig = new CStatic(_Theme.SongMenuTileBoard.StaticCoverBig, _PartyModeID);
_TextBG = new CStatic(_Theme.SongMenuTileBoard.StaticTextBG, _PartyModeID);
_DuetIcon = new CStatic(_Theme.SongMenuTileBoard.StaticDuetIcon, _PartyModeID);
@@ -121,7 +123,7 @@ namespace VocaluxeLib.Menu.SongMenu
_VideoIcon = new CStatic(_Theme.SongMenuTileBoard.StaticVideoIcon, _PartyModeID);
_MedleyCalcIcon = new CStatic(_Theme.SongMenuTileBoard.StaticMedleyCalcIcon, _PartyModeID);
_MedleyTagIcon = new CStatic(_Theme.SongMenuTileBoard.StaticMedleyTagIcon, _PartyModeID);
_SubElements.AddRange(new IMenuElement[] {_Artist, _Title, _SongLength, _DuetIcon, _RapIcon, _VideoIcon, _MedleyCalcIcon, _MedleyTagIcon});
_SubElements.AddRange(new IMenuElement[] {_Artist, _Title, _SongLength, _SongYear, _DuetIcon, _RapIcon, _VideoIcon, _MedleyCalcIcon, _MedleyTagIcon});
}
private void _UpdateTileSelection()
@@ -137,6 +139,7 @@ namespace VocaluxeLib.Menu.SongMenu
{
_Theme.SongMenuTileBoard.TextArtist = (SThemeText)_Artist.GetTheme();
_Theme.SongMenuTileBoard.TextSongLength = (SThemeText)_SongLength.GetTheme();
_Theme.SongMenuTileBoard.TextSongYear = (SThemeText)_SongYear.GetTheme();
_Theme.SongMenuTileBoard.TextTitle = (SThemeText)_Title.GetTheme();
_Theme.SongMenuTileBoard.StaticCoverBig = (SThemeStatic)_CoverBig.GetTheme();
_Theme.SongMenuTileBoard.StaticDuetIcon = (SThemeStatic)_DuetIcon.GetTheme();
@@ -211,6 +214,7 @@ namespace VocaluxeLib.Menu.SongMenu
_Artist.Text = String.Empty;
_Title.Text = String.Empty;
_SongLength.Text = String.Empty;
_SongYear.Text = String.Empty;
_DuetIcon.Visible = false;
_RapIcon.Visible = false;
_VideoIcon.Visible = false;
@@ -240,6 +244,7 @@ namespace VocaluxeLib.Menu.SongMenu
_CoverBig.Texture = song.CoverTextureBig;
_Artist.Text = song.Artist;
_Title.Text = song.Title;
_SongYear.Text = song.Year;
_DuetIcon.Visible = song.IsDuet;
_RapIcon.Visible = song.IsRap;
_VideoIcon.Visible = song.VideoFileName != "";
@@ -340,19 +345,55 @@ namespace VocaluxeLib.Menu.SongMenu
break;
case Keys.PageUp:
if (catChangePossible)
if (catChangePossible && CBase.Songs.IsInCategory() && (keyEvent.Mod == EModifier.Ctrl || keyEvent.Mod == EModifier.Alt))
{
_PrevCategory();
keyEvent.Handled = true;
}
else if (moveAllowed)
{
int numSongsPerPage = _NumH * _NumW;
if ((_SelectionNr - numSongsPerPage) <= 0)
_SelectionNr = 0;
else
_SelectionNr = _SelectionNr - numSongsPerPage;
keyEvent.Handled = true;
}
break;
case Keys.PageDown:
if (catChangePossible)
if (catChangePossible && CBase.Songs.IsInCategory() && (keyEvent.Mod == EModifier.Ctrl || keyEvent.Mod == EModifier.Alt))
{
_NextCategory();
keyEvent.Handled = true;
}
else if (moveAllowed)
{
int numSongsPerPage = _NumH * _NumW;
int maxCount_PageDown = (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && !CBase.Songs.IsInCategory() ? CBase.Songs.GetNumCategories() : CBase.Songs.GetNumSongsVisible());
if ((_SelectionNr + numSongsPerPage) >= maxCount_PageDown)
_SelectionNr = maxCount_PageDown - 1;
else
_SelectionNr = _SelectionNr + numSongsPerPage;
keyEvent.Handled = true;
}
break;
case Keys.Home:
if (moveAllowed)
{
_SelectionNr = 0;
keyEvent.Handled = true;
}
break;
case Keys.End:
int maxCount_End = (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && !CBase.Songs.IsInCategory() ? CBase.Songs.GetNumCategories() : CBase.Songs.GetNumSongsVisible());
if (moveAllowed)
{
_SelectionNr = maxCount_End - 1;
keyEvent.Handled = true;
}
break;
case Keys.Left:
+13 -2
View File
@@ -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; }
@@ -289,6 +289,17 @@ namespace VocaluxeLib.Songs
return loader.ReadNotes();
}
public bool ReloadSong(bool reloadNotes)
{
var loader = new CSongLoader(this);
bool retValue = loader.ReadHeader();
if (!retValue)
return false;
retValue = loader.ReadNotes(reloadNotes);
return retValue;
}
public bool Save()
{
return Save(Path.Combine(Folder, FileName));
@@ -519,4 +530,4 @@ namespace VocaluxeLib.Songs
ShortEnd.Source = EDataSource.Calculated;
}
}
}
}
+8 -2
View File
@@ -82,12 +82,16 @@ namespace VocaluxeLib.Songs
_Song.Languages.Clear();
_Song.Genres.Clear();
_Song.UnknownTags.Clear();
_Song.BackgroundFileNames.Clear();
_Song._Comment = "";
_Song.ManualEncoding = false;
_Song.Medley.Source = EDataSource.None;
_Song._CalculateMedley = true;
_Song.Preview.Source = EDataSource.None;
_Song.ShortEnd.Source = EDataSource.None;
_Song.Start = 0;
_Song.VideoGap = 0;
_Song.Preview.StartTime = 0;
var headerFlags = new EHeaderFlags();
StreamReader sr = null;
@@ -569,6 +573,8 @@ namespace VocaluxeLib.Songs
case 'R':
case 'G':
case 'F':
case 'R': // Read R (RAP) and G (Golden RAP) notes as Freestyle notes currently. Final implementation needed!
case 'G': // Read R (RAP) and G (Golden RAP) notes as Freestyle notes currently. Final implementation needed!
string[] noteData = line.Split(splitChars, 4);
if (noteData.Length < 4)
{
@@ -616,7 +622,7 @@ namespace VocaluxeLib.Songs
if (tag.Equals('*'))
noteType = ENoteType.Golden;
else if (tag.Equals('F'))
else if (tag.Equals('F') || tag.Equals('R') || tag.Equals('G')) // Read R (RAP) and G (Golden RAP) notes as Freestyle notes currently. Final implementation needed!
noteType = ENoteType.Freestyle;
else if (tag.Equals('R'))
{
@@ -773,4 +779,4 @@ namespace VocaluxeLib.Songs
}
}
}
}
}
+2 -1
View File
@@ -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();
}
}
}
}