moved CSong to SongMenu/CSong.cs
This commit is contained in:
1 parent
06f6ca0d40
commit
0c636929a2
26 files changed
+399
-137
No files matched your search
@@ -1,14 +1,15 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using System.Drawing;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ using SQLiteDataReader = Mono.Data.Sqlite.SqliteDataReader;
|
|||||||
using Community.CsharpSqlite;
|
using Community.CsharpSqlite;
|
||||||
|
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ using System.Text;
|
|||||||
|
|
||||||
using Vocaluxe.GameModes;
|
using Vocaluxe.GameModes;
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
using Vocaluxe.Menu.SingNotes;
|
using Vocaluxe.Menu.SingNotes;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
{
|
{
|
||||||
|
|||||||
+192
-1
@@ -4,6 +4,7 @@ using System.Drawing;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
{
|
{
|
||||||
@@ -22,8 +23,15 @@ namespace Vocaluxe.Base
|
|||||||
public static IGame Game = new BGame();
|
public static IGame Game = new BGame();
|
||||||
public static IProfiles Profiles = new BProfiles();
|
public static IProfiles Profiles = new BProfiles();
|
||||||
public static IRecording Record = new BRecord();
|
public static IRecording Record = new BRecord();
|
||||||
|
public static ISongs Songs = new BSongs();
|
||||||
|
public static IVideo Video = new BVideo();
|
||||||
|
public static ISound Sound = new BSound();
|
||||||
|
public static ICover Cover = new BCover();
|
||||||
|
public static IDataBase DataBase = new BDataBase();
|
||||||
|
|
||||||
public static Menu.Base Base = new Menu.Base(Config, Settings, Theme, Helper, Log, BackgroundMusic, Draw, Graphics, Fonts, Language, Game, Profiles, Record);
|
|
||||||
|
public static Menu.Base Base = new Menu.Base(
|
||||||
|
Config, Settings, Theme, Helper, Log, BackgroundMusic, Draw, Graphics, Fonts, Language, Game, Profiles, Record, Songs, Video, Sound, Cover, DataBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
class BConfig : IConfig
|
class BConfig : IConfig
|
||||||
@@ -45,6 +53,11 @@ namespace Vocaluxe.Base
|
|||||||
return CConfig.BackgroundMusicVolume;
|
return CConfig.BackgroundMusicVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int GetPreviewMusicVolume()
|
||||||
|
{
|
||||||
|
return CConfig.PreviewMusicVolume;
|
||||||
|
}
|
||||||
|
|
||||||
public ESongMenu GetSongMenuType()
|
public ESongMenu GetSongMenuType()
|
||||||
{
|
{
|
||||||
return CConfig.SongMenu;
|
return CConfig.SongMenu;
|
||||||
@@ -60,6 +73,11 @@ namespace Vocaluxe.Base
|
|||||||
return CConfig.VideoBackgrounds;
|
return CConfig.VideoBackgrounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EOffOn GetVideoPreview()
|
||||||
|
{
|
||||||
|
return CConfig.VideoPreview;
|
||||||
|
}
|
||||||
|
|
||||||
public EOffOn GetDrawNoteLines()
|
public EOffOn GetDrawNoteLines()
|
||||||
{
|
{
|
||||||
return CConfig.DrawNoteLines;
|
return CConfig.DrawNoteLines;
|
||||||
@@ -69,6 +87,16 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
return CConfig.DrawToneHelper;
|
return CConfig.DrawToneHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int GetCoverSize()
|
||||||
|
{
|
||||||
|
return CConfig.CoverSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<string> GetSongFolder()
|
||||||
|
{
|
||||||
|
return CConfig.SongFolder;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BSettings : ISettings
|
class BSettings : ISettings
|
||||||
@@ -122,6 +150,26 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
return CSettings.MaxNumPlayer;
|
return CSettings.MaxNumPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float GetDefaultMedleyFadeInTime()
|
||||||
|
{
|
||||||
|
return CSettings.DefaultMedleyFadeInTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float GetDefaultMedleyFadeOutTime()
|
||||||
|
{
|
||||||
|
return CSettings.DefaultMedleyFadeOutTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetMedleyMinSeriesLength()
|
||||||
|
{
|
||||||
|
return CSettings.MedleyMinSeriesLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float GetMedleyMinDuration()
|
||||||
|
{
|
||||||
|
return CSettings.MedleyMinDuration;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BTheme : ITheme
|
class BTheme : ITheme
|
||||||
@@ -279,6 +327,11 @@ namespace Vocaluxe.Base
|
|||||||
CDraw.DrawTextureReflection(Texture, Rect, Color, Bounds, ReflectionSpace, ReflectionHeight);
|
CDraw.DrawTextureReflection(Texture, Rect, Color, Bounds, ReflectionSpace, ReflectionHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RemoveTexture(ref STexture Texture)
|
||||||
|
{
|
||||||
|
CDraw.RemoveTexture(ref Texture);
|
||||||
|
}
|
||||||
|
|
||||||
public void DrawColor(SColorF Color, SRectF Rect)
|
public void DrawColor(SColorF Color, SRectF Rect)
|
||||||
{
|
{
|
||||||
CDraw.DrawColor(Color, Rect);
|
CDraw.DrawColor(Color, Rect);
|
||||||
@@ -383,6 +436,11 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
return CGame.Rand.NextDouble();
|
return CGame.Rand.NextDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float GetTimeFromBeats(float Beat, float BPM)
|
||||||
|
{
|
||||||
|
return CGame.GetTimeFromBeats(Beat, BPM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BProfiles : IProfiles
|
class BProfiles : IProfiles
|
||||||
@@ -400,4 +458,137 @@ namespace Vocaluxe.Base
|
|||||||
return CSound.RecordGetToneAbs(PlayerNr);
|
return CSound.RecordGetToneAbs(PlayerNr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class BSongs : ISongs
|
||||||
|
{
|
||||||
|
public int GetNumVisibleSongs()
|
||||||
|
{
|
||||||
|
return CSongs.NumVisibleSongs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetNumCategories()
|
||||||
|
{
|
||||||
|
return CSongs.NumCategories;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetCurrentCategoryIndex()
|
||||||
|
{
|
||||||
|
return CSongs.Category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetCategory(int CategoryIndex)
|
||||||
|
{
|
||||||
|
CSongs.Category = CategoryIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CSong GetVisibleSong(int VisibleIndex)
|
||||||
|
{
|
||||||
|
if (VisibleIndex >= CSongs.NumVisibleSongs)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
CSong song = CSongs.VisibleSongs[VisibleIndex];
|
||||||
|
if (song == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return new CSong(song);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BVideo : IVideo
|
||||||
|
{
|
||||||
|
public int Load(string VideoFileName)
|
||||||
|
{
|
||||||
|
return CVideo.VdLoad(VideoFileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Skip(int VideoStream, float StartPosition, float VideoGap)
|
||||||
|
{
|
||||||
|
return CVideo.VdSkip(VideoStream, StartPosition, VideoGap);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool GetFrame(int VideoStream, ref STexture VideoTexture, float Time, ref float VideoTime)
|
||||||
|
{
|
||||||
|
return CVideo.VdGetFrame(VideoStream, ref VideoTexture, Time, ref VideoTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsFinished(int VideoStream)
|
||||||
|
{
|
||||||
|
return CVideo.VdFinished(VideoStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Close(int VideoStream)
|
||||||
|
{
|
||||||
|
return CVideo.VdClose(VideoStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class BSound : ISound
|
||||||
|
{
|
||||||
|
public int Load(string SoundFile, bool Prescan)
|
||||||
|
{
|
||||||
|
return CSound.Load(SoundFile, Prescan);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetPosition(int SoundStream, float NewPosition)
|
||||||
|
{
|
||||||
|
CSound.SetPosition(SoundStream, NewPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Play(int SoundStream)
|
||||||
|
{
|
||||||
|
CSound.Play(SoundStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Fade(int SoundStream, float TargetVolume, float Duration)
|
||||||
|
{
|
||||||
|
CSound.Fade(SoundStream, TargetVolume, Duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsFinished(int SoundStream)
|
||||||
|
{
|
||||||
|
return CSound.IsFinished(SoundStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float GetPosition(int SoundStream)
|
||||||
|
{
|
||||||
|
return CSound.GetPosition(SoundStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float GetLength(int SoundStream)
|
||||||
|
{
|
||||||
|
return CSound.GetLength(SoundStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FadeAndStop(int SoundStream, float TargetVolume, float Duration)
|
||||||
|
{
|
||||||
|
CSound.FadeAndStop(SoundStream, TargetVolume, Duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetStreamVolume(int SoundStream, float Volume)
|
||||||
|
{
|
||||||
|
CSound.SetStreamVolume(SoundStream, Volume);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetStreamVolumeMax(int SoundStream, float MaxVolume)
|
||||||
|
{
|
||||||
|
CSound.SetStreamVolumeMax(SoundStream, MaxVolume);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BCover : ICover
|
||||||
|
{
|
||||||
|
public STexture GetNoCover()
|
||||||
|
{
|
||||||
|
return CCover.NoCover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BDataBase : IDataBase
|
||||||
|
{
|
||||||
|
public bool GetCover(string FileName, ref STexture Texture, int CoverSize)
|
||||||
|
{
|
||||||
|
return CDataBase.GetCover(FileName, ref Texture, CoverSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@ using System.Text;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Xml.XPath;
|
using System.Xml.XPath;
|
||||||
|
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Lib.Playlist;
|
using Vocaluxe.Lib.Playlist;
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ using System.Text.RegularExpressions;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Base
|
namespace Vocaluxe.Base
|
||||||
{
|
{
|
||||||
@@ -958,7 +959,7 @@ namespace Vocaluxe.Base
|
|||||||
CLog.StartBenchmark(2, "Read TXTs");
|
CLog.StartBenchmark(2, "Read TXTs");
|
||||||
foreach (string file in files)
|
foreach (string file in files)
|
||||||
{
|
{
|
||||||
CSong Song = new CSong();
|
CSong Song = new CSong(CMain.Base);
|
||||||
if (Song.ReadTXTSong(file))
|
if (Song.ReadTXTSong(file))
|
||||||
{
|
{
|
||||||
Song.ID = _Songs.Count;
|
Song.ID = _Songs.Count;
|
||||||
|
|||||||
@@ -348,39 +348,4 @@ namespace Vocaluxe.Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static class CEncoding
|
|
||||||
{
|
|
||||||
public static Encoding GetEncoding(string EncodingName)
|
|
||||||
{
|
|
||||||
switch (EncodingName)
|
|
||||||
{
|
|
||||||
case "AUTO":
|
|
||||||
return Encoding.Default;
|
|
||||||
case "CP1250":
|
|
||||||
return Encoding.GetEncoding(1250);
|
|
||||||
case "CP1252":
|
|
||||||
return Encoding.GetEncoding(1252);
|
|
||||||
case "LOCALE":
|
|
||||||
return Encoding.Default;
|
|
||||||
case "UTF8":
|
|
||||||
return Encoding.UTF8;
|
|
||||||
default:
|
|
||||||
return Encoding.UTF8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetEncodingName(Encoding Enc)
|
|
||||||
{
|
|
||||||
string Result = "UTF8";
|
|
||||||
|
|
||||||
if (Enc.CodePage == 1250)
|
|
||||||
Result = "CP1250";
|
|
||||||
|
|
||||||
if (Enc.CodePage == 1252)
|
|
||||||
Result = "CP1252";
|
|
||||||
|
|
||||||
return Result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
using Vocaluxe.Menu.SongMenu;
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ using System.Collections.Generic;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.GameModes
|
namespace Vocaluxe.GameModes
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ using System.Xml.XPath;
|
|||||||
|
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.GameModes;
|
using Vocaluxe.GameModes;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Playlist
|
namespace Vocaluxe.Lib.Playlist
|
||||||
|
|||||||
@@ -310,4 +310,39 @@ namespace Vocaluxe.Menu
|
|||||||
return ((bounds.X <= x) && (bounds.X + bounds.W >= x) && (bounds.Y <= y) && (bounds.Y + bounds.H >= y));
|
return ((bounds.X <= x) && (bounds.X + bounds.W >= x) && (bounds.Y <= y) && (bounds.Y + bounds.H >= y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class CEncoding
|
||||||
|
{
|
||||||
|
public static Encoding GetEncoding(string EncodingName)
|
||||||
|
{
|
||||||
|
switch (EncodingName)
|
||||||
|
{
|
||||||
|
case "AUTO":
|
||||||
|
return Encoding.Default;
|
||||||
|
case "CP1250":
|
||||||
|
return Encoding.GetEncoding(1250);
|
||||||
|
case "CP1252":
|
||||||
|
return Encoding.GetEncoding(1252);
|
||||||
|
case "LOCALE":
|
||||||
|
return Encoding.Default;
|
||||||
|
case "UTF8":
|
||||||
|
return Encoding.UTF8;
|
||||||
|
default:
|
||||||
|
return Encoding.UTF8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetEncodingName(Encoding Enc)
|
||||||
|
{
|
||||||
|
string Result = "UTF8";
|
||||||
|
|
||||||
|
if (Enc.CodePage == 1250)
|
||||||
|
Result = "CP1250";
|
||||||
|
|
||||||
|
if (Enc.CodePage == 1252)
|
||||||
|
Result = "CP1252";
|
||||||
|
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+12
-1
@@ -2337,9 +2337,15 @@ namespace Vocaluxe.Menu
|
|||||||
public IGame Game;
|
public IGame Game;
|
||||||
public IProfiles Profiles;
|
public IProfiles Profiles;
|
||||||
public IRecording Record;
|
public IRecording Record;
|
||||||
|
public ISongs Songs;
|
||||||
|
public IVideo Video;
|
||||||
|
public ISound Sound;
|
||||||
|
public ICover Cover;
|
||||||
|
public IDataBase DataBase;
|
||||||
|
|
||||||
public Base(IConfig Config, ISettings Settings, ITheme Theme, IHelper Helper, ILog Log, IBackgroundMusic BackgroundMusic,
|
public Base(IConfig Config, ISettings Settings, ITheme Theme, IHelper Helper, ILog Log, IBackgroundMusic BackgroundMusic,
|
||||||
IDrawing Draw, IGraphics Graphics, IFonts Fonts, ILanguage Language, IGame Game, IProfiles Profiles, IRecording Record)
|
IDrawing Draw, IGraphics Graphics, IFonts Fonts, ILanguage Language, IGame Game, IProfiles Profiles, IRecording Record,
|
||||||
|
ISongs Songs, IVideo Video, ISound Sound, ICover Cover, IDataBase DataBase)
|
||||||
{
|
{
|
||||||
this.Config = Config;
|
this.Config = Config;
|
||||||
this.Settings = Settings;
|
this.Settings = Settings;
|
||||||
@@ -2354,6 +2360,11 @@ namespace Vocaluxe.Menu
|
|||||||
this.Game = Game;
|
this.Game = Game;
|
||||||
this.Profiles = Profiles;
|
this.Profiles = Profiles;
|
||||||
this.Record = Record;
|
this.Record = Record;
|
||||||
|
this.Songs = Songs;
|
||||||
|
this.Video = Video;
|
||||||
|
this.Sound = Sound;
|
||||||
|
this.Cover = Cover;
|
||||||
|
this.DataBase = DataBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using Vocaluxe.Lib.Song;
|
using Vocaluxe.Menu.SongMenu;
|
||||||
using Vocaluxe.GameModes;
|
using Vocaluxe.GameModes;
|
||||||
|
|
||||||
namespace Vocaluxe.Menu
|
namespace Vocaluxe.Menu
|
||||||
|
|||||||
+64
-1
@@ -5,6 +5,7 @@ using System.Text;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using Vocaluxe.Menu.SingNotes;
|
using Vocaluxe.Menu.SingNotes;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Menu
|
namespace Vocaluxe.Menu
|
||||||
{
|
{
|
||||||
@@ -47,13 +48,20 @@ namespace Vocaluxe.Menu
|
|||||||
void SetBackgroundMusicVolume(int NewVolume);
|
void SetBackgroundMusicVolume(int NewVolume);
|
||||||
int GetBackgroundMusicVolume();
|
int GetBackgroundMusicVolume();
|
||||||
|
|
||||||
|
int GetPreviewMusicVolume();
|
||||||
|
|
||||||
EOffOn GetVideosToBackground();
|
EOffOn GetVideosToBackground();
|
||||||
EOffOn GetVideoBackgrounds();
|
EOffOn GetVideoBackgrounds();
|
||||||
|
EOffOn GetVideoPreview();
|
||||||
|
|
||||||
ESongMenu GetSongMenuType();
|
ESongMenu GetSongMenuType();
|
||||||
|
|
||||||
EOffOn GetDrawNoteLines();
|
EOffOn GetDrawNoteLines();
|
||||||
EOffOn GetDrawToneHelper();
|
EOffOn GetDrawToneHelper();
|
||||||
|
|
||||||
|
int GetCoverSize();
|
||||||
|
|
||||||
|
List<string> GetSongFolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ISettings
|
public interface ISettings
|
||||||
@@ -72,6 +80,11 @@ namespace Vocaluxe.Menu
|
|||||||
|
|
||||||
int GetNumNoteLines();
|
int GetNumNoteLines();
|
||||||
int GetMaxNumPlayer();
|
int GetMaxNumPlayer();
|
||||||
|
|
||||||
|
float GetDefaultMedleyFadeInTime();
|
||||||
|
float GetDefaultMedleyFadeOutTime();
|
||||||
|
int GetMedleyMinSeriesLength();
|
||||||
|
float GetMedleyMinDuration();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ITheme
|
public interface ITheme
|
||||||
@@ -124,6 +137,8 @@ namespace Vocaluxe.Menu
|
|||||||
void DrawTexture(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds);
|
void DrawTexture(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds);
|
||||||
void DrawTextureReflection(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds, float ReflectionSpace, float ReflectionHeight);
|
void DrawTextureReflection(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds, float ReflectionSpace, float ReflectionHeight);
|
||||||
|
|
||||||
|
void RemoveTexture(ref STexture 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);
|
||||||
}
|
}
|
||||||
@@ -165,6 +180,8 @@ namespace Vocaluxe.Menu
|
|||||||
|
|
||||||
int GetRandom(int Max);
|
int GetRandom(int Max);
|
||||||
double GetRandomDouble();
|
double GetRandomDouble();
|
||||||
|
|
||||||
|
float GetTimeFromBeats(float Beat, float BPM);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IRecording
|
public interface IRecording
|
||||||
@@ -177,6 +194,52 @@ namespace Vocaluxe.Menu
|
|||||||
SProfile[] GetProfiles();
|
SProfile[] GetProfiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface ISongs
|
||||||
|
{
|
||||||
|
int GetNumVisibleSongs();
|
||||||
|
int GetNumCategories();
|
||||||
|
int GetCurrentCategoryIndex();
|
||||||
|
|
||||||
|
void SetCategory(int CategoryIndex);
|
||||||
|
|
||||||
|
CSong GetVisibleSong(int VisibleIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IVideo
|
||||||
|
{
|
||||||
|
int Load(string VideoFileName);
|
||||||
|
bool Skip(int VideoStream, float StartPosition, float VideoGap);
|
||||||
|
bool GetFrame(int VideoStream, ref STexture VideoTexture, float Time, ref float VideoTime);
|
||||||
|
bool IsFinished(int VideoStream);
|
||||||
|
bool Close(int VideoStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ISound
|
||||||
|
{
|
||||||
|
int Load(string SoundFile, bool Prescan);
|
||||||
|
void SetPosition(int SoundStream, float NewPosition);
|
||||||
|
void Play(int SoundStream);
|
||||||
|
void Fade(int SoundStream, float TargetVolume, float Duration);
|
||||||
|
|
||||||
|
bool IsFinished(int SoundStream);
|
||||||
|
float GetPosition(int SoundStream);
|
||||||
|
float GetLength(int SoundStream);
|
||||||
|
void FadeAndStop(int SoundStream, float TargetVolume, float Duration);
|
||||||
|
|
||||||
|
void SetStreamVolume(int SoundStream, float Volume);
|
||||||
|
void SetStreamVolumeMax(int SoundStream, float MaxVolume);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ICover
|
||||||
|
{
|
||||||
|
STexture GetNoCover();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IDataBase
|
||||||
|
{
|
||||||
|
bool GetCover(string FileName, ref STexture Texture, int CoverSize);
|
||||||
|
}
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum EModifier
|
public enum EModifier
|
||||||
{
|
{
|
||||||
@@ -305,7 +368,7 @@ namespace Vocaluxe.Menu
|
|||||||
EditTheme
|
EditTheme
|
||||||
}
|
}
|
||||||
|
|
||||||
enum EAspect
|
public enum EAspect
|
||||||
{
|
{
|
||||||
Crop,
|
Crop,
|
||||||
LetterBox,
|
LetterBox,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Vocaluxe.Menu;
|
|||||||
|
|
||||||
namespace Vocaluxe.Menu.SingNotes
|
namespace Vocaluxe.Menu.SingNotes
|
||||||
{
|
{
|
||||||
class CNotes
|
public class CNotes
|
||||||
{
|
{
|
||||||
private List<CLines> _Lines = new List<CLines>();
|
private List<CLines> _Lines = new List<CLines>();
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,11 @@ using System.IO;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
using Vocaluxe.Base;
|
|
||||||
using Vocaluxe.Lib.Draw;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
using Vocaluxe.Menu.SingNotes;
|
using Vocaluxe.Menu.SingNotes;
|
||||||
using Vocaluxe.GameModes;
|
using Vocaluxe.GameModes;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Song
|
namespace Vocaluxe.Menu.SongMenu
|
||||||
{
|
{
|
||||||
[Flags]
|
[Flags]
|
||||||
enum EHeaderFlags
|
enum EHeaderFlags
|
||||||
@@ -24,14 +22,14 @@ namespace Vocaluxe.Lib.Song
|
|||||||
MedleyEndBeat = 64
|
MedleyEndBeat = 64
|
||||||
}
|
}
|
||||||
|
|
||||||
enum EMedleySource
|
public enum EMedleySource
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
Calculated,
|
Calculated,
|
||||||
Tag
|
Tag
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SMedley
|
public struct SMedley
|
||||||
{
|
{
|
||||||
public EMedleySource Source;
|
public EMedleySource Source;
|
||||||
public int StartBeat;
|
public int StartBeat;
|
||||||
@@ -49,8 +47,9 @@ namespace Vocaluxe.Lib.Song
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CSong
|
public class CSong
|
||||||
{
|
{
|
||||||
|
private Base _Base;
|
||||||
private bool _CoverLoaded = false;
|
private bool _CoverLoaded = false;
|
||||||
private bool _NotesLoaded = false;
|
private bool _NotesLoaded = false;
|
||||||
private STexture _CoverTextureSmall = new STexture(-1);
|
private STexture _CoverTextureSmall = new STexture(-1);
|
||||||
@@ -98,11 +97,11 @@ namespace Vocaluxe.Lib.Song
|
|||||||
|
|
||||||
if (this.CoverFileName != String.Empty)
|
if (this.CoverFileName != String.Empty)
|
||||||
{
|
{
|
||||||
if (!CDataBase.GetCover(Path.Combine(this.Folder, this.CoverFileName), ref _CoverTextureSmall, CConfig.CoverSize))
|
if (!_Base.DataBase.GetCover(Path.Combine(this.Folder, this.CoverFileName), ref _CoverTextureSmall, _Base.Config.GetCoverSize()))
|
||||||
_CoverTextureSmall = CCover.NoCover;
|
_CoverTextureSmall = _Base.Cover.GetNoCover();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_CoverTextureSmall = CCover.NoCover;
|
_CoverTextureSmall = _Base.Cover.GetNoCover();
|
||||||
|
|
||||||
_CoverLoaded = true;
|
_CoverLoaded = true;
|
||||||
}
|
}
|
||||||
@@ -175,12 +174,14 @@ namespace Vocaluxe.Lib.Song
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CSong()
|
public CSong(Base Base)
|
||||||
{
|
{
|
||||||
|
_Base = Base;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CSong(CSong song)
|
public CSong(CSong song)
|
||||||
{
|
{
|
||||||
|
this._Base = song._Base;
|
||||||
this._CoverTextureSmall = song._CoverTextureSmall;
|
this._CoverTextureSmall = song._CoverTextureSmall;
|
||||||
this._CoverTextureBig = song._CoverTextureBig;
|
this._CoverTextureBig = song._CoverTextureBig;
|
||||||
|
|
||||||
@@ -284,7 +285,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
|
|
||||||
this.Folder = Path.GetDirectoryName(FilePath);
|
this.Folder = Path.GetDirectoryName(FilePath);
|
||||||
|
|
||||||
foreach (string folder in CConfig.SongFolder)
|
foreach (string folder in _Base.Config.GetSongFolder())
|
||||||
{
|
{
|
||||||
if (this.Folder.Contains(folder))
|
if (this.Folder.Contains(folder))
|
||||||
{
|
{
|
||||||
@@ -411,7 +412,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLog.LogError("Can't find audio file: " + Path.Combine(this.Folder, Value));
|
_Base.Log.LogError("Can't find audio file: " + Path.Combine(this.Folder, Value));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -461,7 +462,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
if (File.Exists(Path.Combine(this.Folder, Value)))
|
if (File.Exists(Path.Combine(this.Folder, Value)))
|
||||||
this.VideoFileName = Value;
|
this.VideoFileName = Value;
|
||||||
else
|
else
|
||||||
CLog.LogError("Can't find video file: " + Path.Combine(this.Folder, Value));
|
_Base.Log.LogError("Can't find video file: " + Path.Combine(this.Folder, Value));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "VIDEOGAP":
|
case "VIDEOGAP":
|
||||||
@@ -517,31 +518,31 @@ namespace Vocaluxe.Lib.Song
|
|||||||
|
|
||||||
if ((HeaderFlags & EHeaderFlags.Title) == 0)
|
if ((HeaderFlags & EHeaderFlags.Title) == 0)
|
||||||
{
|
{
|
||||||
CLog.LogError("Title tag missing: " + FilePath);
|
_Base.Log.LogError("Title tag missing: " + FilePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((HeaderFlags & EHeaderFlags.Artist) == 0)
|
if ((HeaderFlags & EHeaderFlags.Artist) == 0)
|
||||||
{
|
{
|
||||||
CLog.LogError("Artist tag missing: " + FilePath);
|
_Base.Log.LogError("Artist tag missing: " + FilePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((HeaderFlags & EHeaderFlags.MP3) == 0)
|
if ((HeaderFlags & EHeaderFlags.MP3) == 0)
|
||||||
{
|
{
|
||||||
CLog.LogError("MP3 tag missing: " + FilePath);
|
_Base.Log.LogError("MP3 tag missing: " + FilePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((HeaderFlags & EHeaderFlags.BPM) == 0)
|
if ((HeaderFlags & EHeaderFlags.BPM) == 0)
|
||||||
{
|
{
|
||||||
CLog.LogError("BPM tag missing: " + FilePath);
|
_Base.Log.LogError("BPM tag missing: " + FilePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Relative == EOffOn.TR_CONFIG_ON)
|
if (this.Relative == EOffOn.TR_CONFIG_ON)
|
||||||
{
|
{
|
||||||
CLog.LogError("Relative songs are not supported by Vocaluxe (perhaps later)! (" + FilePath + ")");
|
_Base.Log.LogError("Relative songs are not supported by Vocaluxe (perhaps later)! (" + FilePath + ")");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +551,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
{
|
{
|
||||||
if (this.Medley.StartBeat > this.Medley.EndBeat)
|
if (this.Medley.StartBeat > this.Medley.EndBeat)
|
||||||
{
|
{
|
||||||
CLog.LogError("MedleyStartBeat is bigger than MedleyEndBeat in file: " + FilePath);
|
_Base.Log.LogError("MedleyStartBeat is bigger than MedleyEndBeat in file: " + FilePath);
|
||||||
HeaderFlags = HeaderFlags - EHeaderFlags.MedleyStartBeat - EHeaderFlags.MedleyEndBeat;
|
HeaderFlags = HeaderFlags - EHeaderFlags.MedleyStartBeat - EHeaderFlags.MedleyEndBeat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -560,7 +561,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
//PreviewStart is not set or <=0
|
//PreviewStart is not set or <=0
|
||||||
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0)
|
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0)
|
||||||
//fallback to MedleyStart
|
//fallback to MedleyStart
|
||||||
this.PreviewStart = CGame.GetTimeFromBeats(this.Medley.StartBeat, this.BPM);
|
this.PreviewStart = _Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM);
|
||||||
else
|
else
|
||||||
//else set to 0, it will be set in FindRefrainStart
|
//else set to 0, it will be set in FindRefrainStart
|
||||||
this.PreviewStart = 0f;
|
this.PreviewStart = 0f;
|
||||||
@@ -569,8 +570,8 @@ namespace Vocaluxe.Lib.Song
|
|||||||
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0)
|
if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0)
|
||||||
{
|
{
|
||||||
this.Medley.Source = EMedleySource.Tag;
|
this.Medley.Source = EMedleySource.Tag;
|
||||||
this.Medley.FadeInTime = CSettings.DefaultMedleyFadeInTime;
|
this.Medley.FadeInTime = _Base.Settings.GetDefaultMedleyFadeInTime();
|
||||||
this.Medley.FadeOutTime = CSettings.DefaultMedleyFadeOutTime;
|
this.Medley.FadeOutTime = _Base.Settings.GetDefaultMedleyFadeOutTime();
|
||||||
}
|
}
|
||||||
#endregion check medley tags
|
#endregion check medley tags
|
||||||
|
|
||||||
@@ -578,7 +579,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CLog.LogError("Error reading txt header in file \"" + FilePath + "\": " + e.Message);
|
_Base.Log.LogError("Error reading txt header in file \"" + FilePath + "\": " + e.Message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -606,7 +607,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
{
|
{
|
||||||
if (!File.Exists(FilePath))
|
if (!File.Exists(FilePath))
|
||||||
{
|
{
|
||||||
CLog.LogError("Error loading song. The file does not exist: " + FilePath);
|
_Base.Log.LogError("Error loading song. The file does not exist: " + FilePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -637,7 +638,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
|
|
||||||
if (sr.EndOfStream || (line.Length == 0))
|
if (sr.EndOfStream || (line.Length == 0))
|
||||||
{
|
{
|
||||||
CLog.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". The file is empty or it starts with an empty line: " + FilePath);
|
_Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". The file is empty or it starts with an empty line: " + FilePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -661,7 +662,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
Player = 2;
|
Player = 2;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLog.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Wrong or missing number after \"P\": " + FilePath);
|
_Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Wrong or missing number after \"P\": " + FilePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -705,7 +706,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
{
|
{
|
||||||
if (isNewSentence)
|
if (isNewSentence)
|
||||||
{
|
{
|
||||||
CLog.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Double sentence break: " + FilePath);
|
_Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". Double sentence break: " + FilePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -731,7 +732,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CLog.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath);
|
_Base.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
FindRefrain();
|
FindRefrain();
|
||||||
@@ -744,7 +745,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
|
|
||||||
private void ParseNote(int Player, ENoteType NoteType, int Start, int Length, int Tone, string Text)
|
private void ParseNote(int Player, ENoteType NoteType, int Start, int Length, int Tone, string Text)
|
||||||
{
|
{
|
||||||
CNote note = new CNote(CMain.Base, Start, Length, Tone, Text, NoteType);
|
CNote note = new CNote(_Base, Start, Length, Tone, Text, NoteType);
|
||||||
CLines lines = this.Notes.GetLines(Player);
|
CLines lines = this.Notes.GetLines(Player);
|
||||||
|
|
||||||
if (lines.LineCount == 0)
|
if (lines.LineCount == 0)
|
||||||
@@ -810,12 +811,12 @@ namespace Vocaluxe.Lib.Song
|
|||||||
if (DuetPart1 == String.Empty)
|
if (DuetPart1 == String.Empty)
|
||||||
{
|
{
|
||||||
DuetPart1 = "Part 1";
|
DuetPart1 = "Part 1";
|
||||||
CLog.LogError("Warning: Can't find #P1-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
|
_Base.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
|
||||||
}
|
}
|
||||||
if (DuetPart2 == String.Empty)
|
if (DuetPart2 == String.Empty)
|
||||||
{
|
{
|
||||||
DuetPart2 = "Part 2";
|
DuetPart2 = "Part 2";
|
||||||
CLog.LogError("Warning: Can't find #P2-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
|
_Base.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -896,7 +897,7 @@ namespace Vocaluxe.Lib.Song
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set medley vars
|
// set medley vars
|
||||||
if (series.Count > 0 && series[longest].length > CSettings.MedleyMinSeriesLength)
|
if (series.Count > 0 && series[longest].length > _Base.Settings.GetMedleyMinSeriesLength())
|
||||||
{
|
{
|
||||||
this.Medley.StartBeat = lines.Line[series[longest].start].FirstNoteBeat;
|
this.Medley.StartBeat = lines.Line[series[longest].start].FirstNoteBeat;
|
||||||
this.Medley.EndBeat = lines.Line[series[longest].end].LastNoteBeat;
|
this.Medley.EndBeat = lines.Line[series[longest].end].LastNoteBeat;
|
||||||
@@ -904,16 +905,16 @@ namespace Vocaluxe.Lib.Song
|
|||||||
bool foundEnd = false;
|
bool foundEnd = false;
|
||||||
|
|
||||||
// set end if duration > MedleyMinDuration
|
// set end if duration > MedleyMinDuration
|
||||||
if (CGame.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + CSettings.MedleyMinDuration >
|
if (_Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + _Base.Settings.GetMedleyMinDuration() >
|
||||||
CGame.GetTimeFromBeats(this.Medley.EndBeat, this.BPM))
|
_Base.Game.GetTimeFromBeats(this.Medley.EndBeat, this.BPM))
|
||||||
foundEnd = true;
|
foundEnd = true;
|
||||||
|
|
||||||
if (!foundEnd)
|
if (!foundEnd)
|
||||||
{
|
{
|
||||||
for (int i = series[longest].start + 1; i < lines.LineCount - 1; i++)
|
for (int i = series[longest].start + 1; i < lines.LineCount - 1; i++)
|
||||||
{
|
{
|
||||||
if (CGame.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + CSettings.MedleyMinDuration >
|
if (_Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + _Base.Settings.GetMedleyMinDuration() >
|
||||||
CGame.GetTimeFromBeats(lines.Line[i].LastNoteBeat, this.BPM))
|
_Base.Game.GetTimeFromBeats(lines.Line[i].LastNoteBeat, this.BPM))
|
||||||
{
|
{
|
||||||
foundEnd = true;
|
foundEnd = true;
|
||||||
this.Medley.EndBeat = lines.Line[i].LastNoteBeat;
|
this.Medley.EndBeat = lines.Line[i].LastNoteBeat;
|
||||||
@@ -924,15 +925,15 @@ namespace Vocaluxe.Lib.Song
|
|||||||
if (foundEnd)
|
if (foundEnd)
|
||||||
{
|
{
|
||||||
this.Medley.Source = EMedleySource.Calculated;
|
this.Medley.Source = EMedleySource.Calculated;
|
||||||
this.Medley.FadeInTime = CSettings.DefaultMedleyFadeInTime;
|
this.Medley.FadeInTime = _Base.Settings.GetDefaultMedleyFadeInTime();
|
||||||
this.Medley.FadeOutTime = CSettings.DefaultMedleyFadeOutTime;
|
this.Medley.FadeOutTime = _Base.Settings.GetDefaultMedleyFadeOutTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.PreviewStart == 0f)
|
if (this.PreviewStart == 0f)
|
||||||
{
|
{
|
||||||
if (this.Medley.Source == EMedleySource.Calculated)
|
if (this.Medley.Source == EMedleySource.Calculated)
|
||||||
this.PreviewStart = CGame.GetTimeFromBeats(this.Medley.StartBeat, this.BPM);
|
this.PreviewStart = _Base.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,8 +6,6 @@ using System.Text;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Xml.XPath;
|
using System.Xml.XPath;
|
||||||
|
|
||||||
using Vocaluxe.Base;
|
|
||||||
using Vocaluxe.Lib.Draw;
|
|
||||||
using Vocaluxe.PartyModes;
|
using Vocaluxe.PartyModes;
|
||||||
|
|
||||||
namespace Vocaluxe.Menu.SongMenu
|
namespace Vocaluxe.Menu.SongMenu
|
||||||
@@ -273,7 +271,7 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
|
|
||||||
if (CHelper.GetValueFromXML(item + "/Color", navigator, ref _Theme.ColorName, String.Empty))
|
if (CHelper.GetValueFromXML(item + "/Color", navigator, ref _Theme.ColorName, String.Empty))
|
||||||
{
|
{
|
||||||
_ThemeLoaded &= CTheme.GetColor(_Theme.ColorName, SkinIndex, ref _Color);
|
_ThemeLoaded &= _Base.Theme.GetColor(_Theme.ColorName, SkinIndex, ref _Color);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -444,17 +442,17 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
|
|
||||||
if (_streams.Count > 0 && _video != -1)
|
if (_streams.Count > 0 && _video != -1)
|
||||||
{
|
{
|
||||||
if (CVideo.VdFinished(_video) || CSound.IsFinished(_actsongstream))
|
if (_Base.Video.IsFinished(_video) || _Base.Sound.IsFinished(_actsongstream))
|
||||||
{
|
{
|
||||||
CVideo.VdClose(_video);
|
_Base.Video.Close(_video);
|
||||||
_video = -1;
|
_video = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
float time = CSound.GetPosition(_actsongstream);
|
float time = _Base.Sound.GetPosition(_actsongstream);
|
||||||
|
|
||||||
float vtime = 0f;
|
float vtime = 0f;
|
||||||
CVideo.VdGetFrame(_video, ref _vidtex, time, ref vtime);
|
_Base.Video.GetFrame(_video, ref _vidtex, time, ref vtime);
|
||||||
if (_VideoFadeTimer.ElapsedMilliseconds <= 3000L)
|
if (_VideoFadeTimer.ElapsedMilliseconds <= 3000L)
|
||||||
{
|
{
|
||||||
_vidtex.color.A = (_VideoFadeTimer.ElapsedMilliseconds / 3000f);
|
_vidtex.color.A = (_VideoFadeTimer.ElapsedMilliseconds / 3000f);
|
||||||
@@ -477,14 +475,14 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
{
|
{
|
||||||
foreach (int stream in _streams)
|
foreach (int stream in _streams)
|
||||||
{
|
{
|
||||||
CSound.FadeAndStop(stream, 0f, 0.75f);
|
_Base.Sound.FadeAndStop(stream, 0f, 0.75f);
|
||||||
}
|
}
|
||||||
_streams.Clear();
|
_streams.Clear();
|
||||||
|
|
||||||
CVideo.VdClose(_video);
|
_Base.Video.Close(_video);
|
||||||
_video = -1;
|
_video = -1;
|
||||||
|
|
||||||
CDraw.RemoveTexture(ref _vidtex);
|
_Base.Drawing.RemoveTexture(ref _vidtex);
|
||||||
|
|
||||||
_timer.Stop();
|
_timer.Stop();
|
||||||
_timer.Reset();
|
_timer.Reset();
|
||||||
@@ -510,7 +508,7 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
|
|
||||||
if (_video != -1)
|
if (_video != -1)
|
||||||
{
|
{
|
||||||
CDraw.DrawTexture(_vidtex, new SRectF(0, 0, 1280, 720, 0));
|
_Base.Drawing.DrawTexture(_vidtex, new SRectF(0, 0, 1280, 720, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -521,7 +519,7 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
|
|
||||||
foreach (int stream in _streams)
|
foreach (int stream in _streams)
|
||||||
{
|
{
|
||||||
CSound.SetStreamVolumeMax(stream, _MaxVolume);
|
_Base.Sound.SetStreamVolumeMax(stream, _MaxVolume);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -582,7 +580,7 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
Init();
|
Init();
|
||||||
|
|
||||||
if (_Theme.ColorName != String.Empty)
|
if (_Theme.ColorName != String.Empty)
|
||||||
_Color = CTheme.GetColor(_Theme.ColorName);
|
_Color = _Base.Theme.GetColor(_Theme.ColorName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReloadTextures()
|
public void ReloadTextures()
|
||||||
@@ -596,10 +594,10 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
if (!_Initialized)
|
if (!_Initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Category >= CSongs.NumCategories)
|
if (Category >= _Base.Songs.GetNumCategories())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CSongs.Category = Category;
|
_Base.Songs.SetCategory(Category);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void ShowCategories()
|
protected virtual void ShowCategories()
|
||||||
@@ -607,58 +605,58 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
if (!_Initialized)
|
if (!_Initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (CSongs.Category != -1)
|
if (_Base.Songs.GetCurrentCategoryIndex() != -1)
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
CSongs.Category = -1;
|
_Base.Songs.SetCategory(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyVolume()
|
public void ApplyVolume()
|
||||||
{
|
{
|
||||||
CSound.SetStreamVolume(_actsongstream, CConfig.PreviewMusicVolume);
|
_Base.Sound.SetStreamVolume(_actsongstream, _Base.Config.GetPreviewMusicVolume());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void SelectSong(int nr)
|
protected void SelectSong(int nr)
|
||||||
{
|
{
|
||||||
if (CSongs.Category >= 0 && (CSongs.NumVisibleSongs > 0) && (nr >= 0) && ((_actsong != nr) || (_streams.Count == 0)))
|
if (_Base.Songs.GetCurrentCategoryIndex() >= 0 && (_Base.Songs.GetNumVisibleSongs() > 0) && (nr >= 0) && ((_actsong != nr) || (_streams.Count == 0)))
|
||||||
{
|
{
|
||||||
foreach (int stream in _streams)
|
foreach (int stream in _streams)
|
||||||
{
|
{
|
||||||
CSound.FadeAndStop(stream, 0f, 1f);
|
_Base.Sound.FadeAndStop(stream, 0f, 1f);
|
||||||
}
|
}
|
||||||
_streams.Clear();
|
_streams.Clear();
|
||||||
|
|
||||||
CVideo.VdClose(_video);
|
_Base.Video.Close(_video);
|
||||||
_video = -1;
|
_video = -1;
|
||||||
|
|
||||||
CDraw.RemoveTexture(ref _vidtex);
|
_Base.Drawing.RemoveTexture(ref _vidtex);
|
||||||
|
|
||||||
_actsong = nr;
|
_actsong = nr;
|
||||||
if (_actsong >= CSongs.NumVisibleSongs)
|
if (_actsong >= _Base.Songs.GetNumVisibleSongs())
|
||||||
_actsong = 0;
|
_actsong = 0;
|
||||||
|
|
||||||
|
|
||||||
int _stream = CSound.Load(Path.Combine(CSongs.VisibleSongs[_actsong].Folder, CSongs.VisibleSongs[_actsong].MP3FileName), true);
|
int _stream = _Base.Sound.Load(Path.Combine(_Base.Songs.GetVisibleSong(_actsong).Folder, _Base.Songs.GetVisibleSong(_actsong).MP3FileName), true);
|
||||||
CSound.SetStreamVolumeMax(_stream, _MaxVolume);
|
_Base.Sound.SetStreamVolumeMax(_stream, _MaxVolume);
|
||||||
CSound.SetStreamVolume(_stream, 0f);
|
_Base.Sound.SetStreamVolume(_stream, 0f);
|
||||||
|
|
||||||
float startposition = CSongs.VisibleSongs[_actsong].PreviewStart;
|
float startposition = _Base.Songs.GetVisibleSong(_actsong).PreviewStart;
|
||||||
|
|
||||||
if (startposition == 0f)
|
if (startposition == 0f)
|
||||||
startposition = CSound.GetLength(_stream) / 4f;
|
startposition = _Base.Sound.GetLength(_stream) / 4f;
|
||||||
|
|
||||||
CSound.SetPosition(_stream, startposition);
|
_Base.Sound.SetPosition(_stream, startposition);
|
||||||
CSound.Play(_stream);
|
_Base.Sound.Play(_stream);
|
||||||
CSound.Fade(_stream, 100f, 3f);
|
_Base.Sound.Fade(_stream, 100f, 3f);
|
||||||
_streams.Add(_stream);
|
_streams.Add(_stream);
|
||||||
_actsongstream = _stream;
|
_actsongstream = _stream;
|
||||||
|
|
||||||
if (CSongs.VisibleSongs[_actsong].VideoFileName != String.Empty && CConfig.VideoPreview == EOffOn.TR_CONFIG_ON)
|
if (_Base.Songs.GetVisibleSong(_actsong).VideoFileName != String.Empty && _Base.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
|
||||||
{
|
{
|
||||||
_video = CVideo.VdLoad(Path.Combine(CSongs.VisibleSongs[_actsong].Folder, CSongs.VisibleSongs[_actsong].VideoFileName));
|
_video = _Base.Video.Load(Path.Combine(_Base.Songs.GetVisibleSong(_actsong).Folder, _Base.Songs.GetVisibleSong(_actsong).VideoFileName));
|
||||||
if (_video == -1)
|
if (_video == -1)
|
||||||
return;
|
return;
|
||||||
CVideo.VdSkip(_video, startposition, CSongs.VisibleSongs[_actsong].VideoGap);
|
_Base.Video.Skip(_video, startposition, _Base.Songs.GetVisibleSong(_actsong).VideoGap);
|
||||||
_VideoFadeTimer.Stop();
|
_VideoFadeTimer.Stop();
|
||||||
_VideoFadeTimer.Reset();
|
_VideoFadeTimer.Reset();
|
||||||
_VideoFadeTimer.Start();
|
_VideoFadeTimer.Start();
|
||||||
@@ -670,14 +668,14 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
{
|
{
|
||||||
foreach (int stream in _streams)
|
foreach (int stream in _streams)
|
||||||
{
|
{
|
||||||
CSound.FadeAndStop(stream, 0f, 0.75f);
|
_Base.Sound.FadeAndStop(stream, 0f, 0.75f);
|
||||||
}
|
}
|
||||||
_streams.Clear();
|
_streams.Clear();
|
||||||
|
|
||||||
CVideo.VdClose(_video);
|
_Base.Video.Close(_video);
|
||||||
_video = -1;
|
_video = -1;
|
||||||
|
|
||||||
CDraw.RemoveTexture(ref _vidtex);
|
_Base.Drawing.RemoveTexture(ref _vidtex);
|
||||||
|
|
||||||
_timer.Stop();
|
_timer.Stop();
|
||||||
_timer.Reset();
|
_timer.Reset();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using Vocaluxe.Lib.Song;
|
using Vocaluxe.Menu.SongMenu;
|
||||||
using Vocaluxe.PartyModes;
|
using Vocaluxe.PartyModes;
|
||||||
|
|
||||||
namespace Vocaluxe.Menu.SongMenu
|
namespace Vocaluxe.Menu.SongMenu
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Vocaluxe.Base;
|
|||||||
using Vocaluxe.GameModes;
|
using Vocaluxe.GameModes;
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
using Vocaluxe.Lib.Song;
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Vocaluxe.Base;
|
|||||||
using Vocaluxe.GameModes;
|
using Vocaluxe.GameModes;
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
using Vocaluxe.Lib.Song;
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.GameModes;
|
using Vocaluxe.GameModes;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Vocaluxe.Base;
|
|||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
using Vocaluxe.GameModes;
|
using Vocaluxe.GameModes;
|
||||||
|
|
||||||
using Vocaluxe.Lib.Song;
|
using Vocaluxe.Menu.SongMenu;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ using Vocaluxe.Base;
|
|||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
using Vocaluxe.Menu.SingNotes;
|
using Vocaluxe.Menu.SingNotes;
|
||||||
|
using Vocaluxe.Menu.SongMenu;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ using System.Windows.Forms;
|
|||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.GameModes;
|
using Vocaluxe.GameModes;
|
||||||
using Vocaluxe.Lib.Draw;
|
using Vocaluxe.Lib.Draw;
|
||||||
using Vocaluxe.Lib.Song;
|
|
||||||
using Vocaluxe.Menu;
|
using Vocaluxe.Menu;
|
||||||
using Vocaluxe.Menu.SongMenu;
|
using Vocaluxe.Menu.SongMenu;
|
||||||
using Vocaluxe.PartyModes;
|
using Vocaluxe.PartyModes;
|
||||||
@@ -814,7 +813,7 @@ namespace Vocaluxe.Screens
|
|||||||
id = CSongs.VisibleSongs[song].ID;
|
id = CSongs.VisibleSongs[song].ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
int visibleID = Array.FindIndex<Vocaluxe.Lib.Song.CSong>(CSongs.VisibleSongs, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
|
int visibleID = Array.FindIndex<CSong>(CSongs.VisibleSongs, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
|
||||||
if (visibleID > -1)
|
if (visibleID > -1)
|
||||||
{
|
{
|
||||||
id = visibleID;
|
id = visibleID;
|
||||||
|
|||||||
@@ -210,7 +210,7 @@
|
|||||||
<Compile Include="Lib\Playlist\CPlaylistFile.cs" />
|
<Compile Include="Lib\Playlist\CPlaylistFile.cs" />
|
||||||
<Compile Include="Menu\CParticle.cs" />
|
<Compile Include="Menu\CParticle.cs" />
|
||||||
<Compile Include="Menu\SingNotes\CNotes.cs" />
|
<Compile Include="Menu\SingNotes\CNotes.cs" />
|
||||||
<Compile Include="Lib\Song\CSong.cs" />
|
<Compile Include="Menu\SongMenu\CSong.cs" />
|
||||||
<Compile Include="Lib\Sound\CDirectSoundRecord.cs" />
|
<Compile Include="Lib\Sound\CDirectSoundRecord.cs" />
|
||||||
<Compile Include="Lib\Sound\COpenALPlay.cs" />
|
<Compile Include="Lib\Sound\COpenALPlay.cs" />
|
||||||
<Compile Include="Lib\Sound\COpenALRecord.cs" />
|
<Compile Include="Lib\Sound\COpenALRecord.cs" />
|
||||||
|
|||||||
Reference in new issue
Block a user