Skip to content

Commit

Permalink
added http api command "toggleplaypause".
Browse files Browse the repository at this point in the history
updated beta to version 1.4.11
  • Loading branch information
seliver committed Jun 3, 2015
1 parent 83fd163 commit f755a9f
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 26 deletions.
3 changes: 3 additions & 0 deletions BetaChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.4.11
Added http api command "toggleplaypause".

v1.4.10
Added support for switching audio output devices. (Thanks to joecoolio)

Expand Down
15 changes: 15 additions & 0 deletions Elpis/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,21 @@ public static void Play()
_player.Play();
}));
}
public static void PlayPauseToggle()
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
if (_player.Paused)
{
_mainWindow.showBalloon(PLAY);
}
if (_player.Playing)
{
_mainWindow.showBalloon(PAUSE);
}
_player.PlayPause();
}));
}
public static void Like()
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
Expand Down
2 changes: 1 addition & 1 deletion Elpis/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.4.10")]
[assembly: AssemblyVersion("1.4.11")]
//[assembly: AssemblyFileVersion("0.0.0.0")]
24 changes: 24 additions & 0 deletions Elpis/WebInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,30 @@ public void OnRequest(HttpRequestHead request, IDataProducer requestBody,
};
response.OnResponse(headers, new BufferedProducer(body));
}
else if (request.Method.ToUpperInvariant() == "GET" && request.Uri.StartsWith("/toggleplaypause"))
{
var body = "";
if (MainWindow._player.Playing)
{
body = "Paused.";
}
else
{
body = "Playing.";
}
MainWindow.PlayPauseToggle();

var headers = new HttpResponseHead()
{
Status = "200 OK",
Headers = new Dictionary<string, string>()
{
{ "Content-Type", "text/plain" },
{ "Content-Length", body.Length.ToString() },
}
};
response.OnResponse(headers, new BufferedProducer(body));
}
else if (request.Method.ToUpperInvariant() == "GET" && request.Uri.StartsWith("/like"))
{
MainWindow.Like();
Expand Down
46 changes: 23 additions & 23 deletions ElpisSetup/ElpisSetup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
"Entry"
{
"MsmKey" = "8:_28035C075265B0593085A2866E700674"
"OwnerKey" = "8:_C0D607861CBA44EB990DD3A2C241B2C6"
"OwnerKey" = "8:_ABD5A4E57FD842C5AFA8FFBF5B55064E"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_28035C075265B0593085A2866E700674"
"OwnerKey" = "8:_ABD5A4E57FD842C5AFA8FFBF5B55064E"
"OwnerKey" = "8:_C0D607861CBA44EB990DD3A2C241B2C6"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand Down Expand Up @@ -136,13 +136,13 @@
"Entry"
{
"MsmKey" = "8:_C3FC75DE0D4394CCCC02FDC3089DF8C0"
"OwnerKey" = "8:_C0D607861CBA44EB990DD3A2C241B2C6"
"OwnerKey" = "8:_E91B36C8829F1D3F85101A8682DD0A4E"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_C3FC75DE0D4394CCCC02FDC3089DF8C0"
"OwnerKey" = "8:_ABD5A4E57FD842C5AFA8FFBF5B55064E"
"OwnerKey" = "8:_28035C075265B0593085A2866E700674"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -154,13 +154,13 @@
"Entry"
{
"MsmKey" = "8:_C3FC75DE0D4394CCCC02FDC3089DF8C0"
"OwnerKey" = "8:_28035C075265B0593085A2866E700674"
"OwnerKey" = "8:_ABD5A4E57FD842C5AFA8FFBF5B55064E"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_C3FC75DE0D4394CCCC02FDC3089DF8C0"
"OwnerKey" = "8:_E91B36C8829F1D3F85101A8682DD0A4E"
"OwnerKey" = "8:_C0D607861CBA44EB990DD3A2C241B2C6"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -172,13 +172,13 @@
"Entry"
{
"MsmKey" = "8:_D3A5D7EE5E1B649F19FA950B9F4A1BD2"
"OwnerKey" = "8:_7AB720A5D8D651D9FB48BF4B06BEE4AD"
"OwnerKey" = "8:_400B827A0F0AD2219A9A7D5665DAECB3"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_D3A5D7EE5E1B649F19FA950B9F4A1BD2"
"OwnerKey" = "8:_400B827A0F0AD2219A9A7D5665DAECB3"
"OwnerKey" = "8:_7AB720A5D8D651D9FB48BF4B06BEE4AD"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -202,7 +202,7 @@
"Entry"
{
"MsmKey" = "8:_E91B36C8829F1D3F85101A8682DD0A4E"
"OwnerKey" = "8:_C0D607861CBA44EB990DD3A2C241B2C6"
"OwnerKey" = "8:_28035C075265B0593085A2866E700674"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -214,7 +214,7 @@
"Entry"
{
"MsmKey" = "8:_E91B36C8829F1D3F85101A8682DD0A4E"
"OwnerKey" = "8:_28035C075265B0593085A2866E700674"
"OwnerKey" = "8:_C0D607861CBA44EB990DD3A2C241B2C6"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -226,31 +226,31 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_ABD5A4E57FD842C5AFA8FFBF5B55064E"
"OwnerKey" = "8:_D3A5D7EE5E1B649F19FA950B9F4A1BD2"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_010E6E01E6F5B6AADC295523D4ECA4D6"
"OwnerKey" = "8:_C3FC75DE0D4394CCCC02FDC3089DF8C0"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_7AB720A5D8D651D9FB48BF4B06BEE4AD"
"OwnerKey" = "8:_400B827A0F0AD2219A9A7D5665DAECB3"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_28035C075265B0593085A2866E700674"
"OwnerKey" = "8:_B90B87FCA3141C9B270F792D475E5A0F"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_E91B36C8829F1D3F85101A8682DD0A4E"
"OwnerKey" = "8:_6B9D0DC250535A53CC073223A6735BFF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -262,31 +262,31 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_6B9D0DC250535A53CC073223A6735BFF"
"OwnerKey" = "8:_E91B36C8829F1D3F85101A8682DD0A4E"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_B90B87FCA3141C9B270F792D475E5A0F"
"OwnerKey" = "8:_28035C075265B0593085A2866E700674"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_400B827A0F0AD2219A9A7D5665DAECB3"
"OwnerKey" = "8:_7AB720A5D8D651D9FB48BF4B06BEE4AD"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_C3FC75DE0D4394CCCC02FDC3089DF8C0"
"OwnerKey" = "8:_010E6E01E6F5B6AADC295523D4ECA4D6"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_D3A5D7EE5E1B649F19FA950B9F4A1BD2"
"OwnerKey" = "8:_ABD5A4E57FD842C5AFA8FFBF5B55064E"
"MsmSig" = "8:_UNDEFINED"
}
}
Expand Down Expand Up @@ -904,15 +904,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Elpis"
"ProductCode" = "8:{550F6F71-E6FB-49B1-83ED-11BFCF3A31B4}"
"PackageCode" = "8:{F773E32B-310D-4FF3-B238-887F0EC9BC11}"
"ProductCode" = "8:{EBDFB764-182D-401E-80F7-495340C0F943}"
"PackageCode" = "8:{A60F8AE8-5148-45E0-B42B-8B5018BB6FF2}"
"UpgradeCode" = "8:{F0962B86-5C6F-4A2C-98F4-2FF9D0AC46AD}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.4.10"
"ProductVersion" = "8:1.4.11"
"Manufacturer" = "8:Adam Haile, Alexey Seliverstov"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:https://github.com/adammhaile/Elpis/"
Expand Down
4 changes: 2 additions & 2 deletions version.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CurrentVersion|1.4.7.0
DownloadUrl|https://github.com/adammhaile/Elpis/releases/download/1.4.7/ElpisInstall_1.4.7.exe
ReleaseNotes|https://raw.githubusercontent.com/adammhaile/Elpis/master/ChangeLog.txt
BetaVersion|1.4.10.0
BetaDownloadUrl|https://github.com/adammhaile/Elpis/releases/download/1.4.10/ElpisInstall_1.4.10.exe
BetaVersion|1.4.11.0
BetaDownloadUrl|https://github.com/adammhaile/Elpis/releases/download/1.4.11/ElpisInstall_1.4.11.exe
BetaReleaseNotes|https://raw.githubusercontent.com/adammhaile/Elpis/master/BetaChangeLog.txt

0 comments on commit f755a9f

Please sign in to comment.