Skip to content

Commit

Permalink
Merge branch 'release/0.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Shukuyen committed Feb 15, 2014
2 parents 8b98a55 + d8d2cb5 commit 650fed3
Show file tree
Hide file tree
Showing 16 changed files with 185 additions and 72 deletions.
31 changes: 10 additions & 21 deletions Installer/WifiRemote_1_2_Installer.xmp2
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Click Next to continue or Cancel to exit Setup.</Value>
<Version>
<Major>0</Major>
<Minor>8</Minor>
<Build>0</Build>
<Build>1</Build>
<Revision>0</Revision>
</Version>
<ExtensionDescription>WifiRemote is a process plugin for the popular opensource mediacenter software "MediaPortal".
Expand All @@ -197,28 +197,17 @@ Click Next to continue or Cancel to exit Setup.</Value>
It publishes a Bonjour Service on your local network which allows clients (for example an iPhone or Android app) to list all found MediaPortal installations and connect to it. </ExtensionDescription>
<VersionDescription>Developers: The WifiRemote source code moved to github! Please go to https://github.com/MPExtended/WifiRemote to check it out and feel free to fork and submit pull requests!

New in 0.8:
- api level increased to 14
- MediaPortal 1.6 only, switched to .NET 4
- Request a screenshot with the screenshot command
- Fixed missing text in dialogs
- Fixed crash related to music db changes in MediaPortal 1.6 (thanks, sebastiii!)
- Fixed crash when encountering music with special chars in it (thanks, Martin K.!)
- Added Artist to now playing radio message (thanks, johanj!)
- Added methods for setting playlist repeat and shuffle (thanks, johanj!)
- Improved starting radio channel (thanks, johanj!)
- Send open dialogs to connecting clients
- Send facade info to connecting clients
- Added ViewType property to FacadeInfo message
- Added support for the trakt plugin rating dialog


</VersionDescription>
New in 0.8.1:
- api level increased to 15
- added "ok" dialog to ShowDialogs
- fixed tv now playing message braking zero button for switching to previous channels (thanks johanj!)
- fixed crash when using MediaPortal screen blanking (thanks johanj!)
- added MediaPortal compatibility checks</VersionDescription>
<DevelopmentStatus>Stable</DevelopmentStatus>
<OnlineLocation>https://github.com/MPExtended/WifiRemote/releases/download/0.8/WifiRemote_0.8.mpe1</OnlineLocation>
<ReleaseDate>2014-01-03T20:16:04</ReleaseDate>
<OnlineLocation>https://github.com/MPExtended/WifiRemote/releases/download/0.8.1/WifiRemote_0.8.1.mpe1</OnlineLocation>
<ReleaseDate>2014-02-15T20:16:04</ReleaseDate>
<Tags>remote, wifi, json, client control</Tags>
<Location>WifiRemote_0.8.mpe1</Location>
<Location>WifiRemote_0.8.1.mpe1</Location>
<Params>
<Items>
<SectionParam Name="Icon">
Expand Down
Binary file added Libs/TvControl.dll
Binary file not shown.
1 change: 1 addition & 0 deletions Sources/DemoClient/DemoClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AsyncSocket.cs" />
<Compile Include="Messages\MessageShowDialog.cs" />
<Compile Include="PlaylistLoadDialog.cs">
<SubType>Form</SubType>
</Compile>
Expand Down
37 changes: 37 additions & 0 deletions Sources/DemoClient/Messages/MessageShowDialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DemoClient
{
class MessageShowDialog : IMessage
{
String type = "showdialog";
public String Type
{
get { return type; }
}

public String AutologinKey
{
get;
set;
}

public String DialogType
{
get { return "ok"; }
}

public String Title
{
get { return "Message from DemoClient"; }
}

public String Text
{
get { return "This is an OK dialog. Oh myy!"; }
}
}
}
12 changes: 11 additions & 1 deletion Sources/DemoClient/Remote.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Sources/DemoClient/Remote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ private void requestNowPlayingInfoToolStripMenuItem_Click(object sender, EventAr
SendCommand(new MessageRequestNowPlaying(), socket);
}

private void showOKDialogToolStripMenuItem_Click(object sender, EventArgs e)
{
SendCommand(new MessageShowDialog(), socket);
}

private void showConsoleWindowToolStripMenuItem_Click(object sender, EventArgs e)
{
if (logWindow.Visible)
Expand Down Expand Up @@ -659,5 +664,7 @@ public void Log(string statusLabelText, string logWindowText, string toolStripTe
}

#endregion


}
}
13 changes: 13 additions & 0 deletions Sources/WifiRemote/Core/SocketServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,12 @@ void newSocket_DidRead(AsyncSocket sender, byte[] data, long tag)
{
// Turn on display
keybd_event(VK_LSHIFT, 0x45, KEYEVENTF_KEYUP, 0);
if (GUIGraphicsContext.BlankScreen)
{
WifiRemote.LogMessage("Blank screen active, turn on screen", WifiRemote.LogType.Debug);
GUIGraphicsContext.BlankScreen = false;
GUIGraphicsContext.ResetLastActivity();
}

// Send a command
if (type == "command")
Expand Down Expand Up @@ -914,6 +920,13 @@ void newSocket_DidRead(AsyncSocket sender, byte[] data, long tag)

// Turn on display
keybd_event(VK_LSHIFT, 0x45, KEYEVENTF_KEYUP, 0);
if (GUIGraphicsContext.BlankScreen)
{
WifiRemote.LogMessage("Blank screen active, turn on screen", WifiRemote.LogType.Debug);
GUIGraphicsContext.BlankScreen = false;
GUIGraphicsContext.ResetLastActivity();
}


if (WifiRemote.IsAvailableNotificationBar && ShowNotifications)
{
Expand Down
15 changes: 11 additions & 4 deletions Sources/WifiRemote/Core/WifiRemote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using MediaPortal.Dialogs;
using WifiRemote.MPDialogs;
using WifiRemote.Messages;
using WifiRemote.PluginConnection;

namespace WifiRemote
{
Expand Down Expand Up @@ -333,7 +334,14 @@ public void Start()
g_Player.PlayBackEnded += new g_Player.EndedHandler(g_Player_PlayBackEnded);
g_Player.PlayBackStopped += new g_Player.StoppedHandler(g_Player_PlayBackStopped);
g_Player.PlayBackChanged += new g_Player.ChangedHandler(g_Player_PlayBackChanged);
g_Player.TVChannelChanged += new g_Player.TVChannelChangeHandler(g_Player_TVPlayBackChanged);

// Only subscribe to the tv channel changed callback if the tv plugin is installed.
// Argus users will experience crashes otherwise.
if (WifiRemote.IsAvailableTVPlugin)
{
g_Player.TVChannelChanged += new g_Player.TVChannelChangeHandler(g_Player_TVPlayBackChanged);
}


GUIWindowManager.Receivers += new SendMessageHandler(GUIWindowManager_Receivers);

Expand Down Expand Up @@ -606,10 +614,9 @@ void g_Player_PlayBackChanged(g_Player.MediaType type, int stoptime, string file
/// </summary>
void g_Player_TVPlayBackChanged()
{
TvPlugin.TVHome.Navigator.UpdateCurrentChannel();
TvDatabase.Channel current = TvPlugin.TVHome.Navigator.Channel;
TvDatabase.Channel current = MpTvServerHelper.GetCurrentTimeShiftingTVChannel();

if (socketServer != null && (LatestChannelId == -1 || LatestChannelId != current.IdChannel))
if (socketServer != null && current != null && (LatestChannelId == -1 || LatestChannelId != current.IdChannel))
{
LatestChannelId = current.IdChannel;
LogMessage("TV Playback changed!", LogType.Debug);
Expand Down
18 changes: 18 additions & 0 deletions Sources/WifiRemote/MPDialogs/ShowDialogHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ internal static void ShowYesNoDialog(string dialogId, string title, string text,
socketServer.SendMessageToClient(result, sender);
}
}

/// <summary>
/// Show an ok dialog in MediaPortal
/// </summary>
/// <param name="title">Dialog title</param>
/// <param name="text">Dialog text</param>
internal static void ShowOkDialog(string title, string text)
{
GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
if (dlg != null)
{
dlg.Reset();
dlg.SetHeading(title);
dlg.SetLine(1, text);
dlg.DoModal(GUIWindowManager.ActiveWindow);
}
}

/// <summary>
/// Show a select dialog in MediaPortal. After that, send the result to the sender.
/// </summary>
Expand Down
12 changes: 11 additions & 1 deletion Sources/WifiRemote/MPDialogs/ShowDialogMessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ internal static void HandleShowDialogMessage(Newtonsoft.Json.Linq.JObject messag
//show dialog in new thread so we don't block the tcp thread
new Thread(new ParameterizedThreadStart(ShowYesNoThreaded)).Start(new object[] { dialogId, title, text, socketServer, sender });
}
else if (dialogType.Equals("ok"))
{
new Thread(new ParameterizedThreadStart(ShowOkDialogThreaded)).Start(new object[] { title, text });
}
else if (dialogType.Equals("yesnoselect"))
{
List<String> options = new List<String>();
Expand All @@ -46,7 +50,7 @@ internal static void HandleShowDialogMessage(Newtonsoft.Json.Linq.JObject messag
}

//show dialog in new thread so we don't block the tcp thread
new Thread(new ParameterizedThreadStart(ShowYesNoThenSelectThreaded)).Start(new object[] { dialogId, title, text, options, socketServer, sender });
new Thread(new ParameterizedThreadStart(ShowYesNoThenSelectThreaded)).Start(new object[] { dialogId, title, text, options, socketServer, sender });
}
else if (dialogType.Equals("select"))
{
Expand Down Expand Up @@ -84,6 +88,12 @@ private static void ShowYesNoThreaded(object pars)
ShowDialogHelper.ShowYesNoDialog((string)parameters[0], (string)parameters[1], (string)parameters[2], (SocketServer)parameters[3], (Deusty.Net.AsyncSocket)parameters[4]);
}

private static void ShowOkDialogThreaded(object pars)
{
object[] parameters = (object[])pars;
ShowDialogHelper.ShowOkDialog((string)parameters[0], (string)parameters[1]);
}

/// <summary>
/// Show yes/no-then-select dialog from a new thread
/// </summary>
Expand Down
25 changes: 9 additions & 16 deletions Sources/WifiRemote/Messages/MessageNowPlaying.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,27 +187,20 @@ public IAdditionalNowPlayingInfo MediaInfo
}
}
}
else if (g_Player.IsTV)
else if (g_Player.IsTV && WifiRemote.IsAvailableTVPlugin)
{
if (!WifiRemote.IsAvailableTVPlugin)
if (g_Player.IsTVRecording)
{
WifiRemote.LogMessage("No TVPlugin installed: can't add now playing", WifiRemote.LogType.Error);
NowPlayingRecording recording = MpTvServerHelper.GetNowPlayingRecording();

if (recording.IsRecording())
{
return recording;
}
}
else
{
if (g_Player.IsTVRecording)
{
NowPlayingRecording recording = MpTvServerHelper.GetNowPlayingRecording();

if (recording.IsRecording())
{
return recording;
}
}
else
{
return MpTvServerHelper.GetNowPlayingTv();
}
return MpTvServerHelper.GetNowPlayingTv();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/WifiRemote/Messages/MessageWelcome.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace WifiRemote
class MessageWelcome : IMessage
{
string type = "welcome";
int server_version = 14;
int server_version = 15;
AuthMethod authMethod = AuthMethod.UserPassword;

/// <summary>
Expand Down
43 changes: 23 additions & 20 deletions Sources/WifiRemote/Messages/Now Playing/NowPlayingTv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using System.Drawing;
using WifiRemote.MpExtended;
using WifiRemote.PluginConnection;

namespace WifiRemote
{
Expand Down Expand Up @@ -145,29 +146,31 @@ public DateTime NextProgramEnd
/// </summary>
public NowPlayingTv()
{
TvPlugin.TVHome.Navigator.UpdateCurrentChannel();
TvDatabase.Channel current = TvPlugin.TVHome.Navigator.Channel;
ChannelId = current.IdChannel;
ChannelName = current.DisplayName;

if (current.CurrentProgram != null)
TvDatabase.Channel current = MpTvServerHelper.GetCurrentTimeShiftingTVChannel();
if (current != null)
{
CurrentProgramId = current.CurrentProgram.IdProgram;
CurrentProgramName = current.CurrentProgram.Title;
CurrentProgramDescription = current.CurrentProgram.Description;
CurrentProgramBegin = current.CurrentProgram.StartTime;
CurrentProgramEnd = current.CurrentProgram.EndTime;
}

if (current.NextProgram != null)
{
NextProgramId = current.NextProgram.IdProgram;
NextProgramName = current.NextProgram.Title;
NextProgramDescription = current.NextProgram.Description;
NextProgramBegin = current.NextProgram.StartTime;
NextProgramEnd = current.NextProgram.EndTime;
ChannelId = current.IdChannel;
ChannelName = current.DisplayName;

if (current.CurrentProgram != null)
{
CurrentProgramId = current.CurrentProgram.IdProgram;
CurrentProgramName = current.CurrentProgram.Title;
CurrentProgramDescription = current.CurrentProgram.Description;
CurrentProgramBegin = current.CurrentProgram.StartTime;
CurrentProgramEnd = current.CurrentProgram.EndTime;
}

if (current.NextProgram != null)
{
NextProgramId = current.NextProgram.IdProgram;
NextProgramName = current.NextProgram.Title;
NextProgramDescription = current.NextProgram.Description;
NextProgramBegin = current.NextProgram.StartTime;
NextProgramEnd = current.NextProgram.EndTime;
}
}

}
}
}
Loading

0 comments on commit 650fed3

Please sign in to comment.