Merge branch 'develop' into newAcinerella
This commit is contained in:
commit
078687934a
8 files changed
+87
-25
No files matched your search
@@ -18,6 +18,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Songs;
|
||||
using VocaluxeLib.Draw;
|
||||
@@ -47,6 +48,10 @@ namespace Vocaluxe.Base
|
||||
private static bool _BackgroundMusicAdded;
|
||||
private static bool _Disabled;
|
||||
|
||||
private static Task _PreviewStartHelperTask;
|
||||
private static int _PreviewStartWaitCounter;
|
||||
private const int _PreviewStartWaitMaxTries = 10;
|
||||
|
||||
public static bool VideoEnabled
|
||||
{
|
||||
get { return _CurPlayer.VideoEnabled; }
|
||||
@@ -249,6 +254,14 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static void Update()
|
||||
{
|
||||
if (_PreviewStartHelperTask != null && ( _PreviewPlayer.Length > 0 || _PreviewStartWaitCounter++ >= _PreviewStartWaitMaxTries))
|
||||
{
|
||||
_PreviewStartHelperTask.RunSynchronously(TaskScheduler.FromCurrentSynchronizationContext());
|
||||
_PreviewStartHelperTask.Dispose();
|
||||
_PreviewStartHelperTask = null;
|
||||
_PreviewStartWaitCounter = 0;
|
||||
}
|
||||
|
||||
if (!IsPlaying)
|
||||
return;
|
||||
|
||||
@@ -299,31 +312,41 @@ namespace Vocaluxe.Base
|
||||
bool songChanged = _CurPlayer.SongID != song.ID;
|
||||
|
||||
_PreviewPlayer.Load(song);
|
||||
|
||||
|
||||
//Change song position only if song is changed or near to end
|
||||
if (songChanged || _CurPlayer.Position + 30 < _CurPlayer.Length)
|
||||
{
|
||||
float length = _PreviewPlayer.Length;
|
||||
if (length < 1)
|
||||
length = 30; // If length is unknow or invalid assume a length of 30s
|
||||
_PreviewStartHelperTask = new Task(() =>
|
||||
{
|
||||
float length = _PreviewPlayer.Length;
|
||||
if (length < 1)
|
||||
length = 30; // If length is unknow or invalid assume a length of 30s
|
||||
|
||||
if (start < 0)
|
||||
start = (song.Preview.Source == EDataSource.None) ? length / 4f : song.Preview.StartTime;
|
||||
if (start > length - 5f)
|
||||
start = Math.Max(0f, Math.Min(length / 4f, length - 5f));
|
||||
if (start >= 0.5f)
|
||||
start -= 0.5f;
|
||||
if (start < 0)
|
||||
start = (song.Preview.Source == EDataSource.None) ? length / 4f : song.Preview.StartTime;
|
||||
if (start > length - 5f)
|
||||
start = Math.Max(0f, Math.Min(length / 4f, length - 5f));
|
||||
if (start >= 0.5f)
|
||||
start -= 0.5f;
|
||||
|
||||
_PreviewPlayer.Position = start;
|
||||
_PreviewPlayer.Position = start;
|
||||
Play();
|
||||
});
|
||||
_CurPlayer = _PreviewPlayer;
|
||||
}
|
||||
else
|
||||
{
|
||||
_PreviewStartHelperTask.Dispose();
|
||||
_PreviewStartHelperTask = null;
|
||||
_PreviewPlayer.Position = _CurPlayer.Position;
|
||||
_CurPlayer = _PreviewPlayer;
|
||||
Play();
|
||||
}
|
||||
|
||||
_CurPlayer = _PreviewPlayer;
|
||||
|
||||
|
||||
Play();
|
||||
|
||||
}
|
||||
|
||||
public static void StopPreview()
|
||||
|
||||
@@ -163,6 +163,7 @@ namespace Vocaluxe.Base
|
||||
[DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn ServerActive;
|
||||
[DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn ServerEncryption;
|
||||
[DefaultValue(3000)] public int ServerPort;
|
||||
[DefaultValue(70)] public int SongCountCoverThreshold;
|
||||
}
|
||||
#pragma warning restore 649
|
||||
// ReSharper restore UnassignedField.Global
|
||||
@@ -495,6 +496,8 @@ namespace Vocaluxe.Base
|
||||
return "Server Encryption On/Off: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn)));
|
||||
case "ServerPort":
|
||||
return "Server Port (default: 3000) [1..65535]";
|
||||
case "SongCountCoverThreshold":
|
||||
return "Threshold of songs for that covers will not longer be included in get-all-songs-requests (e.g. song list) (default: 70) [-1..65535] -1 => always deliver covers";
|
||||
case "Stretch":
|
||||
return "Stretch view to full window size: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn)));
|
||||
default:
|
||||
|
||||
@@ -624,11 +624,20 @@ namespace Vocaluxe.Base.Server
|
||||
return _GetSongInfo(song, true);
|
||||
}
|
||||
|
||||
|
||||
private static SSongInfo[] _SongInfoCache = null;
|
||||
public static SSongInfo[] GetAllSongs()
|
||||
{
|
||||
List<CSong> songs = CSongs.Songs;
|
||||
return (from s in songs
|
||||
select _GetSongInfo(s, false)).ToArray<SSongInfo>();
|
||||
bool sendCovers = CConfig.Config.Server.SongCountCoverThreshold == -1 || CConfig.Config.Server.SongCountCoverThreshold > CSongs.Songs.Count;
|
||||
|
||||
if (_SongInfoCache == null)
|
||||
{
|
||||
List<CSong> songs = CSongs.Songs;
|
||||
_SongInfoCache = (from s in songs
|
||||
select _GetSongInfo(s, sendCovers)).AsParallel().ToArray<SSongInfo>();
|
||||
}
|
||||
|
||||
return _SongInfoCache;
|
||||
}
|
||||
|
||||
public static string GetMp3Path(int songId)
|
||||
@@ -658,7 +667,17 @@ namespace Vocaluxe.Base.Server
|
||||
result.IsDuet = song.IsDuet;
|
||||
result.SongId = song.ID;
|
||||
if (includeCover)
|
||||
result.Cover = new CBase64Image(_CreateDelayedImage(song.Folder + "\\" + song.CoverFileName));
|
||||
{
|
||||
if (song.CoverFileName == "")
|
||||
{
|
||||
result.Cover = new CBase64Image(_CreateDelayedImage("Website\\img\\noCover.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Cover = new CBase64Image(_CreateDelayedImage(song.Folder + "\\" + song.CoverFileName));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -684,7 +684,7 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
int song = _SongMenu.GetSelectedSongNr();
|
||||
if (song >= 0 && song < CSongs.VisibleSongs.Count)
|
||||
selectionText = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title + " ( "+(song+1)+" / "+CSongs.NumAllSongs+" )";
|
||||
selectionText = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title + " ( "+(song+1)+" / "+CSongs.NumSongsVisible+" )";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -540,26 +540,26 @@ powershell -command "(Get-Content -Encoding UTF8 '$(ProjectDir)Properties\Assemb
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.csharpsqlite.1.0.1\build\vocaluxe.dependencies.csharpsqlite.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.csharpsqlite.1.0.1\build\vocaluxe.dependencies.csharpsqlite.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.ffmpeg.1.0.1\build\vocaluxe.dependencies.ffmpeg.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.ffmpeg.1.0.1\build\vocaluxe.dependencies.ffmpeg.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.gstreamersharp.1.0.1\build\vocaluxe.dependencies.gstreamersharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.gstreamersharp.1.0.1\build\vocaluxe.dependencies.gstreamersharp.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.hidapi.1.0.1\build\vocaluxe.dependencies.hidapi.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.hidapi.1.0.1\build\vocaluxe.dependencies.hidapi.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.hidapi.1.0.3\build\vocaluxe.dependencies.hidapi.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.hidapi.1.0.3\build\vocaluxe.dependencies.hidapi.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.opentk.1.0.1\build\vocaluxe.dependencies.opentk.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.opentk.1.0.1\build\vocaluxe.dependencies.opentk.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.portaudiosharp.1.0.1\build\vocaluxe.dependencies.portaudiosharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.portaudiosharp.1.0.1\build\vocaluxe.dependencies.portaudiosharp.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.qrcoder.1.0.1\build\vocaluxe.dependencies.qrcoder.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.qrcoder.1.0.1\build\vocaluxe.dependencies.qrcoder.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.slimdx.1.0.1\build\vocaluxe.dependencies.slimdx.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.slimdx.1.0.1\build\vocaluxe.dependencies.slimdx.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.sqlite.1.0.1\build\vocaluxe.dependencies.sqlite.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.sqlite.1.0.1\build\vocaluxe.dependencies.sqlite.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.gstreamer.1.0.1\build\vocaluxe.dependencies.gstreamer.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.gstreamer.1.0.1\build\vocaluxe.dependencies.gstreamer.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.1.0.6\build\vocaluxe.dependencies.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.1.0.6\build\vocaluxe.dependencies.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\vocaluxe.dependencies.1.0.8\build\vocaluxe.dependencies.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vocaluxe.dependencies.1.0.8\build\vocaluxe.dependencies.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\vocaluxe.dependencies.acinerella.1.0.1\build\vocaluxe.dependencies.acinerella.targets" Condition="Exists('..\packages\vocaluxe.dependencies.acinerella.1.0.1\build\vocaluxe.dependencies.acinerella.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.aforgevideo.1.0.1\build\vocaluxe.dependencies.aforgevideo.targets" Condition="Exists('..\packages\vocaluxe.dependencies.aforgevideo.1.0.1\build\vocaluxe.dependencies.aforgevideo.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.csharpsqlite.1.0.1\build\vocaluxe.dependencies.csharpsqlite.targets" Condition="Exists('..\packages\vocaluxe.dependencies.csharpsqlite.1.0.1\build\vocaluxe.dependencies.csharpsqlite.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.ffmpeg.1.0.1\build\vocaluxe.dependencies.ffmpeg.targets" Condition="Exists('..\packages\vocaluxe.dependencies.ffmpeg.1.0.1\build\vocaluxe.dependencies.ffmpeg.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.gstreamersharp.1.0.1\build\vocaluxe.dependencies.gstreamersharp.targets" Condition="Exists('..\packages\vocaluxe.dependencies.gstreamersharp.1.0.1\build\vocaluxe.dependencies.gstreamersharp.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.hidapi.1.0.1\build\vocaluxe.dependencies.hidapi.targets" Condition="Exists('..\packages\vocaluxe.dependencies.hidapi.1.0.1\build\vocaluxe.dependencies.hidapi.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.hidapi.1.0.3\build\vocaluxe.dependencies.hidapi.targets" Condition="Exists('..\packages\vocaluxe.dependencies.hidapi.1.0.3\build\vocaluxe.dependencies.hidapi.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.opentk.1.0.1\build\vocaluxe.dependencies.opentk.targets" Condition="Exists('..\packages\vocaluxe.dependencies.opentk.1.0.1\build\vocaluxe.dependencies.opentk.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.portaudiosharp.1.0.1\build\vocaluxe.dependencies.portaudiosharp.targets" Condition="Exists('..\packages\vocaluxe.dependencies.portaudiosharp.1.0.1\build\vocaluxe.dependencies.portaudiosharp.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.qrcoder.1.0.1\build\vocaluxe.dependencies.qrcoder.targets" Condition="Exists('..\packages\vocaluxe.dependencies.qrcoder.1.0.1\build\vocaluxe.dependencies.qrcoder.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.slimdx.1.0.1\build\vocaluxe.dependencies.slimdx.targets" Condition="Exists('..\packages\vocaluxe.dependencies.slimdx.1.0.1\build\vocaluxe.dependencies.slimdx.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.sqlite.1.0.1\build\vocaluxe.dependencies.sqlite.targets" Condition="Exists('..\packages\vocaluxe.dependencies.sqlite.1.0.1\build\vocaluxe.dependencies.sqlite.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.gstreamer.1.0.1\build\vocaluxe.dependencies.gstreamer.targets" Condition="Exists('..\packages\vocaluxe.dependencies.gstreamer.1.0.1\build\vocaluxe.dependencies.gstreamer.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.1.0.6\build\vocaluxe.dependencies.targets" Condition="Exists('..\packages\vocaluxe.dependencies.1.0.6\build\vocaluxe.dependencies.targets')" />
|
||||
<Import Project="..\packages\vocaluxe.dependencies.1.0.8\build\vocaluxe.dependencies.targets" Condition="Exists('..\packages\vocaluxe.dependencies.1.0.8\build\vocaluxe.dependencies.targets')" />
|
||||
</Project>
|
||||
@@ -897,9 +897,26 @@
|
||||
}
|
||||
|
||||
for (var id in allSongsCache) {
|
||||
$('<li id="selectSongLine_' + allSongsCache[id].SongId + '"> <a href="#"> '/*+'<img src="' + ((data[profile].Avatar && data[profile].Avatar.base64Data) ? data[id].Avatar.base64Data : "img/profile.png") + '"> '*/ + ' <h2>' + allSongsCache[id].Artist + '</h2> <p>' + allSongsCache[id].Title + '</p> </a> </li>')
|
||||
var coverString = "";
|
||||
var currentCoverId = "";
|
||||
|
||||
if (allSongsCache[id].Cover !== null) {
|
||||
if (allSongsCache[id].Cover.base64Data !== "") {
|
||||
coverString = '<img src="' + allSongsCache[id].Cover.base64Data + '">';
|
||||
}
|
||||
else if (allSongsCache[id].Cover.imageId !== "") {
|
||||
currentCoverId = "songListCoverId_" + id;
|
||||
coverString = '<img id="' + currentCoverId + '" src="">';
|
||||
}
|
||||
}
|
||||
|
||||
$('<li id="selectSongLine_' + allSongsCache[id].SongId + '"> <a href="#"> ' + coverString + ' <h2>' + allSongsCache[id].Artist + '</h2> <p>' + allSongsCache[id].Title + '</p> </a> </li>')
|
||||
.appendTo('#selectSongList')
|
||||
.click(handleSelectSongLineClick);
|
||||
|
||||
if (currentCoverId !== "") {
|
||||
imageLoader.delayedImageLoad($("#" + currentCoverId)[0], allSongsCache[id].Cover.imageId, "img/noCover.png");
|
||||
}
|
||||
}
|
||||
|
||||
$('#selectSongList').listview('refresh');
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="vocaluxe.dependencies" version="1.0.6" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies" version="1.0.8" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.acinerella" version="1.0.1" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.aforgevideo" version="1.0.1" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.csharpsqlite" version="1.0.1" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.ffmpeg" version="1.0.1" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.gstreamer" version="1.0.1" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.gstreamersharp" version="1.0.1" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.hidapi" version="1.0.1" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.hidapi" version="1.0.3" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.opentk" version="1.0.1" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.portaudiosharp" version="1.0.1" targetFramework="net40" />
|
||||
<package id="vocaluxe.dependencies.qrcoder" version="1.0.1" targetFramework="net40" />
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (song == null)
|
||||
return;
|
||||
|
||||
CBase.BackgroundMusic.LoadPreview(song);
|
||||
CBase.BackgroundMusic.LoadPreview(song, song.Preview.StartTime);
|
||||
}
|
||||
|
||||
protected void _ResetPreview(bool playBGagain = true)
|
||||
|
||||
Reference in new issue
Block a user