From: <kro...@us...> - 2010-11-28 20:12:39
|
Revision: 3985 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3985&view=rev Author: kroko_koenig Date: 2010-11-28 20:12:33 +0000 (Sun, 28 Nov 2010) Log Message: ----------- more remote control Modified Paths: -------------- trunk/plugins/AndroidRemote/Server/AndroidRemote/Properties/AssemblyInfo.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Properties/AssemblyInfo.cs 2010-11-28 12:47:40 UTC (rev 3984) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Properties/AssemblyInfo.cs 2010-11-28 20:12:33 UTC (rev 3985) @@ -32,5 +32,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.1.0.0")] +[assembly: AssemblyFileVersion("0.1.0.0")] Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-28 12:47:40 UTC (rev 3984) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-28 20:12:33 UTC (rev 3985) @@ -98,8 +98,13 @@ AndroidServer.logDebug("receive HTTP GET : " + req); + if (req.StartsWith("/info")) + { + ReplyInfo(); + } + #region pictures - if (req.StartsWith("/pictures")) + else if (req.StartsWith("/pictures")) { // handle pictures req = req.Replace("/pictures", ""); @@ -160,6 +165,9 @@ } } #endregion + + #region music datatbase + else if (req.StartsWith("/db_music")) { // handle pictures @@ -179,7 +187,6 @@ ReplyMusicDbSongs(); } } - #region music datatbase #endregion @@ -232,6 +239,9 @@ private void ExceuteCommand(string Message) { AndroidServer.logDebug("execute command"); + System.Diagnostics.Debug.WriteLine(Message); + + #region player if (Message.Contains("ACTION_PLAY")) { Action action = new Action(Action.ActionType.ACTION_PLAY, 0, 0); @@ -257,7 +267,19 @@ Action action = new Action(Action.ActionType.ACTION_PREV_ITEM, 0, 0); GUIGraphicsContext.OnAction(action); } + if (Message.Contains("ACTION_FORWARD")) + { + Action action = new Action(Action.ActionType.ACTION_FORWARD, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_REWIND")) + { + Action action = new Action(Action.ActionType.ACTION_REWIND, 0, 0); + GUIGraphicsContext.OnAction(action); + } + #endregion + #region navigate if (Message.Contains("ACTION_MOVE_RIGHT")) { Action action = new Action(Action.ActionType.ACTION_MOVE_RIGHT, 0, 0); @@ -283,13 +305,87 @@ Action action = new Action(Action.ActionType.ACTION_SELECT_ITEM, 0, 0); GUIGraphicsContext.OnAction(action); } + #endregion + + #region menu if (Message.Contains("ACTION_PREVIOUS_MENU")) { Action action = new Action(Action.ActionType.ACTION_PREVIOUS_MENU, 0, 0); GUIGraphicsContext.OnAction(action); } + if (Message.Contains("ACTION_PARENT_DIR")) + { + Action action = new Action(Action.ActionType.ACTION_PARENT_DIR, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_SHOW_INFO")) + { + Action action = new Action(Action.ActionType.ACTION_SHOW_INFO, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_CONTEXT_MENU")) + { + Action action = new Action(Action.ActionType.ACTION_CONTEXT_MENU, 0, 0); + GUIGraphicsContext.OnAction(action); + } + #endregion + + #region volume / programm + if (Message.Contains("ACTION_VOLUME_UP")) + { + Action action = new Action(Action.ActionType.ACTION_VOLUME_UP, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_VOLUME_DOWN")) + { + Action action = new Action(Action.ActionType.ACTION_VOLUME_DOWN, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_VOLUME_MUTE")) + { + Action action = new Action(Action.ActionType.ACTION_VOLUME_MUTE, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_NEXT_CHANNEL")) + { + Action action = new Action(Action.ActionType.ACTION_NEXT_CHANNEL, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_PREV_CHANNEL")) + { + Action action = new Action(Action.ActionType.ACTION_PREV_CHANNEL, 0, 0); + GUIGraphicsContext.OnAction(action); + } + + + #endregion + } + private void ReplyInfo() + { + string msg = string.Empty; + // header + msg += "HTTP/1.0 200 Ok\r\n"; + msg += "Content-Type: application/xml; charset=utf-8; filename=info.xml" + "\r\n"; + msg += "Proxy-Connection: close" + "\r\n"; + msg += "\r\n"; + // content + msg += "<?xml version=\"1.0\"?>\r\n"; + msg += "<Info>\r\n"; + + string strVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + msg += "<ServerVersion>" + strVersion + "</ServerVersion>"; + + string Computername = System.Windows.Forms.SystemInformation.ComputerName.ToString(); + msg += "<ComputerName>" + Computername + "</ComputerName>"; + + msg += "</Info>\r\n"; + // send + sendMessage(socket, msg); + AndroidServer.logDebug("Reply info server"); + } + private void ReplyPictureDir(string dir, string request) { if (Directory.Exists(dir)) Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |