Merge branch 'develop' of git://github.com/Vocaluxe/Vocaluxe into develop
Conflicts: ClientServerLib/ClientServerLib/CServer.cs
This commit is contained in:
commit
d4dc4f7c20
5 files changed
+73
-11
No files matched your search
@@ -76,9 +76,9 @@ namespace ServerLib
|
|||||||
_Init(port, encrypted);
|
_Init(port, encrypted);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetLocalAddress()
|
public string GetBaseAddress()
|
||||||
{
|
{
|
||||||
return Dns.GetHostName();
|
return _BaseAddress.AbsoluteUri;
|
||||||
|
|
||||||
/*IPAddress[] ips = Dns.GetHostAddresses(Dns.GetHostName());
|
/*IPAddress[] ips = Dns.GetHostAddresses(Dns.GetHostName());
|
||||||
foreach (IPAddress ip in ips)
|
foreach (IPAddress ip in ips)
|
||||||
@@ -89,6 +89,11 @@ namespace ServerLib
|
|||||||
return "";*/
|
return "";*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsRunning()
|
||||||
|
{
|
||||||
|
return _Host.State == CommunicationState.Opened;
|
||||||
|
}
|
||||||
|
|
||||||
#region server control
|
#region server control
|
||||||
private void _Init(int port, bool encrypted)
|
private void _Init(int port, bool encrypted)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -217,4 +217,5 @@
|
|||||||
<string name="TR_SCREENOVIDEOADJUSTMENTS_BOTTOMRIGHT">Bottom right</string>
|
<string name="TR_SCREENOVIDEOADJUSTMENTS_BOTTOMRIGHT">Bottom right</string>
|
||||||
<string name="TR_SCREENPVOLUMECONTROL_VOLUME">Volume</string>
|
<string name="TR_SCREENPVOLUMECONTROL_VOLUME">Volume</string>
|
||||||
<string name="TR_SCREENPSERVERQR_ADDRESS">Server address</string>
|
<string name="TR_SCREENPSERVERQR_ADDRESS">Server address</string>
|
||||||
|
<string name="TR_SCREENPSERVERQR_NOTRUNNING">Server is not running. Please check config.xml!</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -131,6 +131,36 @@
|
|||||||
<!-- <Space>: Reflection Space-->
|
<!-- <Space>: Reflection Space-->
|
||||||
<!-- <Height>: Reflection Height-->
|
<!-- <Height>: Reflection Height-->
|
||||||
</TextServerAddress>
|
</TextServerAddress>
|
||||||
|
<TextServerNotRunning>
|
||||||
|
<!--<X>, <Y>: Text position-->
|
||||||
|
<X>640</X>
|
||||||
|
<Y>265</Y>
|
||||||
|
<!--<Z>: Text position-->
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<!--<H>: Text height-->
|
||||||
|
<H>45</H>
|
||||||
|
<!--<MaxW>: Maximum text width (if exists)-->
|
||||||
|
<MaxW>600</MaxW>
|
||||||
|
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>StaticColor</Color>
|
||||||
|
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>TextSColor</SColor>
|
||||||
|
<!--<Align>: Text align horizontal: Left, Center, Right-->
|
||||||
|
<Align>Center</Align>
|
||||||
|
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
|
||||||
|
<HAlign>Center</HAlign>
|
||||||
|
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
|
<Style>Bold</Style>
|
||||||
|
<!--<Font>: Text font name-->
|
||||||
|
<Font>Outline</Font>
|
||||||
|
<!--<Text>: Nothing or translation tag-->
|
||||||
|
<Text>TR_SCREENPSERVERQR_NOTRUNNING</Text>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</TextServerNotRunning>
|
||||||
<Text1>
|
<Text1>
|
||||||
<!--<X>, <Y>: Text position-->
|
<!--<X>, <Y>: Text position-->
|
||||||
<X>640</X>
|
<X>640</X>
|
||||||
|
|||||||
@@ -88,6 +88,19 @@ namespace Vocaluxe.Base.Server
|
|||||||
//_Discover.Stop();
|
//_Discover.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetServerAddress()
|
||||||
|
{
|
||||||
|
return _Server == null ? "" : _Server.GetBaseAddress();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsServerRunning()
|
||||||
|
{
|
||||||
|
if (_Server == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return _Server.IsRunning();
|
||||||
|
}
|
||||||
|
|
||||||
private static bool _SendKeyEvent(string key)
|
private static bool _SendKeyEvent(string key)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
using ServerLib;
|
using ServerLib;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using Vocaluxe.Base.Server;
|
||||||
using VocaluxeLib;
|
using VocaluxeLib;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using VocaluxeLib.Draw;
|
using VocaluxeLib.Draw;
|
||||||
@@ -45,25 +46,37 @@ namespace Vocaluxe.Screens
|
|||||||
private const string _StaticQRWindowsPhone = "StaticQRWindowsPhone";
|
private const string _StaticQRWindowsPhone = "StaticQRWindowsPhone";
|
||||||
|
|
||||||
private const string _TextServerAddress = "TextServerAddress";
|
private const string _TextServerAddress = "TextServerAddress";
|
||||||
|
private const string _TextServerNotRunning = "TextServerNotRunning";
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|
||||||
_ThemeStatics = new string[] { _StaticQRServer, _StaticQRAndroid, _StaticQRSymbian, _StaticQRWebOS, _StaticQRWindowsPhone };
|
_ThemeStatics = new string[] { _StaticQRServer, _StaticQRAndroid, _StaticQRSymbian, _StaticQRWebOS, _StaticQRWindowsPhone };
|
||||||
_ThemeTexts = new string[] { _TextServerAddress };
|
_ThemeTexts = new string[] { _TextServerAddress, _TextServerNotRunning };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LoadTheme(string xmlPath)
|
public override void LoadTheme(string xmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(xmlPath);
|
base.LoadTheme(xmlPath);
|
||||||
_GenerateQRs();
|
}
|
||||||
_Statics[_StaticQRServer].Texture = _QRServerAddress;
|
|
||||||
_Statics[_StaticQRAndroid].Texture = _QRAndroidLink;
|
public override void OnShow()
|
||||||
_Statics[_StaticQRSymbian].Texture = _QRSymbianLink;
|
{
|
||||||
_Statics[_StaticQRWebOS].Texture = _QRWebOSLink;
|
base.OnShow();
|
||||||
_Statics[_StaticQRWindowsPhone].Texture = _QRWindowsPhoneLink;
|
if (_QRServerAddress == null)
|
||||||
_Texts[_TextServerAddress].Text = CServer.GetLocalAddress() + ":" + CConfig.ServerPort;
|
{
|
||||||
|
_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();
|
||||||
|
_Statics[_StaticQRServer].Visible = CVocaluxeServer.IsServerRunning();
|
||||||
|
_Texts[_TextServerNotRunning].Visible = !CVocaluxeServer.IsServerRunning();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleMouse(SMouseEvent mouseEvent)
|
public override bool HandleMouse(SMouseEvent mouseEvent)
|
||||||
@@ -94,7 +107,7 @@ namespace Vocaluxe.Screens
|
|||||||
QRCodeGenerator qr = new QRCodeGenerator();
|
QRCodeGenerator qr = new QRCodeGenerator();
|
||||||
|
|
||||||
//ServerAddress
|
//ServerAddress
|
||||||
QRCodeGenerator.QRCode qrcode = qr.CreateQrCode(CServer.GetLocalAddress() + ":" + CConfig.ServerPort, QRCodeGenerator.ECCLevel.H);
|
QRCodeGenerator.QRCode qrcode = qr.CreateQrCode(CVocaluxeServer.GetServerAddress(), QRCodeGenerator.ECCLevel.H);
|
||||||
_QRServerAddress = CDraw.AddTexture(qrcode.GetGraphic(20));
|
_QRServerAddress = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||||
|
|
||||||
//Android
|
//Android
|
||||||
|
|||||||
Reference in new issue
Block a user