Merge remote-tracking branch 'voc/release-0.1' into release-0.1

This commit is contained in:
Florian Kuepper committed 2012-03-03 08:52:05 +01:00
commit 593fe04f20
49 files changed
+58117 -1603

No files matched your search

Binary file not shown.
+184
View File
@@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<Info>
<Name>Español</Name>
</Info>
<Texts>
<!--General-->
<TR_PROGRAM_NAME>Vocaluxe</TR_PROGRAM_NAME>
<TR_GENERAL_AND>y</TR_GENERAL_AND>
<!--General: Buttons-->
<TR_BUTTON_EXIT>Salir</TR_BUTTON_EXIT>
<TR_BUTTON_SAVE>Guardar</TR_BUTTON_SAVE>
<TR_BUTTON_BACK>Volver</TR_BUTTON_BACK>
<TR_BUTTON_START>Comenzar</TR_BUTTON_START>
<!--General: Debug-->
<TR_DEBUG_AUDIO_STREAMS>Streams de audio</TR_DEBUG_AUDIO_STREAMS>
<TR_DEBUG_VIDEO_STREAMS>Streams de video</TR_DEBUG_VIDEO_STREAMS>
<TR_DEBUG_TEXTURES>Texturas</TR_DEBUG_TEXTURES>
<TR_DEBUG_TONE_ABS>ToneAbs</TR_DEBUG_TONE_ABS>
<TR_DEBUG_MAX_VOLUME>Volumen Máx</TR_DEBUG_MAX_VOLUME>
<TR_DEBUG_MOUSE>Mouse</TR_DEBUG_MOUSE>
<!--General: Game-Modes-->
<TR_GAMEMODE_NORMAL>Normal</TR_GAMEMODE_NORMAL>
<TR_GAMEMODE_DUET>Dueto</TR_GAMEMODE_DUET>
<TR_GAMEMODE_MEDLEY>Medley</TR_GAMEMODE_MEDLEY>
<!--General: Ratings-->
<TR_RATING_VOCAL_HERO>Héroe Vocal</TR_RATING_VOCAL_HERO>
<TR_RATING_SUPERSTAR>Superestrella</TR_RATING_SUPERSTAR>
<TR_RATING_LEAD_SINGER>Vocalista Principal</TR_RATING_LEAD_SINGER>
<TR_RATING_RISING_STAR>Estrella Naciente</TR_RATING_RISING_STAR>
<TR_RATING_HOPEFUL>Prometedor</TR_RATING_HOPEFUL>
<TR_RATING_WANNABE>Aspirante</TR_RATING_WANNABE>
<TR_RATING_AMATEUR>Amateur</TR_RATING_AMATEUR>
<TR_RATING_TONE_DEAF>Sordo</TR_RATING_TONE_DEAF>
<!--Config-->
<!--Config: Renderer-->
<TR_CONFIG_SOFTWARE>Software</TR_CONFIG_SOFTWARE>
<TR_CONFIG_OPENGL>OpenGL</TR_CONFIG_OPENGL>
<TR_CONFIG_DIRECT3D>Direct3D</TR_CONFIG_DIRECT3D>
<!--Config: Texture-Quality-->
<TR_CONFIG_TEXTURE_LOWEST>Muy Baja</TR_CONFIG_TEXTURE_LOWEST>
<TR_CONFIG_TEXTURE_LOW>Baja</TR_CONFIG_TEXTURE_LOW>
<TR_CONFIG_TEXTURE_MEDIUM>Media</TR_CONFIG_TEXTURE_MEDIUM>
<TR_CONFIG_TEXTURE_HIGH>Alta</TR_CONFIG_TEXTURE_HIGH>
<TR_CONFIG_TEXTURE_HIGHEST>Muy Alta</TR_CONFIG_TEXTURE_HIGHEST>
<!--Config: On/Off-->
<TR_CONFIG_OFF>Off</TR_CONFIG_OFF>
<TR_CONFIG_ON>On</TR_CONFIG_ON>
<!--Config: Debug-Level-->
<TR_CONFIG_ONLY_FPS>Solo FPS</TR_CONFIG_ONLY_FPS>
<TR_CONFIG_LEVEL1>Nivel 1</TR_CONFIG_LEVEL1>
<TR_CONFIG_LEVEL2>Nivel 2</TR_CONFIG_LEVEL2>
<TR_CONFIG_LEVEL3>Nivel 3</TR_CONFIG_LEVEL3>
<TR_CONFIG_LEVEL_MAX>Máx</TR_CONFIG_LEVEL_MAX>
<!--Config: Song-Menu-Style-->
<TR_CONFIG_LIST>Lista</TR_CONFIG_LIST>
<TR_CONFIG_DREIDEL>Dreidel</TR_CONFIG_DREIDEL>
<TR_CONFIG_TILE_BOARD>TileBoard</TR_CONFIG_TILE_BOARD>
<TR_CONFIG_BOOK>Libro</TR_CONFIG_BOOK>
<!--Config: Cover-Loading-->
<TR_CONFIG_COVERLOADING_ONDEMAND>Según Sean Necesarias</TR_CONFIG_COVERLOADING_ONDEMAND>
<TR_CONFIG_COVERLOADING_ATSTART>Al Iniciar</TR_CONFIG_COVERLOADING_ATSTART>
<TR_CONFIG_COVERLOADING_DYNAMIC>Dinámica</TR_CONFIG_COVERLOADING_DYNAMIC>
<!--Config: Song-Sorting-->
<TR_CONFIG_NONE>Ninguno</TR_CONFIG_NONE>
<TR_CONFIG_RANDOM>Al Azar</TR_CONFIG_RANDOM>
<TR_CONFIG_FOLDER>Carpeta</TR_CONFIG_FOLDER>
<TR_CONFIG_ARTIST>Artista</TR_CONFIG_ARTIST>
<TR_CONFIG_ARTIST_LETTER>Letra del Artista</TR_CONFIG_ARTIST_LETTER>
<TR_CONFIG_TITLE_LETTER>Letra del Título</TR_CONFIG_TITLE_LETTER>
<TR_CONFIG_EDITION>Edición</TR_CONFIG_EDITION>
<TR_CONFIG_GENRE>Género</TR_CONFIG_GENRE>
<TR_CONFIG_YEAR>Año</TR_CONFIG_YEAR>
<TR_CONFIG_DECADE>Década</TR_CONFIG_DECADE>
<TR_CONFIG_LANGUAGE>Idioma</TR_CONFIG_LANGUAGE>
<!--Config: Game-Difficulty-->
<TR_CONFIG_EASY>Fácil</TR_CONFIG_EASY>
<TR_CONFIG_NORMAL>Normal</TR_CONFIG_NORMAL>
<TR_CONFIG_HARD>Difícil</TR_CONFIG_HARD>
<!--Config: Timer-Mode-->
<TR_CONFIG_TIMERMODE_CURRENT>Actual</TR_CONFIG_TIMERMODE_CURRENT>
<TR_CONFIG_TIMERMODE_REMAINING>Restante</TR_CONFIG_TIMERMODE_REMAINING>
<TR_CONFIG_TIMERMODE_TOTAL>Total</TR_CONFIG_TIMERMODE_TOTAL>
<!--Config: Timer-Look-->
<TR_CONFIG_TIMERLOOK_NORMAL>Normal</TR_CONFIG_TIMERLOOK_NORMAL>
<TR_CONFIG_TIMERLOOK_EXPANDED>Expandido</TR_CONFIG_TIMERLOOK_EXPANDED>
<!--Config: Background-Music-Source-->
<TR_CONFIG_OWN_MUSIC>Canciones del juego y tema Vocaluxe</TR_CONFIG_OWN_MUSIC>
<TR_CONFIG_NO_OWN_MUSIC>Sin canciones del juego</TR_CONFIG_NO_OWN_MUSIC>
<TR_CONFIG_ONLY_OWN_MUSIC>Solo canciones del juego</TR_CONFIG_ONLY_OWN_MUSIC>
<!--Screens-->
<!--ScreenLoad-->
<TR_SCREENLOAD_LOADING>Cargando...</TR_SCREENLOAD_LOADING>
<TR_SCREENLOAD_TOTAL>Total</TR_SCREENLOAD_TOTAL>
<TR_SCREENLOAD_SONGS>Canciones</TR_SCREENLOAD_SONGS>
<TR_SCREENLOAD_LOADED>cargadas</TR_SCREENLOAD_LOADED>
<!--ScreenMain-->
<TR_SCREENMAIN_MENU>Menú Principal</TR_SCREENMAIN_MENU>
<TR_SCREENMAIN_BUTTON_SING>Cantar</TR_SCREENMAIN_BUTTON_SING>
<TR_SCREENMAIN_BUTTON_OPTIONS>Opciones</TR_SCREENMAIN_BUTTON_OPTIONS>
<TR_SCREENMAIN_BUTTON_PROFILES>Perfiles</TR_SCREENMAIN_BUTTON_PROFILES>
<!--ScreenNames-->
<TR_SCREENNAMES_MENU>Selección de Jugadores</TR_SCREENNAMES_MENU>
<TR_SCREENNAMES_BUTTON_1PLAYER>Jugador 1</TR_SCREENNAMES_BUTTON_1PLAYER>
<TR_SCREENNAMES_BUTTON_2PLAYER>Jugador 2</TR_SCREENNAMES_BUTTON_2PLAYER>
<TR_SCREENNAMES_BUTTON_3PLAYER>Jugador 3</TR_SCREENNAMES_BUTTON_3PLAYER>
<TR_SCREENNAMES_WARNING_SG>Advertencia: ¡No hay micrófonos asignados al jugador %v!</TR_SCREENNAMES_WARNING_SG>
<TR_SCREENNAMES_WARNING_PL>Advertencia: ¡No hay micrófonos asignados a los jugadores %v!</TR_SCREENNAMES_WARNING_PL>
<!--ScreenSong-->
<TR_SCREENSONG_MENU>Selección de Canciones</TR_SCREENSONG_MENU>
<TR_SCREENSONG_SEARCH>Buscar:</TR_SCREENSONG_SEARCH>
<TR_SCREENSONG_NOLANGUAGE>Sin Idioma</TR_SCREENSONG_NOLANGUAGE>
<TR_SCREENSONG_NOYEAR>Sin Año</TR_SCREENSONG_NOYEAR>
<TR_SCREENSONG_NOGENRE>Sin Género</TR_SCREENSONG_NOGENRE>
<TR_SCREENSONG_NOEDITION>Sin Edición</TR_SCREENSONG_NOEDITION>
<TR_SCREENSONG_ALLSONGS>Todas las Canciones</TR_SCREENSONG_ALLSONGS>
<TR_SCREENSONG_NUMSONGS>(%v Canciones)</TR_SCREENSONG_NUMSONGS>
<TR_SCREENSONG_NUMSONG>(%v Canción)</TR_SCREENSONG_NUMSONG>
<!--ScreenSing-->
<TR_SCREENSING_PAUSE>Pausa</TR_SCREENSING_PAUSE>
<TR_SCREENSING_BUTTON_CANCEL>Dejar de cantar</TR_SCREENSING_BUTTON_CANCEL>
<TR_SCREENSING_BUTTON_CONTINUE>Continuar</TR_SCREENSING_BUTTON_CONTINUE>
<!--ScreenScore-->
<TR_SCREENSCORE_SCORES>Resultados</TR_SCREENSCORE_SCORES>
<TR_SCREENSCORE_RATING>Rating</TR_SCREENSCORE_RATING>
<TR_SCREENSCORE_POINTS>Puntuación</TR_SCREENSCORE_POINTS>
<TR_SCREENSCORE_GAMEDIFFICULTY>Dificultad</TR_SCREENSCORE_GAMEDIFFICULTY>
<!--ScreenHighscore-->
<TR_SCREENHIGHSCORE_HIGHSCORE>Alta Puntuación</TR_SCREENHIGHSCORE_HIGHSCORE>
<!--ScreenProfiles-->
<TR_SCREENPROFILES_PROFILES>Perfiles</TR_SCREENPROFILES_PROFILES>
<TR_SCREENPROFILES_PLAYERNAME>Nombre del Jugador</TR_SCREENPROFILES_PLAYERNAME>
<TR_SCREENPROFILES_GAMEDIFFICULTY>Dificultad del Juego</TR_SCREENPROFILES_GAMEDIFFICULTY>
<TR_SCREENPROFILES_AVATAR>Avatar</TR_SCREENPROFILES_AVATAR>
<TR_SCREENPROFILES_GUESTPROFILE>Perfil Invitado</TR_SCREENPROFILES_GUESTPROFILE>
<TR_SCREENPROFILES_ACTIVE>Activa</TR_SCREENPROFILES_ACTIVE>
<TR_SCREENPROFILES_BUTTON_NEW>Nuevo</TR_SCREENPROFILES_BUTTON_NEW>
<TR_SCREENPROFILES_BUTTON_DELETE>Eliminar</TR_SCREENPROFILES_BUTTON_DELETE>
<!--ScreenOptions-->
<TR_SCREENO_OPTIONS>Opciones del Menú</TR_SCREENO_OPTIONS>
<TR_SCREENO_BUTTON_GAME>Juego</TR_SCREENO_BUTTON_GAME>
<TR_SCRENNO_BUTTON_SOUND>Sonido</TR_SCRENNO_BUTTON_SOUND>
<TR_SCREENO_BUTTON_RECORD>Grabación</TR_SCREENO_BUTTON_RECORD>
<TR_SCREENO_BUTTON_VIDEO>Video</TR_SCREENO_BUTTON_VIDEO>
<TR_SCREENO_BUTTON_THEME>Estilos</TR_SCREENO_BUTTON_THEME>
<!--ScreenOptionsGame-->
<TR_SCREENOGAME_OPTIONS>Opciones del Juego</TR_SCREENOGAME_OPTIONS>
<TR_SCREENOGAME_LANGUAGE>Idioma</TR_SCREENOGAME_LANGUAGE>
<TR_SCREENOGAME_DEBUGLEVEL>Nivel de Depuración</TR_SCREENOGAME_DEBUGLEVEL>
<TR_SCREENOGAME_SONGMENU>Menú de Canciones</TR_SCREENOGAME_SONGMENU>
<TR_SCREENOGAME_SONGSORTING>Organización de Canciones</TR_SCREENOGAME_SONGSORTING>
<TR_SCREENOGAME_TABS>Etiquetas</TR_SCREENOGAME_TABS>
<TR_SCREENOGAME_DIFFICULTY>Dificultad del Juego</TR_SCREENOGAME_DIFFICULTY>
<TR_SCREENOGAME_TIMERMODE>Modo del Timer</TR_SCREENOGAME_TIMERMODE>
<!--ScreenOptionsRecord-->
<TR_SCREENORECORD_OPTIONS>Opciones de Grabación</TR_SCREENORECORD_OPTIONS>
<TR_SCREENORECORD_DEVICE>Dispositivo</TR_SCREENORECORD_DEVICE>
<TR_SCREENORECORD_INPUT>Entrada</TR_SCREENORECORD_INPUT>
<TR_SCREENORECORD_CHANNEL_1>Canal 1</TR_SCREENORECORD_CHANNEL_1>
<TR_SCREENORECORD_CHANNEL_2>Canal 2</TR_SCREENORECORD_CHANNEL_2>
<TR_SCREENORECORD_MIC_DELAY>Retraso del Micrófono</TR_SCREENORECORD_MIC_DELAY>
<TR_SCREENORECORD_MIC_WARNING>Advertencia: Al menos un jugador ha sido asignado a dos micrófonos.</TR_SCREENORECORD_MIC_WARNING>
<TR_SCREENORECORD_BUTTON_DELAYTEST>Prueba de Retraso</TR_SCREENORECORD_BUTTON_DELAYTEST>
<!--ScreenOptionsSound-->
<TR_SCREENOSOUND_OPTIONS>Opciones de Sonido</TR_SCREENOSOUND_OPTIONS>
<TR_SCREENOSOUND_BACKGROUNDMUSIC>Música de Fondo</TR_SCREENOSOUND_BACKGROUNDMUSIC>
<TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>Volumen de la Música de Fondo</TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>
<TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>Origen de la Música de Fondo</TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>
<!--ScreenOptionsTheme-->
<TR_SCREENOTHEME_OPTIONS>Opciones de Estilo</TR_SCREENOTHEME_OPTIONS>
<TR_SCREENOTHEME_THEME>Estilo</TR_SCREENOTHEME_THEME>
<TR_SCREENOTHEME_SKIN>Skin</TR_SCREENOTHEME_SKIN>
<TR_SCREENOTHEME_COVERTHEME>Estilo de Carátulas</TR_SCREENOTHEME_COVERTHEME>
<TR_SCREENOTHEME_NOTELINES>Mostrar Líneas de las Notas</TR_SCREENOTHEME_NOTELINES>
<TR_SCREENOTHEME_TONEHELPER>Mostrar Guía de Tonos</TR_SCREENOTHEME_TONEHELPER>
<TR_SCREENOTHEME_TIMERLOOK>Aspecto del Timer</TR_SCREENOTHEME_TIMERLOOK>
<TR_SCREENOTHEME_COVERLOADING>Comportamiento de la Carga de Carátulas</TR_SCREENOTHEME_COVERLOADING>
<!--ScreenOptionsVideo-->
<TR_SCREENOVIDEO_OPTIONS>Opciones de Video</TR_SCREENOVIDEO_OPTIONS>
<TR_SCREENOVIDEO_VIDEOBACKGROUNDS>Videos de Fondo</TR_SCREENOVIDEO_VIDEOBACKGROUNDS>
<TR_SCREENOVIDEO_VIDEOPREVIEW>Previsualización del Video</TR_SCREENOVIDEO_VIDEOPREVIEW>
<TR_SCREENOVIDEO_VIDEOINSONGS>Videos al Cantar</TR_SCREENOVIDEO_VIDEOINSONGS>
</Texts>
</root>
-31
View File
@@ -1,31 +0,0 @@
Microsoft Public License (Ms-PL)
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
BIN
View File
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
<configuration>
<dllmap os="linux" dll="PortAudio.dll" target="libportaudio.so"/>
</configuration>
+1 -1
View File
@@ -4,7 +4,7 @@
<ScreenVersion>1</ScreenVersion>
<Background1>
<!--<Type>: Background type: None, Color, Texture, Video-->
<Type>None</Type>
<Type>Texture</Type>
<!--<Video>: Background video name-->
<Video>BG_Video</Video>
<!--<Skin>: Background Texture name-->
-7
View File
@@ -1,7 +0,0 @@
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
<dllmap os="linux" dll="PortAudio.dll" target="libportaudio.so.2"/>
</startup>
</configuration>
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
<configuration>
<dllmap os="linux" dll="acinerella.dll" target="libacinerella.so"/>
</configuration>
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+57639
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
+6
View File
@@ -5,12 +5,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vocaluxe", "Vocaluxe\Vocalu
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x64.ActiveCfg = Debug|x64
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x64.Build.0 = Debug|x64
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x86.ActiveCfg = Debug|x86
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Debug|x86.Build.0 = Debug|x86
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x64.ActiveCfg = Release|x64
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x64.Build.0 = Release|x64
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x86.ActiveCfg = Release|x86
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.Release|x86.Build.0 = Release|x86
EndGlobalSection
+2 -5
View File
@@ -68,15 +68,12 @@ namespace Vocaluxe.Base
public enum EPlaybackLib
{
BASS,
PortAudio,
NAudio,
OpenAL
}
public enum ERecordLib
{
BASS,
PortAudio
}
@@ -188,11 +185,11 @@ namespace Vocaluxe.Base
// Game
public static List<string> SongFolder = new List<string>();
public static ESongMenu SongMenu = ESongMenu.TR_CONFIG_TILE_BOARD;
public static ESongSorting SongSorting = ESongSorting.TR_CONFIG_FOLDER;
public static ESongSorting SongSorting = ESongSorting.TR_CONFIG_ARTIST;
public static float ScoreAnimationTime = 10;
public static ETimerMode TimerMode = ETimerMode.TR_CONFIG_TIMERMODE_REMAINING;
public static int NumPlayer = 2;
public static EOffOn Tabs = EOffOn.TR_CONFIG_ON;
public static EOffOn Tabs = EOffOn.TR_CONFIG_OFF;
public static string Language = "English";
public static EOffOn LyricsOnTop = EOffOn.TR_CONFIG_OFF;
+14
View File
@@ -265,6 +265,20 @@ namespace Vocaluxe.Base
private static bool InitHighscoreDB()
{
string OldDBFilePath = Path.Combine(Environment.CurrentDirectory, CSettings.sFileOldHighscoreDB);
if (File.Exists(OldDBFilePath))
{
if (File.Exists(_HighscoreFilePath))
{
CLog.LogError("Found old Highscore DB (" + OldDBFilePath + "). If you want to import it just delete the new one (" + _HighscoreFilePath + ")");
}
else
{
File.Copy(OldDBFilePath, _HighscoreFilePath);
File.Move(OldDBFilePath, OldDBFilePath + ".old");
}
}
SQLiteConnection connection = new SQLiteConnection();
connection.ConnectionString = "Data Source=" + _HighscoreFilePath;
SQLiteCommand command;
+67 -6
View File
@@ -319,6 +319,7 @@ namespace Vocaluxe.Base
{
#region private vars
private string _TextureName;
private STexture _Texture;
private SRectF _Rect;
private float _Size;
private SColorF _Color;
@@ -333,7 +334,7 @@ namespace Vocaluxe.Base
private float _Vsize; //size changing speed: period [s]
private float _LastTime;
private EParticeType _Type;
private Stopwatch _Timer;
#endregion private vars
@@ -386,6 +387,7 @@ namespace Vocaluxe.Base
public CParticle(string textureName, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize, EParticeType type)
{
_TextureName = textureName;
_Texture = new STexture(-1);
_Color = color;
_Rect = new SRectF(x, y, size, size, z);
_Size = size;
@@ -403,6 +405,29 @@ namespace Vocaluxe.Base
_MaxAge = maxage;
_Rotation = (float)(CGame.Rand.NextDouble() * 360.0);
}
public CParticle(STexture texture, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize, EParticeType type)
{
_TextureName = String.Empty;
_Texture = texture;
_Color = color;
_Rect = new SRectF(x, y, size, size, z);
_Size = size;
_Alpha = 1f;
_Angle = 0f;
_Vx = vx;
_Vy = vy;
_Vr = vr;
_Vsize = vsize;
_LastTime = 0f;
_Type = type;
_Timer = new Stopwatch();
_Age = 0f;
_MaxAge = maxage;
_Rotation = (float)(CGame.Rand.NextDouble() * 360.0);
}
#endregion Constructors
public void Update()
@@ -553,7 +578,10 @@ namespace Vocaluxe.Base
public void Draw()
{
CDraw.DrawTexture(CTheme.GetSkinTexture(_TextureName), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
if (_TextureName != String.Empty)
CDraw.DrawTexture(CTheme.GetSkinTexture(_TextureName), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
else
CDraw.DrawTexture(_Texture, _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
}
}
@@ -561,6 +589,7 @@ namespace Vocaluxe.Base
{
private List<CParticle> _Stars;
private string _TextureName;
private STexture _Texture;
private int _MaxNumber;
private SRectF _Area;
private SColorF _Color;
@@ -579,12 +608,33 @@ namespace Vocaluxe.Base
}
}
public SRectF Area
{
get { return _Area; }
set { _Area = value; }
}
public CParticleEffect(int MaxNumber, SColorF Color, SRectF Area, string TextureName, float Size, EParticeType Type)
{
_Stars = new List<CParticle>();
_Area = Area;
_Color = Color;
_TextureName = TextureName;
_Texture = new STexture(-1);
_MaxNumber = MaxNumber;
_Size = Size;
_Type = Type;
_SpawnTimer = new Stopwatch();
_NextSpawnTime = 0f;
}
public CParticleEffect(int MaxNumber, SColorF Color, SRectF Area, STexture texture, float Size, EParticeType Type)
{
_Stars = new List<CParticle>();
_Area = Area;
_Color = Color;
_TextureName = String.Empty;
_Texture = texture;
_MaxNumber = MaxNumber;
_Size = Size;
_Type = Type;
@@ -682,10 +732,21 @@ namespace Vocaluxe.Base
if (h < 0)
h = 0;
CParticle star = new CParticle(_TextureName, _Color,
CGame.Rand.Next(w) + _Area.X - size / 4f,
CGame.Rand.Next(h) + _Area.Y - size / 4f,
size, lifetime, _Area.Z, vx, vy, vr, vsize, _Type);
CParticle star;
if (_TextureName != String.Empty)
{
star = new CParticle(_TextureName, _Color,
CGame.Rand.Next(w) + _Area.X - size / 4f,
CGame.Rand.Next(h) + _Area.Y - size / 4f,
size, lifetime, _Area.Z, vx, vy, vr, vsize, _Type);
}
else
{
star = new CParticle(_Texture, _Color,
CGame.Rand.Next(w) + _Area.X - size / 4f,
CGame.Rand.Next(h) + _Area.Y - size / 4f,
size, lifetime, _Area.Z, vx, vy, vr, vsize, _Type);
}
_Stars.Add(star);
}
+18 -2
View File
@@ -20,8 +20,23 @@ namespace Vocaluxe.Base
Release
}
enum EArch
{
x86,
x64
}
static class CSettings
{
#if ARCH_X86
public const EArch ARCH = EArch.x86;
#endif
#if ARCH_X64
public const EArch ARCH = EArch.x64;
#endif
public static EGameState GameState = EGameState.Start;
public const string sProgramName = "Vocaluxe";
@@ -32,7 +47,7 @@ namespace Vocaluxe.Base
public const int iVersionSub = 0; // steps
public const ERevision VersionRevision = ERevision.Beta;
public const int iBuild = 52; // Increase on every published version! Never Reset!
public const int iBuild = 53; // Increase on every published version! Never Reset!
public const int iDatabaseHighscoreVersion = 1;
public const int iDatabaseCoverVersion = 1;
@@ -55,6 +70,7 @@ namespace Vocaluxe.Base
public const string sFileCover = "Cover.xml";
public const string sFileFonts = "Fonts.xml";
public const string sFileOldHighscoreDB = "Ultrastar.db";
public static string sFileHighscoreDB = "HighscoreDB.sqlite";
public const string sFileCoverDB = "CoverDB.sqlite";
public const string sFileCreditsRessourcesDB = "CreditsRessourcesDB.sqlite";
@@ -103,7 +119,7 @@ namespace Vocaluxe.Base
{
string sVersion = "v" + iVersionMajor.ToString() + "." +
iVersionMinor.ToString() + "." +
iVersionSub.ToString();
iVersionSub.ToString() + " (" + Enum.GetName(typeof(EArch), ARCH) + ")";
if (VersionRevision != ERevision.Release)
sVersion += " " + GetVersionStatus() + String.Format(" ({0:0000)}", iBuild);
+2 -14
View File
@@ -22,24 +22,16 @@ namespace Vocaluxe.Base
{
switch (CConfig.PlayBackLib)
{
case EPlaybackLib.BASS:
_Playback = new CBassPlay();
break;
case EPlaybackLib.PortAudio:
_Playback = new CPortAudioPlay();
break;
case EPlaybackLib.NAudio:
_Playback = new CNAudioPlay();
break;
case EPlaybackLib.OpenAL:
_Playback = new COpenALPlay();
break;
default:
_Playback = new CBassPlay();
_Playback = new CPortAudioPlay();
break;
}
return true;
@@ -186,16 +178,12 @@ namespace Vocaluxe.Base
{
switch (CConfig.RecordLib)
{
case ERecordLib.BASS:
_Record = new CBassRecord();
break;
case ERecordLib.PortAudio:
_Record = new CPortAudioRecord();
break;
default:
_Record = new CBassRecord();
_Record = new CPortAudioRecord();
break;
}
+8 -3
View File
@@ -72,15 +72,15 @@
-------------------------------------------------------------
+ v0.1.0:
- Menu Background Music
- Theme System Update
- A nicer Theme!
+ v0.2.0:
- Menu Background Music
- Medley
- WiiMote Support
- OnScreen Keyboard?
- Kinect Support?
- Jukebox light (bg music controls)
- Show Avatars and Player Name in Sing Screen (and perhaps some other screens)
+ v0.3.0:
- Song Editor
@@ -92,6 +92,7 @@
+ v0.4.0:
- Challenge Mode (with more than 2 player at once)
- More Player at once
+ v0.5.0:
- Party Mode: Team-Battle
@@ -114,3 +115,7 @@
- ?
-----------------
just some ideas:
- OnScreen Keyboard?
- Kinect Support?
-483
View File
@@ -1,483 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Xml;
using System.Xml.XPath;
using Un4seen.Bass;
using Vocaluxe.Base;
namespace Vocaluxe.Lib.Sound
{
class CBassPlay: IPlayback
{
private bool _Initialized = false;
private List<AudioStreams> _Streams;
private SYNCPROC _SyncSlideAndStop;
private SYNCPROC _SyncSlideAndPause;
private Object MutexAudioStreams = new Object();
public CBassPlay()
{
Init();
}
public bool Init()
{
if (_Initialized)
return true;
#region Registration
string EMail = String.Empty;
string Code = String.Empty;
ReadRegistrationFile(Path.Combine(Environment.CurrentDirectory, CSettings.sBassRegistration), ref EMail, ref Code);
if (EMail == String.Empty || Code == String.Empty)
WriteRegistrationFile(Path.Combine(Environment.CurrentDirectory, CSettings.sBassRegistration), "your mail adress", "your registration code");
else
BassNet.Registration(EMail, Code);
#endregion Registration
bool ok = false;
try
{
ok = Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
_Streams = new List<AudioStreams>();
_SyncSlideAndStop = new SYNCPROC(EndSync);
_SyncSlideAndPause = new SYNCPROC(PauseSync);
}
catch (Exception)
{
ok = false;
}
_Initialized = ok;
return ok;
}
public void CloseAll()
{
while (_Streams.Count > 0)
{
Close(_Streams[_Streams.Count - 1].handle);
}
lock (MutexAudioStreams)
{
_Streams.Clear();
}
}
public void SetGlobalVolume(float Volume)
{
if (_Initialized)
{
Bass.BASS_SetVolume(Volume / 100f);
}
}
public int GetStreamCount()
{
if (!_Initialized)
return 0;
lock (MutexAudioStreams)
{
return _Streams.Count;
}
}
public void Update()
{
}
#region Stream Handling
public int Load(string Media)
{
return Load(Media, false);
}
public int Load(string Media, bool Prescan)
{
if (!_Initialized)
return 0;
BASSFlag flags = BASSFlag.BASS_DEFAULT;
if (Prescan)
flags = BASSFlag.BASS_STREAM_PRESCAN;
AudioStreams stream = new AudioStreams(0);
stream.handle = Bass.BASS_StreamCreateFile(Media, 0L, 0L, flags);
if (stream.handle != 0)
{
stream.file = Media;
lock (MutexAudioStreams)
{
_Streams.Add(stream);
}
return stream.handle;
}
return 0;
}
public void Close(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
Bass.BASS_StreamFree(Stream);
_Streams.RemoveAt(GetStreamIndex(Stream));
}
}
}
}
public void Play(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
Play(Stream, false);
}
}
}
}
public void Play(int Stream, bool Loop)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
if (Loop)
Bass.BASS_ChannelFlags(Stream, BASSFlag.BASS_SAMPLE_LOOP, BASSFlag.BASS_SAMPLE_LOOP);
Bass.BASS_ChannelPlay(Stream, false);
}
}
}
}
public void Pause(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
Bass.BASS_ChannelPause(Stream);
}
}
}
}
public void Stop(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
Bass.BASS_ChannelStop(Stream);
}
}
}
}
public void Fade(int Stream, float TargetVolume, float Seconds)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
Bass.BASS_ChannelSlideAttribute(Stream, BASSAttribute.BASS_ATTRIB_VOL, TargetVolume/100f, (int)Math.Round(Seconds*1000f));
}
}
}
}
public void FadeAndPause(int Stream, float TargetVolume, float Seconds)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
Bass.BASS_ChannelSlideAttribute(Stream, BASSAttribute.BASS_ATTRIB_VOL, TargetVolume / 100f, (int)Math.Round(Seconds * 1000f));
Bass.BASS_ChannelSetSync(Stream, BASSSync.BASS_SYNC_SLIDE, 0L, _SyncSlideAndPause, IntPtr.Zero);
}
}
}
}
public void FadeAndStop(int Stream, float TargetVolume, float Seconds)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
Bass.BASS_ChannelSlideAttribute(Stream, BASSAttribute.BASS_ATTRIB_VOL, TargetVolume / 100f, (int)Math.Round(Seconds * 1000f));
Bass.BASS_ChannelSetSync(Stream, BASSSync.BASS_SYNC_SLIDE, 0L, _SyncSlideAndStop, IntPtr.Zero);
}
}
}
}
public void SetStreamVolume(int Stream, float Volume)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
Bass.BASS_ChannelSetAttribute(Stream, BASSAttribute.BASS_ATTRIB_VOL, Volume / 100f);
}
}
}
}
public float GetLength(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
long len = Bass.BASS_ChannelGetLength(Stream);
return (float)Bass.BASS_ChannelBytes2Seconds(Stream, len);
}
}
return 0f;
}
return 0f;
}
public float GetPosition(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
long pos = Bass.BASS_ChannelGetPosition(Stream);
return (float)Bass.BASS_ChannelBytes2Seconds(Stream, pos);
}
}
return 0f;
}
return 0f;
}
public bool IsPlaying(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
return (Bass.BASS_ChannelIsActive(Stream) == BASSActive.BASS_ACTIVE_PLAYING);
}
}
}
return false;
}
public bool IsPaused(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
return (Bass.BASS_ChannelIsActive(Stream) == BASSActive.BASS_ACTIVE_PAUSED);
}
}
}
return false;
}
public bool IsFinished(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
return (Bass.BASS_ChannelIsActive(Stream) == BASSActive.BASS_ACTIVE_STOPPED);
}
}
}
return true;
}
public void SetPosition(int Stream, float Position)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
Bass.BASS_ChannelSetPosition(Stream, Position);
}
}
}
}
#endregion Stream Handling
private bool AlreadyAdded(int Stream)
{
foreach (AudioStreams st in _Streams)
{
if (st.handle == Stream)
{
return true;
}
}
return false;
}
private int GetStreamIndex(int Stream)
{
for (int i = 0; i < _Streams.Count; i++)
{
if (_Streams[i].handle == Stream)
return i;
}
return -1;
}
private void PauseSync(int handle, int Stream, int data, IntPtr user)
{
if (_Initialized)
{
if (AlreadyAdded(Stream))
{
Pause(Stream);
}
}
}
private void EndSync(int handle, int Stream, int data, IntPtr user)
{
if (_Initialized)
{
if (AlreadyAdded(Stream))
{
Close(Stream);
}
}
}
private void ReadRegistrationFile(string FileName, ref string Email, ref string Code)
{
#region Inits
bool loaded = false;
XPathDocument xPathDoc = null;
XPathNavigator navigator = null;
try
{
xPathDoc = new XPathDocument(FileName);
navigator = xPathDoc.CreateNavigator();
loaded = true;
}
catch (Exception)
{
loaded = false;
if (navigator != null)
navigator = null;
if (xPathDoc != null)
xPathDoc = null;
}
#endregion Inits
if (loaded)
{
CHelper.GetValueFromXML("//root/Registration/EMail", navigator, ref Email, String.Empty);
CHelper.GetValueFromXML("//root/Registration/Code", navigator, ref Code, String.Empty);
}
}
private void WriteRegistrationFile(string FileName, string Email, string Code)
{
XmlWriterSettings _settings = new XmlWriterSettings();
_settings.Indent = true;
_settings.Encoding = Encoding.UTF8;
_settings.ConformanceLevel = ConformanceLevel.Document;
XmlWriter writer;
try
{
writer = XmlWriter.Create(FileName, _settings);
}
catch (Exception)
{
return;
}
writer.WriteStartDocument();
writer.WriteStartElement("root");
writer.WriteStartElement("Registration");
writer.WriteComment("Register your BASS.NET version and suppress the freeware splash screen (http://bass.radio42.com/bass_register.html)");
writer.WriteElementString("EMail", Email);
writer.WriteElementString("Code", Code);
writer.WriteEndElement();
// End of File
writer.WriteEndElement(); //end of root
writer.WriteEndDocument();
writer.Flush();
writer.Close();
}
}
}
-220
View File
@@ -1,220 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using Un4seen.Bass;
using Vocaluxe.Base;
namespace Vocaluxe.Lib.Sound
{
class CBassRecord: IRecord
{
private List<SRecordDevice> _Devices = null;
private SRecordDevice[] _DeviceConfig;
private RECORDPROC _myRecProc;
private int[] _recHandle;
private CBuffer[] _Buffer;
public CBassRecord()
{
Init();
_Buffer = new CBuffer[CSettings.MaxNumPlayer];
for (int i = 0; i < _Buffer.Length; i++)
{
_Buffer[i] = new CBuffer();
}
_recHandle = new int[_Devices.Count];
_myRecProc = new RECORDPROC(MyRecording);
_DeviceConfig = _Devices.ToArray();
}
public bool Init()
{
_Devices = new List<SRecordDevice>();
try
{
BASS_DEVICEINFO info = new BASS_DEVICEINFO();
for (int n = 0; Bass.BASS_RecordGetDeviceInfo(n, info); n++)
{
if (info.IsEnabled)
{
SRecordDevice dev = new SRecordDevice();
dev.ID = n;
dev.Name = info.name;
dev.Driver = info.driver;
dev.Inputs = new List<SInput>();
if (Bass.BASS_RecordInit(n))
{
string name = String.Empty;
for (int j = 0; ((name = Bass.BASS_RecordGetInputName(j)) != null); j++)
{
SInput inp = new SInput();
inp.Name = name;
inp.Channels = 2; //TODO: how to retrieve the amount of channels?
dev.Inputs.Add(inp);
}
_Devices.Add(dev);
Bass.BASS_RecordFree();
}
}
}
}
catch (Exception)
{
//throw;
}
return true;
}
public bool Start(SRecordDevice[] DeviceConfig)
{
for (int i = 0; i < _Buffer.Length; i++)
{
_Buffer[i].Reset();
}
for (int i = 0; i < _recHandle.Length; i++)
{
_recHandle[i] = -1;
}
_DeviceConfig = DeviceConfig;
bool[] active = new bool[DeviceConfig.Length];
for (int dev = 0; dev < DeviceConfig.Length; dev++)
{
active[dev] = false;
for (int inp = 0; inp < DeviceConfig[dev].Inputs.Count; inp++)
{
if (DeviceConfig[dev].Inputs[inp].PlayerChannel1 > 0 ||
DeviceConfig[dev].Inputs[inp].PlayerChannel2 > 0)
active[dev] = true;
}
}
bool result = true;
for (int i = 0; i < _recHandle.Length; i++)
{
if (active[i])
{
if (Bass.BASS_RecordInit(i))
{
_recHandle[i] = Bass.BASS_RecordStart(44100, 2, BASSFlag.BASS_RECORD_PAUSE, 20, _myRecProc, IntPtr.Zero);
// start recording
result |= Bass.BASS_ChannelPlay(_recHandle[i], false);
}
}
}
return result;
}
public bool Stop()
{
for (int i = 0; i < _recHandle.Length; i++)
{
Bass.BASS_ChannelStop(_recHandle[i]);
}
Bass.BASS_RecordFree();
//System.IO.File.Delete("test0.raw");
//System.IO.File.Delete("test1.raw");
//System.IO.File.WriteAllBytes("test0.raw", _Buffer[0].Buffer);
//System.IO.File.WriteAllBytes("test1.raw", _Buffer[1].Buffer);
return true;
}
public void CloseAll()
{
Stop();
}
public void AnalyzeBuffer(int Player)
{
_Buffer[Player].AnalyzeBuffer();
}
public int GetToneAbs(int Player)
{
return _Buffer[Player].ToneAbs;
}
public int GetTone(int Player)
{
return _Buffer[Player].Tone;
}
public void SetTone(int Player, int Tone)
{
_Buffer[Player].Tone = Tone;
}
public float GetMaxVolume(int Player)
{
return _Buffer[Player].MaxVolume;
}
public bool ToneValid(int Player)
{
return _Buffer[Player].ToneValid;
}
public SRecordDevice[] RecordDevices()
{
return _Devices.ToArray();
}
private bool MyRecording(int handle, IntPtr buffer, int length, IntPtr user)
{
bool cont = true;
if (length > 0 && buffer != IntPtr.Zero)
{
byte[] _recbuffer = new byte[length];
byte[] _leftBuffer = new byte[length / 2];
byte[] _rightBuffer = new byte[length / 2];
// copy from managed to unmanaged memory
Marshal.Copy(buffer, _recbuffer, 0, length);
// copy into left/right Buffer
for (int i = 0; i < length / 2; i++)
{
_leftBuffer[i] = _recbuffer[i * 2 - (i % 2)];
_rightBuffer[i] = _recbuffer[i * 2 - (i % 2) + 2];
}
for (int i = 0; i < _recHandle.Length; i++)
{
if (_recHandle[i] == handle)
{
if (_DeviceConfig[i].Inputs[0].PlayerChannel1 > 0)
_Buffer[_DeviceConfig[i].Inputs[0].PlayerChannel1 - 1].ProcessNewBuffer(_leftBuffer);
if (_DeviceConfig[i].Inputs[0].PlayerChannel2 > 0)
_Buffer[_DeviceConfig[i].Inputs[0].PlayerChannel2 - 1].ProcessNewBuffer(_rightBuffer);
break;
}
}
}
return cont;
}
}
}
-740
View File
@@ -1,740 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Xml;
using System.Xml.XPath;
using NAudio;
using NAudio.Wave;
using NAudio.CoreAudioApi;
using Vocaluxe.Base;
namespace Vocaluxe.Lib.Sound
{
class NAudioStream
{
const float DELAY = 0.15f;
private string _FileName;
private IWavePlayer _waveOutDevice;
private WaveStream _mainOutputStream;
private WaveChannel32 _volumeStream;
private bool _loaded;
private float _Volume = 1f;
private float _Position = 0f;
private Stopwatch _Timer;
private float _CurrentTime = 0f;
private Stopwatch _fadeTimer;
private float _fadeTime;
private float _targetVolume;
private float _startVolume;
private bool _closeStreamAfterFade = false;
private bool _pauseStreamAfterFade = false;
private bool _fading = false;
public int Handle;
public NAudioStream(string FileName)
{
_loaded = false;
_FileName = FileName;
Handle = 0;
_Timer = new Stopwatch();
_fadeTimer = new Stopwatch();
try
{
_waveOutDevice = new WaveOut();
_mainOutputStream = CreateInputStream(FileName);
_waveOutDevice.Init(_mainOutputStream);
}
catch (Exception)
{
_loaded = false;
}
_loaded = true;
}
public void Play()
{
if (_loaded)
{
if (IsPaused())
{
_waveOutDevice.Play();
_Timer.Start();
}
else
{
_waveOutDevice.Play();
Position = _Position;
Volume = _Volume;
_CurrentTime = Position;
_Timer.Start();
}
_pauseStreamAfterFade = false;
}
}
public void Stop()
{
if (_loaded)
{
_waveOutDevice.Stop();
_Timer.Stop();
_Timer.Reset();
_Position = 0f;
_CurrentTime = _Position;
}
}
public void Pause()
{
if (_loaded)
{
_waveOutDevice.Pause();
_Timer.Stop();
}
}
public void Close()
{
CloseWaveOut();
_Timer.Stop();
}
public float Length
{
get
{
if (_loaded)
{
TimeSpan tt = _volumeStream.TotalTime;
return (float)tt.TotalSeconds;
}
return 0f;
}
}
public float Position
{
get
{
if (_loaded && _volumeStream != null)
{
TimeSpan tt = _volumeStream.CurrentTime;
float time = (float)tt.TotalSeconds;
if (time != _CurrentTime)
{
_CurrentTime = time;
_Timer.Stop();
_Timer.Reset();
_Timer.Start();
}
else
{
time = _CurrentTime + _Timer.ElapsedMilliseconds / 1000f;
}
//Console.WriteLine(time.ToString("#0.000"));
return time - DELAY;
}
return 0f;
}
set
{
if (_loaded && _volumeStream != null)
{
float pos = value;
if (pos > Length)
pos = Length;
if (pos < 0L)
pos = 0L;
int skip = (int)(pos - _CurrentTime);
_volumeStream.Skip(skip);
_CurrentTime += skip;
}
_Position = value;
}
}
public float Volume
{
get
{
if (_loaded && _volumeStream != null)
{
return _volumeStream.Volume;
}
return 0f;
}
set
{
if (_loaded && _volumeStream != null)
{
float volume = value;
if (volume > 1f)
volume = 1f;
if (volume < 0f)
volume = 0f;
_volumeStream.Volume = volume;
}
_Volume = value;
}
}
public bool IsPlaying()
{
if (_loaded && _waveOutDevice != null)
return _waveOutDevice.PlaybackState == PlaybackState.Playing;
return false;
}
public bool IsPaused()
{
if (_loaded && _waveOutDevice != null)
return _waveOutDevice.PlaybackState == PlaybackState.Paused;
return false;
}
public bool IsFinished()
{
if (_loaded && _waveOutDevice != null)
return _waveOutDevice.PlaybackState == PlaybackState.Stopped;
return false;
}
public bool Update()
{
if (_fading)
{
if ((float)_fadeTimer.ElapsedMilliseconds / 1000f < _fadeTime)
Volume = _startVolume + (_targetVolume - _startVolume) * ((_fadeTimer.ElapsedMilliseconds / 1000f) / _fadeTime);
else
{
Volume = _targetVolume;
_fadeTimer.Stop();
_fading = false;
if (_closeStreamAfterFade)
return false;
if (_pauseStreamAfterFade)
Pause();
}
return true;
}
return true;
}
public void Fade(float TargetVolume, float FadeTime)
{
if (!_loaded || _volumeStream == null)
return;
_fading = true;
_fadeTimer.Stop();
_fadeTimer.Reset();
_startVolume = Volume;
_targetVolume = TargetVolume / 100f;
_fadeTime = FadeTime;
_fadeTimer.Start();
}
public void FadeAndPause(float TargetVolume, float FadeTime)
{
if (!_loaded || _volumeStream == null)
return;
_pauseStreamAfterFade = true;
Fade(TargetVolume, FadeTime);
}
public void FadeAndStop(float TargetVolume, float FadeTime)
{
if (!_loaded || _volumeStream == null)
return;
_closeStreamAfterFade = true;
Fade(TargetVolume, FadeTime);
}
private WaveStream CreateInputStream(string fileName)
{
WaveChannel32 inputStream;
if (fileName.EndsWith(".mp3"))
{
WaveStream mp3Reader = new Mp3FileReader(fileName);
inputStream = new WaveChannel32(mp3Reader);
}
else
{
throw new InvalidOperationException("Unsupported extension");
}
_volumeStream = inputStream;
return _volumeStream;
}
private void CloseWaveOut()
{
if (_waveOutDevice != null)
{
_waveOutDevice.Stop();
}
if (_mainOutputStream != null)
{
// this one really closes the file and ACM conversion
_volumeStream.Close();
_volumeStream = null;
// this one does the metering stream
_mainOutputStream.Close();
_mainOutputStream = null;
}
if (_waveOutDevice != null)
{
_waveOutDevice.Dispose();
_waveOutDevice = null;
}
}
}
class CNAudioPlay : IPlayback
{
private bool _Initialized = false;
private int _HandleCounter = 0;
private List<NAudioStream> _Streams;
private Object MutexAudioStreams = new Object();
public CNAudioPlay()
{
Init();
}
public bool Init()
{
if (_Initialized)
{
foreach (NAudioStream stream in _Streams)
{
stream.Close();
}
_Streams.Clear();
_Initialized = false;
}
else
_Streams = new List<NAudioStream>();
_Initialized = true;
return _Initialized;
}
public void CloseAll()
{
while (_Streams.Count > 0)
{
Close(_Streams[_Streams.Count - 1].Handle);
}
lock (MutexAudioStreams)
{
_Streams.Clear();
}
}
public void SetGlobalVolume(float Volume)
{
if (_Initialized)
{
//Bass.BASS_SetVolume(Volume / 100f);
}
}
public int GetStreamCount()
{
if (!_Initialized)
return 0;
lock (MutexAudioStreams)
{
return _Streams.Count;
}
}
public void Update()
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
List<int> StreamsToClose = new List<int>();
for (int i = 0; i < _Streams.Count; i++)
{
if (!_Streams[i].Update())
StreamsToClose.Add(_Streams[i].Handle);
}
foreach (int stream in StreamsToClose)
{
Close(stream);
}
}
}
}
#region Stream Handling
public int Load(string Media)
{
return Load(Media, false);
}
public int Load(string Media, bool Prescan)
{
if (!_Initialized)
return 0;
//BASSFlag flags = BASSFlag.BASS_DEFAULT;
//if (Prescan)
// flags = BASSFlag.BASS_STREAM_PRESCAN;
NAudioStream stream = new NAudioStream(Media);
stream.Handle = ++_HandleCounter;
//stream.handle = Bass.BASS_StreamCreateFile(Media, 0L, 0L, flags);
if (stream.Handle != 0)
{
lock (MutexAudioStreams)
{
_Streams.Add(stream);
}
return stream.Handle;
}
return 0;
}
public void Close(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
_Streams[index].Close();
//Bass.BASS_StreamFree(Stream);
_Streams.RemoveAt(index);
}
}
}
}
public void Play(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
Play(Stream, false);
}
}
}
}
public void Play(int Stream, bool Loop)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
_Streams[index].Play();
//if (Loop)
//Bass.BASS_ChannelFlags(Stream, BASSFlag.BASS_SAMPLE_LOOP, BASSFlag.BASS_SAMPLE_LOOP);
//Bass.BASS_ChannelPlay(Stream, false);
}
}
}
}
public void Pause(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
_Streams[index].Pause();
//Bass.BASS_ChannelPause(Stream);
}
}
}
}
public void Stop(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
_Streams[index].Stop();
//Bass.BASS_ChannelStop(Stream);
}
}
}
}
public void Fade(int Stream, float TargetVolume, float Seconds)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
_Streams[index].Fade(TargetVolume, Seconds);
}
}
}
}
public void FadeAndPause(int Stream, float TargetVolume, float Seconds)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
_Streams[index].FadeAndPause(TargetVolume, Seconds);
}
}
}
}
public void FadeAndStop(int Stream, float TargetVolume, float Seconds)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
//Stop(Stream);
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
_Streams[index].FadeAndStop(TargetVolume, Seconds);
}
}
}
}
public void SetStreamVolume(int Stream, float Volume)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
_Streams[index].Volume = Volume / 100f;
//Bass.BASS_ChannelSetAttribute(Stream, BASSAttribute.BASS_ATTRIB_VOL, Volume / 100f);
}
}
}
}
public float GetLength(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
return _Streams[index].Length;
//long len = Bass.BASS_ChannelGetLength(Stream);
//return (float)Bass.BASS_ChannelBytes2Seconds(Stream, len);
}
}
return 0f;
}
return 0f;
}
public float GetPosition(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
return _Streams[index].Position;
//long pos = Bass.BASS_ChannelGetPosition(Stream);
//return (float)Bass.BASS_ChannelBytes2Seconds(Stream, pos);
}
}
return 0f;
}
return 0f;
}
public bool IsPlaying(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
return _Streams[index].IsPlaying();
//return (Bass.BASS_ChannelIsActive(Stream) == BASSActive.BASS_ACTIVE_PLAYING);
}
}
}
return false;
}
public bool IsPaused(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
return _Streams[index].IsPaused();
//return (Bass.BASS_ChannelIsActive(Stream) == BASSActive.BASS_ACTIVE_PAUSED);
}
}
}
return false;
}
public bool IsFinished(int Stream)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
return _Streams[index].IsFinished();
//return (Bass.BASS_ChannelIsActive(Stream) == BASSActive.BASS_ACTIVE_STOPPED);
}
}
}
return true;
}
public void SetPosition(int Stream, float Position)
{
if (_Initialized)
{
lock (MutexAudioStreams)
{
if (AlreadyAdded(Stream))
{
int index = GetStreamIndex(Stream);
_Streams[index].Position = Position;
//Bass.BASS_ChannelSetPosition(Stream, Position);
}
}
}
}
#endregion Stream Handling
private bool AlreadyAdded(int Stream)
{
foreach (NAudioStream st in _Streams)
{
if (st.Handle == Stream)
{
return true;
}
}
return false;
}
private int GetStreamIndex(int Stream)
{
for (int i = 0; i < _Streams.Count; i++)
{
if (_Streams[i].Handle == Stream)
return i;
}
return -1;
}
private void EndSync(int handle, int Stream, int data, IntPtr user)
{
if (_Initialized)
{
if (AlreadyAdded(Stream))
{
Close(Stream);
}
}
}
}
}
+2 -2
View File
@@ -84,10 +84,10 @@ namespace Vocaluxe.Lib.Sound
_DeviceConfig = _Devices.ToArray();
}
catch (Exception)
catch (Exception e)
{
_initialized = false;
CLog.LogError("Error initializing PortAudio");
CLog.LogError("Error initializing PortAudio: " + e.Message);
return false;
}
return true;
+59 -49
View File
@@ -22,6 +22,9 @@
using System;
using System.Runtime.InteropServices;
using System.IO;
using Vocaluxe.Base;
namespace PortAudioSharp {
@@ -274,11 +277,18 @@ namespace PortAudioSharp {
#endregion
#region **** PORTAUDIO FUNCTIONS ****
[DllImport ("PortAudio.dll")]
#if ARCH_X86
private const string PaDll = "x86\\PortAudio.dll";
#endif
#if ARCH_X64
private const string PaDll = "x64\\PortAudio.dll";
#endif
[DllImport (PaDll)]
public static extern int Pa_GetVersion();
[DllImport ("PortAudio.dll",EntryPoint="Pa_GetVersionText")]
[DllImport (PaDll,EntryPoint="Pa_GetVersionText")]
private static extern IntPtr IntPtr_Pa_GetVersionText();
public static string Pa_GetVersionText() {
@@ -286,7 +296,7 @@ namespace PortAudioSharp {
return Marshal.PtrToStringAnsi(strptr);
}
[DllImport ("PortAudio.dll",EntryPoint="Pa_GetErrorText")]
[DllImport (PaDll,EntryPoint="Pa_GetErrorText")]
public static extern IntPtr IntPtr_Pa_GetErrorText(PaError errorCode);
public static string Pa_GetErrorText(PaError errorCode) {
@@ -294,19 +304,19 @@ namespace PortAudioSharp {
return Marshal.PtrToStringAnsi(strptr);
}
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_Initialize();
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_Terminate();
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern int Pa_GetHostApiCount();
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern int Pa_GetDefaultHostApi();
[DllImport ("PortAudio.dll",EntryPoint="Pa_GetHostApiInfo")]
[DllImport (PaDll,EntryPoint="Pa_GetHostApiInfo")]
public static extern IntPtr IntPtr_Pa_GetHostApiInfo(int hostApi);
public static PaHostApiInfo Pa_GetHostApiInfo(int hostApi) {
@@ -314,13 +324,13 @@ namespace PortAudioSharp {
return (PaHostApiInfo) Marshal.PtrToStructure(structptr, typeof(PaHostApiInfo));
}
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern int Pa_HostApiTypeIdToHostApiIndex(PaHostApiTypeId type);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern int Pa_HostApiDeviceIndexToDeviceIndex(int hostApi, int hostApiDeviceIndex);
[DllImport ("PortAudio.dll",EntryPoint="Pa_GetLastHostErrorInfo")]
[DllImport (PaDll,EntryPoint="Pa_GetLastHostErrorInfo")]
public static extern IntPtr IntPtr_Pa_GetLastHostErrorInfo();
public static PaHostErrorInfo Pa_GetLastHostErrorInfo() {
@@ -328,16 +338,16 @@ namespace PortAudioSharp {
return (PaHostErrorInfo) Marshal.PtrToStructure(structptr, typeof(PaHostErrorInfo));
}
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern int Pa_GetDeviceCount();
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern int Pa_GetDefaultInputDevice();
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern int Pa_GetDefaultOutputDevice();
[DllImport ("PortAudio.dll",EntryPoint="Pa_GetDeviceInfo")]
[DllImport (PaDll,EntryPoint="Pa_GetDeviceInfo")]
public static extern IntPtr IntPtr_Pa_GetDeviceInfo(int device);
public static PaDeviceInfo Pa_GetDeviceInfo(int device) {
@@ -345,13 +355,13 @@ namespace PortAudioSharp {
return (PaDeviceInfo) Marshal.PtrToStructure(structptr, typeof(PaDeviceInfo));
}
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_IsFormatSupported(
ref PaStreamParameters inputParameters,
ref PaStreamParameters outputParameters,
double sampleRate);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_OpenStream(
out IntPtr stream,
ref PaStreamParameters inputParameters,
@@ -362,7 +372,7 @@ namespace PortAudioSharp {
PaStreamCallbackDelegate streamCallback,
IntPtr userData);
[DllImport("PortAudio.dll")]
[DllImport(PaDll)]
public static extern PaError Pa_OpenStream(
out IntPtr stream,
ref PaStreamParameters inputParameters,
@@ -373,7 +383,7 @@ namespace PortAudioSharp {
PaStreamCallbackDelegate streamCallback,
IntPtr userData);
[DllImport("PortAudio.dll")]
[DllImport(PaDll)]
public static extern PaError Pa_OpenStream(
out IntPtr stream,
IntPtr inputParameters,
@@ -384,7 +394,7 @@ namespace PortAudioSharp {
PaStreamCallbackDelegate streamCallback,
IntPtr userData);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_OpenDefaultStream(
out IntPtr stream,
int numInputChannels,
@@ -395,30 +405,30 @@ namespace PortAudioSharp {
PaStreamCallbackDelegate streamCallback,
IntPtr userData);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_CloseStream(IntPtr stream);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_SetStreamFinishedCallback(
ref IntPtr stream,
[MarshalAs(UnmanagedType.FunctionPtr)]PaStreamFinishedCallbackDelegate streamFinishedCallback);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_StartStream(IntPtr stream);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_StopStream(IntPtr stream);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_AbortStream(IntPtr stream);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_IsStreamStopped(IntPtr stream);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_IsStreamActive(IntPtr stream);
[DllImport ("PortAudio.dll",EntryPoint="Pa_GetStreamInfo")]
[DllImport (PaDll,EntryPoint="Pa_GetStreamInfo")]
public static extern IntPtr IntPtr_Pa_GetStreamInfo(IntPtr stream);
public static PaStreamInfo Pa_GetStreamInfo(IntPtr stream) {
@@ -426,106 +436,106 @@ namespace PortAudioSharp {
return (PaStreamInfo) Marshal.PtrToStructure(structptr,typeof(PaStreamInfo));
}
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern double Pa_GetStreamTime(IntPtr stream);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern double Pa_GetStreamCpuLoad(IntPtr stream);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_ReadStream(
IntPtr stream,
[Out]float[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_ReadStream(
IntPtr stream,
[Out]byte[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_ReadStream(
IntPtr stream,
[Out]sbyte[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_ReadStream(
IntPtr stream,
[Out]ushort[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_ReadStream(
IntPtr stream,
[Out]short[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_ReadStream(
IntPtr stream,
[Out]uint[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_ReadStream(
IntPtr stream,
[Out]int[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_WriteStream(
IntPtr stream,
[In]float[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_WriteStream(
IntPtr stream,
[In]byte[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_WriteStream(
IntPtr stream,
[In]sbyte[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_WriteStream(
IntPtr stream,
[In]ushort[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_WriteStream(
IntPtr stream,
[In]short[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_WriteStream(
IntPtr stream,
[In]uint[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_WriteStream(
IntPtr stream,
[In]int[] buffer,
uint frames);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern int Pa_GetStreamReadAvailable(IntPtr stream);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern int Pa_GetStreamWriteAvailable(IntPtr stream);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern PaError Pa_GetSampleSize(PaSampleFormat format);
[DllImport ("PortAudio.dll")]
[DllImport (PaDll)]
public static extern void Pa_Sleep(int msec);
#endregion
+11 -1
View File
@@ -1,5 +1,8 @@
using System;
using System.Runtime.InteropServices;
using System.IO;
using Vocaluxe.Base;
namespace Vocaluxe.Lib.Video.Acinerella
{
@@ -155,7 +158,14 @@ namespace Vocaluxe.Lib.Video.Acinerella
public static class CAcinerella
{
private const string AcDll = "acinerella.dll";
#if ARCH_X86
private const string AcDll = "x86\\acinerella.dll";
#endif
#if ARCH_X64
private const string AcDll = "x64\\acinerella.dll";
#endif
private static Object _lock = new Object();
// Defines the type of an Acinerella media stream. Currently only video and
+14 -1
View File
@@ -102,7 +102,7 @@ namespace Vocaluxe.Menu
if (t < _CursorFadingTime)
{
if (_CursorTargetAlpha >= _CursorStartAlpha)
_Cursor.color.A = (_CursorTargetAlpha - _CursorStartAlpha) * t / _CursorFadingTime;
_Cursor.color.A = _CursorStartAlpha + (_CursorTargetAlpha - _CursorStartAlpha) * t / _CursorFadingTime;
else
_Cursor.color.A = (_CursorStartAlpha - _CursorTargetAlpha) * (1f - t / _CursorFadingTime);
}
@@ -152,6 +152,13 @@ namespace Vocaluxe.Menu
Fade(0f, 0.5f);
}
public void FadeIn()
{
_Movetimer.Reset();
_Movetimer.Start();
Fade(1f, 0.2f);
}
private void Fade(float targetAlpha, float time)
{
_CursorFadingTimer.Stop();
@@ -421,6 +428,12 @@ namespace Vocaluxe.Menu
while (Mouse.PollEvent(ref MouseEvent))
{
if (MouseEvent.Wheel != 0)
{
CSettings.MouseActive();
_Cursor.FadeIn();
}
UpdateMousePosition(MouseEvent.X, MouseEvent.Y);
if (!_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB))
+22 -1
View File
@@ -2,6 +2,7 @@
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Reflection;
using System.Runtime.InteropServices;
using System.IO;
using System.Windows.Forms;
@@ -16,10 +17,12 @@ namespace Vocaluxe
static class MainProgram
{
static SplashScreen _SplashScreen;
[STAThread]
static void Main(string[] args)
{
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(AssemblyResolver);
// Close program if there is another instance running
if (!EnsureSingleInstance())
{
@@ -151,6 +154,24 @@ namespace Vocaluxe
CLog.CloseAll();
}
static Assembly AssemblyResolver(Object sender, ResolveEventArgs args)
{
string[] arr = args.Name.Split(new Char[] { ',' });
if (arr != null)
{
#if ARCH_X86
Assembly assembly = Assembly.LoadFrom("x86\\" + arr[0] + ".dll");
#endif
#if ARCH_X64
Assembly assembly = Assembly.LoadFrom("x64\\" + arr[0] + ".dll");
#endif
return assembly;
}
return null;
}
static bool EnsureSingleInstance()
{
Process currentProcess = Process.GetCurrentProcess();
+21 -9
View File
@@ -113,20 +113,25 @@ namespace Vocaluxe.Screens
_CurrentIntroVideoNr = -1;
_IntroOutPlayed = false;
for (int i = 0; i < _Intros.Length; i++)
if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON)
{
_Intros[i].Load(IntroVideo[i]);
for (int i = 0; i < _Intros.Length; i++)
{
_Intros[i].Load(IntroVideo[i]);
}
}
}
public override void OnShowFinish()
{
base.OnShowFinish();
for (int i = 0; i < _Intros.Length; i++)
if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON)
{
_Intros[i].PreLoad();
for (int i = 0; i < _Intros.Length; i++)
{
_Intros[i].PreLoad();
}
}
CLog.StartBenchmark(3, "Load Cover");
@@ -154,7 +159,7 @@ namespace Vocaluxe.Screens
bool next = ((CConfig.CoverLoading == ECoverLoading.TR_CONFIG_COVERLOADING_ATSTART && CSongs.CoverLoaded) ||
CConfig.CoverLoading != ECoverLoading.TR_CONFIG_COVERLOADING_ATSTART);
if ((_IntroOutPlayed || _SkipIntro) && next && CSettings.GameState != EGameState.EditTheme)
if ((_IntroOutPlayed || _SkipIntro) && next && CSettings.GameState != EGameState.EditTheme && CSongs.SongsLoaded)
{
CSettings.GameState = EGameState.Normal;
}
@@ -198,9 +203,10 @@ namespace Vocaluxe.Screens
_timer.Stop();
_timer.Reset();
_Intros[0].Close();
_Intros[1].Close();
_Intros[2].Close();
for (int i = 0; i < _Intros.Length; i++)
{
_Intros[i].Close();
}
CLog.StopBenchmark(3, "Load Cover");
}
@@ -210,6 +216,12 @@ namespace Vocaluxe.Screens
if (_IntroOutPlayed)
return;
if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_OFF)
{
_IntroOutPlayed = true;
return;
}
if (_CurrentIntroVideoNr < 0)
{
_CurrentIntroVideoNr = 0;
+43 -21
View File
@@ -12,6 +12,7 @@
<AssemblyName>Vocaluxe</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@@ -24,7 +25,6 @@
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
@@ -34,18 +34,23 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Output\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG;ARCH_X86</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LibPath>x86</LibPath>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Output\</OutputPath>
<LibPath>x86</LibPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<DefineConstants>ARCH_X86</DefineConstants>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Vocaluxe.MainProgram</StartupObject>
@@ -53,18 +58,35 @@
<PropertyGroup>
<ApplicationIcon>Vocaluxe.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Output\</OutputPath>
<DefineConstants>TRACE;DEBUG;ARCH_X64</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LibPath>x64</LibPath>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Output\</OutputPath>
<LibPath>x64</LibPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<DefineConstants>ARCH_X64</DefineConstants>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
</PropertyGroup>
<ItemGroup>
<Reference Include="Bass.Net, Version=2.4.7.4, Culture=neutral, PublicKeyToken=b7566c273e6ef480, processorArchitecture=MSIL">
<Reference Include="Community.CsharpSqlite">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Output\Bass.Net.dll</HintPath>
</Reference>
<Reference Include="Community.CsharpSqlite, Version=3.7.7.1, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Output\Community.CsharpSqlite.dll</HintPath>
</Reference>
<Reference Include="NAudio, Version=1.5.4.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Output\NAudio.dll</HintPath>
<HintPath>..\Output\$(LibPath)\Community.CsharpSqlite.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenTK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -78,15 +100,16 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Output\OpenTK.GLControl.dll</HintPath>
</Reference>
<Reference Include="SlimDX, Version=2.0.13.43, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9, processorArchitecture=x86">
<Reference Include="SlimDX">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Output\SlimDX.dll</HintPath>
<HintPath>..\Output\$(LibPath)\SlimDX.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Output\System.Data.SQLite.dll</HintPath>
<Reference Include="System.Data.SQLite">
<HintPath>..\Output\$(LibPath)\System.Data.SQLite.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
@@ -125,9 +148,6 @@
</Compile>
<Compile Include="Lib\Song\CNotes.cs" />
<Compile Include="Lib\Song\CSong.cs" />
<Compile Include="Lib\Sound\CBassPlay.cs" />
<Compile Include="Lib\Sound\CBassRecord.cs" />
<Compile Include="Lib\Sound\CNAudioPlay.cs" />
<Compile Include="Lib\Sound\COpenALPlay.cs" />
<Compile Include="Lib\Sound\COpenALRecord.cs" />
<Compile Include="Base\CSound.cs" />
@@ -183,7 +203,9 @@
<Compile Include="Screens\CScreenOptionsVideo.cs" />
<Compile Include="Screens\CScreenOptionsRecord.cs" />
<Compile Include="Screens\CScreenOptionsTheme.cs" />
<None Include="app.config" />
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<Compile Include="Lib\Sound\Portaudio\PortAudio.cs" />
<Compile Include="Lib\Sound\Portaudio\PortAudioASIO.cs" />
<None Include="Doc\SQLite.NET.chm" />
+4 -1
View File
@@ -1,3 +1,6 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>