Generate Covers for songs
This commit is contained in:
1 parent
0a48c6b74b
commit
fe07a2f926
6 files changed
+15
-6
No files matched your search
@@ -7,7 +7,7 @@
|
|||||||
</Info>
|
</Info>
|
||||||
<!--Cover definitions when a category is missing a cover-->
|
<!--Cover definitions when a category is missing a cover-->
|
||||||
<CoverGenerator1>
|
<CoverGenerator1>
|
||||||
<!--Possible types are: Default, Artist, Letter, Edition, Genre, Language, Year, Decade, Date -->
|
<!--Possible types are: Default, Song, Artist, Letter, Edition, Genre, Language, Year, Decade, Date -->
|
||||||
<Type>Default</Type>
|
<Type>Default</Type>
|
||||||
<Text>
|
<Text>
|
||||||
<!--<Text>: Text to be shown, %TEXT% will be replace by the category name-->
|
<!--<Text>: Text to be shown, %TEXT% will be replace by the category name-->
|
||||||
|
|||||||
@@ -871,6 +871,11 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
return CCover.NoCover;
|
return CCover.NoCover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CTextureRef GenerateCover(string text, ECoverGeneratorType type, CSong firstSong)
|
||||||
|
{
|
||||||
|
return CCover.GenerateCover(text, type, firstSong);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CBdataBase : IDataBase
|
class CBdataBase : IDataBase
|
||||||
|
|||||||
@@ -833,7 +833,9 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
|
|
||||||
public CTextureRef CopyTexture(CTextureRef textureRef)
|
public CTextureRef CopyTexture(CTextureRef textureRef)
|
||||||
{
|
{
|
||||||
_EnsureMainThread();
|
// Lock to make sure the texture is not disposed while we are in this method
|
||||||
|
lock (_Textures)
|
||||||
|
{
|
||||||
TTextureType texture;
|
TTextureType texture;
|
||||||
if (!_GetTexture(textureRef, out texture, false))
|
if (!_GetTexture(textureRef, out texture, false))
|
||||||
return null;
|
return null;
|
||||||
@@ -851,6 +853,7 @@ namespace Vocaluxe.Lib.Draw
|
|||||||
Debug.Assert(textureRef.OrigSize.Width > 0);
|
Debug.Assert(textureRef.OrigSize.Width > 0);
|
||||||
return _GetTextureReference(textureRef.OrigSize, texture);
|
return _GetTextureReference(textureRef.OrigSize, texture);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes a texture from the Vram
|
/// Removes a texture from the Vram
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ namespace VocaluxeLib
|
|||||||
public interface ICover
|
public interface ICover
|
||||||
{
|
{
|
||||||
CTextureRef GetNoCover();
|
CTextureRef GetNoCover();
|
||||||
|
CTextureRef GenerateCover(string text, ECoverGeneratorType type, CSong firstSong);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IDataBase
|
public interface IDataBase
|
||||||
|
|||||||
@@ -314,11 +314,10 @@ namespace VocaluxeLib.Songs
|
|||||||
return;
|
return;
|
||||||
if (CoverFileName != "")
|
if (CoverFileName != "")
|
||||||
{
|
{
|
||||||
if (!CBase.DataBase.GetCover(Path.Combine(Folder, CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
|
if (CBase.DataBase.GetCover(Path.Combine(Folder, CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
|
||||||
_CoverTextureSmall = CBase.Cover.GetNoCover();
|
return;
|
||||||
}
|
}
|
||||||
else
|
_CoverTextureSmall = CBase.Cover.GenerateCover(Title, ECoverGeneratorType.Song, null);
|
||||||
_CoverTextureSmall = CBase.Cover.GetNoCover();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _CheckFiles()
|
private void _CheckFiles()
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace VocaluxeLib
|
|||||||
public enum ECoverGeneratorType
|
public enum ECoverGeneratorType
|
||||||
{
|
{
|
||||||
Default,
|
Default,
|
||||||
|
Song,
|
||||||
Folder,
|
Folder,
|
||||||
Artist,
|
Artist,
|
||||||
Letter,
|
Letter,
|
||||||
|
|||||||
Reference in new issue
Block a user