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

@@ -22,7 +22,7 @@ namespace VocaluxeLib.Draw
/// <summary>
/// Reference to a texture in the drawing driver
/// </summary>
public class CTexture
public class CTextureRef
{
public readonly int ID;
@@ -102,7 +102,7 @@ namespace VocaluxeLib.Draw
/// <param name="dataSize">Size of the data used</param>
/// <param name="texWidth">Width 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;
_DataSize = dataSize;
+15 -15
View File
@@ -99,8 +99,8 @@ namespace VocaluxeLib
{
string GetThemeScreensPath(int partyModeID);
int GetSkinIndex(int partyModeID);
CTexture GetSkinTexture(string textureName, int partyModeID);
CTexture GetSkinVideoTexture(string videoName, int partyModeID);
CTextureRef GetSkinTexture(string textureName, int partyModeID);
CTextureRef GetSkinVideoTexture(string videoName, int partyModeID);
void SkinVideoResume(string videoName, int partyModeID);
void SkinVideoPause(string videoName, int partyModeID);
@@ -131,7 +131,7 @@ namespace VocaluxeLib
void Play();
void Stop();
CTexture GetVideoTexture();
CTextureRef GetVideoTexture();
void LoadPreview(CSong song, float start = 0f);
void PlayPreview(float start = -1f);
@@ -140,13 +140,13 @@ namespace VocaluxeLib
public interface IDrawing
{
void DrawTexture(CTexture texture, SRectF rect);
void DrawTexture(CTexture texture, SRectF rect, SColorF color);
void DrawTexture(CTexture 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 DrawTexture(CTextureRef texture, SRectF rect);
void DrawTexture(CTextureRef texture, SRectF rect, SColorF color);
void DrawTexture(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, bool mirrored = false);
void DrawTextureReflection(CTextureRef texture, SRectF rect, SColorF color, SRectF bounds, float reflectionSpace, float reflectionHeight);
CTexture AddTexture(string fileName);
void RemoveTexture(ref CTexture texture);
CTextureRef AddTexture(string fileName);
void RemoveTexture(ref CTextureRef texture);
void DrawColor(SColorF color, SRectF rect);
void DrawColorReflection(SColorF color, SRectF rect, float space, float height);
@@ -223,7 +223,7 @@ namespace VocaluxeLib
CProfile[] GetProfiles();
EGameDifficulty GetDifficulty(int profileID);
string GetPlayerName(int profileID, int playerNum = 0);
CTexture GetAvatar(int profileID);
CTextureRef GetAvatar(int profileID);
CAvatar GetAvatarByFilename(string fileName);
bool IsProfileIDValid(int profileID);
bool IsGuest(int profileID);
@@ -264,7 +264,7 @@ namespace VocaluxeLib
{
int Load(string videoFileName);
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 Close(int streamID);
void SetLoop(int streamID, bool loop = true);
@@ -289,12 +289,12 @@ namespace VocaluxeLib
public interface ICover
{
CTexture GetNoCover();
CTextureRef GetNoCover();
}
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);
}
@@ -333,8 +333,8 @@ namespace VocaluxeLib
void Load(CSong song, float start = 0f);
void Stop();
void TogglePause();
CTexture GetCover();
CTexture GetVideoTexture();
CTextureRef GetCover();
CTextureRef GetVideoTexture();
bool IsPlaying();
float GetLength();
}
+8 -8
View File
@@ -55,7 +55,7 @@ namespace VocaluxeLib.Menu
private int _SlideShowCurrent;
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;
@@ -223,7 +223,7 @@ namespace VocaluxeLib.Menu
_Theme.Type = EBackgroundTypes.SlideShow;
if (!String.IsNullOrEmpty(image))
{
CTexture texture = CBase.Drawing.AddTexture(image);
CTextureRef texture = CBase.Drawing.AddTexture(image);
if (texture != null)
_SlideShowTextures.Add(texture);
}
@@ -231,9 +231,9 @@ namespace VocaluxeLib.Menu
public void RemoveSlideShowTextures()
{
foreach (CTexture tex in _SlideShowTextures)
foreach (CTextureRef tex in _SlideShowTextures)
{
CTexture texture = tex;
CTextureRef texture = tex;
CBase.Drawing.RemoveTexture(ref texture);
}
_SlideShowTextures.Clear();
@@ -256,7 +256,7 @@ namespace VocaluxeLib.Menu
private bool _DrawTexture()
{
CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
CTextureRef texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
if (texture != null)
{
var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
@@ -288,7 +288,7 @@ namespace VocaluxeLib.Menu
_SlideShowCurrent = 0;
}
CTexture texture = _SlideShowTextures[_SlideShowCurrent];
CTextureRef texture = _SlideShowTextures[_SlideShowCurrent];
if (texture == null)
return false;
@@ -323,7 +323,7 @@ namespace VocaluxeLib.Menu
private bool _DrawVideo()
{
CTexture videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
CTextureRef videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
if (videoTexture != null)
{
var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
@@ -338,7 +338,7 @@ namespace VocaluxeLib.Menu
private bool _DrawBackgroundMusicVideo()
{
CTexture videoTexture = CBase.BackgroundMusic.GetVideoTexture();
CTextureRef videoTexture = CBase.BackgroundMusic.GetVideoTexture();
if (videoTexture != null)
{
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 readonly int _PartyModeID;
public CTexture Texture;
public CTexture SelTexture;
public CTextureRef Texture;
public CTextureRef SelTexture;
public SRectF Rect;
public SColorF Color;
public SColorF SelColor;
@@ -290,7 +290,7 @@ namespace VocaluxeLib.Menu
if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme && !forceDraw)
return;
CTexture texture;
CTextureRef texture;
if (!Selected && !Pressed || !_Enabled)
{
+2 -2
View File
@@ -476,7 +476,7 @@ namespace VocaluxeLib.Menu
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);
}
@@ -521,7 +521,7 @@ namespace VocaluxeLib.Menu
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);
}
+1 -1
View File
@@ -683,7 +683,7 @@ namespace VocaluxeLib.Menu
for (int i = 0; i < _TeamList[_CurrentTeam].Count; 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);
}
for (int i = _TeamList[_CurrentTeam].Count; i < _NumPlayerTeams[_CurrentTeam]; i++)
+3 -3
View File
@@ -69,9 +69,9 @@ namespace VocaluxeLib.Menu
public SRectF Rect;
private readonly List<CTile> _Tiles;
private CTexture _TextureEmptyTile;
private CTexture _TextureTileSelected;
public CTexture TextureEmptyTile
private CTextureRef _TextureEmptyTile;
private CTextureRef _TextureTileSelected;
public CTextureRef TextureEmptyTile
{
get { return _TextureEmptyTile; }
}
+4 -4
View File
@@ -44,7 +44,7 @@ namespace VocaluxeLib.Menu
#region private vars
private readonly int _PartyModeID;
private readonly string _TextureName;
private readonly CTexture _Texture;
private readonly CTextureRef _Texture;
private SRectF _Rect;
private float _Size;
private SColorF _Color;
@@ -127,7 +127,7 @@ namespace VocaluxeLib.Menu
_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)
{
_PartyModeID = partyModeID;
@@ -300,7 +300,7 @@ namespace VocaluxeLib.Menu
private SThemeParticleEffect _Theme;
private bool _ThemeLoaded;
public CTexture Texture;
public CTextureRef Texture;
public SColorF Color;
public SRectF Rect;
@@ -352,7 +352,7 @@ namespace VocaluxeLib.Menu
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;
_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);
}
+15 -15
View File
@@ -111,7 +111,7 @@ namespace VocaluxeLib.Menu
private readonly List<string> _ValueNames;
private readonly List<int> _ValuePartyModeIDs;
private readonly List<CTexture> _Textures;
private readonly List<CTextureRef> _Textures;
private readonly List<int> _ValueIndexes;
private readonly List<SRectF> _ValueBounds = new List<SRectF>();
@@ -179,7 +179,7 @@ namespace VocaluxeLib.Menu
MaxW = 0f;
_Selected = false;
_Textures = new List<CTexture>();
_Textures = new List<CTextureRef>();
_ValueIndexes = new List<int>();
_ValueNames = new List<string>();
_ValuePartyModeIDs = new List<int>();
@@ -227,7 +227,7 @@ namespace VocaluxeLib.Menu
MaxW = slide.MaxW;
_Selected = slide._Selected;
_Textures = new List<CTexture>(slide._Textures);
_Textures = new List<CTextureRef>(slide._Textures);
_ValueIndexes = new List<int>(slide._ValueIndexes);
_ValueNames = new List<string>(slide._ValueNames);
_ValueBounds = new List<SRectF>(slide._ValueBounds);
@@ -534,17 +534,17 @@ namespace VocaluxeLib.Menu
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);
}
private void _AddValue(string value, CTexture texture, int valueIndex)
private void _AddValue(string value, CTextureRef texture, int valueIndex)
{
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);
_Textures.Add(texture);
@@ -565,7 +565,7 @@ namespace VocaluxeLib.Menu
_ValueBounds.Clear();
}
public void AddValues(string[] values, CTexture[] textures)
public void AddValues(string[] values, CTextureRef[] textures)
{
if (values.Length != textures.Length)
return;
@@ -589,7 +589,7 @@ namespace VocaluxeLib.Menu
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)
return;
@@ -713,15 +713,15 @@ namespace VocaluxeLib.Menu
if (!Visible && CBase.Settings.GetProgramState() != EProgramState.EditTheme)
return;
CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
CTexture textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID);
CTexture textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID);
CTextureRef texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
CTextureRef textureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.TextureArrowLeftName, _PartyModeID);
CTextureRef textureArrowRight = CBase.Theme.GetSkinTexture(_Theme.TextureArrowRightName, _PartyModeID);
CTexture selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID);
CTexture selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _PartyModeID);
CTexture selTextureArrowRight = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowRightName, _PartyModeID);
CTextureRef selTexture = CBase.Theme.GetSkinTexture(_Theme.SelTextureName, _PartyModeID);
CTextureRef selTextureArrowLeft = CBase.Theme.GetSkinTexture(_Theme.SelTextureArrowLeftName, _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)
{
+4 -4
View File
@@ -40,8 +40,8 @@ namespace VocaluxeLib.Menu
return _Theme.Name;
}
private CTexture _Texture;
public CTexture Texture
private CTextureRef _Texture;
public CTextureRef Texture
{
get { return _Texture ?? CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID); }
@@ -83,7 +83,7 @@ namespace VocaluxeLib.Menu
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;
@@ -192,7 +192,7 @@ namespace VocaluxeLib.Menu
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 rect;
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);
CTexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
CTexture noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID);
CTexture noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID);
CTextureRef noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
CTextureRef noteMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinMiddleName, _PartyModeID);
CTextureRef noteEnd = CBase.Theme.GetSkinTexture(_Theme.SkinRightName, _PartyModeID);
//Width of each of the ends (round parts)
//Need 2 of them so use minimum
@@ -519,9 +519,9 @@ namespace VocaluxeLib.Menu.SingNotes
rect.Z
);
CTexture noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID);
CTexture noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID);
CTexture noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID);
CTextureRef noteBackgroundBegin = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundLeftName, _PartyModeID);
CTextureRef noteBackgroundMiddle = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundMiddleName, _PartyModeID);
CTextureRef noteBackgroundEnd = CBase.Theme.GetSkinTexture(_Theme.SkinBackgroundRightName, _PartyModeID);
float dx = r.H * noteBackgroundBegin.OrigAspect;
if (2 * dx > r.W)
@@ -614,7 +614,7 @@ namespace VocaluxeLib.Menu.SingNotes
rect.Z
);
CTexture noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
CTextureRef noteBegin = CBase.Theme.GetSkinTexture(_Theme.SkinLeftName, _PartyModeID);
float dx = r.H * noteBegin.OrigAspect;
if (2 * dx > r.W)
dx = r.W / 2;
@@ -671,7 +671,7 @@ namespace VocaluxeLib.Menu.SingNotes
_PlayerNotes[n].Color.B,
_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);
@@ -37,8 +37,8 @@ namespace VocaluxeLib.Menu.SongMenu
private CStatic _MedleyCalcIcon;
private CStatic _MedleyTagIcon;
private CTexture _CoverBigBGTexture;
private CTexture _CoverBGTexture;
private CTextureRef _CoverBigBGTexture;
private CTextureRef _CoverBGTexture;
private CText _Artist;
private CText _Title;
@@ -467,7 +467,7 @@ namespace VocaluxeLib.Menu.SongMenu
_TextBG.Draw();
CTexture vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null;
CTextureRef vidtex = CBase.BackgroundMusic.IsPlayingPreview() ? CBase.BackgroundMusic.GetVideoTexture() : null;
if (vidtex != null)
{
+4 -4
View File
@@ -25,10 +25,10 @@ namespace VocaluxeLib.Profile
{
public int ID;
private readonly string _FileName = "";
private CTexture _Texture;
private CTextureRef _Texture;
private const int _MaxNameLen = 12;
public CTexture Texture
public CTextureRef Texture
{
get { return _Texture; }
}
@@ -39,11 +39,11 @@ namespace VocaluxeLib.Profile
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);
}
private CAvatar(CTexture texture, string fileName, int id = -1)
private CAvatar(CTextureRef texture, string fileName, int id = -1)
{
_Texture = texture;
_FileName = fileName;
+4 -4
View File
@@ -24,8 +24,8 @@ namespace VocaluxeLib.Songs
public class CCategory
{
public readonly string Name;
private CTexture _CoverTextureSmall;
private CTexture _CoverTextureBig;
private CTextureRef _CoverTextureSmall;
private CTextureRef _CoverTextureBig;
public readonly List<CSongPointer> Songs = new List<CSongPointer>();
public CCategory(string name)
@@ -33,14 +33,14 @@ namespace VocaluxeLib.Songs
Name = name;
}
public CTexture CoverTextureSmall
public CTextureRef CoverTextureSmall
{
get { return _CoverTextureSmall; }
set { _CoverTextureSmall = value; }
}
public CTexture CoverTextureBig
public CTextureRef CoverTextureBig
{
get { return _CoverTextureBig ?? _CoverTextureSmall; }
set
+4 -4
View File
@@ -78,8 +78,8 @@ namespace VocaluxeLib.Songs
public partial class CSong
{
private CTexture _CoverTextureSmall;
private CTexture _CoverTextureBig;
private CTextureRef _CoverTextureSmall;
private CTextureRef _CoverTextureBig;
public SMedley Medley;
@@ -104,7 +104,7 @@ namespace VocaluxeLib.Songs
public bool NotesLoaded { get; private set; }
public CTexture CoverTextureSmall
public CTextureRef CoverTextureSmall
{
get
{
@@ -116,7 +116,7 @@ namespace VocaluxeLib.Songs
set { _CoverTextureSmall = value; }
}
public CTexture CoverTextureBig
public CTextureRef CoverTextureBig
{
get { return _CoverTextureBig ?? _CoverTextureSmall; }
set { _CoverTextureBig = value; }
+10 -15
View File
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using VocaluxeLib.Draw;
using VocaluxeLib.Songs;
@@ -14,7 +13,7 @@ namespace VocaluxeLib.Utils.Player
private CSong _Song;
private bool _VideoEnabled;
private int _Video = -1;
private CTexture _CurrentVideoTexture;
private CTextureRef _CurrentVideoTexture;
private CFading _VideoFading;
public bool VideoEnabled
@@ -41,7 +40,7 @@ namespace VocaluxeLib.Utils.Player
}
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
@@ -56,7 +55,7 @@ namespace VocaluxeLib.Utils.Player
}
}
public CTexture Cover
public CTextureRef Cover
{
get { return _Song == null ? CBase.Cover.GetNoCover() : _Song.CoverTextureBig; }
}
@@ -66,11 +65,10 @@ namespace VocaluxeLib.Utils.Player
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)
: base(Path.Combine(song.Folder,song.MP3FileName), loop, position, autoplay)
: base(Path.Combine(song.Folder, song.MP3FileName), loop, position, autoplay)
{
_Song = song;
_LoadVideo();
@@ -82,7 +80,7 @@ namespace VocaluxeLib.Utils.Player
_Song = null;
}
public CTexture GetVideoTexture()
public CTextureRef GetVideoTexture()
{
if (_Video == -1 || _Song == null)
return null;
@@ -101,7 +99,7 @@ namespace VocaluxeLib.Utils.Player
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)
return;
@@ -109,7 +107,7 @@ namespace VocaluxeLib.Utils.Player
Stop();
_Song = song;
base.Load(Path.Combine(song.Folder, song.MP3FileName), position, false);
_LoadVideo();
@@ -155,13 +153,10 @@ namespace VocaluxeLib.Utils.Player
CBase.Video.Pause(_Video);
CBase.Video.Skip(_Video, CBase.Sound.GetPosition(_StreamID) + _FadeTime, _Song.VideoGap);
}
else if(_Video != -1)
{
else if (_Video != -1)
CBase.Video.Resume(_Video);
}
base.TogglePause();
}
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\CText.cs" />
<Compile Include="Menu\CScreenSetting.cs" />
<Compile Include="Draw\CTexture.cs" />
<Compile Include="Draw\CTextureRef.cs" />
<Compile Include="CXMLReader.cs" />
<Compile Include="Enums.cs" />
<Compile Include="Menu\IMenu.cs" />