Merge branch 'develop' of github.com:Vocaluxe/Vocaluxe into develop
This commit is contained in:
commit
2596099fb6
12 files changed
+83
-288
No files matched your search
@@ -2,7 +2,7 @@
|
||||
<Screen xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Informations>
|
||||
<ScreenName>PopupScreenServerQR</ScreenName>
|
||||
<ScreenVersion>1</ScreenVersion>
|
||||
<ScreenVersion>2</ScreenVersion>
|
||||
</Informations>
|
||||
<Backgrounds />
|
||||
<Statics>
|
||||
@@ -26,54 +26,10 @@
|
||||
<Skin>Menu</Skin>
|
||||
<Color Name="Visible" />
|
||||
<Rect>
|
||||
<X>490</X>
|
||||
<X>465</X>
|
||||
<Y>210</Y>
|
||||
<W>300</W>
|
||||
<H>300</H>
|
||||
<Z>-2</Z>
|
||||
</Rect>
|
||||
</Static>
|
||||
<Static Name="StaticQRAndroid">
|
||||
<Skin>Menu</Skin>
|
||||
<Color Name="Visible" />
|
||||
<Rect>
|
||||
<X>25</X>
|
||||
<Y>25</Y>
|
||||
<W>200</W>
|
||||
<H>200</H>
|
||||
<Z>-2</Z>
|
||||
</Rect>
|
||||
</Static>
|
||||
<Static Name="StaticQRSymbian">
|
||||
<Skin>Menu</Skin>
|
||||
<Color Name="Visible" />
|
||||
<Rect>
|
||||
<X>1055</X>
|
||||
<Y>25</Y>
|
||||
<W>200</W>
|
||||
<H>200</H>
|
||||
<Z>-2</Z>
|
||||
</Rect>
|
||||
</Static>
|
||||
<Static Name="StaticQRWebOS">
|
||||
<Skin>Menu</Skin>
|
||||
<Color Name="Visible" />
|
||||
<Rect>
|
||||
<X>25</X>
|
||||
<Y>495</Y>
|
||||
<W>200</W>
|
||||
<H>200</H>
|
||||
<Z>-2</Z>
|
||||
</Rect>
|
||||
</Static>
|
||||
<Static Name="StaticQRWindowsPhone">
|
||||
<Skin>Menu</Skin>
|
||||
<Color Name="Visible" />
|
||||
<Rect>
|
||||
<X>1055</X>
|
||||
<Y>495</Y>
|
||||
<W>200</W>
|
||||
<H>200</H>
|
||||
<W>350</W>
|
||||
<H>350</H>
|
||||
<Z>-2</Z>
|
||||
</Rect>
|
||||
</Static>
|
||||
@@ -81,7 +37,7 @@
|
||||
<Texts>
|
||||
<Text Name="Text1">
|
||||
<X>640</X>
|
||||
<Y>180</Y>
|
||||
<Y>170</Y>
|
||||
<Z>-2</Z>
|
||||
<H>35</H>
|
||||
<MaxW>300</MaxW>
|
||||
@@ -93,65 +49,9 @@
|
||||
<Font>Outline</Font>
|
||||
<Text>TR_SCREENPSERVERQR_ADDRESS</Text>
|
||||
</Text>
|
||||
<Text Name="Text2">
|
||||
<X>125</X>
|
||||
<Y>230</Y>
|
||||
<Z>-2</Z>
|
||||
<H>27</H>
|
||||
<MaxW>200</MaxW>
|
||||
<Color Name="StaticColor" />
|
||||
<SelColor Name="TextSelColor" />
|
||||
<Align>Center</Align>
|
||||
<ResizeAlign>Center</ResizeAlign>
|
||||
<Style>Bold</Style>
|
||||
<Font>Outline</Font>
|
||||
<Text>Android</Text>
|
||||
</Text>
|
||||
<Text Name="Text3">
|
||||
<X>1155</X>
|
||||
<Y>230</Y>
|
||||
<Z>-2</Z>
|
||||
<H>27</H>
|
||||
<MaxW>200</MaxW>
|
||||
<Color Name="StaticColor" />
|
||||
<SelColor Name="TextSelColor" />
|
||||
<Align>Center</Align>
|
||||
<ResizeAlign>Center</ResizeAlign>
|
||||
<Style>Bold</Style>
|
||||
<Font>Outline</Font>
|
||||
<Text>Symbian</Text>
|
||||
</Text>
|
||||
<Text Name="Text4">
|
||||
<X>125</X>
|
||||
<Y>460</Y>
|
||||
<Z>-2</Z>
|
||||
<H>27</H>
|
||||
<MaxW>200</MaxW>
|
||||
<Color Name="StaticColor" />
|
||||
<SelColor Name="TextSelColor" />
|
||||
<Align>Center</Align>
|
||||
<ResizeAlign>Center</ResizeAlign>
|
||||
<Style>Bold</Style>
|
||||
<Font>Outline</Font>
|
||||
<Text>WebOS</Text>
|
||||
</Text>
|
||||
<Text Name="Text5">
|
||||
<X>1155</X>
|
||||
<Y>460</Y>
|
||||
<Z>-2</Z>
|
||||
<H>27</H>
|
||||
<MaxW>200</MaxW>
|
||||
<Color Name="StaticColor" />
|
||||
<SelColor Name="TextSelColor" />
|
||||
<Align>Center</Align>
|
||||
<ResizeAlign>Center</ResizeAlign>
|
||||
<Style>Bold</Style>
|
||||
<Font>Outline</Font>
|
||||
<Text>Windows Phone</Text>
|
||||
</Text>
|
||||
<Text Name="TextServerAddress">
|
||||
<X>640</X>
|
||||
<Y>515</Y>
|
||||
<Y>570</Y>
|
||||
<Z>-2</Z>
|
||||
<H>35</H>
|
||||
<MaxW>300</MaxW>
|
||||
|
||||
@@ -153,10 +153,8 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
GameData = new SData {NumPlayer = 4, NumPlayerAtOnce = 2, NumRounds = 12, NumJokers = 5, RefillJokers = true, CurrentRoundNr = 1, ProfileIDs = new List<int>(), CatSongIndices = null, Results = null};
|
||||
}
|
||||
|
||||
public override bool Init()
|
||||
public override void SetDefaults()
|
||||
{
|
||||
if (!base.Init())
|
||||
return false;
|
||||
_Stage = EStage.Config;
|
||||
|
||||
_ScreenSongOptions.Sorting.IgnoreArticles = CBase.Config.GetIgnoreArticles();
|
||||
@@ -168,7 +166,15 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
_ScreenSongOptions.Sorting.Tabs = EOffOn.TR_CONFIG_ON;
|
||||
|
||||
GameData.ResultTable = new List<CResultTableRow>();
|
||||
}
|
||||
|
||||
public override bool Init()
|
||||
{
|
||||
if (!base.Init())
|
||||
return false;
|
||||
_Stage = EStage.Config;
|
||||
|
||||
SetDefaults();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -168,14 +168,19 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
GameData = new SData {NumPlayer = 4, NumPlayerAtOnce = 2, NumRounds = 12, CurrentRoundNr = 1, ProfileIDs = new List<int>(), NumSongs = 5, Songs = new List<int>(), SongSource = ESongSource.TR_ALLSONGS, CatSongIndices = null, Results = null};
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
_Stage = EStage.Config;
|
||||
GameData.CurrentRoundNr = 1;
|
||||
GameData.ResultTable = new List<CResultTableRow>();
|
||||
}
|
||||
|
||||
public override bool Init()
|
||||
{
|
||||
if (!base.Init())
|
||||
return false;
|
||||
_Stage = EStage.Config;
|
||||
|
||||
GameData.ResultTable = new List<CResultTableRow>();
|
||||
|
||||
SetDefaults();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -168,10 +168,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
};
|
||||
}
|
||||
|
||||
public override bool Init()
|
||||
public override void SetDefaults()
|
||||
{
|
||||
if (!base.Init())
|
||||
return false;
|
||||
_Stage = EStage.Config;
|
||||
|
||||
_ScreenSongOptions.Sorting.IgnoreArticles = CBase.Config.GetIgnoreArticles();
|
||||
@@ -186,6 +184,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
GameData.Rounds.Clear();
|
||||
GameData.PlayerTeam1.Clear();
|
||||
GameData.PlayerTeam2.Clear();
|
||||
}
|
||||
|
||||
public override bool Init()
|
||||
{
|
||||
if (!base.Init())
|
||||
return false;
|
||||
|
||||
SetDefaults();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
Vocaluxe is a free and open source singing game, inspired by the original UltraStar (developed by corvus5) and the great Ultrastar Deluxe project - yet it is an entirely new development in C#.
|
||||
It allows up to six players to sing along with music using microphones in order to score points, depending on the pitch of the voice and the rhythm of singing.
|
||||
It features mouse, keyboard, gamepad and Wiimote navigation, a multi-language interface, and singer profiles with avatars and supports songs in CP1250/52 and UTF8 encodings.
|
||||
Vocaluxe offers diversified party modes and can optionally be controlled via Browser/App.
|
||||
Vocaluxe offers diversified party modes and can optionally be controlled via a browser (desktop and mobile supported).
|
||||
|
||||
Supported Operating Systems / Requirements:
|
||||
- WinXP, Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 with .NET 4.0
|
||||
|
||||
@@ -63,8 +63,10 @@ namespace Vocaluxe.Base
|
||||
get { return _CurrentPartyMode.ID; }
|
||||
set
|
||||
{
|
||||
if (_CurrentPartyMode.ID == value)
|
||||
if (_CurrentPartyMode.ID == value) {
|
||||
_CurrentPartyMode.SetDefaults();
|
||||
return;
|
||||
}
|
||||
if (value != -1 && !_PartyModes.ContainsKey(value))
|
||||
throw new ArgumentException("Partymode with ID=" + value + " does not exist!");
|
||||
IPartyMode pm = _PartyModes[value].PartyMode;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Vocaluxe.Lib.Video.Acinerella
|
||||
@@ -191,6 +192,26 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
#endif
|
||||
|
||||
private static readonly Object _Lock = new Object();
|
||||
private static readonly Object _DictionaryLock = new Object();
|
||||
private static readonly Dictionary<Int64, object> _AcInstanceLocks = new Dictionary<Int64, object>(20);
|
||||
|
||||
private static object _GetLockToken(IntPtr pAcDecoder)
|
||||
{
|
||||
object l;
|
||||
|
||||
lock (_DictionaryLock)
|
||||
{
|
||||
_AcInstanceLocks.TryGetValue(pAcDecoder.ToInt64(), out l);
|
||||
if (l == null)
|
||||
{
|
||||
l = new object();
|
||||
_AcInstanceLocks.Add(pAcDecoder.ToInt64(), l);
|
||||
}
|
||||
}
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
|
||||
// Defines the type of an Acinerella media stream. Currently only video and
|
||||
// audio streams are supported, subtitle and data streams will be marked as
|
||||
@@ -216,7 +237,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
|
||||
public static void AcFree(IntPtr pAcInstance)
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcInstance))
|
||||
{
|
||||
_ac_free(pAcInstance);
|
||||
}
|
||||
@@ -261,7 +282,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
IntPtr proberesult
|
||||
)
|
||||
{
|
||||
lock (_lock)
|
||||
lock (_GetLockToken(pAcDecoder))
|
||||
{
|
||||
return _ac_open(PAc_instance, sender, open_proc, read_proc, seek_proc, close_proc, proberesult);
|
||||
}
|
||||
@@ -274,7 +295,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
public static Int32 AcOpen2(IntPtr pAcInstance, string filename)
|
||||
// ReSharper restore UnusedMethodReturnValue.Global
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcInstance))
|
||||
{
|
||||
return _ac_open2(pAcInstance, filename);
|
||||
}
|
||||
@@ -287,7 +308,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
|
||||
public static void AcClose(IntPtr pAcInstance)
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcInstance))
|
||||
{
|
||||
_ac_close(pAcInstance);
|
||||
}
|
||||
@@ -300,7 +321,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
|
||||
public static void AcGetStreamInfo(IntPtr pAcInstance, Int32 nb, out SACStreamInfo info)
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcInstance))
|
||||
{
|
||||
_ac_get_stream_info(pAcInstance, nb, out info);
|
||||
}
|
||||
@@ -321,7 +342,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
|
||||
public static IntPtr AcCreateVideoDecoder(IntPtr pAcInstance)
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcInstance))
|
||||
{
|
||||
return _ac_create_video_decoder(pAcInstance);
|
||||
}
|
||||
@@ -332,7 +353,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
|
||||
public static IntPtr AcCreateAudioDecoder(IntPtr pAcInstance)
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcInstance))
|
||||
{
|
||||
return _ac_create_audio_decoder(pAcInstance);
|
||||
}
|
||||
@@ -347,8 +368,12 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
{
|
||||
lock (_Lock)
|
||||
{
|
||||
_ac_free_decoder(pAcDecoder);
|
||||
lock (_GetLockToken(pAcDecoder))
|
||||
{
|
||||
_ac_free_decoder(pAcDecoder);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Decodes a package using the specified decoder. The decodec data is stored in the
|
||||
@@ -359,7 +384,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
|
||||
public static bool AcDecodePackage(IntPtr pAcPackage, IntPtr pAcDecoder)
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcDecoder))
|
||||
{
|
||||
return _ac_decode_package(pAcPackage, pAcDecoder) != 0;
|
||||
}
|
||||
@@ -370,7 +395,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
|
||||
public static bool AcGetAudioFrame(IntPtr pAcInstance, IntPtr pAcDecoder)
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcDecoder))
|
||||
{
|
||||
return _ac_get_audio_frame(pAcInstance, pAcDecoder) != 0;
|
||||
}
|
||||
@@ -381,7 +406,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
|
||||
public static bool AcGetFrame(IntPtr pAcInstance, IntPtr pAcDecoder)
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcDecoder))
|
||||
{
|
||||
return _ac_get_frame(pAcInstance, pAcDecoder) != 0;
|
||||
}
|
||||
@@ -392,7 +417,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
|
||||
public static bool AcSkipFrames(IntPtr pAcInstance, IntPtr pAcDecoder, Int32 num)
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcDecoder))
|
||||
{
|
||||
return _ac_skip_frames(pAcInstance, pAcDecoder, num) != 0;
|
||||
}
|
||||
@@ -408,7 +433,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
||||
|
||||
public static bool AcSeek(IntPtr pAcDecoder, Int32 dir, Int64 targetPos)
|
||||
{
|
||||
lock (_Lock)
|
||||
lock (_GetLockToken(pAcDecoder))
|
||||
{
|
||||
return _ac_seek(pAcDecoder, dir, targetPos) != 0;
|
||||
}
|
||||
|
||||
@@ -30,20 +30,11 @@ namespace Vocaluxe.Screens
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
{
|
||||
get { return 1; }
|
||||
get { return 2; }
|
||||
}
|
||||
|
||||
private CTextureRef _QRServerAddress;
|
||||
private CTextureRef _QRAndroidLink;
|
||||
private CTextureRef _QRSymbianLink;
|
||||
private CTextureRef _QRWebOSLink;
|
||||
private CTextureRef _QRWindowsPhoneLink;
|
||||
|
||||
private const string _StaticQRServer = "StaticQRServer";
|
||||
private const string _StaticQRAndroid = "StaticQRAndroid";
|
||||
private const string _StaticQRSymbian = "StaticQRSymbian";
|
||||
private const string _StaticQRWebOS = "StaticQRWebOS";
|
||||
private const string _StaticQRWindowsPhone = "StaticQRWindowsPhone";
|
||||
|
||||
private const string _TextServerAddress = "TextServerAddress";
|
||||
private const string _TextServerNotRunning = "TextServerNotRunning";
|
||||
@@ -52,7 +43,7 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
base.Init();
|
||||
|
||||
_ThemeStatics = new string[] {_StaticQRServer, _StaticQRAndroid, _StaticQRSymbian, _StaticQRWebOS, _StaticQRWindowsPhone};
|
||||
_ThemeStatics = new string[] {_StaticQRServer};
|
||||
_ThemeTexts = new string[] {_TextServerAddress, _TextServerNotRunning};
|
||||
}
|
||||
|
||||
@@ -63,10 +54,6 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
_GenerateQRs();
|
||||
_Statics[_StaticQRServer].Texture = _QRServerAddress;
|
||||
_Statics[_StaticQRAndroid].Texture = _QRAndroidLink;
|
||||
_Statics[_StaticQRSymbian].Texture = _QRSymbianLink;
|
||||
_Statics[_StaticQRWebOS].Texture = _QRWebOSLink;
|
||||
_Statics[_StaticQRWindowsPhone].Texture = _QRWindowsPhoneLink;
|
||||
_Texts[_TextServerAddress].Text = CVocaluxeServer.GetServerAddress();
|
||||
}
|
||||
_Texts[_TextServerAddress].Visible = CVocaluxeServer.IsServerRunning();
|
||||
@@ -108,22 +95,6 @@ namespace Vocaluxe.Screens
|
||||
//ServerAddress
|
||||
QRCodeGenerator.QRCode qrcode = qr.CreateQrCode(CVocaluxeServer.GetServerAddress(), QRCodeGenerator.ECCLevel.H);
|
||||
_QRServerAddress = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||
|
||||
//Android
|
||||
qrcode = qr.CreateQrCode(CSettings.LinkAndroidApp, QRCodeGenerator.ECCLevel.H);
|
||||
_QRAndroidLink = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||
|
||||
//Symbian
|
||||
qrcode = qr.CreateQrCode(CSettings.LinkSymbianApp, QRCodeGenerator.ECCLevel.H);
|
||||
_QRSymbianLink = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||
|
||||
//WebOS
|
||||
qrcode = qr.CreateQrCode(CSettings.LinkWebOSApp, QRCodeGenerator.ECCLevel.H);
|
||||
_QRWebOSLink = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||
|
||||
//WindowsPhone
|
||||
qrcode = qr.CreateQrCode(CSettings.LinkWindowsPhoneApp, QRCodeGenerator.ECCLevel.H);
|
||||
_QRWindowsPhoneLink = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -232,10 +232,6 @@
|
||||
<img class="cursorStyleClickable" id="displaySongAddPlaylist" src="img/addPlaylist.png" />
|
||||
<br />
|
||||
<audio controls id="displaySongPlayer" preload="none"></audio>
|
||||
<br />
|
||||
<img class="cursorStyleClickable" id="displaySongLinkYoutube" src="img/youtube.png" />
|
||||
<img class="cursorStyleClickable" id="displaySongLinkSpotify" src="img/spotify.png" />
|
||||
<img class="cursorStyleClickable" id="displaySongLinkWikipedia" src="img/wikipedia.png" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
+1
-123
@@ -2,7 +2,6 @@
|
||||
/// <reference path="../index.html" />
|
||||
(function () {
|
||||
var imageLoader;
|
||||
var externalServices;
|
||||
var translator;
|
||||
var pageHandler;
|
||||
var sessionHandler;
|
||||
@@ -30,7 +29,6 @@
|
||||
|
||||
sessionHandler = new SessionHandler();
|
||||
imageLoader = new ImageLoader();
|
||||
externalServices = new ExternalServices();
|
||||
pageHandler = new PageHandler();
|
||||
|
||||
pageHandler.init();
|
||||
@@ -160,115 +158,6 @@
|
||||
};
|
||||
}
|
||||
|
||||
function ExternalServices() {
|
||||
var popupVideoHeight = 390;
|
||||
var popupVideoWidth = 640;
|
||||
|
||||
var init = function () {
|
||||
initVideoPopup();
|
||||
};
|
||||
|
||||
var initVideoPopup = function () {
|
||||
|
||||
function scale(width, height, padding, border) {
|
||||
var scrWidth = $(window).width() - 30,
|
||||
scrHeight = $(window).height() - 30,
|
||||
ifrPadding = 2 * padding,
|
||||
ifrBorder = 2 * border,
|
||||
ifrWidth = width + ifrPadding + ifrBorder,
|
||||
ifrHeight = height + ifrPadding + ifrBorder,
|
||||
h, w;
|
||||
|
||||
if (ifrWidth < scrWidth && ifrHeight < scrHeight) {
|
||||
w = ifrWidth;
|
||||
h = ifrHeight;
|
||||
} else if ((ifrWidth / scrWidth) > (ifrHeight / scrHeight)) {
|
||||
w = scrWidth;
|
||||
h = (scrWidth / ifrWidth) * ifrHeight;
|
||||
} else {
|
||||
h = scrHeight;
|
||||
w = (scrHeight / ifrHeight) * ifrWidth;
|
||||
}
|
||||
|
||||
return {
|
||||
'width': w - (ifrPadding + ifrBorder),
|
||||
'height': h - (ifrPadding + ifrBorder)
|
||||
};
|
||||
}
|
||||
|
||||
$("#popupVideo").find("a").click(function () {
|
||||
$("#popupVideo").popup("close");
|
||||
$("#popupVideo").popup("close"); //Sometimes twice??
|
||||
});
|
||||
|
||||
$("#popupVideo iframe")
|
||||
.attr("width", 0)
|
||||
.attr("height", 0);
|
||||
|
||||
$("#popupVideo").on({
|
||||
popupbeforeposition: function () {
|
||||
var size = scale(popupVideoWidth, popupVideoHeight, 15, 1),
|
||||
w = size.width,
|
||||
h = size.height;
|
||||
|
||||
$("#popupVideo iframe")
|
||||
.attr("width", w)
|
||||
.attr("height", h);
|
||||
},
|
||||
popupafterclose: function () {
|
||||
$("#popupVideo iframe")
|
||||
.attr("width", 0)
|
||||
.attr("height", 0)
|
||||
.attr("src", "");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.showYoutube = function (artist, title) {
|
||||
request({
|
||||
url: "http://gdata.youtube.com/feeds/api/videos/-/Music?max-results=1&alt=json&format=5&q=" + artist + " " + title,
|
||||
dataType: "json",
|
||||
}, "external")
|
||||
.done(function (result) {
|
||||
if (result && result.feed && result.feed.entry && result.feed.entry.length > 0) {
|
||||
var vidId = result.feed.entry[0].id.$t.replace("http://gdata.youtube.com/feeds/api/videos/", "");
|
||||
popupVideoHeight = 390;
|
||||
popupVideoWidth = 640;
|
||||
|
||||
$("#popupVideo iframe").attr("src", "http://www.youtube.com/embed/" + vidId + "?&autoplay=1&rel=0&showinfo=0&disablekb=1&autohide=1");
|
||||
$("#popupVideo").popup("open");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.showSpotify = function (artist, title) {
|
||||
request({
|
||||
url: "http://ws.spotify.com/search/1/track.json?q=" + title + "+artist:" + artist,
|
||||
dataType: "json",
|
||||
}, "external")
|
||||
.done(function (result) {
|
||||
if (result && result.tracks && result.tracks.length > 0) {
|
||||
var spotId = result.tracks[0].href;
|
||||
popupVideoHeight = 80;
|
||||
popupVideoWidth = 300;
|
||||
|
||||
$("#popupVideo iframe").attr("src", "https://embed.spotify.com/?uri=" + spotId);
|
||||
$("#popupVideo").popup("open");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.showWikipedia = function (artist) {
|
||||
popupVideoHeight = 800;
|
||||
popupVideoWidth = 600;
|
||||
|
||||
$("#popupVideo iframe").attr("src", "http://m.wikipedia.org/wiki/Special:Search/" + artist);
|
||||
$("#popupVideo").popup("open");
|
||||
};
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
function Translator() {
|
||||
this.translationLoaded = $.Deferred();
|
||||
var translationLoaded = this.translationLoaded;
|
||||
@@ -1101,18 +990,7 @@
|
||||
};
|
||||
$.mobile.changePage("#selectPlaylist", { transition: "slidefade" });
|
||||
});
|
||||
|
||||
$('#displaySongLinkYoutube').unbind('click').click(function () {
|
||||
externalServices.showYoutube(result.Artist, result.Title);
|
||||
});
|
||||
|
||||
$('#displaySongLinkSpotify').unbind('click').click(function () {
|
||||
externalServices.showSpotify(result.Artist, result.Title);
|
||||
});
|
||||
|
||||
$('#displaySongLinkWikipedia').unbind('click').click(function () {
|
||||
externalServices.showWikipedia(result.Artist);
|
||||
});
|
||||
|
||||
} else {
|
||||
$('#displaySongLinks').hide();
|
||||
}
|
||||
|
||||
@@ -48,6 +48,11 @@ namespace VocaluxeLib.PartyModes
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void SetDefaults()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public void LoadTheme()
|
||||
{
|
||||
string xmlPath = CBase.Themes.GetThemeScreensPath(ID);
|
||||
|
||||
@@ -99,6 +99,7 @@ namespace VocaluxeLib.PartyModes
|
||||
|
||||
bool Init();
|
||||
|
||||
void SetDefaults();
|
||||
void LoadTheme();
|
||||
void ReloadSkin();
|
||||
void ReloadTheme();
|
||||
|
||||
Reference in new issue
Block a user