Rename CTexture to CTextureRef to reflect it is only a reference

This commit is contained in:
Flamefire committed 2014-09-13 17:51:55 +02:00
1 parent 3fe8cdf05c
commit 7f8e974fe1
51 files changed
+290 -285

No files matched your search

+29 -19
View File
@@ -52,25 +52,26 @@ namespace Vocaluxe.Base
public static bool VideoEnabled public static bool VideoEnabled
{ {
get { return _PlaysPreview ? _PreviewPlayer.VideoEnabled : _SongPlayer.VideoEnabled; } get { return _PlaysPreview ? _PreviewPlayer.VideoEnabled : _SongPlayer.VideoEnabled; }
set { set
if(_PlaysPreview) {
if (_PlaysPreview)
_PreviewPlayer.VideoEnabled = value; _PreviewPlayer.VideoEnabled = value;
else else
_SongPlayer.VideoEnabled = value; _SongPlayer.VideoEnabled = value;
} }
} }
public static bool CanSing public static bool CanSing
{ {
get get
{ {
if (_PlaysPreview) if (_PlaysPreview)
return false; return false;
else if (_BGMusicFiles.Contains(_CurrentPlaylistElement))
return false;
else else
if (_BGMusicFiles.Contains(_CurrentPlaylistElement)) return true;
return false; }
else return true;
}
} }
public static bool Disabled public static bool Disabled
@@ -85,7 +86,8 @@ namespace Vocaluxe.Base
} }
} }
public static bool RepeatSong { public static bool RepeatSong
{
get { return _SongPlayer.RepeatSong; } get { return _SongPlayer.RepeatSong; }
set { _SongPlayer.RepeatSong = value; } set { _SongPlayer.RepeatSong = value; }
} }
@@ -100,13 +102,20 @@ namespace Vocaluxe.Base
get { return _SongPlayer.SongHasVideo; } get { return _SongPlayer.SongHasVideo; }
} }
public static bool IsPlaying { get { return _PlaysPreview ? _PreviewPlayer.IsPlaying : _SongPlayer.IsPlaying; } } public static bool IsPlaying
{
get { return _PlaysPreview ? _PreviewPlayer.IsPlaying : _SongPlayer.IsPlaying; }
}
public static bool IsPlayingPreview { get { return _PlaysPreview; } } public static bool IsPlayingPreview
{
get { return _PlaysPreview; }
}
public static string ArtistAndTitle public static string ArtistAndTitle
{ {
get { get
{
if (_PlaysPreview) if (_PlaysPreview)
return _PreviewPlayer.ArtistAndTitle; return _PreviewPlayer.ArtistAndTitle;
else else
@@ -119,7 +128,7 @@ namespace Vocaluxe.Base
get { return _PlaysPreview ? _PreviewPlayer.Length : _SongPlayer.Length; } get { return _PlaysPreview ? _PreviewPlayer.Length : _SongPlayer.Length; }
} }
public static CTexture Cover public static CTextureRef Cover
{ {
get { return _PlaysPreview ? _PreviewPlayer.Cover : _SongPlayer.Cover; } get { return _PlaysPreview ? _PreviewPlayer.Cover : _SongPlayer.Cover; }
} }
@@ -184,12 +193,14 @@ namespace Vocaluxe.Base
if (_PlaysPreview) if (_PlaysPreview)
_PreviewPlayer.Play(); _PreviewPlayer.Play();
else if(CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF) else if (CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF)
{
if (_SongPlayer.SongLoaded) if (_SongPlayer.SongLoaded)
//Resume //Resume
_SongPlayer.TogglePause(); _SongPlayer.TogglePause();
else else
Next(); Next();
}
} }
public static void Stop() public static void Stop()
@@ -278,7 +289,7 @@ namespace Vocaluxe.Base
public static void Update() public static void Update()
{ {
if (!IsPlaying && (!_SongPlayer.SongLoaded || !_PreviewPlayer.SongLoaded) ) if (!IsPlaying && (!_SongPlayer.SongLoaded || !_PreviewPlayer.SongLoaded))
return; return;
if (_PlaysPreview) if (_PlaysPreview)
@@ -291,7 +302,7 @@ namespace Vocaluxe.Base
} }
} }
public static CTexture GetVideoTexture() public static CTextureRef GetVideoTexture()
{ {
return _PlaysPreview ? _PreviewPlayer.GetVideoTexture() : _SongPlayer.GetVideoTexture(); return _PlaysPreview ? _PreviewPlayer.GetVideoTexture() : _SongPlayer.GetVideoTexture();
} }
@@ -439,6 +450,5 @@ namespace Vocaluxe.Base
{ {
return _BGMusicFiles.Contains(element); return _BGMusicFiles.Contains(element);
} }
} }
} }
+4 -4
View File
@@ -32,10 +32,10 @@ namespace Vocaluxe.Base
static class CCover static class CCover
{ {
private static readonly Dictionary<string, CTexture> _Covers = new Dictionary<string, CTexture>(); private static readonly Dictionary<string, CTextureRef> _Covers = new Dictionary<string, CTextureRef>();
private static readonly List<SCoverTheme> _CoverThemes = new List<SCoverTheme>(); private static readonly List<SCoverTheme> _CoverThemes = new List<SCoverTheme>();
public static CTexture NoCover { get; private set; } public static CTextureRef NoCover { get; private set; }
public static void Init() public static void Init()
{ {
@@ -81,7 +81,7 @@ namespace Vocaluxe.Base
/// <summary> /// <summary>
/// Returns a STexture for a given cover name. Returns "NoCover" if the cover does not exist. /// Returns a STexture for a given cover name. Returns "NoCover" if the cover does not exist.
/// </summary> /// </summary>
public static CTexture Cover(string name) public static CTextureRef Cover(string name)
{ {
lock (_Covers) lock (_Covers)
{ {
@@ -116,7 +116,7 @@ namespace Vocaluxe.Base
{ {
foreach (string key in _Covers.Keys) foreach (string key in _Covers.Keys)
{ {
CTexture texture = _Covers[key]; CTextureRef texture = _Covers[key];
CDraw.RemoveTexture(ref texture); CDraw.RemoveTexture(ref texture);
} }
_Covers.Clear(); _Covers.Clear();
+1 -1
View File
@@ -27,7 +27,7 @@ namespace Vocaluxe.Base
{ {
private int _MouseMoveDiffMin = CSettings.MouseMoveDiffMinActive; private int _MouseMoveDiffMin = CSettings.MouseMoveDiffMinActive;
private CFading _Fading; private CFading _Fading;
private CTexture _Cursor; private CTextureRef _Cursor;
private Point _LastDiffPos; private Point _LastDiffPos;
private readonly Stopwatch _Movetimer = new Stopwatch(); private readonly Stopwatch _Movetimer = new Stopwatch();
+2 -2
View File
@@ -93,7 +93,7 @@ namespace Vocaluxe.Base
_HighscoreDB.IncreaseSongCounter(dataBaseSongID); _HighscoreDB.IncreaseSongCounter(dataBaseSongID);
} }
public static bool GetCover(string fileName, ref CTexture tex, int maxSize) public static bool GetCover(string fileName, ref CTextureRef tex, int maxSize)
{ {
return _CoverDB.GetCover(fileName, ref tex, maxSize); return _CoverDB.GetCover(fileName, ref tex, maxSize);
} }
@@ -103,7 +103,7 @@ namespace Vocaluxe.Base
_CoverDB.CommitCovers(); _CoverDB.CommitCovers();
} }
public static bool GetCreditsRessource(string fileName, ref CTexture tex) public static bool GetCreditsRessource(string fileName, ref CTextureRef tex)
{ {
return _ResourceDB.GetCreditsRessource(fileName, ref tex); return _ResourceDB.GetCreditsRessource(fileName, ref tex);
} }
+16 -16
View File
@@ -130,12 +130,12 @@ namespace Vocaluxe.Base
_Draw.ClearScreen(); _Draw.ClearScreen();
} }
public static CTexture CopyScreen() public static CTextureRef CopyScreen()
{ {
return _Draw.CopyScreen(); return _Draw.CopyScreen();
} }
public static void CopyScreen(ref CTexture texture) public static void CopyScreen(ref CTextureRef texture)
{ {
_Draw.CopyScreen(ref texture); _Draw.CopyScreen(ref texture);
} }
@@ -145,67 +145,67 @@ namespace Vocaluxe.Base
_Draw.MakeScreenShot(); _Draw.MakeScreenShot();
} }
public static CTexture AddTexture(Bitmap bitmap) public static CTextureRef AddTexture(Bitmap bitmap)
{ {
return _Draw.AddTexture(bitmap); return _Draw.AddTexture(bitmap);
} }
public static CTexture AddTexture(string texturePath) public static CTextureRef AddTexture(string texturePath)
{ {
return _Draw.AddTexture(texturePath); return _Draw.AddTexture(texturePath);
} }
public static CTexture AddTexture(int w, int h, byte[] data) public static CTextureRef AddTexture(int w, int h, byte[] data)
{ {
return _Draw.AddTexture(w, h, data); return _Draw.AddTexture(w, h, data);
} }
public static CTexture EnqueueTexture(int w, int h, byte[] data) public static CTextureRef EnqueueTexture(int w, int h, byte[] data)
{ {
return _Draw.EnqueueTexture(w, h, data); return _Draw.EnqueueTexture(w, h, data);
} }
public static bool UpdateTexture(CTexture texture, int w, int h, byte[] data) public static bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data)
{ {
return _Draw.UpdateTexture(texture, w, h, data); return _Draw.UpdateTexture(texture, w, h, data);
} }
public static bool UpdateOrAddTexture(ref CTexture texture, int w, int h, byte[] data) public static bool UpdateOrAddTexture(ref CTextureRef texture, int w, int h, byte[] data)
{ {
return _Draw.UpdateOrAddTexture(ref texture, w, h, data); return _Draw.UpdateOrAddTexture(ref texture, w, h, data);
} }
public static void RemoveTexture(ref CTexture texture) public static void RemoveTexture(ref CTextureRef texture)
{ {
_Draw.RemoveTexture(ref texture); _Draw.RemoveTexture(ref texture);
} }
public static void DrawTexture(CTexture texture) public static void DrawTexture(CTextureRef texture)
{ {
_Draw.DrawTexture(texture); _Draw.DrawTexture(texture);
} }
public static void DrawTexture(CTexture texture, SRectF rect) public static void DrawTexture(CTextureRef texture, SRectF rect)
{ {
_Draw.DrawTexture(texture, rect); _Draw.DrawTexture(texture, rect);
} }
public static void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false) public static void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, bool mirrored = false)
{ {
_Draw.DrawTexture(texture, rect, color, mirrored); _Draw.DrawTexture(texture, rect, color, mirrored);
} }
public static void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) public static void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
{ {
_Draw.DrawTexture(texture, rect, color, bounds, mirrored); _Draw.DrawTexture(texture, rect, color, bounds, mirrored);
} }
public static void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end) public static void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, float begin, float end)
{ {
_Draw.DrawTexture(texture, rect, color, begin, end); _Draw.DrawTexture(texture, rect, color, begin, end);
} }
public static void DrawTexture(CStatic staticBounds, CTexture texture, EAspect aspect) public static void DrawTexture(CStatic staticBounds, CTextureRef texture, EAspect aspect)
{ {
if (texture == null) if (texture == null)
return; return;
@@ -218,7 +218,7 @@ namespace Vocaluxe.Base
texture.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f)); texture.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f));
} }
public static void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) public static void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
{ {
_Draw.DrawTextureReflection(texture, rect, color, bounds, space, height); _Draw.DrawTextureReflection(texture, rect, color, bounds, space, height);
} }
+13 -13
View File
@@ -267,12 +267,12 @@ namespace Vocaluxe.Base
return CTheme.GetSkinIndex(partyModeID); return CTheme.GetSkinIndex(partyModeID);
} }
public CTexture GetSkinTexture(string textureName, int partyModeID) public CTextureRef GetSkinTexture(string textureName, int partyModeID)
{ {
return CTheme.GetSkinTexture(textureName, partyModeID); return CTheme.GetSkinTexture(textureName, partyModeID);
} }
public CTexture GetSkinVideoTexture(string videoName, int partyModeID) public CTextureRef GetSkinVideoTexture(string videoName, int partyModeID)
{ {
return CTheme.GetSkinVideoTexture(videoName, partyModeID); return CTheme.GetSkinVideoTexture(videoName, partyModeID);
} }
@@ -400,7 +400,7 @@ namespace Vocaluxe.Base
CBackgroundMusic.StopPreview(); CBackgroundMusic.StopPreview();
} }
public CTexture GetVideoTexture() public CTextureRef GetVideoTexture()
{ {
return CBackgroundMusic.GetVideoTexture(); return CBackgroundMusic.GetVideoTexture();
} }
@@ -408,32 +408,32 @@ namespace Vocaluxe.Base
class CBdraw : IDrawing class CBdraw : IDrawing
{ {
public void DrawTexture(CTexture texture, SRectF rect) public void DrawTexture(CTextureRef texture, SRectF rect)
{ {
CDraw.DrawTexture(texture, rect); CDraw.DrawTexture(texture, rect);
} }
public void DrawTexture(CTexture texture, SRectF rect, SColorF color) public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color)
{ {
CDraw.DrawTexture(texture, rect, color); CDraw.DrawTexture(texture, rect, color);
} }
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
{ {
CDraw.DrawTexture(texture, rect, color, bounds, mirrored); CDraw.DrawTexture(texture, rect, color, bounds, mirrored);
} }
public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight) public void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight)
{ {
CDraw.DrawTextureReflection(texture, rect, color, bounds, reflectionSpace, reflectionHeight); CDraw.DrawTextureReflection(texture, rect, color, bounds, reflectionSpace, reflectionHeight);
} }
public CTexture AddTexture(string fileName) public CTextureRef AddTexture(string fileName)
{ {
return CDraw.AddTexture(fileName); return CDraw.AddTexture(fileName);
} }
public void RemoveTexture(ref CTexture texture) public void RemoveTexture(ref CTextureRef texture)
{ {
CDraw.RemoveTexture(ref texture); CDraw.RemoveTexture(ref texture);
} }
@@ -651,7 +651,7 @@ namespace Vocaluxe.Base
return CProfiles.GetPlayerName(profileID, playerNum); return CProfiles.GetPlayerName(profileID, playerNum);
} }
public CTexture GetAvatar(int profileID) public CTextureRef GetAvatar(int profileID)
{ {
return CProfiles.GetAvatarTextureFromProfile(profileID); return CProfiles.GetAvatarTextureFromProfile(profileID);
} }
@@ -810,7 +810,7 @@ namespace Vocaluxe.Base
return CVideo.Skip(videoStream, startPosition, videoGap); return CVideo.Skip(videoStream, startPosition, videoGap);
} }
public bool GetFrame(int videoStream, ref CTexture videoTexture, float time, out float videoTime) public bool GetFrame(int videoStream, ref CTextureRef videoTexture, float time, out float videoTime)
{ {
return CVideo.GetFrame(videoStream, ref videoTexture, time, out videoTime); return CVideo.GetFrame(videoStream, ref videoTexture, time, out videoTime);
} }
@@ -891,7 +891,7 @@ namespace Vocaluxe.Base
class CBcover : ICover class CBcover : ICover
{ {
public CTexture GetNoCover() public CTextureRef GetNoCover()
{ {
return CCover.NoCover; return CCover.NoCover;
} }
@@ -899,7 +899,7 @@ namespace Vocaluxe.Base
class CBdataBase : IDataBase class CBdataBase : IDataBase
{ {
public bool GetCover(string fileName, ref CTexture texture, int coverSize) public bool GetCover(string fileName, ref CTextureRef texture, int coverSize)
{ {
return CDataBase.GetCover(fileName, ref texture, coverSize); return CDataBase.GetCover(fileName, ref texture, coverSize);
} }
+1 -1
View File
@@ -61,7 +61,7 @@ namespace Vocaluxe.Base
get { return _Song != null ? _Song.Finish : 0f; } get { return _Song != null ? _Song.Finish : 0f; }
} }
public CTexture Cover public CTextureRef Cover
{ {
get { return _Song != null ? _Song.CoverTextureSmall : CCover.NoCover; } get { return _Song != null ? _Song.CoverTextureSmall : CCover.NoCover; }
} }
+2 -2
View File
@@ -504,7 +504,7 @@ namespace Vocaluxe.Base
#endregion profile properties #endregion profile properties
#region avatar texture #region avatar texture
public static CTexture GetAvatarTexture(int avatarID) public static CTextureRef GetAvatarTexture(int avatarID)
{ {
if (!IsAvatarIDValid(avatarID)) if (!IsAvatarIDValid(avatarID))
return null; return null;
@@ -512,7 +512,7 @@ namespace Vocaluxe.Base
return _Avatars[avatarID].Texture; return _Avatars[avatarID].Texture;
} }
public static CTexture GetAvatarTextureFromProfile(int profileID) public static CTextureRef GetAvatarTextureFromProfile(int profileID)
{ {
if (!IsProfileIDValid(profileID) || _Profiles[profileID].Avatar == null) if (!IsProfileIDValid(profileID) || _Profiles[profileID].Avatar == null)
return null; return null;
+3 -3
View File
@@ -44,7 +44,7 @@ namespace Vocaluxe.Base
class CSkinElement class CSkinElement
{ {
public string Value; public string Value;
public CTexture Texture; public CTextureRef Texture;
} }
class CVideoSkinElement : CSkinElement class CVideoSkinElement : CSkinElement
@@ -554,7 +554,7 @@ namespace Vocaluxe.Base
return path; return path;
} }
public static CTexture GetSkinTexture(string textureName, int partyModeID) public static CTextureRef GetSkinTexture(string textureName, int partyModeID)
{ {
int skinIndex = GetSkinIndex(partyModeID); int skinIndex = GetSkinIndex(partyModeID);
CSkinElement sk; CSkinElement sk;
@@ -597,7 +597,7 @@ namespace Vocaluxe.Base
return null; return null;
} }
public static CTexture GetSkinVideoTexture(string videoName, int partyModeID) public static CTextureRef GetSkinVideoTexture(string videoName, int partyModeID)
{ {
CVideoSkinElement sk = GetSkinVideo(videoName, partyModeID); CVideoSkinElement sk = GetSkinVideo(videoName, partyModeID);
if (sk == null) if (sk == null)
+1 -1
View File
@@ -75,7 +75,7 @@ namespace Vocaluxe.Base
return _VideoDecoder.GetLength(streamID); return _VideoDecoder.GetLength(streamID);
} }
public static bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime) public static bool GetFrame(int streamID, ref CTextureRef frame, float time, out float videoTime)
{ {
return _VideoDecoder.GetFrame(streamID, ref frame, time, out videoTime); return _VideoDecoder.GetFrame(streamID, ref frame, time, out videoTime);
} }
+1 -1
View File
@@ -7,7 +7,7 @@ namespace Vocaluxe.Base
{ {
class CVideoPlayer class CVideoPlayer
{ {
private CTexture _VideoTexture; private CTextureRef _VideoTexture;
private int _VideoStream; private int _VideoStream;
private readonly Stopwatch _VideoTimer = new Stopwatch(); private readonly Stopwatch _VideoTimer = new Stopwatch();
private bool _Finished; private bool _Finished;
+1 -1
View File
@@ -57,7 +57,7 @@ namespace Vocaluxe.Base
_Webcam = null; _Webcam = null;
} }
public static bool GetFrame(ref CTexture tex) public static bool GetFrame(ref CTextureRef tex)
{ {
return _Webcam != null && _Webcam.GetFrame(ref tex); return _Webcam != null && _Webcam.GetFrame(ref tex);
} }
+3 -3
View File
@@ -85,7 +85,7 @@ namespace Vocaluxe.Base.Fonts
public void DrawGlyph(char chr, float x, float y, float z, SColorF color) public void DrawGlyph(char chr, float x, float y, float z, SColorF color)
{ {
CTexture texture; CTextureRef texture;
SRectF rect; SRectF rect;
GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect); GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect);
CDraw.DrawTexture(texture, rect, color); CDraw.DrawTexture(texture, rect, color);
@@ -93,7 +93,7 @@ namespace Vocaluxe.Base.Fonts
public void DrawGlyph(char chr, float x, float y, float z, SColorF color, float begin, float end) public void DrawGlyph(char chr, float x, float y, float z, SColorF color, float begin, float end)
{ {
CTexture texture; CTextureRef texture;
SRectF rect; SRectF rect;
GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect); GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect);
CDraw.DrawTexture(texture, rect, color, begin, end); CDraw.DrawTexture(texture, rect, color, begin, end);
@@ -101,7 +101,7 @@ namespace Vocaluxe.Base.Fonts
public void DrawGlyphReflection(char chr, float x, float y, float z, SColorF color, float rspace, float rheight) public void DrawGlyphReflection(char chr, float x, float y, float z, SColorF color, float rspace, float rheight)
{ {
CTexture texture; CTextureRef texture;
SRectF rect; SRectF rect;
GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect); GetOrAddGlyph(chr).GetTextureAndRect(x, y, z, out texture, out rect);
CDraw.DrawTextureReflection(texture, rect, color, rect, rspace, rheight); CDraw.DrawTextureReflection(texture, rect, color, rect, rspace, rheight);
+2 -2
View File
@@ -31,7 +31,7 @@ namespace Vocaluxe.Base.Fonts
{ {
class CGlyph class CGlyph
{ {
private CTexture _Texture; private CTextureRef _Texture;
private readonly SizeF _BoundingBox; private readonly SizeF _BoundingBox;
private readonly RectangleF _DrawBounding; private readonly RectangleF _DrawBounding;
public readonly float MaxHeight; public readonly float MaxHeight;
@@ -147,7 +147,7 @@ namespace Vocaluxe.Base.Fonts
return CFonts.Height / _BoundingBox.Height; return CFonts.Height / _BoundingBox.Height;
} }
public void GetTextureAndRect(float x, float y, float z, out CTexture texture, out SRectF rect) public void GetTextureAndRect(float x, float y, float z, out CTextureRef texture, out SRectF rect)
{ {
texture = _Texture; texture = _Texture;
float factor = _GetFactor(); float factor = _GetFactor();
+1 -1
View File
@@ -63,7 +63,7 @@ namespace Vocaluxe.Lib.Database
} }
} }
public bool GetCover(string coverPath, ref CTexture tex, int maxSize) public bool GetCover(string coverPath, ref CTextureRef tex, int maxSize)
{ {
if (_Connection == null) if (_Connection == null)
return false; return false;
+1 -1
View File
@@ -66,7 +66,7 @@ namespace Vocaluxe.Lib.Database
return true; return true;
} }
public bool GetCreditsRessource(string fileName, ref CTexture tex) public bool GetCreditsRessource(string fileName, ref CTextureRef tex)
{ {
if (_Connection == null) if (_Connection == null)
return false; return false;
+12 -12
View File
@@ -52,7 +52,7 @@ namespace Vocaluxe.Lib.Draw
private VertexBuffer _VertexBuffer; private VertexBuffer _VertexBuffer;
private IndexBuffer _IndexBuffer; private IndexBuffer _IndexBuffer;
private CTexture _BlankTexture; private CTextureRef _BlankTexture;
private readonly Queue<STexturedColoredVertex> _Vertices = new Queue<STexturedColoredVertex>(); private readonly Queue<STexturedColoredVertex> _Vertices = new Queue<STexturedColoredVertex>();
private readonly Queue<Texture> _VerticesTextures = new Queue<Texture>(); private readonly Queue<Texture> _VerticesTextures = new Queue<Texture>();
@@ -466,9 +466,9 @@ namespace Vocaluxe.Lib.Draw
/// Copies the current frame into a texture /// Copies the current frame into a texture
/// <returns>A texture holding the current frame</returns> /// <returns>A texture holding the current frame</returns>
/// </summary> /// </summary>
public CTexture CopyScreen() public CTextureRef CopyScreen()
{ {
CTexture texture = _GetNewTextureRef(_W, _H); CTextureRef texture = _GetNewTextureRef(_W, _H);
Surface backbufferSurface = _Device.GetBackBuffer(0, 0); Surface backbufferSurface = _Device.GetBackBuffer(0, 0);
var tex = new Texture(_Device, texture.W2, texture.H2, 0, Usage.AutoGenerateMipMap, Format.A8R8G8B8, Pool.Managed); var tex = new Texture(_Device, texture.W2, texture.H2, 0, Usage.AutoGenerateMipMap, Format.A8R8G8B8, Pool.Managed);
@@ -487,7 +487,7 @@ namespace Vocaluxe.Lib.Draw
/// Copies the current frame into a texture /// Copies the current frame into a texture
/// </summary> /// </summary>
/// <param name="texture">The texture in which the frame is copied to</param> /// <param name="texture">The texture in which the frame is copied to</param>
public void CopyScreen(ref CTexture texture) public void CopyScreen(ref CTextureRef texture)
{ {
if (!_TextureExists(texture) || texture.DataSize.Width != GetScreenWidth() || texture.DataSize.Height != GetScreenHeight()) if (!_TextureExists(texture) || texture.DataSize.Width != GetScreenWidth() || texture.DataSize.Height != GetScreenHeight())
{ {
@@ -566,7 +566,7 @@ namespace Vocaluxe.Lib.Draw
#endregion Basic Draw Methods #endregion Basic Draw Methods
#region Textures #region Textures
protected override Texture _CreateTexture(CTexture texture, byte[] data) protected override Texture _CreateTexture(CTextureRef texture, byte[] data)
{ {
//Create a new texture in the managed pool, which does not need to be recreated on a lost device //Create a new texture in the managed pool, which does not need to be recreated on a lost device
//because a copy of the texture is hold in the Ram //because a copy of the texture is hold in the Ram
@@ -602,7 +602,7 @@ namespace Vocaluxe.Lib.Draw
/// <param name="h"></param> /// <param name="h"></param>
/// <param name="data">A byte array containing the new texture's data</param> /// <param name="data">A byte array containing the new texture's data</param>
/// <returns>True if succeeded</returns> /// <returns>True if succeeded</returns>
public override bool UpdateTexture(CTexture texture, int w, int h, byte[] data) public override bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data)
{ {
if (!_TextureExists(texture)) if (!_TextureExists(texture))
return false; return false;
@@ -626,7 +626,7 @@ namespace Vocaluxe.Lib.Draw
/// Draws a texture /// Draws a texture
/// </summary> /// </summary>
/// <param name="texture">The texture to be drawn</param> /// <param name="texture">The texture to be drawn</param>
public void DrawTexture(CTexture texture) public void DrawTexture(CTextureRef texture)
{ {
if (texture == null) if (texture == null)
return; return;
@@ -638,7 +638,7 @@ namespace Vocaluxe.Lib.Draw
/// </summary> /// </summary>
/// <param name="texture">The texture to be drawn</param> /// <param name="texture">The texture to be drawn</param>
/// <param name="rect">A SRectF struct containing the destination coordinates</param> /// <param name="rect">A SRectF struct containing the destination coordinates</param>
public void DrawTexture(CTexture texture, SRectF rect) public void DrawTexture(CTextureRef texture, SRectF rect)
{ {
if (texture == null) if (texture == null)
return; return;
@@ -652,7 +652,7 @@ namespace Vocaluxe.Lib.Draw
/// <param name="rect">A SRectF struct containing the destination coordinates</param> /// <param name="rect">A SRectF struct containing the destination coordinates</param>
/// <param name="color">A SColorF struct containing a color which the texture will be colored in</param> /// <param name="color">A SColorF struct containing a color which the texture will be colored in</param>
/// <param name="mirrored">True if the texture should be mirrored</param> /// <param name="mirrored">True if the texture should be mirrored</param>
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false) public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, bool mirrored = false)
{ {
if (rect.W < 1 || rect.H < 1) if (rect.W < 1 || rect.H < 1)
return; return;
@@ -698,7 +698,7 @@ namespace Vocaluxe.Lib.Draw
/// <param name="color">A SColorF struct containing a color which the texture will be colored in</param> /// <param name="color">A SColorF struct containing a color which the texture will be colored in</param>
/// <param name="bounds">A SRectF struct containing which part of the texture should be drawn</param> /// <param name="bounds">A SRectF struct containing which part of the texture should be drawn</param>
/// <param name="mirrored">True if the texture should be mirrored</param> /// <param name="mirrored">True if the texture should be mirrored</param>
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
{ {
if (Math.Abs(rect.W) < 1 || Math.Abs(rect.H) < 1 || Math.Abs(bounds.H) < 1 || Math.Abs(bounds.W) < 1 || if (Math.Abs(rect.W) < 1 || Math.Abs(rect.H) < 1 || Math.Abs(bounds.H) < 1 || Math.Abs(bounds.W) < 1 ||
Math.Abs(color.A) < 0.01) Math.Abs(color.A) < 0.01)
@@ -775,7 +775,7 @@ namespace Vocaluxe.Lib.Draw
/// <param name="color">A SColorF struct containing a color which the texture will be colored in</param> /// <param name="color">A SColorF struct containing a color which the texture will be colored in</param>
/// <param name="begin">A Value ranging from 0 to 1 containing the beginning of the texture</param> /// <param name="begin">A Value ranging from 0 to 1 containing the beginning of the texture</param>
/// <param name="end">A Value ranging from 0 to 1 containing the ending of the texture</param> /// <param name="end">A Value ranging from 0 to 1 containing the ending of the texture</param>
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end) public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, float begin, float end)
{ {
if (!_TextureExists(texture)) if (!_TextureExists(texture))
return; return;
@@ -819,7 +819,7 @@ namespace Vocaluxe.Lib.Draw
/// <param name="bounds">A SRectF struct containing which part of the texture should be drawn</param> /// <param name="bounds">A SRectF struct containing which part of the texture should be drawn</param>
/// <param name="space">The space between the texture and the reflection</param> /// <param name="space">The space between the texture and the reflection</param>
/// <param name="height">The height of the reflection</param> /// <param name="height">The height of the reflection</param>
public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) public void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
{ {
if (!_TextureExists(texture)) if (!_TextureExists(texture))
return; return;
+22 -22
View File
@@ -15,10 +15,10 @@ namespace Vocaluxe.Lib.Draw
{ {
struct STextureQueue struct STextureQueue
{ {
public readonly CTexture Texture; public readonly CTextureRef Texture;
public readonly byte[] Data; public readonly byte[] Data;
public STextureQueue(CTexture texture, byte[] data) public STextureQueue(CTextureRef texture, byte[] data)
{ {
Texture = texture; Texture = texture;
Data = data; Data = data;
@@ -141,7 +141,7 @@ namespace Vocaluxe.Lib.Draw
/// <param name="texture"></param> /// <param name="texture"></param>
/// <param name="data"></param> /// <param name="data"></param>
/// <returns></returns> /// <returns></returns>
protected abstract TTextureType _CreateTexture(CTexture texture, byte[] data); protected abstract TTextureType _CreateTexture(CTextureRef texture, byte[] data);
/// <summary> /// <summary>
/// Creates the texture specified by the reference and fills it with the given data<br /> /// Creates the texture specified by the reference and fills it with the given data<br />
@@ -150,14 +150,14 @@ namespace Vocaluxe.Lib.Draw
/// <param name="texture"></param> /// <param name="texture"></param>
/// <param name="data"></param> /// <param name="data"></param>
/// <returns></returns> /// <returns></returns>
protected virtual TTextureType _CreateTexture(CTexture texture, IntPtr data) protected virtual TTextureType _CreateTexture(CTextureRef texture, IntPtr data)
{ {
byte[] dataArray = new byte[4 * texture.DataSize.Width * texture.DataSize.Height]; byte[] dataArray = new byte[4 * texture.DataSize.Width * texture.DataSize.Height];
Marshal.Copy(data, dataArray, 0, dataArray.Length); Marshal.Copy(data, dataArray, 0, dataArray.Length);
return _CreateTexture(texture, dataArray); return _CreateTexture(texture, dataArray);
} }
protected CTexture _GetNewTextureRef(int origWidth, int origHeight, int dataWidth = 0, int dataHeight = 0) protected CTextureRef _GetNewTextureRef(int origWidth, int origHeight, int dataWidth = 0, int dataHeight = 0)
{ {
Debug.Assert(origWidth > 0 && origHeight > 0); Debug.Assert(origWidth > 0 && origHeight > 0);
Debug.Assert(dataWidth > 0 || dataHeight <= 0); Debug.Assert(dataWidth > 0 || dataHeight <= 0);
@@ -168,7 +168,7 @@ namespace Vocaluxe.Lib.Draw
} }
Size origSize = new Size(origWidth, origHeight); Size origSize = new Size(origWidth, origHeight);
Size dataSize = (dataHeight > 0) ? new Size(dataWidth, dataHeight) : origSize; Size dataSize = (dataHeight > 0) ? new Size(dataWidth, dataHeight) : origSize;
return new CTexture(id, origSize, dataSize, _CheckForNextPowerOf2(dataSize.Width), _CheckForNextPowerOf2(dataSize.Height)); return new CTextureRef(id, origSize, dataSize, _CheckForNextPowerOf2(dataSize.Width), _CheckForNextPowerOf2(dataSize.Height));
} }
/// <summary> /// <summary>
@@ -176,7 +176,7 @@ namespace Vocaluxe.Lib.Draw
/// </summary> /// </summary>
/// <param name="texturePath">The texture's filepath</param> /// <param name="texturePath">The texture's filepath</param>
/// <returns>A STexture object containing the added texture</returns> /// <returns>A STexture object containing the added texture</returns>
public CTexture AddTexture(string texturePath) public CTextureRef AddTexture(string texturePath)
{ {
if (!File.Exists(texturePath)) if (!File.Exists(texturePath))
{ {
@@ -193,7 +193,7 @@ namespace Vocaluxe.Lib.Draw
CLog.LogError("Error loading Texture: " + texturePath); CLog.LogError("Error loading Texture: " + texturePath);
return null; return null;
} }
CTexture s; CTextureRef s;
try try
{ {
s = AddTexture(bmp, texturePath); s = AddTexture(bmp, texturePath);
@@ -205,7 +205,7 @@ namespace Vocaluxe.Lib.Draw
return s; return s;
} }
public CTexture AddTexture(Bitmap bmp) public CTextureRef AddTexture(Bitmap bmp)
{ {
return AddTexture(bmp, ""); return AddTexture(bmp, "");
} }
@@ -216,7 +216,7 @@ namespace Vocaluxe.Lib.Draw
/// <param name="bmp">The Bitmap of which the texure will be created from</param> /// <param name="bmp">The Bitmap of which the texure will be created from</param>
/// <param name="texturePath"></param> /// <param name="texturePath"></param>
/// <returns>A STexture object containing the added texture</returns> /// <returns>A STexture object containing the added texture</returns>
public CTexture AddTexture(Bitmap bmp, string texturePath) public CTextureRef AddTexture(Bitmap bmp, string texturePath)
{ {
if (bmp.Height == 0 || bmp.Width == 0) if (bmp.Height == 0 || bmp.Width == 0)
return null; return null;
@@ -247,7 +247,7 @@ namespace Vocaluxe.Lib.Draw
int w = Math.Min(bmp.Width, maxSize); int w = Math.Min(bmp.Width, maxSize);
int h = Math.Min(bmp.Height, maxSize); int h = Math.Min(bmp.Height, maxSize);
CTexture texture = _GetNewTextureRef(bmp.Width, bmp.Height, w, h); CTextureRef texture = _GetNewTextureRef(bmp.Width, bmp.Height, w, h);
texture.TexturePath = texturePath; texture.TexturePath = texturePath;
Bitmap bmp2 = null; Bitmap bmp2 = null;
@@ -285,14 +285,14 @@ namespace Vocaluxe.Lib.Draw
return texture; return texture;
} }
public CTexture AddTexture(int w, int h, byte[] data) public CTextureRef AddTexture(int w, int h, byte[] data)
{ {
CTexture texture = _GetNewTextureRef(w, h); CTextureRef texture = _GetNewTextureRef(w, h);
_AddTexture(texture, data); _AddTexture(texture, data);
return texture; return texture;
} }
private void _AddTexture(CTexture texture, byte[] data) private void _AddTexture(CTextureRef texture, byte[] data)
{ {
TTextureType t = _CreateTexture(texture, data); TTextureType t = _CreateTexture(texture, data);
lock (_Textures) lock (_Textures)
@@ -301,7 +301,7 @@ namespace Vocaluxe.Lib.Draw
} }
} }
private void _AddTexture(CTexture texture, IntPtr data) private void _AddTexture(CTextureRef texture, IntPtr data)
{ {
TTextureType t = _CreateTexture(texture, data); TTextureType t = _CreateTexture(texture, data);
lock (_Textures) lock (_Textures)
@@ -310,9 +310,9 @@ namespace Vocaluxe.Lib.Draw
} }
} }
public CTexture EnqueueTexture(int w, int h, byte[] data) public CTextureRef EnqueueTexture(int w, int h, byte[] data)
{ {
CTexture texture = _GetNewTextureRef(w, h); CTextureRef texture = _GetNewTextureRef(w, h);
lock (_Textures) lock (_Textures)
{ {
@@ -330,9 +330,9 @@ namespace Vocaluxe.Lib.Draw
/// <param name="h"></param> /// <param name="h"></param>
/// <param name="data">A byte array containing the new texture's data</param> /// <param name="data">A byte array containing the new texture's data</param>
/// <returns>True if succeeded</returns> /// <returns>True if succeeded</returns>
public abstract bool UpdateTexture(CTexture texture, int w, int h, byte[] data); public abstract bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data);
public bool UpdateOrAddTexture(ref CTexture texture, int w, int h, byte[] data) public bool UpdateOrAddTexture(ref CTextureRef texture, int w, int h, byte[] data)
{ {
if (!UpdateTexture(texture, w, h, data)) if (!UpdateTexture(texture, w, h, data))
{ {
@@ -347,7 +347,7 @@ namespace Vocaluxe.Lib.Draw
/// </summary> /// </summary>
/// <param name="texture">The texture to check</param> /// <param name="texture">The texture to check</param>
/// <returns>True if the texture exists</returns> /// <returns>True if the texture exists</returns>
protected bool _TextureExists(CTexture texture) protected bool _TextureExists(CTextureRef texture)
{ {
lock (_Textures) lock (_Textures)
{ {
@@ -356,7 +356,7 @@ namespace Vocaluxe.Lib.Draw
} }
} }
protected TTextureType _GetTexture(CTexture textureRef) protected TTextureType _GetTexture(CTextureRef textureRef)
{ {
if (textureRef == null) if (textureRef == null)
return null; return null;
@@ -369,7 +369,7 @@ namespace Vocaluxe.Lib.Draw
/// Removes a texture from the Vram /// Removes a texture from the Vram
/// </summary> /// </summary>
/// <param name="texture">The texture to be removed</param> /// <param name="texture">The texture to be removed</param>
public void RemoveTexture(ref CTexture texture) public void RemoveTexture(ref CTextureRef texture)
{ {
if (texture == null) if (texture == null)
return; return;
+23 -23
View File
@@ -44,7 +44,7 @@ namespace Vocaluxe.Lib.Draw
private bool _TopMost; private bool _TopMost;
private Rectangle _Bounds; private Rectangle _Bounds;
private readonly Dictionary<int, CTexture> _Textures = new Dictionary<int, CTexture>(); private readonly Dictionary<int, CTextureRef> _Textures = new Dictionary<int, CTextureRef>();
private readonly List<Bitmap> _Bitmaps = new List<Bitmap>(); private readonly List<Bitmap> _Bitmaps = new List<Bitmap>();
private readonly Color _ClearColor = Color.DarkBlue; private readonly Color _ClearColor = Color.DarkBlue;
@@ -279,11 +279,11 @@ namespace Vocaluxe.Lib.Draw
_G.Clear(_ClearColor); _G.Clear(_ClearColor);
} }
public CTexture CopyScreen() public CTextureRef CopyScreen()
{ {
var bmp = new Bitmap(_Backbuffer); var bmp = new Bitmap(_Backbuffer);
_Bitmaps.Add(bmp); _Bitmaps.Add(bmp);
CTexture texture = _GetNewTexture(bmp.Width, bmp.Height); CTextureRef texture = _GetNewTexture(bmp.Width, bmp.Height);
// Add to Texture List // Add to Texture List
_Textures[texture.ID] = texture; _Textures[texture.ID] = texture;
@@ -291,7 +291,7 @@ namespace Vocaluxe.Lib.Draw
return texture; return texture;
} }
public void CopyScreen(ref CTexture texture) public void CopyScreen(ref CTextureRef texture)
{ {
if (!_TextureExists(texture) || texture.W2 != GetScreenWidth() || texture.H2 != GetScreenHeight()) if (!_TextureExists(texture) || texture.W2 != GetScreenWidth() || texture.H2 != GetScreenHeight())
{ {
@@ -318,11 +318,11 @@ namespace Vocaluxe.Lib.Draw
public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) {} public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) {}
public CTexture AddTexture(Bitmap bmp) public CTextureRef AddTexture(Bitmap bmp)
{ {
var bmp2 = new Bitmap(bmp); var bmp2 = new Bitmap(bmp);
_Bitmaps.Add(bmp2); _Bitmaps.Add(bmp2);
CTexture texture = _GetNewTexture(bmp.Width, bmp.Height); CTextureRef texture = _GetNewTexture(bmp.Width, bmp.Height);
// Add to Texture List // Add to Texture List
_Textures[texture.ID] = texture; _Textures[texture.ID] = texture;
@@ -330,23 +330,23 @@ namespace Vocaluxe.Lib.Draw
return texture; return texture;
} }
private CTexture _GetNewTexture(int w, int h) private CTextureRef _GetNewTexture(int w, int h)
{ {
return new CTexture(_Bitmaps.Count - 1, new Size(w, h), new Size(w, h)); return new CTextureRef(_Bitmaps.Count - 1, new Size(w, h), new Size(w, h));
} }
public CTexture AddTexture(string texturePath) public CTextureRef AddTexture(string texturePath)
{ {
if (File.Exists(texturePath)) if (File.Exists(texturePath))
{ {
foreach (CTexture tex in _Textures.Values) foreach (CTextureRef tex in _Textures.Values)
{ {
if (tex.TexturePath == texturePath) if (tex.TexturePath == texturePath)
return tex; return tex;
} }
using (var bmp = new Bitmap(texturePath)) using (var bmp = new Bitmap(texturePath))
{ {
CTexture texture = AddTexture(bmp); CTextureRef texture = AddTexture(bmp);
texture.TexturePath = texturePath; texture.TexturePath = texturePath;
} }
} }
@@ -354,12 +354,12 @@ namespace Vocaluxe.Lib.Draw
return null; return null;
} }
private bool _TextureExists(CTexture texture) private bool _TextureExists(CTextureRef texture)
{ {
return texture != null && _Textures.ContainsKey(texture.ID); return texture != null && _Textures.ContainsKey(texture.ID);
} }
public void RemoveTexture(ref CTexture texture) public void RemoveTexture(ref CTextureRef texture)
{ {
if (_TextureExists(texture)) if (_TextureExists(texture))
{ {
@@ -369,12 +369,12 @@ namespace Vocaluxe.Lib.Draw
texture = null; texture = null;
} }
public CTexture EnqueueTexture(int w, int h, byte[] data) public CTextureRef EnqueueTexture(int w, int h, byte[] data)
{ {
return AddTexture(w, h, data); return AddTexture(w, h, data);
} }
public CTexture AddTexture(int w, int h, byte[] data) public CTextureRef AddTexture(int w, int h, byte[] data)
{ {
using (var bmp = new Bitmap(w, h)) using (var bmp = new Bitmap(w, h))
{ {
@@ -385,7 +385,7 @@ namespace Vocaluxe.Lib.Draw
} }
} }
public bool UpdateTexture(CTexture texture, int w, int h, byte[] data) public bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data)
{ {
if (_TextureExists(texture)) if (_TextureExists(texture))
{ {
@@ -398,7 +398,7 @@ namespace Vocaluxe.Lib.Draw
return false; return false;
} }
public bool UpdateOrAddTexture(ref CTexture texture, int w, int h, byte[] data) public bool UpdateOrAddTexture(ref CTextureRef texture, int w, int h, byte[] data)
{ {
if (!UpdateTexture(texture, w, h, data)) if (!UpdateTexture(texture, w, h, data))
{ {
@@ -408,25 +408,25 @@ namespace Vocaluxe.Lib.Draw
return true; return true;
} }
public void DrawTexture(CTexture texture) public void DrawTexture(CTextureRef texture)
{ {
if (texture != null) if (texture != null)
DrawTexture(texture, texture.Rect, texture.Color); DrawTexture(texture, texture.Rect, texture.Color);
} }
public void DrawTexture(CTexture texture, SRectF rect) public void DrawTexture(CTextureRef texture, SRectF rect)
{ {
if (texture != null) if (texture != null)
DrawTexture(texture, rect, texture.Color); DrawTexture(texture, rect, texture.Color);
} }
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false) public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, bool mirrored = false)
{ {
if (texture != null) if (texture != null)
DrawTexture(texture, rect, color, rect, mirrored); DrawTexture(texture, rect, color, rect, mirrored);
} }
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
{ {
if (!_TextureExists(texture)) if (!_TextureExists(texture))
return; return;
@@ -435,9 +435,9 @@ namespace Vocaluxe.Lib.Draw
coloredBitmap.Dispose(); coloredBitmap.Dispose();
} }
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end) {} public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, float begin, float end) {}
public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) {} public void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) {}
public int GetTextureCount() public int GetTextureCount()
{ {
+12 -12
View File
@@ -275,9 +275,9 @@ namespace Vocaluxe.Lib.Draw
GL.Ortho(-CConfig.BorderLeft, CConfig.BorderRight + CSettings.RenderW, CConfig.BorderBottom + CSettings.RenderH, -CConfig.BorderTop, CSettings.ZNear, CSettings.ZFar); GL.Ortho(-CConfig.BorderLeft, CConfig.BorderRight + CSettings.RenderW, CConfig.BorderBottom + CSettings.RenderH, -CConfig.BorderTop, CSettings.ZNear, CSettings.ZFar);
} }
public CTexture CopyScreen() public CTextureRef CopyScreen()
{ {
CTexture texture = _GetNewTextureRef(_W, _H); CTextureRef texture = _GetNewTextureRef(_W, _H);
CGLTexture t = new CGLTexture(GL.GenTexture()); CGLTexture t = new CGLTexture(GL.GenTexture());
GL.BindTexture(TextureTarget.Texture2D, t.Name); GL.BindTexture(TextureTarget.Texture2D, t.Name);
@@ -299,7 +299,7 @@ namespace Vocaluxe.Lib.Draw
return texture; return texture;
} }
public void CopyScreen(ref CTexture texture) public void CopyScreen(ref CTextureRef texture)
{ {
//Check for actual texture sizes as it may be downsized compared to OrigSize //Check for actual texture sizes as it may be downsized compared to OrigSize
if (!_TextureExists(texture) || texture.DataSize.Width != GetScreenWidth() || texture.DataSize.Height != GetScreenHeight()) if (!_TextureExists(texture) || texture.DataSize.Width != GetScreenWidth() || texture.DataSize.Height != GetScreenHeight())
@@ -419,7 +419,7 @@ namespace Vocaluxe.Lib.Draw
#region Textures #region Textures
#region adding #region adding
protected override CGLTexture _CreateTexture(CTexture texture, IntPtr data) protected override CGLTexture _CreateTexture(CTextureRef texture, IntPtr data)
{ {
CGLTexture t = new CGLTexture(GL.GenTexture()); CGLTexture t = new CGLTexture(GL.GenTexture());
@@ -439,7 +439,7 @@ namespace Vocaluxe.Lib.Draw
return t; return t;
} }
protected override CGLTexture _CreateTexture(CTexture texture, byte[] data) protected override CGLTexture _CreateTexture(CTextureRef texture, byte[] data)
{ {
CGLTexture t = new CGLTexture(GL.GenTexture()); CGLTexture t = new CGLTexture(GL.GenTexture());
@@ -476,7 +476,7 @@ namespace Vocaluxe.Lib.Draw
#endregion adding #endregion adding
#region updating #region updating
public override bool UpdateTexture(CTexture texture, int w, int h, byte[] data) public override bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data)
{ {
CGLTexture t = _GetTexture(texture); CGLTexture t = _GetTexture(texture);
if (t == null) if (t == null)
@@ -524,21 +524,21 @@ namespace Vocaluxe.Lib.Draw
#endregion updating #endregion updating
#region drawing #region drawing
public void DrawTexture(CTexture texture) public void DrawTexture(CTextureRef texture)
{ {
if (texture == null) if (texture == null)
return; return;
DrawTexture(texture, texture.Rect, texture.Color); DrawTexture(texture, texture.Rect, texture.Color);
} }
public void DrawTexture(CTexture texture, SRectF rect) public void DrawTexture(CTextureRef texture, SRectF rect)
{ {
if (texture == null) if (texture == null)
return; return;
DrawTexture(texture, rect, texture.Color); DrawTexture(texture, rect, texture.Color);
} }
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false) public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, bool mirrored = false)
{ {
CGLTexture t = _GetTexture(texture); CGLTexture t = _GetTexture(texture);
if (t == null) if (t == null)
@@ -601,7 +601,7 @@ namespace Vocaluxe.Lib.Draw
GL.BindTexture(TextureTarget.Texture2D, 0); GL.BindTexture(TextureTarget.Texture2D, 0);
} }
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false) public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false)
{ {
CGLTexture t = _GetTexture(texture); CGLTexture t = _GetTexture(texture);
if (t == null) if (t == null)
@@ -696,7 +696,7 @@ namespace Vocaluxe.Lib.Draw
GL.BindTexture(TextureTarget.Texture2D, 0); GL.BindTexture(TextureTarget.Texture2D, 0);
} }
public void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end) public void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, float begin, float end)
{ {
CGLTexture t = _GetTexture(texture); CGLTexture t = _GetTexture(texture);
if (t == null) if (t == null)
@@ -729,7 +729,7 @@ namespace Vocaluxe.Lib.Draw
GL.BindTexture(TextureTarget.Texture2D, 0); GL.BindTexture(TextureTarget.Texture2D, 0);
} }
public void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height) public void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
{ {
CGLTexture t = _GetTexture(texture); CGLTexture t = _GetTexture(texture);
if (t == null) if (t == null)
+15 -15
View File
@@ -33,29 +33,29 @@ namespace Vocaluxe.Lib.Draw
int GetTextureCount(); int GetTextureCount();
void ClearScreen(); void ClearScreen();
CTexture CopyScreen(); CTextureRef CopyScreen();
void CopyScreen(ref CTexture texture); void CopyScreen(ref CTextureRef texture);
void MakeScreenShot(); void MakeScreenShot();
CTexture AddTexture(string texturePath); CTextureRef AddTexture(string texturePath);
CTexture AddTexture(Bitmap bitmap); CTextureRef AddTexture(Bitmap bitmap);
CTexture AddTexture(int w, int h, byte[] data); CTextureRef AddTexture(int w, int h, byte[] data);
CTexture EnqueueTexture(int w, int h, byte[] data); CTextureRef EnqueueTexture(int w, int h, byte[] data);
bool UpdateTexture(CTexture texture, int w, int h, byte[] data); bool UpdateTexture(CTextureRef texture, int w, int h, byte[] data);
bool UpdateOrAddTexture(ref CTexture texture, int w, int h, byte[] data); bool UpdateOrAddTexture(ref CTextureRef texture, int w, int h, byte[] data);
void RemoveTexture(ref CTexture texture); void RemoveTexture(ref CTextureRef texture);
// Basic Draw Methods // Basic Draw Methods
void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2); void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2);
void DrawColor(SColorF color, SRectF rect); void DrawColor(SColorF color, SRectF rect);
void DrawColorReflection(SColorF color, SRectF rect, float space, float height); void DrawColorReflection(SColorF color, SRectF rect, float space, float height);
void DrawTexture(CTexture texture); void DrawTexture(CTextureRef texture);
void DrawTexture(CTexture texture, SRectF rect); void DrawTexture(CTextureRef texture, SRectF rect);
void DrawTexture(CTexture texture, SRectF rect, SColorF color, bool mirrored = false); void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, bool mirrored = false);
void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false); void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false);
void DrawTexture(CTexture texture, SRectF rect, SColorF color, float begin, float end); void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, float begin, float end);
void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float space, float height); void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float space, float height);
} }
} }
+1 -1
View File
@@ -102,7 +102,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
Finished = true; Finished = true;
} }
public bool GetFrame(ref CTexture frame, float time, out float videoTime) public bool GetFrame(ref CTextureRef frame, float time, out float videoTime)
{ {
if (Finished) if (Finished)
{ {
@@ -193,7 +193,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
/// <param name="time">Maximum start time for frame</param> /// <param name="time">Maximum start time for frame</param>
/// <param name="finished">Set to whether there are no more frames (stream finished, no loop, future calls will always return false)</param> /// <param name="finished">Set to whether there are no more frames (stream finished, no loop, future calls will always return false)</param>
/// <returns>True if a new frame was gotten</returns> /// <returns>True if a new frame was gotten</returns>
public bool GetFrame(ref CTexture frame, ref float time, out bool finished) public bool GetFrame(ref CTextureRef frame, ref float time, out bool finished)
{ {
bool result; bool result;
if (Math.Abs(_LastShownTime - time) < _FrameDuration && frame != null) //Check 1 frame difference if (Math.Abs(_LastShownTime - time) < _FrameDuration && frame != null) //Check 1 frame difference
+1 -1
View File
@@ -69,7 +69,7 @@ namespace Vocaluxe.Lib.Video
return _Decoder.Count; return _Decoder.Count;
} }
public bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime) public bool GetFrame(int streamID, ref CTextureRef frame, float time, out float videoTime)
{ {
CDecoder decoder; CDecoder decoder;
if (_Decoder.TryGetValue(streamID, out decoder)) if (_Decoder.TryGetValue(streamID, out decoder))
+1 -1
View File
@@ -73,7 +73,7 @@ namespace Vocaluxe.Lib.Video
/// </param> /// </param>
/// <param name="videoTime">The actual position in s of the returned frame. Should be ~ time+VideoGap</param> /// <param name="videoTime">The actual position in s of the returned frame. Should be ~ time+VideoGap</param>
/// <returns>True if frame is valid, false: frame and videoTime might be unchanged or invalid</returns> /// <returns>True if frame is valid, false: frame and videoTime might be unchanged or invalid</returns>
bool GetFrame(int streamID, ref CTexture frame, float time, out float videoTime); bool GetFrame(int streamID, ref CTextureRef frame, float time, out float videoTime);
/// <summary> /// <summary>
/// Seeks to given position /// Seeks to given position
+1 -1
View File
@@ -201,7 +201,7 @@ namespace Vocaluxe.Lib.Webcam
} }
} }
public bool GetFrame(ref CTexture frame) public bool GetFrame(ref CTextureRef frame)
{ {
lock (_MutexData) lock (_MutexData)
{ {
+1 -1
View File
@@ -58,7 +58,7 @@ namespace Vocaluxe.Lib.Webcam
/// </summary> /// </summary>
/// <param name="frame"></param> /// <param name="frame"></param>
/// <returns></returns> /// <returns></returns>
bool GetFrame(ref CTexture frame); bool GetFrame(ref CTextureRef frame);
/// <summary> /// <summary>
/// Gets the last captured frame as a bitma /// Gets the last captured frame as a bitma
+5 -5
View File
@@ -33,11 +33,11 @@ namespace Vocaluxe.Screens
get { return 1; } get { return 1; }
} }
private CTexture _QRServerAddress; private CTextureRef _QRServerAddress;
private CTexture _QRAndroidLink; private CTextureRef _QRAndroidLink;
private CTexture _QRSymbianLink; private CTextureRef _QRSymbianLink;
private CTexture _QRWebOSLink; private CTextureRef _QRWebOSLink;
private CTexture _QRWindowsPhoneLink; private CTextureRef _QRWindowsPhoneLink;
private const string _StaticQRServer = "StaticQRServer"; private const string _StaticQRServer = "StaticQRServer";
private const string _StaticQRAndroid = "StaticQRAndroid"; private const string _StaticQRAndroid = "StaticQRAndroid";
+15 -15
View File
@@ -126,21 +126,21 @@ namespace Vocaluxe.Screens
private List<string[]> _Paragraphs; private List<string[]> _Paragraphs;
private List<CText> _ParagraphTexts; private List<CText> _ParagraphTexts;
private CTexture _TexLogo; private CTextureRef _TexLogo;
private CTexture _TexPerfectNoteStar; private CTextureRef _TexPerfectNoteStar;
private CTexture _TexRedDot; private CTextureRef _TexRedDot;
private CTexture _TexBlueDot; private CTextureRef _TexBlueDot;
private CTexture _TexNameBrunzel; private CTextureRef _TexNameBrunzel;
private CTexture _TexNameDarkice; private CTextureRef _TexNameDarkice;
private CTexture _TexNameFlokuep; private CTextureRef _TexNameFlokuep;
private CTexture _TexNameFlamefire; private CTextureRef _TexNameFlamefire;
private CTexture _TexNameMesand; private CTextureRef _TexNameMesand;
private CTexture _TexNameBohning; private CTextureRef _TexNameBohning;
private CTexture _TexNameBabene03; private CTextureRef _TexNameBabene03;
private CTexture _TexNamePantero; private CTextureRef _TexNamePantero;
private CTexture _TexNamePinky007; private CTextureRef _TexNamePinky007;
public override void Init() public override void Init()
{ {
@@ -286,12 +286,12 @@ namespace Vocaluxe.Screens
return GetNewParticleEffect(numStars, partColor, rect, _TexPerfectNoteStar, partSize, EParticleType.Star); return GetNewParticleEffect(numStars, partColor, rect, _TexPerfectNoteStar, partSize, EParticleType.Star);
} }
private void _AddNewCreditName(CTexture texture, int particleOffsetX, int particleOffsetY, bool bigParticles) private void _AddNewCreditName(CTextureRef texture, int particleOffsetX, int particleOffsetY, bool bigParticles)
{ {
bool isRight = _CreditNames.Count % 2 == 0; bool isRight = _CreditNames.Count % 2 == 0;
int partRectSize = bigParticles ? 25 : 20; int partRectSize = bigParticles ? 25 : 20;
int partCount = bigParticles ? 8 : 6; int partCount = bigParticles ? 8 : 6;
CTexture texDot = isRight ? _TexRedDot : _TexBlueDot; CTextureRef texDot = isRight ? _TexRedDot : _TexBlueDot;
CStatic image = GetNewStatic(texture, new SColorF(1, 1, 1, 1), new SRectF(-1, -1, 400, 120, -4)); CStatic image = GetNewStatic(texture, new SColorF(1, 1, 1, 1), new SRectF(-1, -1, 400, 120, -4));
+1 -1
View File
@@ -55,7 +55,7 @@ namespace Vocaluxe.Screens
{"EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6"}; {"EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6"};
private readonly string[] _SelectSlideDuetPlayer = new string[] private readonly string[] _SelectSlideDuetPlayer = new string[]
{"SelectSlideDuetPlayer1", "SelectSlideDuetPlayer2", "SelectSlideDuetPlayer3", "SelectSlideDuetPlayer4", "SelectSlideDuetPlayer5", "SelectSlideDuetPlayer6"}; {"SelectSlideDuetPlayer1", "SelectSlideDuetPlayer2", "SelectSlideDuetPlayer3", "SelectSlideDuetPlayer4", "SelectSlideDuetPlayer5", "SelectSlideDuetPlayer6"};
private readonly CTexture[] _OriginalPlayerAvatarTextures = new CTexture[CSettings.MaxNumPlayer]; private readonly CTextureRef[] _OriginalPlayerAvatarTextures = new CTextureRef[CSettings.MaxNumPlayer];
private bool _SelectingKeyboardActive; private bool _SelectingKeyboardActive;
private bool _SelectingFast; private bool _SelectingFast;
+1 -1
View File
@@ -49,7 +49,7 @@ namespace Vocaluxe.Screens
private const string _TextWebcamResolution = "TextWebcamResolution"; private const string _TextWebcamResolution = "TextWebcamResolution";
private SWebcamConfig _Config; private SWebcamConfig _Config;
private CTexture _WebcamTexture; private CTextureRef _WebcamTexture;
private int _DeviceNr; private int _DeviceNr;
private int _CapabilityNr; private int _CapabilityNr;
+1 -1
View File
@@ -64,7 +64,7 @@ namespace Vocaluxe.Screens
private EEditMode _EditMode; private EEditMode _EditMode;
private CTexture _WebcamTexture; private CTextureRef _WebcamTexture;
private Bitmap _Snapshot; private Bitmap _Snapshot;
public override void Init() public override void Init()
+4 -4
View File
@@ -99,9 +99,9 @@ namespace Vocaluxe.Screens
private const float _Volume = 100f; private const float _Volume = 100f;
private int _CurrentVideo = -1; private int _CurrentVideo = -1;
private EAspect _VideoAspect = EAspect.Crop; private EAspect _VideoAspect = EAspect.Crop;
private CTexture _CurrentVideoTexture; private CTextureRef _CurrentVideoTexture;
private CTexture _CurrentWebcamFrameTexture; private CTextureRef _CurrentWebcamFrameTexture;
private CTexture _Background; private CTextureRef _Background;
private float _CurrentTime; private float _CurrentTime;
private float _FinishTime; private float _FinishTime;
@@ -450,7 +450,7 @@ namespace Vocaluxe.Screens
{ {
if (_Active) if (_Active)
{ {
CTexture background; CTextureRef background;
var aspect = EAspect.Crop; var aspect = EAspect.Crop;
if (_CurrentVideo != -1 && CConfig.VideosInSongs == EOffOn.TR_CONFIG_ON && !_Webcam) if (_CurrentVideo != -1 && CConfig.VideosInSongs == EOffOn.TR_CONFIG_ON && !_Webcam)
{ {
@@ -22,7 +22,7 @@ namespace VocaluxeLib.Draw
/// <summary> /// <summary>
/// Reference to a texture in the drawing driver /// Reference to a texture in the drawing driver
/// </summary> /// </summary>
public class CTexture public class CTextureRef
{ {
public readonly int ID; public readonly int ID;
@@ -102,7 +102,7 @@ namespace VocaluxeLib.Draw
/// <param name="dataSize">Size of the data used</param> /// <param name="dataSize">Size of the data used</param>
/// <param name="texWidth">Width in video memory</param> /// <param name="texWidth">Width in video memory</param>
/// <param name="texHeight">Height in video memory</param> /// <param name="texHeight">Height in video memory</param>
public CTexture(int id, Size origSize, Size dataSize, int texWidth = 0, int texHeight = 0) public CTextureRef(int id, Size origSize, Size dataSize, int texWidth = 0, int texHeight = 0)
{ {
ID = id; ID = id;
_DataSize = dataSize; _DataSize = dataSize;
+15 -15
View File
@@ -99,8 +99,8 @@ namespace VocaluxeLib
{ {
string GetThemeScreensPath(int partyModeID); string GetThemeScreensPath(int partyModeID);
int GetSkinIndex(int partyModeID); int GetSkinIndex(int partyModeID);
CTexture GetSkinTexture(string textureName, int partyModeID); CTextureRef GetSkinTexture(string textureName, int partyModeID);
CTexture GetSkinVideoTexture(string videoName, int partyModeID); CTextureRef GetSkinVideoTexture(string videoName, int partyModeID);
void SkinVideoResume(string videoName, int partyModeID); void SkinVideoResume(string videoName, int partyModeID);
void SkinVideoPause(string videoName, int partyModeID); void SkinVideoPause(string videoName, int partyModeID);
@@ -131,7 +131,7 @@ namespace VocaluxeLib
void Play(); void Play();
void Stop(); void Stop();
CTexture GetVideoTexture(); CTextureRef GetVideoTexture();
void LoadPreview(CSong song, float start = 0f); void LoadPreview(CSong song, float start = 0f);
void PlayPreview(float start = -1f); void PlayPreview(float start = -1f);
@@ -140,13 +140,13 @@ namespace VocaluxeLib
public interface IDrawing public interface IDrawing
{ {
void DrawTexture(CTexture texture, SRectF rect); void DrawTexture(CTextureRef texture, SRectF rect);
void DrawTexture(CTexture texture, SRectF rect, SColorF color); void DrawTexture(CTextureRef texture, SRectF rect, SColorF color);
void DrawTexture(CTexture texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false); void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false);
void DrawTextureReflection(CTexture texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight); void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight);
CTexture AddTexture(string fileName); CTextureRef AddTexture(string fileName);
void RemoveTexture(ref CTexture texture); void RemoveTexture(ref CTextureRef texture);
void DrawColor(SColorF color, SRectF rect); void DrawColor(SColorF color, SRectF rect);
void DrawColorReflection(SColorF color, SRectF rect, float space, float height); void DrawColorReflection(SColorF color, SRectF rect, float space, float height);
@@ -223,7 +223,7 @@ namespace VocaluxeLib
CProfile[] GetProfiles(); CProfile[] GetProfiles();
EGameDifficulty GetDifficulty(int profileID); EGameDifficulty GetDifficulty(int profileID);
string GetPlayerName(int profileID, int playerNum = 0); string GetPlayerName(int profileID, int playerNum = 0);
CTexture GetAvatar(int profileID); CTextureRef GetAvatar(int profileID);
CAvatar GetAvatarByFilename(string fileName); CAvatar GetAvatarByFilename(string fileName);
bool IsProfileIDValid(int profileID); bool IsProfileIDValid(int profileID);
bool IsGuest(int profileID); bool IsGuest(int profileID);
@@ -264,7 +264,7 @@ namespace VocaluxeLib
{ {
int Load(string videoFileName); int Load(string videoFileName);
bool Skip(int streamID, float startPosition, float videoGap); bool Skip(int streamID, float startPosition, float videoGap);
bool GetFrame(int streamID, ref CTexture videoTexture, float time, out float videoTime); bool GetFrame(int streamID, ref CTextureRef videoTexture, float time, out float videoTime);
bool IsFinished(int streamID); bool IsFinished(int streamID);
bool Close(int streamID); bool Close(int streamID);
void SetLoop(int streamID, bool loop = true); void SetLoop(int streamID, bool loop = true);
@@ -289,12 +289,12 @@ namespace VocaluxeLib
public interface ICover public interface ICover
{ {
CTexture GetNoCover(); CTextureRef GetNoCover();
} }
public interface IDataBase public interface IDataBase
{ {
bool GetCover(string fileName, ref CTexture texture, int coverSize); bool GetCover(string fileName, ref CTextureRef texture, int coverSize);
bool GetDataBaseSongInfos(string artist, string title, out int numPlayed, out DateTime dateAdded, out int highscoreID); bool GetDataBaseSongInfos(string artist, string title, out int numPlayed, out DateTime dateAdded, out int highscoreID);
} }
@@ -333,8 +333,8 @@ namespace VocaluxeLib
void Load(CSong song, float start = 0f); void Load(CSong song, float start = 0f);
void Stop(); void Stop();
void TogglePause(); void TogglePause();
CTexture GetCover(); CTextureRef GetCover();
CTexture GetVideoTexture(); CTextureRef GetVideoTexture();
bool IsPlaying(); bool IsPlaying();
float GetLength(); float GetLength();
} }
+8 -8
View File
@@ -55,7 +55,7 @@ namespace VocaluxeLib.Menu
private int _SlideShowCurrent; private int _SlideShowCurrent;
private readonly Stopwatch _SlideShowTimer = new Stopwatch(); private readonly Stopwatch _SlideShowTimer = new Stopwatch();
private readonly List<CTexture> _SlideShowTextures = new List<CTexture>(); private readonly List<CTextureRef> _SlideShowTextures = new List<CTextureRef>();
public SColorF Color; public SColorF Color;
@@ -223,7 +223,7 @@ namespace VocaluxeLib.Menu
_Theme.Type = EBackgroundTypes.SlideShow; _Theme.Type = EBackgroundTypes.SlideShow;
if (!String.IsNullOrEmpty(image)) if (!String.IsNullOrEmpty(image))
{ {
CTexture texture = CBase.Drawing.AddTexture(image); CTextureRef texture = CBase.Drawing.AddTexture(image);
if (texture != null) if (texture != null)
_SlideShowTextures.Add(texture); _SlideShowTextures.Add(texture);
} }
@@ -231,9 +231,9 @@ namespace VocaluxeLib.Menu
public void RemoveSlideShowTextures() public void RemoveSlideShowTextures()
{ {
foreach (CTexture tex in _SlideShowTextures) foreach (CTextureRef tex in _SlideShowTextures)
{ {
CTexture texture = tex; CTextureRef texture = tex;
CBase.Drawing.RemoveTexture(ref texture); CBase.Drawing.RemoveTexture(ref texture);
} }
_SlideShowTextures.Clear(); _SlideShowTextures.Clear();
@@ -256,7 +256,7 @@ namespace VocaluxeLib.Menu
private bool _DrawTexture() private bool _DrawTexture()
{ {
CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); CTextureRef texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
if (texture != null) if (texture != null)
{ {
var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH()); var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
@@ -288,7 +288,7 @@ namespace VocaluxeLib.Menu
_SlideShowCurrent = 0; _SlideShowCurrent = 0;
} }
CTexture texture = _SlideShowTextures[_SlideShowCurrent]; CTextureRef texture = _SlideShowTextures[_SlideShowCurrent];
if (texture == null) if (texture == null)
return false; return false;
@@ -323,7 +323,7 @@ namespace VocaluxeLib.Menu
private bool _DrawVideo() private bool _DrawVideo()
{ {
CTexture videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID); CTextureRef videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
if (videoTexture != null) if (videoTexture != null)
{ {
var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH()); var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
@@ -338,7 +338,7 @@ namespace VocaluxeLib.Menu
private bool _DrawBackgroundMusicVideo() private bool _DrawBackgroundMusicVideo()
{ {
CTexture videoTexture = CBase.BackgroundMusic.GetVideoTexture(); CTextureRef videoTexture = CBase.BackgroundMusic.GetVideoTexture();
if (videoTexture != null) if (videoTexture != null)
{ {
var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH()); var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
+3 -3
View File
@@ -38,8 +38,8 @@ namespace VocaluxeLib.Menu
private bool _ThemeLoaded; private bool _ThemeLoaded;
private readonly int _PartyModeID; private readonly int _PartyModeID;
public CTexture Texture; public CTextureRef Texture;
public CTexture SelTexture; public CTextureRef SelTexture;
public SRectF Rect; public SRectF Rect;
public SColorF Color; public SColorF Color;
public SColorF SelColor; public SColorF SelColor;
@@ -290,7 +290,7 @@ namespace VocaluxeLib.Menu
if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme && !forceDraw) if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme && !forceDraw)
return; return;
CTexture texture; CTextureRef texture;
if (!Selected && !Pressed || !_Enabled) if (!Selected && !Pressed || !_Enabled)
{ {
+2 -2
View File
@@ -476,7 +476,7 @@ namespace VocaluxeLib.Menu
return new CStatic(oldStatic); return new CStatic(oldStatic);
} }
public CStatic GetNewStatic(CTexture texture, SColorF color, SRectF rect) public CStatic GetNewStatic(CTextureRef texture, SColorF color, SRectF rect)
{ {
return new CStatic(_PartyModeID, texture, color, rect); return new CStatic(_PartyModeID, texture, color, rect);
} }
@@ -521,7 +521,7 @@ namespace VocaluxeLib.Menu
return new CPlaylist(_PartyModeID); return new CPlaylist(_PartyModeID);
} }
public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, CTexture texture, float size, EParticleType type) public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, CTextureRef texture, float size, EParticleType type)
{ {
return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type); return new CParticleEffect(_PartyModeID, maxNumber, color, area, texture, size, type);
} }
+1 -1
View File
@@ -683,7 +683,7 @@ namespace VocaluxeLib.Menu
for (int i = 0; i < _TeamList[_CurrentTeam].Count; i++) for (int i = 0; i < _TeamList[_CurrentTeam].Count; i++)
{ {
string name = CBase.Profiles.GetPlayerName(_TeamList[_CurrentTeam][i]); string name = CBase.Profiles.GetPlayerName(_TeamList[_CurrentTeam][i]);
CTexture avatar = CBase.Profiles.GetAvatar(_TeamList[_CurrentTeam][i]); CTextureRef avatar = CBase.Profiles.GetAvatar(_TeamList[_CurrentTeam][i]);
_SelectSlides[_SelectSlidePlayer].AddValue(name, avatar); _SelectSlides[_SelectSlidePlayer].AddValue(name, avatar);
} }
for (int i = _TeamList[_CurrentTeam].Count; i < _NumPlayerTeams[_CurrentTeam]; i++) for (int i = _TeamList[_CurrentTeam].Count; i < _NumPlayerTeams[_CurrentTeam]; i++)
+3 -3
View File
@@ -69,9 +69,9 @@ namespace VocaluxeLib.Menu
public SRectF Rect; public SRectF Rect;
private readonly List<CTile> _Tiles; private readonly List<CTile> _Tiles;
private CTexture _TextureEmptyTile; private CTextureRef _TextureEmptyTile;
private CTexture _TextureTileSelected; private CTextureRef _TextureTileSelected;
public CTexture TextureEmptyTile public CTextureRef TextureEmptyTile
{ {
get { return _TextureEmptyTile; } get { return _TextureEmptyTile; }
} }
+4 -4
View File
@@ -44,7 +44,7 @@ namespace VocaluxeLib.Menu
#region private vars #region private vars
private readonly int _PartyModeID; private readonly int _PartyModeID;
private readonly string _TextureName; private readonly string _TextureName;
private readonly CTexture _Texture; private readonly CTextureRef _Texture;
private SRectF _Rect; private SRectF _Rect;
private float _Size; private float _Size;
private SColorF _Color; private SColorF _Color;
@@ -127,7 +127,7 @@ namespace VocaluxeLib.Menu
_Rotation = (float)(CBase.Game.GetRandomDouble() * 360.0); _Rotation = (float)(CBase.Game.GetRandomDouble() * 360.0);
} }
public CParticle(int partyModeID, CTexture texture, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize, public CParticle(int partyModeID, CTextureRef texture, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize,
EParticleType type) EParticleType type)
{ {
_PartyModeID = partyModeID; _PartyModeID = partyModeID;
@@ -300,7 +300,7 @@ namespace VocaluxeLib.Menu
private SThemeParticleEffect _Theme; private SThemeParticleEffect _Theme;
private bool _ThemeLoaded; private bool _ThemeLoaded;
public CTexture Texture; public CTextureRef Texture;
public SColorF Color; public SColorF Color;
public SRectF Rect; public SRectF Rect;
@@ -352,7 +352,7 @@ namespace VocaluxeLib.Menu
Visible = true; Visible = true;
} }
public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, CTexture texture, float size, EParticleType type) public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, CTextureRef texture, float size, EParticleType type)
{ {
_PartyModeID = partyModeID; _PartyModeID = partyModeID;
_Theme = new SThemeParticleEffect(); _Theme = new SThemeParticleEffect();
+1 -1
View File
@@ -126,7 +126,7 @@ namespace VocaluxeLib.Menu
} }
} }
private CTexture _GetTextureValue(string value) private CTextureRef _GetTextureValue(string value)
{ {
return CBase.Theme.GetSkinTexture(value, _PartyModeID); return CBase.Theme.GetSkinTexture(value, _PartyModeID);
} }
+15 -15
View File
@@ -111,7 +111,7 @@ namespace VocaluxeLib.Menu
private readonly List<string> _ValueNames; private readonly List<string> _ValueNames;
private readonly List<int> _ValuePartyModeIDs; private readonly List<int> _ValuePartyModeIDs;
private readonly List<CTexture> _Textures; private readonly List<CTextureRef> _Textures;
private readonly List<int> _ValueIndexes; private readonly List<int> _ValueIndexes;
private readonly List<SRectF> _ValueBounds = new List<SRectF>(); private readonly List<SRectF> _ValueBounds = new List<SRectF>();
@@ -179,7 +179,7 @@ namespace VocaluxeLib.Menu
MaxW = 0f; MaxW = 0f;
_Selected = false; _Selected = false;
_Textures = new List<CTexture>(); _Textures = new List<CTextureRef>();
_ValueIndexes = new List<int>(); _ValueIndexes = new List<int>();
_ValueNames = new List<string>(); _ValueNames = new List<string>();
_ValuePartyModeIDs = new List<int>(); _ValuePartyModeIDs = new List<int>();
@@ -227,7 +227,7 @@ namespace VocaluxeLib.Menu
MaxW = slide.MaxW; MaxW = slide.MaxW;
_Selected = slide._Selected; _Selected = slide._Selected;
_Textures = new List<CTexture>(slide._Textures); _Textures = new List<CTextureRef>(slide._Textures);
_ValueIndexes = new List<int>(slide._ValueIndexes); _ValueIndexes = new List<int>(slide._ValueIndexes);
_ValueNames = new List<string>(slide._ValueNames); _ValueNames = new List<string>(slide._ValueNames);
_ValueBounds = new List<SRectF>(slide._ValueBounds); _ValueBounds = new List<SRectF>(slide._ValueBounds);
@@ -534,17 +534,17 @@ namespace VocaluxeLib.Menu
AddValue(value, null, _ValueIndexes.Count, partyModeID); AddValue(value, null, _ValueIndexes.Count, partyModeID);
} }
public void AddValue(string value, CTexture texture) public void AddValue(string value, CTextureRef texture)
{ {
AddValue(value, texture, _ValueIndexes.Count, _PartyModeID); AddValue(value, texture, _ValueIndexes.Count, _PartyModeID);
} }
private void _AddValue(string value, CTexture texture, int valueIndex) private void _AddValue(string value, CTextureRef texture, int valueIndex)
{ {
AddValue(value, texture, valueIndex, _PartyModeID); AddValue(value, texture, valueIndex, _PartyModeID);
} }
public void AddValue(string value, CTexture texture, int valueIndex, int partyModeID) public void AddValue(string value, CTextureRef texture, int valueIndex, int partyModeID)
{ {
_ValueNames.Add(value); _ValueNames.Add(value);
_Textures.Add(texture); _Textures.Add(texture);
@@ -565,7 +565,7 @@ namespace VocaluxeLib.Menu
_ValueBounds.Clear(); _ValueBounds.Clear();
} }
public void AddValues(string[] values, CTexture[] textures) public void AddValues(string[] values, CTextureRef[] textures)
{ {
if (values.Length != textures.Length) if (values.Length != textures.Length)
return; return;
@@ -589,7 +589,7 @@ namespace VocaluxeLib.Menu
RenameValue(Selection, newName); RenameValue(Selection, newName);
} }
public void RenameValue(int selection, string newName, CTexture newTexture = null) public void RenameValue(int selection, string newName, CTextureRef newTexture = null)
{ {
if (selection < 0 && selection >= _ValueNames.Count) if (selection < 0 && selection >= _ValueNames.Count)
return; return;
@@ -713,15 +713,15 @@ namespace VocaluxeLib.Menu
if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme) if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme)
return; return;
CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); CTextureRef texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
CTexture textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID); CTextureRef textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID);
CTexture textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID); CTextureRef textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID);
CTexture selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID); CTextureRef selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID);
CTexture selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _PartyModeID); CTextureRef selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _PartyModeID);
CTexture selTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID); CTextureRef selTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID);
CTexture highlightTexture = CBase.Theme.GetSkinTexture(_Theme.HighlightTextureName, _PartyModeID); CTextureRef highlightTexture = CBase.Theme.GetSkinTexture(_Theme.HighlightTextureName, _PartyModeID);
if (Selected) if (Selected)
{ {
+4 -4
View File
@@ -40,8 +40,8 @@ namespace VocaluxeLib.Menu
return _Theme.Name; return _Theme.Name;
} }
private CTexture _Texture; private CTextureRef _Texture;
public CTexture Texture public CTextureRef Texture
{ {
get { return _Texture ?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); } get { return _Texture ?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); }
@@ -83,7 +83,7 @@ namespace VocaluxeLib.Menu
Visible = s.Visible; Visible = s.Visible;
} }
public CStatic(int partyModeID, CTexture texture, SColorF color, SRectF rect) public CStatic(int partyModeID, CTextureRef texture, SColorF color, SRectF rect)
{ {
_PartyModeID = partyModeID; _PartyModeID = partyModeID;
@@ -192,7 +192,7 @@ namespace VocaluxeLib.Menu
public void Draw(EAspect aspect, float scale = 1f, float zModify = 0f, bool forceDraw = false) public void Draw(EAspect aspect, float scale = 1f, float zModify = 0f, bool forceDraw = false)
{ {
CTexture texture = Texture; CTextureRef texture = Texture;
SRectF bounds = Rect.Scale(scale); SRectF bounds = Rect.Scale(scale);
SRectF rect; SRectF rect;
if (aspect != EAspect.Stretch && texture != null) if (aspect != EAspect.Stretch && texture != null)
+8 -8
View File
@@ -472,9 +472,9 @@ namespace VocaluxeLib.Menu.SingNotes
var noteRect = new SRectF(rect.X + dw, rect.Y + dh, rect.W - 2 * dw, rect.H - 2 * dh, rect.Z); var noteRect = new SRectF(rect.X + dw, rect.Y + dh, rect.W - 2 * dw, rect.H - 2 * dh, rect.Z);
CTexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID); CTextureRef noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
CTexture noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID); CTextureRef noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID);
CTexture noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID); CTextureRef noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID);
//Width of each of the ends (round parts) //Width of each of the ends (round parts)
//Need 2 of them so use minimum //Need 2 of them so use minimum
@@ -519,9 +519,9 @@ namespace VocaluxeLib.Menu.SingNotes
rect.Z rect.Z
); );
CTexture noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID); CTextureRef noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID);
CTexture noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID); CTextureRef noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID);
CTexture noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID); CTextureRef noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID);
float dx = r.H * noteBackgroundBegin.OrigAspect; float dx = r.H * noteBackgroundBegin.OrigAspect;
if (2 * dx > r.W) if (2 * dx > r.W)
@@ -614,7 +614,7 @@ namespace VocaluxeLib.Menu.SingNotes
rect.Z rect.Z
); );
CTexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID); CTextureRef noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
float dx = r.H * noteBegin.OrigAspect; float dx = r.H * noteBegin.OrigAspect;
if (2 * dx > r.W) if (2 * dx > r.W)
dx = r.W / 2; dx = r.W / 2;
@@ -671,7 +671,7 @@ namespace VocaluxeLib.Menu.SingNotes
_PlayerNotes[n].Color.B, _PlayerNotes[n].Color.B,
_PlayerNotes[n].Color.A * _PlayerNotes[n].Alpha); _PlayerNotes[n].Color.A * _PlayerNotes[n].Alpha);
CTexture toneHelper = CBase.Theme.GetSkinTexture(_Theme.SkinToneHelperName, _PartyModeID); CTextureRef toneHelper = CBase.Theme.GetSkinTexture(_Theme.SkinToneHelperName, _PartyModeID);
CBase.Drawing.DrawTexture(toneHelper, drawRect, color); CBase.Drawing.DrawTexture(toneHelper, drawRect, color);
@@ -37,8 +37,8 @@ namespace VocaluxeLib.Menu.SongMenu
private CStatic _MedleyCalcIcon; private CStatic _MedleyCalcIcon;
private CStatic _MedleyTagIcon; private CStatic _MedleyTagIcon;
private CTexture _CoverBigBGTexture; private CTextureRef _CoverBigBGTexture;
private CTexture _CoverBGTexture; private CTextureRef _CoverBGTexture;
private CText _Artist; private CText _Artist;
private CText _Title; private CText _Title;
@@ -467,7 +467,7 @@ namespace VocaluxeLib.Menu.SongMenu
_TextBG.Draw(); _TextBG.Draw();
CTexture vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null; CTextureRef vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null;
if (vidtex != null) if (vidtex != null)
{ {
+4 -4
View File
@@ -25,10 +25,10 @@ namespace VocaluxeLib.Profile
{ {
public int ID; public int ID;
private readonly string _FileName = ""; private readonly string _FileName = "";
private CTexture _Texture; private CTextureRef _Texture;
private const int _MaxNameLen = 12; private const int _MaxNameLen = 12;
public CTexture Texture public CTextureRef Texture
{ {
get { return _Texture; } get { return _Texture; }
} }
@@ -39,11 +39,11 @@ namespace VocaluxeLib.Profile
public static CAvatar GetAvatar(string fileName) public static CAvatar GetAvatar(string fileName)
{ {
CTexture texture = CBase.Drawing.AddTexture(fileName); CTextureRef texture = CBase.Drawing.AddTexture(fileName);
return texture == null ? null : new CAvatar(texture, fileName); return texture == null ? null : new CAvatar(texture, fileName);
} }
private CAvatar(CTexture texture, string fileName, int id = -1) private CAvatar(CTextureRef texture, string fileName, int id = -1)
{ {
_Texture = texture; _Texture = texture;
_FileName = fileName; _FileName = fileName;
+4 -4
View File
@@ -24,8 +24,8 @@ namespace VocaluxeLib.Songs
public class CCategory public class CCategory
{ {
public readonly string Name; public readonly string Name;
private CTexture _CoverTextureSmall; private CTextureRef _CoverTextureSmall;
private CTexture _CoverTextureBig; private CTextureRef _CoverTextureBig;
public readonly List<CSongPointer> Songs = new List<CSongPointer>(); public readonly List<CSongPointer> Songs = new List<CSongPointer>();
public CCategory(string name) public CCategory(string name)
@@ -33,14 +33,14 @@ namespace VocaluxeLib.Songs
Name = name; Name = name;
} }
public CTexture CoverTextureSmall public CTextureRef CoverTextureSmall
{ {
get { return _CoverTextureSmall; } get { return _CoverTextureSmall; }
set { _CoverTextureSmall = value; } set { _CoverTextureSmall = value; }
} }
public CTexture CoverTextureBig public CTextureRef CoverTextureBig
{ {
get { return _CoverTextureBig ?? _CoverTextureSmall; } get { return _CoverTextureBig ?? _CoverTextureSmall; }
set set
+4 -4
View File
@@ -78,8 +78,8 @@ namespace VocaluxeLib.Songs
public partial class CSong public partial class CSong
{ {
private CTexture _CoverTextureSmall; private CTextureRef _CoverTextureSmall;
private CTexture _CoverTextureBig; private CTextureRef _CoverTextureBig;
public SMedley Medley; public SMedley Medley;
@@ -104,7 +104,7 @@ namespace VocaluxeLib.Songs
public bool NotesLoaded { get; private set; } public bool NotesLoaded { get; private set; }
public CTexture CoverTextureSmall public CTextureRef CoverTextureSmall
{ {
get get
{ {
@@ -116,7 +116,7 @@ namespace VocaluxeLib.Songs
set { _CoverTextureSmall = value; } set { _CoverTextureSmall = value; }
} }
public CTexture CoverTextureBig public CTextureRef CoverTextureBig
{ {
get { return _CoverTextureBig ?? _CoverTextureSmall; } get { return _CoverTextureBig ?? _CoverTextureSmall; }
set { _CoverTextureBig = value; } set { _CoverTextureBig = value; }
+10 -15
View File
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.IO; using System.IO;
using VocaluxeLib.Draw; using VocaluxeLib.Draw;
using VocaluxeLib.Songs; using VocaluxeLib.Songs;
@@ -14,7 +13,7 @@ namespace VocaluxeLib.Utils.Player
private CSong _Song; private CSong _Song;
private bool _VideoEnabled; private bool _VideoEnabled;
private int _Video = -1; private int _Video = -1;
private CTexture _CurrentVideoTexture; private CTextureRef _CurrentVideoTexture;
private CFading _VideoFading; private CFading _VideoFading;
public bool VideoEnabled public bool VideoEnabled
@@ -41,7 +40,7 @@ namespace VocaluxeLib.Utils.Player
} }
public bool SongHasVideo public bool SongHasVideo
{ {
get { return _Song != null && File.Exists(Path.Combine(_Song.Folder,_Song.VideoFileName)); } get { return _Song != null && File.Exists(Path.Combine(_Song.Folder, _Song.VideoFileName)); }
} }
public string ArtistAndTitle public string ArtistAndTitle
@@ -56,7 +55,7 @@ namespace VocaluxeLib.Utils.Player
} }
} }
public CTexture Cover public CTextureRef Cover
{ {
get { return _Song == null ? CBase.Cover.GetNoCover() : _Song.CoverTextureBig; } get { return _Song == null ? CBase.Cover.GetNoCover() : _Song.CoverTextureBig; }
} }
@@ -66,11 +65,10 @@ namespace VocaluxeLib.Utils.Player
get { return _StreamID != -1; } get { return _StreamID != -1; }
} }
public CSongPlayer(bool loop = false) : base(loop) {}
public CSongPlayer(bool loop = false) : base(loop) { }
public CSongPlayer(CSong song, bool loop = false, float position = 0f, bool autoplay = false) public CSongPlayer(CSong song, bool loop = false, float position = 0f, bool autoplay = false)
: base(Path.Combine(song.Folder,song.MP3FileName), loop, position, autoplay) : base(Path.Combine(song.Folder, song.MP3FileName), loop, position, autoplay)
{ {
_Song = song; _Song = song;
_LoadVideo(); _LoadVideo();
@@ -82,7 +80,7 @@ namespace VocaluxeLib.Utils.Player
_Song = null; _Song = null;
} }
public CTexture GetVideoTexture() public CTextureRef GetVideoTexture()
{ {
if (_Video == -1 || _Song == null) if (_Video == -1 || _Song == null)
return null; return null;
@@ -101,7 +99,7 @@ namespace VocaluxeLib.Utils.Player
return null; return null;
} }
public void Load(CSong song, float position = 0f, bool autoplay = false) public void Load(CSong song, float position = 0f, bool autoplay = false)
{ {
if (song == null) if (song == null)
return; return;
@@ -109,7 +107,7 @@ namespace VocaluxeLib.Utils.Player
Stop(); Stop();
_Song = song; _Song = song;
base.Load(Path.Combine(song.Folder, song.MP3FileName), position, false); base.Load(Path.Combine(song.Folder, song.MP3FileName), position, false);
_LoadVideo(); _LoadVideo();
@@ -155,13 +153,10 @@ namespace VocaluxeLib.Utils.Player
CBase.Video.Pause(_Video); CBase.Video.Pause(_Video);
CBase.Video.Skip(_Video, CBase.Sound.GetPosition(_StreamID) + _FadeTime, _Song.VideoGap); CBase.Video.Skip(_Video, CBase.Sound.GetPosition(_StreamID) + _FadeTime, _Song.VideoGap);
} }
else if(_Video != -1) else if (_Video != -1)
{
CBase.Video.Resume(_Video); CBase.Video.Resume(_Video);
}
base.TogglePause(); base.TogglePause();
} }
private void _LoadVideo() private void _LoadVideo()
{ {
@@ -182,4 +177,4 @@ namespace VocaluxeLib.Utils.Player
} }
} }
} }
} }
+1 -1
View File
@@ -100,7 +100,7 @@
<Compile Include="Menu\CStatic.cs" /> <Compile Include="Menu\CStatic.cs" />
<Compile Include="Menu\CText.cs" /> <Compile Include="Menu\CText.cs" />
<Compile Include="Menu\CScreenSetting.cs" /> <Compile Include="Menu\CScreenSetting.cs" />
<Compile Include="Draw\CTexture.cs" /> <Compile Include="Draw\CTextureRef.cs" />
<Compile Include="CXMLReader.cs" /> <Compile Include="CXMLReader.cs" />
<Compile Include="Enums.cs" /> <Compile Include="Enums.cs" />
<Compile Include="Menu\IMenu.cs" /> <Compile Include="Menu\IMenu.cs" />