From: <kro...@us...> - 2010-11-22 22:22:57
|
Revision: 3966 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3966&view=rev Author: kroko_koenig Date: 2010-11-22 21:47:27 +0000 (Mon, 22 Nov 2010) Log Message: ----------- very quick solution just to test the android... Added Paths: ----------- trunk/plugins/AndroidRemote/Release/ trunk/plugins/AndroidRemote/Release/main.jpg trunk/plugins/AndroidRemote/Release/splash.png trunk/plugins/AndroidRemote/Server/ trunk/plugins/AndroidRemote/Server/AndroidRemote/ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj.user trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Properties/ trunk/plugins/AndroidRemote/Server/AndroidRemote/Properties/AssemblyInfo.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.resx trunk/plugins/AndroidRemote/Server/AndroidRemote/icon.png trunk/plugins/AndroidRemote/Server/AndroidRemote/icon_off.png trunk/plugins/AndroidRemote/Server/AndroidRemote.sln trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added: trunk/plugins/AndroidRemote/Release/main.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/main.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Release/splash.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/splash.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj (rev 0) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj 2010-11-22 21:47:27 UTC (rev 3966) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{E508BE47-8031-4202-9FD2-404732F86696}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>AndroidRemote</RootNamespace> + <AssemblyName>AndroidRemote</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\plugins\process\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=1.1.1.11854, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Core.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.2.7.11849, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="AndroidServer.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Request.cs" /> + <Compile Include="Setup.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Setup.Designer.cs"> + <DependentUpon>Setup.cs</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="icon.png" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="icon_off.png" /> + <EmbeddedResource Include="Setup.resx"> + <DependentUpon>Setup.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj.user =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj.user (rev 0) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj.user 2010-11-22 21:47:27 UTC (rev 3966) @@ -0,0 +1,9 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectView>ProjectFiles</ProjectView> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <StartAction>Program</StartAction> + <StartProgram>C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe</StartProgram> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs (rev 0) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs 2010-11-22 21:47:27 UTC (rev 3966) @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; +using MediaPortal.Util; + +using System.Threading; +using System.Net; +using System.Net.Sockets; + +namespace AndroidRemote +{ + [PluginIcons("AndroidRemote.icon.png", "AndroidRemote.icon_off.png")] + + public class AndroidServer : IPlugin, ISetupForm + { + private TcpListener myListener; + private string server = string.Empty; + private string port = string.Empty; + + public static string PicturePath = string.Empty; + public static string MusicPath = string.Empty; + public static string VideoPath = string.Empty; + + private Thread listen; + + #region IPlugin + public void Start() + { + // + //Action action = new Action(Action.ActionType.ACTION_EXIT, 0, 0); + //GUIGraphicsContext.OnAction(action); + LoadSettings(); + + listen = new Thread(DoListen); + listen.Start(); + } + public void Stop() + { + } + #endregion + + private void LoadSettings() + { + string dir = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config); + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(dir + "\\MediaPortal.xml")) + { + server= xmlreader.GetValueAsString("android", "server", "192.168.0.30"); + port = xmlreader.GetValueAsString("android", "port", "5050"); + + PicturePath = xmlreader.GetValueAsString("android", "pictures", + Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)); + MusicPath = xmlreader.GetValueAsString("android", "music", + Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)); + VideoPath = xmlreader.GetValueAsString("android", "videos", + Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); + } + } + + private void DoListen() + { + try + { + objServer_Log("Try to init command controler " + server + ":" + port); + + myListener = new TcpListener(IPAddress.Parse(server), Convert.ToInt32(port)); + myListener.Start(); + + myListener.BeginAcceptSocket(new AsyncCallback(DoAcceptSocketCallback), myListener); + objServer_Log("Command controler " + server + ":" + port + " is running"); + } + catch + { + objServer_Log("Failed to init command controler " + server + ":" + port); + } + } + private static void DoAcceptSocketCallback(IAsyncResult ar) + { + // get socket + TcpListener listener = (TcpListener)ar.AsyncState; + Socket clientSocket = listener.EndAcceptSocket(ar); + + // work on request + Request req = new Request(clientSocket); + Thread thread = new Thread(new ThreadStart(req.DoWork)); + thread.Priority = ThreadPriority.BelowNormal; + thread.Start(); + + // restart listener + listener.BeginAcceptSocket(new AsyncCallback(DoAcceptSocketCallback), listener); + } + + #region ISetupForm + + + public bool CanEnable() + { + return true; + } + + public string PluginName() + { + return "Android remote"; + } + + public bool HasSetup() + { + return true; + } + public bool DefaultEnabled() + { + return false; + } + + public int GetWindowId() + { + return 34999934; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = "Android remote plugin"; + strButtonImage = ""; + strButtonImageFocus = ""; + strPictureImage = ""; + return false; + } + + public string Author() + { + return "Mark Koenig (kroko) 2010"; + } + + public string Description() + { + return "Server for Android remote"; + } + + public void ShowPlugin() + { + System.Windows.Forms.Form setup = new Setup(); + setup.ShowDialog(); + } + + #endregion + + void objServer_Log(string message) + { + Log.Info("Android remote: " + message); + } + + } +} Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Properties/AssemblyInfo.cs 2010-11-22 21:47:27 UTC (rev 3966) @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("AndroidRemote")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("HP")] +[assembly: AssemblyProduct("AndroidRemote")] +[assembly: AssemblyCopyright("Copyright © HP 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("18093164-e02f-48db-bf32-4fb284ce85e9")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// 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")] Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs (rev 0) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-22 21:47:27 UTC (rev 3966) @@ -0,0 +1,426 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using System.Threading; +using System.Net; +using System.Net.Sockets; +using System.IO; +using System.Xml; +using System.Drawing; + +using MediaPortal.GUI.Library; +using MediaPortal.Utils; + +namespace AndroidRemote +{ + public class Request + { + private Socket socket; + private byte[] read; + private byte[] buffer; + + private static Dictionary<string, Bitmap> myList = new Dictionary<string, Bitmap>(); + private static Dictionary<string, Bitmap> myThumbList = new Dictionary<string, Bitmap>(); + + public Request(Socket Socket) + { + socket = Socket; + } + + public void DoWork() + { + string clientmessage = " "; + string allMessage = string.Empty; + + while (socket.Connected) + { + read = new byte[1024]; + int bytes = readmessage(read, ref socket, ref clientmessage); + + if (clientmessage.Contains("Continue")) + { + allMessage = allMessage + clientmessage.Substring(0, bytes); + sendMessage(socket, "HTTP/1.0 100 Continue\r\n"); + sendMessage(socket, "\r\n"); + } + else + { + allMessage = allMessage + clientmessage.Substring(0, bytes); + System.Diagnostics.Debug.WriteLine(allMessage); + + if (clientmessage.Contains("POST")) + { + sendMessage(socket, "HTTP/1.0 200 OK\r\n"); + sendMessage(socket, "\r\n"); + + ExceuteCommand(allMessage); + } + else + { + // GET + + int index1 = clientmessage.IndexOf(' '); + int index2 = clientmessage.IndexOf(' ', index1 + 1); + string req = clientmessage.Substring(index1 + 1, index2 - index1).Trim().ToLower(); + + #region pictures + if (req.StartsWith("/pictures")) + { + // handle pictures + req = req.Replace("/pictures", ""); + if (req.StartsWith("/")) req = req.Substring(1); + + req = req.Replace("%20", " "); + + if (req == "") + { + // root + SendDir(AndroidServer.PicturePath, "root"); + } + else + { + req = req.Replace("/", "\\"); + + if (req.EndsWith(".jpg")) + { + string orgPath = AndroidServer.PicturePath + "\\" + req; + SendFile(Path.GetFileName(orgPath)); + } + else if (req.EndsWith(".thb")) + { + string orgPath = AndroidServer.PicturePath + "\\" + req; + SendFileThb(Path.GetFileName(orgPath)); + } + else + { + SendDir(AndroidServer.PicturePath + "\\" + req, req); + } + } + } + #endregion + + #region music + else if (req.StartsWith("/music")) + { + // handle pictures + req = req.Replace("/music", ""); + if (req.StartsWith("/")) req = req.Substring(1); + + req = req.Replace("%20", " "); + + if (req == "") + { + // root + SendDirM(AndroidServer.MusicPath, "root"); + } + else + { + req = req.Replace("/", "\\"); + + if (req.EndsWith(".mp3")) + { + string orgPath = AndroidServer.MusicPath + "\\" + req; + SendFileM(Path.GetFileName(orgPath)); + } + else + { + SendDirM(AndroidServer.MusicPath + "\\" + req, req); + } + } + } + #endregion + + else + { + SendErrorPage(req); + } + + } + + if (socket != null) + { + if (socket.Connected) + { + socket.Close(); + } + } + } + } + } + + private void ExceuteCommand(string Message) + { + if (Message.Contains("ACTION_MOVE_RIGHT")) + { + Action action = new Action(Action.ActionType.ACTION_MOVE_RIGHT, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_MOVE_LEFT")) + { + Action action = new Action(Action.ActionType.ACTION_MOVE_LEFT, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_MOVE_UP")) + { + Action action = new Action(Action.ActionType.ACTION_MOVE_UP, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_MOVE_DOWN")) + { + Action action = new Action(Action.ActionType.ACTION_MOVE_DOWN, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_SELECT_ITEM")) + { + Action action = new Action(Action.ActionType.ACTION_SELECT_ITEM, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_PREVIOUS_MENU")) + { + Action action = new Action(Action.ActionType.ACTION_PREVIOUS_MENU, 0, 0); + GUIGraphicsContext.OnAction(action); + } + } + + private void SendDir(string dir, string request) + { + if (Directory.Exists(dir)) + { + myList.Clear(); + myThumbList.Clear(); + + sendMessage(socket, "HTTP/1.0 200 Ok\r\n"); + sendMessage(socket, "Content-Type: application/xml; charset=utf-8; filename=info.xml" + "\r\n"); + sendMessage(socket, "Proxy-Connection: close" + "\r\n"); + sendMessage(socket, "\r\n"); + + sendMessage(socket, "<?xml version=\"1.0\"?>\r\n"); + sendMessage(socket, "<Directory>\r\n"); + + string[] dirs = Directory.GetDirectories(dir, "*.*", SearchOption.TopDirectoryOnly); + foreach (string f in dirs) + { + sendMessage(socket, "<Folder>" + Path.GetFileName(f) + "</Folder>\r\n"); + } + + string[] files = Directory.GetFiles(dir, "*.jpg", SearchOption.TopDirectoryOnly); + foreach (string f in files) + { + string name = Path.GetFileName(f).ToLower(); + Image img = Bitmap.FromFile(f); + + myList.Add(name, (Bitmap)img); + Bitmap thumb = (Bitmap)img.Clone(); + thumb = MediaPortal.Util.BitmapResize.Resize(ref thumb, 85, 85, false, true); + myThumbList.Add(name, thumb); + + sendMessage(socket, "<File>" + name + "</File>\r\n"); + } + + sendMessage(socket, "</Directory>\r\n"); + } + else + { + SendErrorPage(request); + } + } + private void SendFile(string File) + { + if (myThumbList.ContainsKey(File)) + { + Bitmap bit = myList[File]; + byte[] b = BildToByteArray((Image)bit); + + if (b != null) + { + sendMessage(socket, "HTTP/1.0 200 Ok\r\n"); + sendMessage(socket, "Content-Type: image/jpeg" + "\r\n"); + sendMessage(socket, "Content-Length: " + b.Length + "\r\n"); + sendMessage(socket, "Proxy-Connection: close" + "\r\n"); + sendMessage(socket, "\r\n"); + + sendBytes(socket, b); + } + else + { + SendErrorPage(File); + } + } + else + { + SendErrorPage(File); + } + } + private void SendFileThb(string File) + { + File = File.Replace(".thb", ".jpg"); + if (myThumbList.ContainsKey(File)) + { + Bitmap bit = myThumbList[File]; + byte[] b = BildToByteArray((Image)bit); + + if (b != null) + { + sendMessage(socket, "HTTP/1.0 200 Ok\r\n"); + sendMessage(socket, "Content-Type: image/jpeg" + "\r\n"); + sendMessage(socket, "Content-Length: " + b.Length + "\r\n"); + sendMessage(socket, "Proxy-Connection: close" + "\r\n"); + sendMessage(socket, "\r\n"); + + sendBytes(socket, b); + } + else + { + SendErrorPage(File); + } + } + else + { + SendErrorPage(File); + } + } + + private void SendDirM(string dir, string request) + { + if (Directory.Exists(dir)) + { + sendMessage(socket, "HTTP/1.0 200 Ok\r\n"); + sendMessage(socket, "Content-Type: application/xml; charset=utf-8; filename=info.xml" + "\r\n"); + sendMessage(socket, "Proxy-Connection: close" + "\r\n"); + sendMessage(socket, "\r\n"); + + sendMessage(socket, "<?xml version=\"1.0\"?>\r\n"); + sendMessage(socket, "<Directory>\r\n"); + + string[] dirs = Directory.GetDirectories(dir, "*.*", SearchOption.TopDirectoryOnly); + foreach (string f in dirs) + { + sendMessage(socket, "<Folder>" + Path.GetFileName(f) + "</Folder>\r\n"); + } + + string[] files = Directory.GetFiles(dir, "*.mp3", SearchOption.TopDirectoryOnly); + foreach (string f in files) + { + string name = Path.GetFileName(f).ToLower(); + sendMessage(socket, "<File>" + name + "</File>\r\n"); + } + + sendMessage(socket, "</Directory>\r\n"); + } + else + { + SendErrorPage(request); + } + } + private void SendFileM(string Filename) + { + string dirfFile = AndroidServer.MusicPath + "\\" + Filename; + + if (File.Exists(dirfFile)) + { + byte[] b = FileToByteArray(dirfFile); + + sendMessage(socket, "HTTP/1.0 200 Ok\r\n"); + sendMessage(socket, "Content-Type: audio/mpeg" + "\r\n"); + sendMessage(socket, "Content-Length: " + b.Length + "\r\n"); + sendMessage(socket, "Proxy-Connection: close" + "\r\n"); + sendMessage(socket, "\r\n"); + + sendBytes(socket, b); + } + else + { + SendErrorPage(Filename); + } + } + + private void SendErrorPage(string Filename) + { + sendMessage(socket, "HTTP/1.0" + " " + + "404" + " " + "Not Found" + "\r\n"); + sendMessage(socket, "Content-Type: text/html; charset=utf-8" + "\r\n"); + sendMessage(socket, "Proxy-Connection: close" + "\r\n"); + sendMessage(socket, "\r\n"); + + sendMessage(socket, "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n"); + sendMessage(socket, "<html><head>" + "\r\n"); + sendMessage(socket, "<title>404 Not Found</title>" + "\r\n"); + sendMessage(socket, "</head><body>" + "\r\n"); + sendMessage(socket, "<h1>Not Found</h1>" + "\r\n"); + sendMessage(socket, "<p>The requested URL " + Filename + " was not found on this server.</p>" + "\r\n"); + sendMessage(socket, "<hr>" + "\r\n"); + sendMessage(socket, "<address>TeamMediaportal Server at 127.0.0.1 Port 5050</address>" + "\r\n"); + sendMessage(socket, "</body></html>" + "\r\n"); + } + + private int readmessage(byte[] ByteArray, ref Socket s, ref String clientmessage) + { + int bytes = s.Receive(ByteArray, 1024, 0); + string messagefromclient = Encoding.ASCII.GetString(ByteArray); + clientmessage = (String)messagefromclient; + return bytes; + } + private void sendMessage(Socket sock, string strMessage) + { + try + { + buffer = new Byte[strMessage.Length + 1]; + int len = Encoding.ASCII.GetBytes(strMessage.ToCharArray(), + 0, strMessage.Length, buffer, 0); + sock.Send(buffer, len, 0); + } + catch { } + + } + private void sendBytes(Socket sock, byte[] Bytes) + { + try + { + sock.Send(Bytes, Bytes.Length, 0); + } + catch { } + + } + public byte[] FileToByteArray(string _FileName) + { + byte[] _Buffer = null; + + try + { + // Open file for reading + System.IO.FileStream _FileStream = new System.IO.FileStream(_FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read); + + // attach filestream to binary reader + System.IO.BinaryReader _BinaryReader = new System.IO.BinaryReader(_FileStream); + + // get total byte length of the file + long _TotalBytes = new System.IO.FileInfo(_FileName).Length; + + // read entire file into buffer + _Buffer = _BinaryReader.ReadBytes((Int32)_TotalBytes); + + // close file reader + _FileStream.Close(); + _FileStream.Dispose(); + _BinaryReader.Close(); + } + catch (Exception _Exception) + { + // Error + Console.WriteLine("Exception caught in process: {0}", _Exception.ToString()); + } + + return _Buffer; + } + + private byte[] BildToByteArray(Image Bild) + { + MemoryStream IS = new MemoryStream(); + Bild.Save(IS, System.Drawing.Imaging.ImageFormat.Jpeg); + IS.Flush(); + return IS.ToArray(); + } + + } +} Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs (rev 0) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs 2010-11-22 21:47:27 UTC (rev 3966) @@ -0,0 +1,274 @@ +namespace AndroidRemote +{ + partial class Setup + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.txtPort = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.txtServer = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.btnSave = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtPic = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.txtMusic = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.txtVideos = new System.Windows.Forms.Label(); + this.btnPic = new System.Windows.Forms.Button(); + this.btnMusic = new System.Windows.Forms.Button(); + this.btnVideos = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.txtPort); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.txtServer); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Location = new System.Drawing.Point(12, 12); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(491, 96); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Command controller"; + // + // txtPort + // + this.txtPort.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtPort.Location = new System.Drawing.Point(92, 58); + this.txtPort.Name = "txtPort"; + this.txtPort.Size = new System.Drawing.Size(77, 22); + this.txtPort.TabIndex = 3; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(14, 61); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(32, 16); + this.label2.TabIndex = 2; + this.label2.Text = "Port"; + // + // txtServer + // + this.txtServer.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtServer.Location = new System.Drawing.Point(92, 30); + this.txtServer.Name = "txtServer"; + this.txtServer.Size = new System.Drawing.Size(171, 22); + this.txtServer.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(14, 33); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(48, 16); + this.label1.TabIndex = 0; + this.label1.Text = "Server"; + // + // btnSave + // + this.btnSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnSave.Location = new System.Drawing.Point(12, 296); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(84, 29); + this.btnSave.TabIndex = 1; + this.btnSave.Text = "Save"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // + // btnCancel + // + this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnCancel.Location = new System.Drawing.Point(419, 296); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(84, 29); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.btnVideos); + this.groupBox2.Controls.Add(this.btnMusic); + this.groupBox2.Controls.Add(this.btnPic); + this.groupBox2.Controls.Add(this.txtVideos); + this.groupBox2.Controls.Add(this.label7); + this.groupBox2.Controls.Add(this.txtMusic); + this.groupBox2.Controls.Add(this.label5); + this.groupBox2.Controls.Add(this.txtPic); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Location = new System.Drawing.Point(12, 114); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(491, 164); + this.groupBox2.TabIndex = 3; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Share"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(14, 16); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(56, 16); + this.label3.TabIndex = 1; + this.label3.Text = "Pictures"; + // + // txtPic + // + this.txtPic.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtPic.Location = new System.Drawing.Point(36, 32); + this.txtPic.Name = "txtPic"; + this.txtPic.Size = new System.Drawing.Size(392, 16); + this.txtPic.TabIndex = 2; + this.txtPic.Text = "..."; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.Location = new System.Drawing.Point(14, 48); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(43, 16); + this.label5.TabIndex = 3; + this.label5.Text = "Music"; + // + // txtMusic + // + this.txtMusic.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtMusic.Location = new System.Drawing.Point(36, 64); + this.txtMusic.Name = "txtMusic"; + this.txtMusic.Size = new System.Drawing.Size(392, 16); + this.txtMusic.TabIndex = 4; + this.txtMusic.Text = "..."; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label7.Location = new System.Drawing.Point(14, 80); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(51, 16); + this.label7.TabIndex = 5; + this.label7.Text = "Videos"; + // + // txtVideos + // + this.txtVideos.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtVideos.Location = new System.Drawing.Point(36, 96); + this.txtVideos.Name = "txtVideos"; + this.txtVideos.Size = new System.Drawing.Size(392, 16); + this.txtVideos.TabIndex = 6; + this.txtVideos.Text = "..."; + // + // btnPic + // + this.btnPic.Location = new System.Drawing.Point(445, 29); + this.btnPic.Name = "btnPic"; + this.btnPic.Size = new System.Drawing.Size(40, 23); + this.btnPic.TabIndex = 7; + this.btnPic.Text = "..."; + this.btnPic.UseVisualStyleBackColor = true; + this.btnPic.Click += new System.EventHandler(this.btnPic_Click); + // + // btnMusic + // + this.btnMusic.Location = new System.Drawing.Point(445, 61); + this.btnMusic.Name = "btnMusic"; + this.btnMusic.Size = new System.Drawing.Size(40, 23); + this.btnMusic.TabIndex = 8; + this.btnMusic.Text = "..."; + this.btnMusic.UseVisualStyleBackColor = true; + this.btnMusic.Click += new System.EventHandler(this.btnMusic_Click); + // + // btnVideos + // + this.btnVideos.Location = new System.Drawing.Point(445, 93); + this.btnVideos.Name = "btnVideos"; + this.btnVideos.Size = new System.Drawing.Size(40, 23); + this.btnVideos.TabIndex = 9; + this.btnVideos.Text = "..."; + this.btnVideos.UseVisualStyleBackColor = true; + this.btnVideos.Click += new System.EventHandler(this.btnVideos_Click); + // + // Setup + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(515, 337); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnSave); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Setup"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Setup Android remote"; + this.Load += new System.EventHandler(this.Setup_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox txtPort; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtServer; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btnSave; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Button btnVideos; + private System.Windows.Forms.Button btnMusic; + private System.Windows.Forms.Button btnPic; + private System.Windows.Forms.Label txtVideos; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label txtMusic; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label txtPic; + private System.Windows.Forms.Label label3; + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs (rev 0) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs 2010-11-22 21:47:27 UTC (rev 3966) @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; + +using MediaPortal.Configuration; + +namespace AndroidRemote +{ + public partial class Setup : Form + { + public Setup() + { + InitializeComponent(); + } + + private void Setup_Load(object sender, EventArgs e) + { + LoadSettings(); + } + + private void LoadSettings() + { + string dir = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config); + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(dir + "\\MediaPortal.xml")) + { + txtServer.Text = xmlreader.GetValueAsString("android", "server", "192.168.0.30"); + txtPort.Text = xmlreader.GetValueAsString("android", "port", "5050"); + + txtPic.Text = xmlreader.GetValueAsString("android", "pictures", + Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)); + txtMusic.Text = xmlreader.GetValueAsString("android", "music", + Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)); + txtVideos.Text = xmlreader.GetValueAsString("android", "videos", + Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); + } + } + private void SaveSettings() + { + string dir = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config); + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(dir + "\\MediaPortal.xml")) + { + xmlwriter.SetValue("android", "server", txtServer.Text); + xmlwriter.SetValue("android", "port", txtPort.Text); + + xmlwriter.SetValue("android", "pictures", txtPic.Text); + xmlwriter.SetValue("android", "music", txtMusic.Text); + xmlwriter.SetValue("android", "videos", txtVideos.Text); + } + } + + private void btnCancel_Click(object sender, EventArgs e) + { + this.Close(); + } + private void btnSave_Click(object sender, EventArgs e) + { + SaveSettings(); + this.Close(); + } + + private void btnPic_Click(object sender, EventArgs e) + { + FolderBrowserDialog folder = new FolderBrowserDialog(); + folder.SelectedPath = txtPic.Text; + + DialogResult res = folder.ShowDialog(); + if (res == DialogResult.OK) + { + txtPic.Text = folder.SelectedPath; + } + } + private void btnMusic_Click(object sender, EventArgs e) + { + FolderBrowserDialog folder = new FolderBrowserDialog(); + folder.SelectedPath = txtMusic.Text; + + DialogResult res = folder.ShowDialog(); + if (res == DialogResult.OK) + { + txtMusic.Text = folder.SelectedPath; + } + } + private void btnVideos_Click(object sender, EventArgs e) + { + FolderBrowserDialog folder = new FolderBrowserDialog(); + folder.SelectedPath = txtVideos.Text; + + DialogResult res = folder.ShowDialog(); + if (res == DialogResult.OK) + { + txtVideos.Text = folder.SelectedPath; + } + } + + + } +} Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.resx =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.resx (rev 0) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.resx 2010-11-22 21:47:27 UTC (rev 3966) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Server/AndroidRemote/icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/icon_off.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Server/AndroidRemote/icon_off.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Server/AndroidRemote.sln =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote.sln (rev 0) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote.sln 2010-11-22 21:47:27 UTC (rev 3966) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AndroidRemote", "AndroidRemote\AndroidRemote.csproj", "{E508BE47-8031-4202-9FD2-404732F86696}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E508BE47-8031-4202-9FD2-404732F86696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E508BE47-8031-4202-9FD2-404732F86696}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E508BE47-8031-4202-9FD2-404732F86696}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E508BE47-8031-4202-9FD2-404732F86696}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/AndroidRemote/Server/AndroidRemote.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Server/AndroidRemote.suo ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2010-11-23 20:32:05
|
Revision: 3969 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3969&view=rev Author: kroko_koenig Date: 2010-11-23 20:31:59 +0000 (Tue, 23 Nov 2010) Log Message: ----------- fix the size of a image to the android Modified Paths: -------------- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Release/pictures.jpg trunk/plugins/AndroidRemote/Release/remote.jpg trunk/plugins/AndroidRemote/Release/setup1.jpg trunk/plugins/AndroidRemote/Release/setup2.jpg Added: trunk/plugins/AndroidRemote/Release/pictures.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/pictures.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Release/remote.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/remote.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Release/setup1.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/setup1.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Release/setup2.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/setup2.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-23 13:07:24 UTC (rev 3968) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-23 20:31:59 UTC (rev 3969) @@ -263,8 +263,20 @@ if (pictureThumbList.ContainsKey(File)) { Bitmap bit = pictureList[File]; - byte[] b = BildToByteArray((Image)bit); + byte[] b; + if ((bit.Width > 600) || (bit.Height > 600)) + { + Bitmap thumb = (Bitmap)bit.Clone(); + thumb = MediaPortal.Util.BitmapResize.Resize(ref thumb, 600, 600, false, true); + + b = BildToByteArray((Image)thumb); + } + else + { + b = BildToByteArray((Image)bit); + } + if (b != null) { string msg = string.Empty; 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. |
From: <kro...@us...> - 2010-11-23 21:33:04
|
Revision: 3970 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3970&view=rev Author: kroko_koenig Date: 2010-11-23 21:32:56 +0000 (Tue, 23 Nov 2010) Log Message: ----------- add Android source (very early stage...) Added Paths: ----------- trunk/plugins/AndroidRemote/Android/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>MediaPortalRemote</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.ApkBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,12 @@ +#Thu Nov 18 22:54:50 CET 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="mediaportal.remote" android:versionCode="1" + android:versionName="1.0"> + <application android:icon="@drawable/icon" android:label="@string/app_name"> + <activity android:name=".splash" android:label="@string/app_name"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + <activity android:name=".main" android:label="@string/app_name"> + <intent-filter> + <action android:name="android.intent.action.DEFAULT" /> + <category android:name="android.intent.category.VIEW" /> + </intent-filter> + </activity> + <activity android:name=".remote"></activity> + <activity android:name=".pictures"></activity> + <activity android:name=".picturesfullscreen"></activity> + <activity android:name=".setup"></activity> + </application> + <uses-sdk android:minSdkVersion="3" /> + + <uses-permission android:name="android.permission.INTERNET"></uses-permission> +</manifest> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_DOWN</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_LEFT</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_RIGHT</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_UP</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_PREVIOUS_MENU</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_SELECT_ITEM</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-3 Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,83 @@ +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package mediaportal.remote; + +public final class R { + public static final class attr { + } + public static final class drawable { + public static final int accept_icon=0x7f020000; + public static final int back=0x7f020001; + public static final int back_icon=0x7f020002; + public static final int close_icon=0x7f020003; + public static final int down_icon=0x7f020004; + public static final int icon=0x7f020005; + public static final int music_logo=0x7f020006; + public static final int next_icon=0x7f020007; + public static final int pictures_logo=0x7f020008; + public static final int play=0x7f020009; + public static final int remote_logo=0x7f02000a; + public static final int splash=0x7f02000b; + public static final int up_icon=0x7f02000c; + public static final int videos_logo=0x7f02000d; + } + public static final class id { + public static final int Button01=0x7f050006; + public static final int GridView01=0x7f050007; + public static final int ImageView01=0x7f050008; + public static final int MainButton1=0x7f050000; + public static final int MainButton2=0x7f050001; + public static final int MainButton3=0x7f050002; + public static final int MainButton4=0x7f050003; + public static final int btnCancel=0x7f05000b; + public static final int btnDown=0x7f05000d; + public static final int btnLeft=0x7f05000f; + public static final int btnOk=0x7f05000c; + public static final int btnReturn=0x7f05000a; + public static final int btnReturnSetup=0x7f050012; + public static final int btnRight=0x7f05000e; + public static final int btnStartSetup=0x7f050004; + public static final int btnUp=0x7f050009; + public static final int server_ip=0x7f050010; + public static final int server_port=0x7f050011; + public static final int widget0=0x7f050005; + } + public static final class layout { + public static final int main=0x7f030000; + public static final int pictures=0x7f030001; + public static final int picturesfullscreen=0x7f030002; + public static final int remote=0x7f030003; + public static final int setup=0x7f030004; + public static final int splash=0x7f030005; + } + public static final class string { + public static final int app_name=0x7f040001; + public static final int hello=0x7f040000; + } + public static final class styleable { + /** Attributes that can be used with a Gallery1. + <p>Includes the following attributes:</p> + <table> + <colgroup align="left" /> + <colgroup align="left" /> + <tr><th>Attribute</th><th>Description</th></tr> + <tr><td><code>{@link #Gallery1_android_galleryItemBackground mediaportal.remote:android_galleryItemBackground}</code></td><td></td></tr> + </table> + @see #Gallery1_android_galleryItemBackground + */ + public static final int[] Gallery1 = { + 0x0101004c + }; + /** + <p>This symbol is the offset where the {@link mediaportal.remote.R.attr#android_galleryItemBackground} + attribute's value can be found in the {@link #Gallery1} array. + @attr name android:android_galleryItemBackground + */ + public static final int Gallery1_android_galleryItemBackground = 0; + }; +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@drawable/back" + > + +<Button android:id="@+id/MainButton1" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/pictures_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button android:id="@+id/MainButton2" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/music_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button android:id="@+id/MainButton3" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/videos_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button android:id="@+id/MainButton4" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/remote_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button + android:id="@+id/btnStartSetup" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Setup"></Button> + +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,24 @@ +<AbsoluteLayout +android:id="@+id/widget0" +android:layout_width="fill_parent" +android:layout_height="wrap_content" +android:background="@drawable/back" +xmlns:android="http://schemas.android.com/apk/res/android" +> +<Button android:text="Return" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> + +<GridView android:layout_y="60dip" + android:layout_x="0dip" + android:id="@+id/GridView01" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:columnWidth="90dp" + android:numColumns="auto_fit" + android:verticalSpacing="10dp" + android:horizontalSpacing="10dp" + android:stretchMode="columnWidth" + android:gravity="center" + > + </GridView> +</AbsoluteLayout> + Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@drawable/back" + > + +<ImageView android:id="@+id/ImageView01" + android:layout_width="wrap_content" + android:layout_height="wrap_content"></ImageView> +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="utf-8"?> +<AbsoluteLayout +android:id="@+id/widget0" +android:layout_width="fill_parent" +android:layout_height="fill_parent" +android:background="@drawable/back" +xmlns:android="http://schemas.android.com/apk/res/android" +> +<Button +android:id="@+id/btnUp" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/up_icon" +android:layout_x="130px" +android:layout_y="100px" +> +</Button> +<Button +android:id="@+id/btnReturn" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:text="Return" +android:layout_x="10px" +android:layout_y="8px" +> +</Button> +<Button +android:id="@+id/btnCancel" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/close_icon" +android:layout_x="260px" +android:layout_y="8px" +> +</Button> +<Button +android:id="@+id/btnOk" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/accept_icon" +android:layout_x="130px" +android:layout_y="175px" +> +</Button> +<Button +android:id="@+id/btnDown" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/down_icon" +android:layout_x="130px" +android:layout_y="250px" +> +</Button> +<Button +android:id="@+id/btnRight" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/next_icon" +android:layout_x="205px" +android:layout_y="175px" +> +</Button> +<Button +android:id="@+id/btnLeft" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/back_icon" +android:layout_x="55px" +android:layout_y="175px" +></Button> + +</AbsoluteLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:orientation="vertical" + android:padding="15dip" + android:background="@drawable/back"> +<TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="MediaPortal IP"></TextView> +<EditText android:id="@+id/server_ip" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:text="192.168.0.30" + android:inputType="text"></EditText> +<TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="MediaPortal Port"></TextView> +<EditText android:id="@+id/server_port" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="8200" android:inputType="number|numberSigned"></EditText> +<Button + android:id="@+id/btnReturnSetup" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Return"></Button> + +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent"> + <ImageView + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:src="@drawable/splash" + android:scaleType="fitXY"> + </ImageView> +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <declare-styleable name="Gallery1"> + <attr name="android:galleryItemBackground"/> + </declare-styleable> +</resources> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="hello">Hello World, main!</string> + <string name="app_name">MediaPortal Remote</string> +</resources> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,159 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.xml.sax.ContentHandler; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.view.View; +import android.view.ViewGroup; +import android.widget.*; + +import mediaportal.remote.httpHandler; + + +public class ImageAdapter extends BaseAdapter { + private Context mContext; + + public ImageAdapter(Context c) { + mContext = c; + } + + public int getCount() { + directoryItems myItems = directoryXmlHandler.getSitesList(); + return myItems.gettitle().size(); + } + + public Object getItem(int position) { + return null; + } + + public long getItemId(int position) { + return 0; + } + + // create a new ImageView for each item referenced by the Adapter + public View getView(int position, View convertView, ViewGroup parent) { + ImageView imageView; + if (convertView == null) { // if it's not recycled, initialize some attributes + imageView = new ImageView(mContext); + imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); + imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); + imageView.setPadding(8, 8, 8, 8); + } else { + imageView = (ImageView) convertView; + } + + imageView.setImageBitmap(bmImg[position]); + return imageView; + } + + public static Bitmap[] bmImg; + public static Bitmap downloadFile(String fileUrl){ + URL myFileUrl =null; + try { + myFileUrl= new URL(fileUrl); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); + conn.setReadTimeout(3000); + conn.setDoInput(true); + conn.connect(); + //int length = conn.getContentLength(); + InputStream is = conn.getInputStream(); + + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser sp = null; + try { + sp = spf.newSAXParser(); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + XMLReader reader = null; + try { + reader = sp.getXMLReader(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + directoryXmlHandler handler = new directoryXmlHandler(); + + reader.setContentHandler(handler); + try { + reader.parse(new InputSource(is)); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + is.close(); + sp.reset(); + + directoryItems myItems = directoryXmlHandler.getSitesList(); + bmImg = new Bitmap[myItems.gettitle().size()]; + + httpHandler h = new httpHandler(); + + for (int i = 0; i < myItems.gettitle().size(); i++) + { + String tit = myItems.gettitle().get(i); + Boolean fold = myItems.getIsFolder().get(i); + + tit = tit + ".thb"; + bmImg[i] = h.DownloadImage("http://192.168.0.30:8200/pictures/" + tit); + } + + + //bmImg = BitmapFactory.decodeStream(is); + return null; + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } + public static Bitmap ddownloadFile2(String fileUrl){ + URL myFileUrl =null; + try { + myFileUrl= new URL(fileUrl); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); + conn.setDoInput(true); + conn.connect(); + //int length = conn.getContentLength(); + InputStream is = conn.getInputStream(); + + Bitmap myImg = BitmapFactory.decodeStream(is); + return myImg; + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,26 @@ +package mediaportal.remote; + +import java.util.ArrayList; + +/** Contains getter and setter method for variables */ +public class directoryItems { + + /** Variables */ + private ArrayList<String> title = new ArrayList<String>(); + private ArrayList<Boolean> isFolder = new ArrayList<Boolean>(); + + public ArrayList<String> gettitle() { + return title; + } + public void settitle(String title) { + this.title.add(title); + } + + public ArrayList<Boolean> getIsFolder() { + return isFolder; + } + public void setIsFolder(Boolean isFolder) { + this.isFolder.add(isFolder); + } + +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,68 @@ +package mediaportal.remote; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public class directoryXmlHandler extends DefaultHandler { + Boolean currentElement = false; + String currentValue = null; + + public static directoryItems itemList = null; + + public static directoryItems getSitesList() { + return itemList; + } + + public static void setSitesList(directoryItems directoryList) { + directoryXmlHandler.itemList = directoryList; + } + + /** + * Called when tag starts ( example:- <name>AndroidPeople</name> -- <name> ) + */ + @Override + public void startElement(String uri, String localName, String qName, + Attributes attributes) throws SAXException { + currentElement = true; + + if (localName == "Directory") { + itemList = new directoryItems(); + } + } + + /** + * Called when tag closing ( example:- <name>AndroidPeople</name> -- </name> ) + */ + @Override + public void endElement(String uri, String localName, String qName) + throws SAXException { + + currentElement = false; + + /** set value */ + if (localName == "Folder") { + itemList.setIsFolder(true); + itemList.settitle(currentValue); + } + if (localName == "File") { + itemList.setIsFolder(false); + itemList.settitle(currentValue); + } + } + + /** + * Called to get tag characters ( example:- <name>AndroidPeople</name> -- to get + * AndroidPeople Character ) + */ + @Override + public void characters(char[] ch, int start, int length) + throws SAXException { + if (currentElement) { + currentValue = new String(ch, start, length); + currentElement = false; + } + + } + +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,73 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; + +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.os.Bundle; +import android.os.Message; + +public class httpHandler { + + public httpHandler() { + + } + + public InputStream openHttpConnection(String urlStr) { + InputStream in = null; + int resCode = -1; + + try { + URL url = new URL(urlStr); + URLConnection urlConn = url.openConnection(); + + if (!(urlConn instanceof HttpURLConnection)) { + throw new IOException("URL is not an Http URL"); + } + + HttpURLConnection httpConn = (HttpURLConnection) urlConn; + httpConn.setAllowUserInteraction(false); + httpConn.setInstanceFollowRedirects(true); + httpConn.setRequestMethod("GET"); + httpConn.connect(); + resCode = httpConn.getResponseCode(); + + if (resCode == HttpURLConnection.HTTP_OK) { + in = httpConn.getInputStream(); + } + + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + return in; + } + + public Bitmap DownloadImage(String urlStr) { + + final String url = urlStr; + Bitmap bitmap = null; + + InputStream in = null; + + try { + in = openHttpConnection(url); + bitmap = BitmapFactory.decodeStream(in); + if (in != null) + in.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + + return bitmap; + + } + +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,54 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.*; +import android.content.SharedPreferences; + +public class main extends Activity { + + public static String HttpServer; + public static String HttpPort; + + public static String SelectedPicture; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + + SharedPreferences settings = getPreferences(MODE_PRIVATE); + + HttpServer = settings.getString("Server", "192.168.0.30"); + HttpPort = settings.getString("Port", "8200"); + + Button btnPictures = (Button) findViewById(R.id.MainButton1); + btnPictures.setOnClickListener(new View.OnClickListener(){ + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), pictures.class); + startActivityForResult(myIntent, 0); + } + }); + + Button btnRemote = (Button) findViewById(R.id.MainButton4); + btnRemote.setOnClickListener(new View.OnClickListener(){ + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), remote.class); + startActivityForResult(myIntent, 0); + } + }); + + Button btnSetup = (Button) findViewById(R.id.btnStartSetup); + btnSetup.setOnClickListener(new View.OnClickListener(){ + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), setup.class); + startActivityForResult(myIntent, 0); + } + }); + + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,47 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import mediaportal.remote.ImageAdapter; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; +import android.widget.Button; +import android.widget.GridView; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.Toast; + +public class pictures extends Activity { + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.pictures); + + ImageAdapter.downloadFile("http://192.168.0.30:8200/pictures/2010/2008%2001%2023"); + + GridView gridview = (GridView) findViewById(R.id.GridView01); + gridview.setAdapter(new ImageAdapter(this)); + + Button ret = (Button) findViewById(R.id.Button01); + ret.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + gridview.setOnItemClickListener(new OnItemClickListener() { + public void onItemClick(AdapterView<?> parent, View v, int position, long id) + { + main.SelectedPicture = "http://192.168.0.30:8200/pictures/2010/2008%2001%2023/sdc10839.jpg"; + Intent myIntent = new Intent(v.getContext(), picturesfullscreen.class); + startActivityForResult(myIntent, 0); + } + }); + } +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,32 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; + +public class picturesfullscreen extends Activity { + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.picturesfullscreen); + + httpHandler h = new httpHandler(); + + ImageView imagev = (ImageView) findViewById(R.id.ImageView01); + imagev.setImageBitmap(h.DownloadImage(main.SelectedPicture)); + + imagev.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,130 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; + +import mediaportal.remote.R; + +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.BasicHttpParams; +import org.apache.http.params.HttpConnectionParams; +import org.apache.http.params.HttpParams; + +import android.app.Activity; +import android.content.Intent; +import android.content.res.AssetManager; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.Toast; + +public class remote extends Activity { + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.remote); + + Button ret = (Button) findViewById(R.id.btnReturn); + ret.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + Button can = (Button) findViewById(R.id.btnCancel); + can.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("prevMenu"); + } + }); + + Button left = (Button) findViewById(R.id.btnLeft); + left.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveLeft"); + } + }); + + Button right = (Button) findViewById(R.id.btnRight); + right.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveRight"); + } + }); + + Button up = (Button) findViewById(R.id.btnUp); + up.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveUp"); + } + }); + + Button down = (Button) findViewById(R.id.btnDown); + down.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveDown"); + } + }); + + Button ok = (Button) findViewById(R.id.btnOk); + ok.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("selectItem"); + } + }); + } + + public void PostCommand(String button) { + + HttpParams httpParameters = new BasicHttpParams(); + HttpConnectionParams.setConnectionTimeout(httpParameters, 3000); + HttpConnectionParams.setSoTimeout(httpParameters, 3000); + + HttpClient httpclient = new DefaultHttpClient(httpParameters); + HttpPost httppost = new HttpPost("http://" + main.HttpServer + ":" + + main.HttpPort); + + try { + + AssetManager assetManager = getAssets(); + + InputStream inputStream = null; + inputStream = assetManager.open("cmd_" + button + ".xml"); + + int x = inputStream.read(); + + String xml = ""; + + while (x != -1) { + xml = xml + (char) x; + x = inputStream.read(); + } + + StringEntity se = new StringEntity(xml, "UTF-8"); + se.setContentType("application/atom+xml"); + + httppost.setEntity(se); + + //HttpResponse response; + //response = httpclient.execute(httppost); + httpclient.execute(httppost); + + } catch (ClientProtocolException e) { + Toast.makeText(remote.this, "ERROR CONNECTION SERVER", + Toast.LENGTH_LONG).show(); + e.printStackTrace(); + } catch (IOException e) { + Toast.makeText(remote.this, "TIME OUT SERVER", Toast.LENGTH_LONG) + .show(); + e.printStackTrace(); + } + } + +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,50 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.os.Handler; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; + +public class setup extends Activity { + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle icicle) { + super.onCreate(icicle); + setContentView(R.layout.setup); + + SharedPreferences settings = getPreferences(MODE_PRIVATE); + EditText txt1 = (EditText)findViewById(R.id.server_ip); + EditText txt2 = (EditText)findViewById(R.id.server_port); + + txt1.setText(settings.getString("Server", "192.168.0.30")); + txt2.setText(settings.getString("Port", "8200")); + + Button ret = (Button) findViewById(R.id.btnReturnSetup); + ret.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + + EditText txt1 = (EditText)findViewById(R.id.server_ip); + EditText txt2 = (EditText)findViewById(R.id.server_port); + + SharedPreferences settings = getPreferences(MODE_PRIVATE); + + SharedPreferences.Editor prefEditor = settings.edit(); + prefEditor.putString("Server", txt1.getEditableText().toString()); + prefEditor.putString("Port", txt2.getEditableText().toString()); + prefEditor.commit(); + + + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + } +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,45 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; + +public class splash extends Activity { + + // =========================================================== + // Fields + // =========================================================== + + private final int SPLASH_DISPLAY_LENGHT = 3000; + + // =========================================================== + // "Constructors" + // =========================================================== + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle icicle) { + super.onCreate(icicle); + setContentView(R.layout.splash); + + /* + * New Handler to start the Menu-Activity + * + * and close this Splash-Screen after some seconds. + */ + + new Handler().postDelayed(new Runnable() { + + // @Override + public void run() { + + /* Create an Intent that will start the main-Activity. */ + Intent mainIntent = new Intent(splash.this, main.class); + splash.this.startActivity(mainIntent); + splash.this.finish(); + } + }, SPLASH_DISPLAY_LENGHT); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2010-11-24 09:33:06
|
Revision: 3972 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3972&view=rev Author: kroko_koenig Date: 2010-11-24 09:32:55 +0000 (Wed, 24 Nov 2010) Log Message: ----------- check in again Modified Paths: -------------- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>MediaPortalRemote</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.ApkBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,12 @@ +#Thu Nov 18 22:54:50 CET 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="mediaportal.remote" android:versionCode="1" + android:versionName="1.0"> + <application android:icon="@drawable/icon" android:label="@string/app_name"> + <activity android:name=".splash" android:label="@string/app_name"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + <activity android:name=".main" android:label="@string/app_name"> + <intent-filter> + <action android:name="android.intent.action.DEFAULT" /> + <category android:name="android.intent.category.VIEW" /> + </intent-filter> + </activity> + <activity android:name=".remote"></activity> + <activity android:name=".pictures"></activity> + <activity android:name=".picturesfullscreen"></activity> + <activity android:name=".setup"></activity> + </application> + <uses-sdk android:minSdkVersion="3" /> + + <uses-permission android:name="android.permission.INTERNET"></uses-permission> +</manifest> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_DOWN</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_LEFT</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_RIGHT</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_UP</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_PREVIOUS_MENU</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_SELECT_ITEM</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-3 Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,83 @@ +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package mediaportal.remote; + +public final class R { + public static final class attr { + } + public static final class drawable { + public static final int accept_icon=0x7f020000; + public static final int back=0x7f020001; + public static final int back_icon=0x7f020002; + public static final int close_icon=0x7f020003; + public static final int down_icon=0x7f020004; + public static final int icon=0x7f020005; + public static final int music_logo=0x7f020006; + public static final int next_icon=0x7f020007; + public static final int pictures_logo=0x7f020008; + public static final int play=0x7f020009; + public static final int remote_logo=0x7f02000a; + public static final int splash=0x7f02000b; + public static final int up_icon=0x7f02000c; + public static final int videos_logo=0x7f02000d; + } + public static final class id { + public static final int Button01=0x7f050006; + public static final int GridView01=0x7f050007; + public static final int ImageView01=0x7f050008; + public static final int MainButton1=0x7f050000; + public static final int MainButton2=0x7f050001; + public static final int MainButton3=0x7f050002; + public static final int MainButton4=0x7f050003; + public static final int btnCancel=0x7f05000b; + public static final int btnDown=0x7f05000d; + public static final int btnLeft=0x7f05000f; + public static final int btnOk=0x7f05000c; + public static final int btnReturn=0x7f05000a; + public static final int btnReturnSetup=0x7f050012; + public static final int btnRight=0x7f05000e; + public static final int btnStartSetup=0x7f050004; + public static final int btnUp=0x7f050009; + public static final int server_ip=0x7f050010; + public static final int server_port=0x7f050011; + public static final int widget0=0x7f050005; + } + public static final class layout { + public static final int main=0x7f030000; + public static final int pictures=0x7f030001; + public static final int picturesfullscreen=0x7f030002; + public static final int remote=0x7f030003; + public static final int setup=0x7f030004; + public static final int splash=0x7f030005; + } + public static final class string { + public static final int app_name=0x7f040001; + public static final int hello=0x7f040000; + } + public static final class styleable { + /** Attributes that can be used with a Gallery1. + <p>Includes the following attributes:</p> + <table> + <colgroup align="left" /> + <colgroup align="left" /> + <tr><th>Attribute</th><th>Description</th></tr> + <tr><td><code>{@link #Gallery1_android_galleryItemBackground mediaportal.remote:android_galleryItemBackground}</code></td><td></td></tr> + </table> + @see #Gallery1_android_galleryItemBackground + */ + public static final int[] Gallery1 = { + 0x0101004c + }; + /** + <p>This symbol is the offset where the {@link mediaportal.remote.R.attr#android_galleryItemBackground} + attribute's value can be found in the {@link #Gallery1} array. + @attr name android:android_galleryItemBackground + */ + public static final int Gallery1_android_galleryItemBackground = 0; + }; +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@drawable/back" + > + +<Button android:id="@+id/MainButton1" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/pictures_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button android:id="@+id/MainButton2" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/music_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button android:id="@+id/MainButton3" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/videos_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button android:id="@+id/MainButton4" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/remote_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button + android:id="@+id/btnStartSetup" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Setup"></Button> + +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,24 @@ +<AbsoluteLayout +android:id="@+id/widget0" +android:layout_width="fill_parent" +android:layout_height="wrap_content" +android:background="@drawable/back" +xmlns:android="http://schemas.android.com/apk/res/android" +> +<Button android:text="Return" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> + +<GridView android:layout_y="60dip" + android:layout_x="0dip" + android:id="@+id/GridView01" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:columnWidth="90dp" + android:numColumns="auto_fit" + android:verticalSpacing="10dp" + android:horizontalSpacing="10dp" + android:stretchMode="columnWidth" + android:gravity="center" + > + </GridView> +</AbsoluteLayout> + Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@drawable/back" + > + +<ImageView android:id="@+id/ImageView01" + android:layout_width="wrap_content" + android:layout_height="wrap_content"></ImageView> +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="utf-8"?> +<AbsoluteLayout +android:id="@+id/widget0" +android:layout_width="fill_parent" +android:layout_height="fill_parent" +android:background="@drawable/back" +xmlns:android="http://schemas.android.com/apk/res/android" +> +<Button +android:id="@+id/btnUp" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/up_icon" +android:layout_x="130px" +android:layout_y="100px" +> +</Button> +<Button +android:id="@+id/btnReturn" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:text="Return" +android:layout_x="10px" +android:layout_y="8px" +> +</Button> +<Button +android:id="@+id/btnCancel" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/close_icon" +android:layout_x="260px" +android:layout_y="8px" +> +</Button> +<Button +android:id="@+id/btnOk" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/accept_icon" +android:layout_x="130px" +android:layout_y="175px" +> +</Button> +<Button +android:id="@+id/btnDown" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/down_icon" +android:layout_x="130px" +android:layout_y="250px" +> +</Button> +<Button +android:id="@+id/btnRight" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/next_icon" +android:layout_x="205px" +android:layout_y="175px" +> +</Button> +<Button +android:id="@+id/btnLeft" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/back_icon" +android:layout_x="55px" +android:layout_y="175px" +></Button> + +</AbsoluteLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:orientation="vertical" + android:padding="15dip" + android:background="@drawable/back"> +<TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="MediaPortal IP"></TextView> +<EditText android:id="@+id/server_ip" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:text="192.168.0.30" + android:inputType="text"></EditText> +<TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="MediaPortal Port"></TextView> +<EditText android:id="@+id/server_port" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="8200" android:inputType="number|numberSigned"></EditText> +<Button + android:id="@+id/btnReturnSetup" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Return"></Button> + +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent"> + <ImageView + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:src="@drawable/splash" + android:scaleType="fitXY"> + </ImageView> +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <declare-styleable name="Gallery1"> + <attr name="android:galleryItemBackground"/> + </declare-styleable> +</resources> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="hello">Hello World, main!</string> + <string name="app_name">MediaPortal Remote</string> +</resources> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,135 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +import android.content.Context; +import android.graphics.Bitmap; +import android.view.View; +import android.view.ViewGroup; +import android.widget.*; + +import mediaportal.remote.httpHandler; + + +public class ImageAdapter extends BaseAdapter { + private Context mContext; + + public ImageAdapter(Context c) { + mContext = c; + } + + public int getCount() { + directoryItems myItems = directoryXmlHandler.getSitesList(); + return myItems.gettitle().size(); + } + + public Object getItem(int position) { + return null; + } + + public long getItemId(int position) { + return 0; + } + + // create a new ImageView for each item referenced by the Adapter + public View getView(int position, View convertView, ViewGroup parent) { + ImageView imageView; + if (convertView == null) { // if it's not recycled, initialize some attributes + imageView = new ImageView(mContext); + imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); + imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); + imageView.setPadding(8, 8, 8, 8); + } else { + imageView = (ImageView) convertView; + } + + imageView.setImageBitmap(bmImg[position]); + return imageView; + } + + public static Bitmap[] bmImg; + public static Bitmap downloadFile(String fileUrl){ + URL myFileUrl =null; + try { + myFileUrl= new URL(fileUrl); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); + conn.setReadTimeout(3000); + conn.setDoInput(true); + conn.connect(); + //int length = conn.getContentLength(); + InputStream is = conn.getInputStream(); + + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser sp = null; + try { + sp = spf.newSAXParser(); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + XMLReader reader = null; + try { + reader = sp.getXMLReader(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + directoryXmlHandler handler = new directoryXmlHandler(); + + reader.setContentHandler(handler); + try { + reader.parse(new InputSource(is)); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + is.close(); + sp.reset(); + + directoryItems myItems = directoryXmlHandler.getSitesList(); + bmImg = new Bitmap[myItems.gettitle().size()]; + + httpHandler h = new httpHandler(); + + for (int i = 0; i < myItems.gettitle().size(); i++) + { + String tit = myItems.gettitle().get(i); + //Boolean fold = myItems.getIsFolder().get(i); + + tit = tit + ".thb"; + + bmImg[i] = h.DownloadImage("http://192.6.10.182:8200/pictures/" + tit); + } + + + //bmImg = BitmapFactory.decodeStream(is); + return null; + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,26 @@ +package mediaportal.remote; + +import java.util.ArrayList; + +/** Contains getter and setter method for variables */ +public class directoryItems { + + /** Variables */ + private ArrayList<String> title = new ArrayList<String>(); + private ArrayList<Boolean> isFolder = new ArrayList<Boolean>(); + + public ArrayList<String> gettitle() { + return title; + } + public void settitle(String title) { + this.title.add(title); + } + + public ArrayList<Boolean> getIsFolder() { + return isFolder; + } + public void setIsFolder(Boolean isFolder) { + this.isFolder.add(isFolder); + } + +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,68 @@ +package mediaportal.remote; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public class directoryXmlHandler extends DefaultHandler { + Boolean currentElement = false; + String currentValue = null; + + public static directoryItems itemList = null; + + public static directoryItems getSitesList() { + return itemList; + } + + public static void setSitesList(directoryItems directoryList) { + directoryXmlHandler.itemList = directoryList; + } + + /** + * Called when tag starts ( example:- <name>AndroidPeople</name> -- <name> ) + */ + @Override + public void startElement(String uri, String localName, String qName, + Attributes attributes) throws SAXException { + currentElement = true; + + if (localName == "Directory") { + itemList = new directoryItems(); + } + } + + /** + * Called when tag closing ( example:- <name>AndroidPeople</name> -- </name> ) + */ + @Override + public void endElement(String uri, String localName, String qName) + throws SAXException { + + currentElement = false; + + /** set value */ + if (localName == "Folder") { + itemList.setIsFolder(true); + itemList.settitle(currentValue); + } + if (localName == "File") { + itemList.setIsFolder(false); + itemList.settitle(currentValue); + } + } + + /** + * Called to get tag characters ( example:- <name>AndroidPeople</name> -- to get + * AndroidPeople Character ) + */ + @Override + public void characters(char[] ch, int start, int length) + throws SAXException { + if (currentElement) { + currentValue = new String(ch, start, length); + currentElement = false; + } + + } + +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,70 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; + +public class httpHandler { + + public httpHandler() { + + } + + public InputStream openHttpConnection(String urlStr) { + InputStream in = null; + int resCode = -1; + + try { + URL url = new URL(urlStr); + URLConnection urlConn = url.openConnection(); + + if (!(urlConn instanceof HttpURLConnection)) { + throw new IOException("URL is not an Http URL"); + } + + HttpURLConnection httpConn = (HttpURLConnection) urlConn; + httpConn.setAllowUserInteraction(false); + httpConn.setInstanceFollowRedirects(true); + httpConn.setRequestMethod("GET"); + httpConn.connect(); + resCode = httpConn.getResponseCode(); + + if (resCode == HttpURLConnection.HTTP_OK) { + in = httpConn.getInputStream(); + } + + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + return in; + } + + public Bitmap DownloadImage(String urlStr) { + + final String url = urlStr; + Bitmap bitmap = null; + + InputStream in = null; + + try { + in = openHttpConnection(url); + bitmap = BitmapFactory.decodeStream(in); + if (in != null) + in.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + + return bitmap; + + } + +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,68 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.*; + +public class main extends Activity { + + public static String SelectedPicture; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + + Button btnPictures = (Button) findViewById(R.id.MainButton1); + btnPictures.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), pictures.class); + startActivityForResult(myIntent, 0); + } + }); + + Button btnRemote = (Button) findViewById(R.id.MainButton4); + btnRemote.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), remote.class); + startActivityForResult(myIntent, 0); + } + }); + + Button btnSetup = (Button) findViewById(R.id.btnStartSetup); + btnSetup.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), setup.class); + startActivityForResult(myIntent, 0); + } + }); + + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + menu.add(0, 111, 0, "Settings"); + menu.add(0, 112, 0, "Exit"); + return true; + } + + @Override + public boolean onOptionsItemSelected (MenuItem item){ + switch (item.getItemId()){ + case 111: + Intent myIntent = new Intent(this, setup.class); + startActivityForResult(myIntent, 0); + return true; + case 112: + this.finish(); + return true; + } + return true; + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,64 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import mediaportal.remote.ImageAdapter; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; +import android.widget.Button; +import android.widget.GridView; +import android.widget.AdapterView.OnItemClickListener; + +public class pictures extends Activity { + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.pictures); + + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE , MODE_PRIVATE); + + String HttpServer = settings.getString("Server", "192.168.0.30"); + String HttpPort = settings.getString("Port", "8200"); + + ImageAdapter.downloadFile("http://" + HttpServer + ":" + HttpPort + + "/pictures/2010/2008%2001%2023"); + + GridView gridview = (GridView) findViewById(R.id.GridView01); + gridview.setAdapter(new ImageAdapter(this)); + + Button ret = (Button) findViewById(R.id.Button01); + ret.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + gridview.setOnItemClickListener(new OnItemClickListener() { + public void onItemClick(AdapterView<?> parent, View v, + int position, long id) { + + SharedPreferences settings = getPreferences(MODE_PRIVATE); + + String HttpServer = settings + .getString("Server", "192.168.0.30"); + String HttpPort = settings.getString("Port", "8200"); + + main.SelectedPicture = "http://" + HttpServer + ":" + HttpPort + + "/pictures/2010/2008%2001%2023/sdc10839.jpg"; + Intent myIntent = new Intent(v.getContext(), + picturesfullscreen.class); + startActivityForResult(myIntent, 0); + } + }); + } +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,32 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; + +public class picturesfullscreen extends Activity { + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.picturesfullscreen); + + httpHandler h = new httpHandler(); + + ImageView imagev = (ImageView) findViewById(R.id.ImageView01); + imagev.setImageBitmap(h.DownloadImage(main.SelectedPicture)); + + imagev.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,139 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; + +import mediaportal.remote.R; + +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.BasicHttpParams; +import org.apache.http.params.HttpConnectionParams; +import org.apache.http.params.HttpParams; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.AssetManager; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.Toast; + +public class remote extends Activity { + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.remote); + + Button ret = (Button) findViewById(R.id.btnReturn); + ret.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + Button can = (Button) findViewById(R.id.btnCancel); + can.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("prevMenu"); + } + }); + + Button left = (Button) findViewById(R.id.btnLeft); + left.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveLeft"); + } + }); + + Button right = (Button) findViewById(R.id.btnRight); + right.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveRight"); + } + }); + + Button up = (Button) findViewById(R.id.btnUp); + up.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveUp"); + } + }); + + Button down = (Button) findViewById(R.id.btnDown); + down.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveDown"); + } + }); + + Button ok = (Button) findViewById(R.id.btnOk); + ok.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("selectItem"); + } + }); + } + + public void PostCommand(String button) { + + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE , MODE_PRIVATE); + + String HttpServer = settings.getString("Server", "192.168.0.30"); + String HttpPort = settings.getString("Port", "8200"); + + HttpParams httpParameters = new BasicHttpParams(); + HttpConnectionParams.setConnectionTimeout(httpParameters, 3000); + HttpConnectionParams.setSoTimeout(httpParameters, 3000); + + HttpClient httpclient = new DefaultHttpClient(httpParameters); + HttpPost httppost = new HttpPost("http://" + HttpServer + ":" + + HttpPort); + + try { + + AssetManager assetManager = getAssets(); + + InputStream inputStream = null; + inputStream = assetManager.open("cmd_" + button + ".xml"); + + int x = inputStream.read(); + + String xml = ""; + + while (x != -1) { + xml = xml + (char) x; + x = inputStream.read(); + } + + StringEntity se = new StringEntity(xml, "UTF-8"); + se.setContentType("application/atom+xml"); + + httppost.setEntity(se); + + // HttpResponse response; + // response = httpclient.execute(httppost); + httpclient.execute(httppost); + + } catch (ClientProtocolException e) { + Toast.makeText(remote.this, "ERROR CONNECTION SERVER", + Toast.LENGTH_LONG).show(); + e.printStackTrace(); + } catch (IOException e) { + Toast.makeText(remote.this, "TIME OUT SERVER", Toast.LENGTH_LONG) + .show(); + e.printStackTrace(); + } + } + +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,62 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; + +public class setup extends Activity { + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle icicle) { + super.onCreate(icicle); + setContentView(R.layout.setup); + + + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE , MODE_PRIVATE); + EditText txt1 = (EditText)findViewById(R.id.server_ip); + EditText txt2 = (EditText)findViewById(R.id.server_port); + + txt1.setText(settings.getString("Server", "192.168.0.30")); + txt2.setText(settings.getString("Port", "8200")); + + + /* + settings set = new settings(); + + EditText txt1 = (EditText)findViewById(R.id.server_ip); + EditText txt2 = (EditText)findViewById(R.id.server_port); + + txt1.setText(set.getServer()); + txt2.setText(set.getPort()); + */ + + Button ret = (Button) findViewById(R.id.btnReturnSetup); + ret.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + + EditText txt1 = (EditText)findViewById(R.id.server_ip); + EditText txt2 = (EditText)findViewById(R.id.server_port); + + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE , MODE_PRIVATE); + + SharedPreferences.Editor prefEditor = settings.edit(); + prefEditor.putString("Server", txt1.getEditableText().toString()); + prefEditor.putString("Port", txt2.getEditableText().toString()); + prefEditor.commit(); + + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + } +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java 2010-11-24 09:32:55 UTC (rev 3972) @@ -0,0 +1,45 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; + +public class splash extends Activity { + + // =========================================================== + // Fields + // =========================================================== + + private final int SPLASH_DISPLAY_LENGHT = 3000; + + // =========================================================== + // "Constructors" + // =========================================================== + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle icicle) { + super.onCreate(icicle); + setContentView(R.layout.splash); + + /* + * New Handler to start the Menu-Activity + * + * and close this Splash-Screen after some seconds. + */ + + new Handler().postDelayed(new Runnable() { + + // @Override + public void run() { + + /* Create an Intent that will start the main-Activity. */ + Intent mainIntent = new Intent(splash.this, main.class); + splash.this.startActivity(mainIntent); + splash.this.finish(); + } + }, SPLASH_DISPLAY_LENGHT); + } +} Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-24 09:16:26 UTC (rev 3971) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-24 09:32:55 UTC (rev 3972) @@ -154,6 +154,13 @@ } #endregion + #region nowplaying + else if (req.StartsWith("/nowplaying")) + { + ReplyNowPlaying(); + } + #endregion + else { SendErrorURL(req); @@ -406,6 +413,32 @@ } } + private void ReplyNowPlaying() + { + 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 += "<NowPlaying>\r\n"; + + msg += "<PlayerState></PlayerState>\r\n"; + + msg += "<Title></Title>\r\n"; + msg += "<Artist></Artist>\r\n"; + msg += "<Cover></Cover>\r\n"; + + msg += "<ActualTime></ActualTime>\r\n"; + msg += "<TotalTime></TotalTime>\r\n"; + + msg += "</NowPlaying>\r\n"; + // send + sendMessage(socket, msg); + } + private void SendErrorURL(string Url) { string msg = string.Empty; 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. |
From: <kro...@us...> - 2010-11-24 17:32:28
|
Revision: 3975 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3975&view=rev Author: kroko_koenig Date: 2010-11-24 17:32:20 +0000 (Wed, 24 Nov 2010) Log Message: ----------- pictures almost finished, start work on mp3 saving Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Release/main.jpg trunk/plugins/AndroidRemote/Release/remote.jpg trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/folder.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/folderback.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/nowplaying_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/picture.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/icon.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturehandler.java trunk/plugins/AndroidRemote/Release/folder.jpg trunk/plugins/AndroidRemote/Release/picture.jpg trunk/plugins/AndroidRemote/Release/settings.jpg Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-24 13:13:47 UTC (rev 3974) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-24 17:32:20 UTC (rev 3975) @@ -16,44 +16,52 @@ public static final int back_icon=0x7f020002; public static final int close_icon=0x7f020003; public static final int down_icon=0x7f020004; - public static final int icon=0x7f020005; - public static final int music_logo=0x7f020006; - public static final int next_icon=0x7f020007; - public static final int pictures_logo=0x7f020008; - public static final int play=0x7f020009; - public static final int remote_logo=0x7f02000a; - public static final int splash=0x7f02000b; - public static final int up_icon=0x7f02000c; - public static final int videos_logo=0x7f02000d; + public static final int folder=0x7f020005; + public static final int folderback=0x7f020006; + public static final int icon=0x7f020007; + public static final int music_logo=0x7f020008; + public static final int next_icon=0x7f020009; + public static final int nowplaying_logo=0x7f02000a; + public static final int picture=0x7f02000b; + public static final int pictures_logo=0x7f02000c; + public static final int play=0x7f02000d; + public static final int remote_logo=0x7f02000e; + public static final int splash=0x7f02000f; + public static final int up_icon=0x7f020010; + public static final int videos_logo=0x7f020011; } public static final class id { - public static final int Button01=0x7f050006; - public static final int GridView01=0x7f050007; - public static final int ImageView01=0x7f050008; - public static final int MainButton1=0x7f050000; - public static final int MainButton2=0x7f050001; - public static final int MainButton3=0x7f050002; - public static final int MainButton4=0x7f050003; - public static final int btnCancel=0x7f05000b; - public static final int btnDown=0x7f05000d; - public static final int btnLeft=0x7f05000f; - public static final int btnOk=0x7f05000c; - public static final int btnReturn=0x7f05000a; - public static final int btnReturnSetup=0x7f050012; - public static final int btnRight=0x7f05000e; - public static final int btnStartSetup=0x7f050004; - public static final int btnUp=0x7f050009; - public static final int server_ip=0x7f050010; - public static final int server_port=0x7f050011; - public static final int widget0=0x7f050005; + public static final int GridView01=0x7f050009; + public static final int ImageView01=0x7f05000b; + public static final int MainButton1=0x7f050003; + public static final int MainButton2=0x7f050004; + public static final int MainButton3=0x7f050005; + public static final int MainButton4=0x7f050006; + public static final int MainButton5=0x7f050007; + public static final int btnCancel=0x7f05000e; + public static final int btnDown=0x7f050010; + public static final int btnLeft=0x7f050012; + public static final int btnOk=0x7f05000f; + public static final int btnReturn=0x7f05000d; + public static final int btnReturnSetup=0x7f050015; + public static final int btnRight=0x7f050011; + public static final int btnUp=0x7f05000c; + public static final int full_text=0x7f05000a; + public static final int icon_image=0x7f050001; + public static final int icon_text=0x7f050002; + public static final int server_ip=0x7f050013; + public static final int server_port=0x7f050014; + public static final int widget0=0x7f050008; + public static final int widget44=0x7f050000; } public static final class layout { - public static final int main=0x7f030000; - public static final int pictures=0x7f030001; - public static final int picturesfullscreen=0x7f030002; - public static final int remote=0x7f030003; - public static final int setup=0x7f030004; - public static final int splash=0x7f030005; + public static final int icon=0x7f030000; + public static final int main=0x7f030001; + public static final int pictures=0x7f030002; + public static final int picturesfullscreen=0x7f030003; + public static final int remote=0x7f030004; + public static final int setup=0x7f030005; + public static final int splash=0x7f030006; } public static final class string { public static final int app_name=0x7f040001; Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/folder.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/folder.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/folderback.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/folderback.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/nowplaying_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/nowplaying_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/picture.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/picture.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/icon.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/icon.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/icon.xml 2010-11-24 17:32:20 UTC (rev 3975) @@ -0,0 +1,23 @@ +<LinearLayout +xmlns:android="http://schemas.android.com/apk/res/android" +android:id="@+id/widget44" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:orientation="vertical" +android:layout_x="201px" +android:layout_y="165px" +android:gravity="center_horizontal"> +<ImageView +android:id="@+id/icon_image" +android:layout_width="wrap_content" +android:layout_height="wrap_content"> +</ImageView> +<TextView +android:id="@+id/icon_text" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:text="TextView" +android:gravity="center_horizontal" +android:textColorHighlight="#656565"> +</TextView> +</LinearLayout> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-11-24 13:13:47 UTC (rev 3974) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-11-24 17:32:20 UTC (rev 3975) @@ -9,7 +9,7 @@ <Button android:id="@+id/MainButton1" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:padding="10dp" + android:padding="0dp" android:background="@drawable/pictures_logo" /> <View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> @@ -17,7 +17,7 @@ <Button android:id="@+id/MainButton2" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:padding="10dp" + android:padding="0dp" android:background="@drawable/music_logo" /> <View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> @@ -25,7 +25,7 @@ <Button android:id="@+id/MainButton3" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:padding="10dp" + android:padding="0dp" android:background="@drawable/videos_logo" /> <View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> @@ -33,15 +33,15 @@ <Button android:id="@+id/MainButton4" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:padding="10dp" + android:padding="0dp" android:background="@drawable/remote_logo" /> <View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> -<Button - android:id="@+id/btnStartSetup" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Setup"></Button> +<Button android:id="@+id/MainButton5" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="0dp" + android:background="@drawable/nowplaying_logo" /> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2010-11-24 13:13:47 UTC (rev 3974) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2010-11-24 17:32:20 UTC (rev 3975) @@ -5,9 +5,7 @@ android:background="@drawable/back" xmlns:android="http://schemas.android.com/apk/res/android" > -<Button android:text="Return" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> - -<GridView android:layout_y="60dip" +<GridView android:layout_y="0dip" android:layout_x="0dip" android:id="@+id/GridView01" android:layout_width="fill_parent" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-11-24 13:13:47 UTC (rev 3974) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-11-24 17:32:20 UTC (rev 3975) @@ -1,10 +1,19 @@ -<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/back" > +<TextView + android:id="@+id/full_text" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="name" + android:gravity="center_horizontal" + android:background="#FFFFFFFF" + android:textColor="#FF000000" + android:textColorHighlight="#FFFFFFFF"> +</TextView> <ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java 2010-11-24 13:13:47 UTC (rev 3974) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java 2010-11-24 17:32:20 UTC (rev 3975) @@ -22,62 +22,64 @@ import mediaportal.remote.httpHandler; - public class ImageAdapter extends BaseAdapter { - private Context mContext; + private Context mContext; - public ImageAdapter(Context c) { - mContext = c; - } + public ImageAdapter(Context c) { + mContext = c; + } - public int getCount() { - directoryItems myItems = directoryXmlHandler.getSitesList(); - return myItems.gettitle().size(); - } + public int getCount() { + directoryItems myItems = directoryXmlHandler.getSitesList(); + return myItems.gettitle().size(); + } - public Object getItem(int position) { - return null; - } + public Object getItem(int position) { + return null; + } - public long getItemId(int position) { - return 0; - } + public long getItemId(int position) { + return 0; + } - // create a new ImageView for each item referenced by the Adapter - public View getView(int position, View convertView, ViewGroup parent) { - ImageView imageView; - if (convertView == null) { // if it's not recycled, initialize some attributes - imageView = new ImageView(mContext); - imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); - imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); - imageView.setPadding(8, 8, 8, 8); - } else { - imageView = (ImageView) convertView; - } - - imageView.setImageBitmap(bmImg[position]); - return imageView; - } - - public static Bitmap[] bmImg; - public static Bitmap downloadFile(String fileUrl){ - URL myFileUrl =null; - try { - myFileUrl= new URL(fileUrl); - } catch (MalformedURLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - try { - HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); - conn.setReadTimeout(3000); - conn.setDoInput(true); - conn.connect(); - //int length = conn.getContentLength(); - InputStream is = conn.getInputStream(); - - SAXParserFactory spf = SAXParserFactory.newInstance(); - SAXParser sp = null; + // create a new ImageView for each item referenced by the Adapter + public View getView(int position, View convertView, ViewGroup parent) { + ImageView imageView; + if (convertView == null) { // if it's not recycled, initialize some + // attributes + imageView = new ImageView(mContext); + imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); + imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); + imageView.setPadding(8, 8, 8, 8); + } else { + imageView = (ImageView) convertView; + } + + imageView.setImageBitmap(bmImg[position]); + return imageView; + } + + public static Bitmap[] bmImg; + + public static Bitmap downloadFile(String fileUrl) { + URL myFileUrl = null; + try { + myFileUrl = new URL(fileUrl); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + HttpURLConnection conn = (HttpURLConnection) myFileUrl + .openConnection(); + conn.setReadTimeout(3000); + conn.setDoInput(true); + conn.connect(); + // int length = conn.getContentLength(); + InputStream is = conn.getInputStream(); + + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser sp = null; try { sp = spf.newSAXParser(); } catch (ParserConfigurationException e) { @@ -87,8 +89,8 @@ // TODO Auto-generated catch block e.printStackTrace(); } - - XMLReader reader = null; + + XMLReader reader = null; try { reader = sp.getXMLReader(); } catch (SAXException e) { @@ -96,40 +98,39 @@ e.printStackTrace(); } - directoryXmlHandler handler = new directoryXmlHandler(); - - reader.setContentHandler(handler); - try { + directoryXmlHandler handler = new directoryXmlHandler(); + + reader.setContentHandler(handler); + try { reader.parse(new InputSource(is)); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } - is.close(); - sp.reset(); - - directoryItems myItems = directoryXmlHandler.getSitesList(); - bmImg = new Bitmap[myItems.gettitle().size()]; - - httpHandler h = new httpHandler(); - - for (int i = 0; i < myItems.gettitle().size(); i++) - { - String tit = myItems.gettitle().get(i); - //Boolean fold = myItems.getIsFolder().get(i); - - tit = tit + ".thb"; - - bmImg[i] = h.DownloadImage("http://192.6.10.182:8200/pictures/" + tit); - } - - - //bmImg = BitmapFactory.decodeStream(is); - return null; - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } + is.close(); + sp.reset(); + + directoryItems myItems = directoryXmlHandler.getSitesList(); + bmImg = new Bitmap[myItems.gettitle().size()]; + + httpHandler h = new httpHandler(); + + for (int i = 0; i < myItems.gettitle().size(); i++) { + String tit = myItems.gettitle().get(i); + // Boolean fold = myItems.getIsFolder().get(i); + + tit = tit + ".thb"; + + bmImg[i] = h.DownloadImage("http://192.6.10.182:8200/pictures/" + + tit); + } + + // bmImg = BitmapFactory.decodeStream(is); + return null; + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } } \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-24 13:13:47 UTC (rev 3974) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-24 17:32:20 UTC (rev 3975) @@ -1,16 +1,28 @@ package mediaportal.remote; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; + +import org.apache.http.util.ByteArrayBuffer; + import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.os.Environment; +import android.widget.Toast; public class httpHandler { + String extStorageDirectory; + public httpHandler() { } @@ -67,4 +79,39 @@ } + public void DownloadFile() { + extStorageDirectory = Environment.getExternalStorageDirectory() + .toString(); + + try { + InputStream in = openHttpConnection("http://192.168.0.30:8200/music/Clementi_Sonatina_Op.36_No.1_Movement_1.mp3"); + + //BufferedInputStream bis = new BufferedInputStream(in); + ByteArrayBuffer baf = new ByteArrayBuffer(50); + int current = 0; + + byte[] bb = new byte[1024]; + int l = in.read(bb,0,1024); + + while (l > -0) { + baf.append(bb, 0, l); + l = in.read(bb,0,1024); + } + + OutputStream outStream = null; + File file = new File(extStorageDirectory, "test.mp3"); + + outStream = new FileOutputStream(file); + outStream.write(baf.toByteArray()); + outStream.flush(); + outStream.close(); + + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-24 13:13:47 UTC (rev 3974) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-24 17:32:20 UTC (rev 3975) @@ -11,8 +11,6 @@ public class main extends Activity { - public static String SelectedPicture; - /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { @@ -35,11 +33,11 @@ } }); - Button btnSetup = (Button) findViewById(R.id.btnStartSetup); - btnSetup.setOnClickListener(new View.OnClickListener() { + Button btnNowPlaying = (Button) findViewById(R.id.MainButton5); + btnNowPlaying.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), setup.class); - startActivityForResult(myIntent, 0); + httpHandler h = new httpHandler(); + h.DownloadFile(); } }); Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturehandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturehandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturehandler.java 2010-11-24 17:32:20 UTC (rev 3975) @@ -0,0 +1,163 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +import android.graphics.Bitmap; + +import mediaportal.remote.directoryItems; + +public class picturehandler { + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + private static directoryItems pictures; + private static picturehandler instance; + + private static String actualDir = ""; + + private String _server; + private String _port; + + public int selectedPicture; + public String selectedPictureName = ""; + + public Bitmap getselectedPicture() { + + String act = pictures.gettitle().get(selectedPicture); + String dir = actualDir + "/" + act; + selectedPictureName = act; + + try { + dir = URLEncoder.encode(dir, "UTF-8"); + } catch (UnsupportedEncodingException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + String fileUrl = "http://" + _server + ":" + _port + "/" + dir; + httpHandler h = new httpHandler(); + return h.DownloadImage(fileUrl); + } + + public static picturehandler getinstance() { + if (instance == null) + instance = new picturehandler(); + return instance; + } + + private picturehandler() { + pictures = new directoryItems(); + } + + public void setconnection(String server, String port) { + _server = server; + _port = port; + } + + public directoryItems getpictures() { + return pictures; + } + + public void getrootdirectory() { + actualDir = "pictures"; + fetchdirectory(actualDir); + } + + private void fetchdirectory(String dir) { + pictures = new directoryItems(); + try { + dir = URLEncoder.encode(dir, "UTF-8"); + } catch (UnsupportedEncodingException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + String fileUrl = "http://" + _server + ":" + _port + "/" + dir; + + URL myFileUrl = null; + try { + myFileUrl = new URL(fileUrl); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + HttpURLConnection conn = (HttpURLConnection) myFileUrl + .openConnection(); + conn.setReadTimeout(10000); + conn.setDoInput(true); + conn.connect(); + // int length = conn.getContentLength(); + InputStream is = conn.getInputStream(); + + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser sp = null; + try { + sp = spf.newSAXParser(); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + XMLReader reader = null; + try { + reader = sp.getXMLReader(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + directoryXmlHandler handler = new directoryXmlHandler(); + + reader.setContentHandler(handler); + try { + reader.parse(new InputSource(is)); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + is.close(); + sp.reset(); + + pictures = directoryXmlHandler.getSitesList(); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public void gotodir(String dir) { + actualDir += "/" + dir; + fetchdirectory(actualDir); + } + + public void oneup() { + int x = actualDir.lastIndexOf("/"); + if (x >= 0) { + actualDir = actualDir.substring(0, x); + } + fetchdirectory(actualDir); + } + + public String getactualdir() { + return actualDir; + } +} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-24 13:13:47 UTC (rev 3974) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-24 17:32:20 UTC (rev 3975) @@ -1,64 +1,172 @@ package mediaportal.remote; import mediaportal.remote.R; -import mediaportal.remote.ImageAdapter; import android.app.Activity; +import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; +import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.widget.AdapterView; +import android.widget.BaseAdapter; import android.widget.Button; import android.widget.GridView; +import android.widget.ImageView; +import android.widget.TextView; import android.widget.AdapterView.OnItemClickListener; +import mediaportal.remote.picturehandler; public class pictures extends Activity { - + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - + /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.pictures); - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE , MODE_PRIVATE); + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); String HttpServer = settings.getString("Server", "192.168.0.30"); String HttpPort = settings.getString("Port", "8200"); - ImageAdapter.downloadFile("http://" + HttpServer + ":" + HttpPort - + "/pictures/2010/2008%2001%2023"); + // ImageAdapter.downloadFile("http://" + HttpServer + ":" + HttpPort + // + "/pictures/2010/2008%2001%2023"); + picturehandler h = picturehandler.getinstance(); + h.setconnection(HttpServer, HttpPort); + h.getrootdirectory(); + GridView gridview = (GridView) findViewById(R.id.GridView01); - gridview.setAdapter(new ImageAdapter(this)); + gridview.setAdapter(new ImageAdapter2(this)); - Button ret = (Button) findViewById(R.id.Button01); - ret.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - Intent intent = new Intent(); - setResult(RESULT_OK, intent); - finish(); - } - }); - gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { - SharedPreferences settings = getPreferences(MODE_PRIVATE); + TextView tv = (TextView) v.findViewById(R.id.icon_text); + ImageView iv = (ImageView) v.findViewById(R.id.icon_image); + picItem pic = (picItem) iv.getTag(); - String HttpServer = settings - .getString("Server", "192.168.0.30"); - String HttpPort = settings.getString("Port", "8200"); + if (pic.typ == "item") { + picturehandler h = picturehandler.getinstance(); + h.selectedPicture = position - 1; - main.SelectedPicture = "http://" + HttpServer + ":" + HttpPort - + "/pictures/2010/2008%2001%2023/sdc10839.jpg"; - Intent myIntent = new Intent(v.getContext(), - picturesfullscreen.class); - startActivityForResult(myIntent, 0); + Intent myIntent = new Intent(v.getContext(), + picturesfullscreen.class); + startActivityForResult(myIntent, 0); + } + + if (pic.typ == "folder") { + + picturehandler h = picturehandler.getinstance(); + h.gotodir(pic.title); + + GridView gridview = (GridView) findViewById(R.id.GridView01); + gridview.setAdapter(new ImageAdapter2(parent.getContext())); + + parent.invalidate(); + } + + if (pic.typ == "oneup") { + picturehandler h = picturehandler.getinstance(); + h.oneup(); + + GridView gridview = (GridView) findViewById(R.id.GridView01); + gridview.setAdapter(new ImageAdapter2(parent.getContext())); + + parent.invalidate(); + } + } }); } + + public class ImageAdapter2 extends BaseAdapter { + private Context mContext; + public static final int ACTIVITY_CREATE = 10; + + public ImageAdapter2(Context c) { + mContext = c; + } + + public int getCount() { + picturehandler h = picturehandler.getinstance(); + return h.getpictures().gettitle().size() + 1; + } + + public Object getItem(int position) { + return null; + } + + public long getItemId(int position) { + return 0; + } + + // @Override + // create a new ImageView for each item referenced by the Adapter + public View getView(int position, View convertView, ViewGroup parent) { + View v; + if (convertView == null) { // if it's not recycled, initialize some + // attributes + + if (position > 0) { + position = position - 1; + + picturehandler h = picturehandler.getinstance(); + String txtName = h.getpictures().gettitle().get(position); + Boolean isFolder = h.getpictures().getIsFolder() + .get(position); + + LayoutInflater li = LayoutInflater.from(mContext); + v = li.inflate(R.layout.icon, null); + TextView tv = (TextView) v.findViewById(R.id.icon_text); + tv.setText(txtName); // ("Profile "+position); + ImageView iv = (ImageView) v.findViewById(R.id.icon_image); + + if (isFolder) { + iv.setImageResource(R.drawable.folder); + picItem pic = new picItem(); + pic.title = txtName; + pic.typ = "folder"; + iv.setTag(pic); + } else { + iv.setImageResource(R.drawable.picture); + picItem pic = new picItem(); + pic.title = txtName; + pic.typ = "item"; + iv.setTag(pic); + } + } else { + LayoutInflater li = LayoutInflater.from(mContext); + v = li.inflate(R.layout.icon, null); + TextView tv = (TextView) v.findViewById(R.id.icon_text); + tv.setText(".."); // ("Profile "+position); + ImageView iv = (ImageView) v.findViewById(R.id.icon_image); + iv.setImageResource(R.drawable.folderback); + picItem pic = new picItem(); + pic.title = ".."; + pic.typ = "oneup"; + iv.setTag(pic); + } + + } else { + v = convertView; + } + + // imageView.setImageBitmap(bmImg[position]); + return v; + } + } + + public class picItem { + public String title; + public String typ; + } + } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-24 13:13:47 UTC (rev 3974) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-24 17:32:20 UTC (rev 3975) @@ -4,29 +4,111 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.GestureDetector; +import android.view.GestureDetector.OnGestureListener; +import android.view.GestureDetector.SimpleOnGestureListener; +import android.view.LayoutInflater.Filter; +import android.view.MotionEvent; import android.view.View; +import android.view.View.OnClickListener; import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; -public class picturesfullscreen extends Activity { +public class picturesfullscreen extends Activity implements OnGestureListener { + private static final int SWIPE_MIN_DISTANCE = 120; + private static final int SWIPE_MAX_OFF_PATH = 250; + private static final int SWIPE_THRESHOLD_VELOCITY = 200; + + private GestureDetector gestureScanner; + /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.picturesfullscreen); - httpHandler h = new httpHandler(); + gestureScanner = new GestureDetector(this); ImageView imagev = (ImageView) findViewById(R.id.ImageView01); - imagev.setImageBitmap(h.DownloadImage(main.SelectedPicture)); + picturehandler pic = picturehandler.getinstance(); + imagev.setImageBitmap(pic.getselectedPicture()); - imagev.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - Intent intent = new Intent(); - setResult(RESULT_OK, intent); - finish(); + TextView txt = (TextView) findViewById(R.id.full_text); + txt.setText(pic.selectedPictureName); + + /* + * imagev.setOnClickListener(new View.OnClickListener() { public void + * onClick(View view) { Intent intent = new Intent(); + * setResult(RESULT_OK, intent); finish(); } }); + */ + + } + + @Override + public boolean onTouchEvent(MotionEvent me) { + return gestureScanner.onTouchEvent(me); + } + + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, + float velocityY) { + try { + if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) + return false; + // right to left swipe + if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE + && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + Toast.makeText(picturesfullscreen.this, "Left Swipe", + Toast.LENGTH_SHORT).show(); + picturehandler pic = picturehandler.getinstance(); + pic.selectedPicture += 1; + if(pic.selectedPicture>=pic.getpictures().gettitle().size()) + pic.selectedPicture = 0; + ImageView imagev = (ImageView) findViewById(R.id.ImageView01); + imagev.setImageBitmap(pic.getselectedPicture()); + TextView txt = (TextView) findViewById(R.id.full_text); + txt.setText(pic.selectedPictureName); + + } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE + && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + Toast.makeText(picturesfullscreen.this, "Right Swipe", + Toast.LENGTH_SHORT).show(); + picturehandler pic = picturehandler.getinstance(); + pic.selectedPicture -= 1; + if(pic.selectedPicture<=0) + pic.selectedPicture = pic.getpictures().gettitle().size(); + ImageView imagev = (ImageView) findViewById(R.id.ImageView01); + imagev.setImageBitmap(pic.getselectedPicture()); + TextView txt = (TextView) findViewById(R.id.full_text); + txt.setText(pic.selectedPictureName); } - }); + } catch (Exception e) { + String g = e.getStackTrace().toString(); + // nothing + } + return false; + } + + public boolean onDown(MotionEvent arg0) { + // TODO Auto-generated method stub + return true; + } + public void onLongPress(MotionEvent arg0) { + // TODO Auto-generated method stub } + public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2, + float arg3) { + // TODO Auto-generated method stub + return false; + } + public void onShowPress(MotionEvent arg0) { + // TODO Auto-generated method stub + + } + public boolean onSingleTapUp(MotionEvent arg0) { + // TODO Auto-generated method stub + return false; + } } \ No newline at end of file Added: trunk/plugins/AndroidRemote/Release/folder.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/folder.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Release/main.jpg =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Release/picture.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/picture.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Release/remote.jpg =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Release/settings.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/settings.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-24 13:13:47 UTC (rev 3974) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-24 17:32:20 UTC (rev 3975) @@ -45,8 +45,6 @@ private byte[] read; private byte[] buffer; - private static Dictionary<string, Bitmap> pictureList = new Dictionary<string, Bitmap>(); - private static Dictionary<string, Bitmap> pictureThumbList = new Dictionary<string, Bitmap>(); private static Dictionary<string, string> musicList = new Dictionary<string, string>(); public Request(Socket Socket) @@ -73,7 +71,6 @@ else { allMessage = allMessage + clientmessage.Substring(0, bytes); - System.Diagnostics.Debug.WriteLine(allMessage); if (clientmessage.Contains("POST")) { @@ -91,6 +88,8 @@ req = HttpUtility.UrlDecode(req); + System.Diagnostics.Debug.WriteLine("GET Request : " + req); + #region pictures if (req.StartsWith("/pictures")) { @@ -110,12 +109,12 @@ if (req.EndsWith(".jpg")) { string orgPath = AndroidServer.PicturePath + "\\" + req; - ReplyPictureFile(Path.GetFileName(orgPath)); + ReplyPictureFile(orgPath); } else if (req.EndsWith(".thb")) { string orgPath = AndroidServer.PicturePath + "\\" + req; - ReplyPictureThumbFile(Path.GetFileName(orgPath)); + ReplyPictureThumbFile(orgPath); } else { @@ -217,9 +216,6 @@ { if (Directory.Exists(dir)) { - pictureList.Clear(); - pictureThumbList.Clear(); - string msg = string.Empty; // header msg += "HTTP/1.0 200 Ok\r\n"; @@ -239,21 +235,7 @@ string[] files = Directory.GetFiles(dir, "*.jpg", SearchOption.TopDirectoryOnly); foreach (string f in files) { - string name = Path.GetFileName(f).ToLower(); - Image img = null; - try - { - img = Bitmap.FromFile(f); - } - catch { } - if (img != null) - { - pictureList.Add(name, (Bitmap)img); - Bitmap thumb = (Bitmap)img.Clone(); - thumb = MediaPortal.Util.BitmapResize.Resize(ref thumb, 85, 85, false, true); - pictureThumbList.Add(name, thumb); - } - msg += "<File>" + name + "</File>\r\n"; + msg += "<File>" + Path.GetFileName(f) + "</File>\r\n"; } msg += "</Directory>\r\n"; // send @@ -265,11 +247,11 @@ SendErrorURL(request); } } - private void ReplyPictureFile(string File) + private void ReplyPictureFile(string filePath) { - if (pictureThumbList.ContainsKey(File)) + if (File.Exists(filePath)) { - Bitmap bit = pictureList[File]; + Bitmap bit = (Bitmap)Bitmap.FromFile(filePath); byte[] b; if ((bit.Width > 600) || (bit.Height > 600)) @@ -299,25 +281,26 @@ } else { - SendErrorFile(File); + SendServerError(filePath,"ReplyPictureFile"); } } else { - SendErrorFile(File); + SendErrorFile(filePath); } } - private void ReplyPictureThumbFile(string File) + private void ReplyPictureThumbFile(string filePath) { - /// - /// we might do cache the thumb different later, right now you need to request the dir first - /// - File = File.Replace(".thb", ""); - if (pictureThumbList.ContainsKey(File)) + if (File.Exists(filePath)) { - Bitmap bit = pictureThumbList[File]; - byte[] b = BildToByteArray((Image)bit); + Bitmap bit = (Bitmap)Bitmap.FromFile(filePath); + byte[] b; + Bitmap thumb = (Bitmap)bit.Clone(); + thumb = MediaPortal.Util.BitmapResize.Resize(ref thumb, 85, 85, false, true); + + b = BildToByteArray((Image)thumb); + if (b != null) { string msg = string.Empty; @@ -333,12 +316,12 @@ } else { - SendErrorFile(File); + SendServerError(filePath, "ReplyPictureThumbFile"); } } else { - SendErrorFile(File); + SendErrorFile(filePath); } } @@ -441,6 +424,7 @@ private void SendErrorURL(string Url) { + System.Diagnostics.Debug.WriteLine("URL NOT FOUND " + Url); string msg = string.Empty; // header msg += "HTTP/1.0 404 Not Found\r\n"; @@ -460,8 +444,9 @@ // send sendMessage(socket, msg); } - private void SendErrorFile(string File) + private void SendErrorFile(string FileName) { + System.Diagnostics.Debug.WriteLine("FILE NOT FOUND " + FileName); string msg = string.Empty; // header msg += "HTTP/1.0 404 Not Found\r\n"; @@ -474,13 +459,35 @@ msg += "<title>404 Not Found</title>" + "\r\n"; msg += "</head><body>" + "\r\n"; msg += "<h1>Not Found</h1>" + "\r\n"; - msg += "<p>The requested file " + File + " was not found on this server.</p>" + "\r\n"; + msg += "<p>The requested file " + FileName + " was not found on this server.</p>" + "\r\n"; msg += "<hr>" + "\r\n"; msg += "<address>TeamMediaportal Server at " + AndroidServer.Server + " Port " + AndroidServer.Port + "</address>" + "\r\n"; msg += "</body></html>" + "\r\n"; // send sendMessage(socket, msg); } + private void SendServerError(string Data, string Who) + { + System.Diagnostics.Debug.WriteLine("Internal Server Error " + Who); + string msg = string.Empty; + // header + msg += "HTTP/1.0 500 Internal Server Error\r\n"; + msg += "Content-Type: text/html; charset=utf-8" + "\r\n"; + msg += "Proxy-Connection: close" + "\r\n"; + msg += "\r\n"; + // message + msg += "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n"; + msg += "<html><head>" + "\r\n"; + msg += "<title>404 Not Found</title>" + "\r\n"; + msg += "</head><body>" + "\r\n"; + msg += "<h1>Not Found</h1>" + "\r\n"; + msg += "<p>The requested data " + Data + " causes a problem.</p>" + "\r\n"; + msg += "<hr>" + "\r\n"; + msg += "<address>TeamMediaportal Server at " + AndroidServer.Server + " Port " + AndroidServer.Port + "</address>" + "\r\n"; + msg += "</body></html>" + "\r\n"; + // send + sendMessage(socket, msg); + } private int readmessage(byte[] ByteArray, ref Socket s, ref String clientmessage) { 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. |
From: <kro...@us...> - 2010-11-24 21:07:28
|
Revision: 3976 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3976&view=rev Author: kroko_koenig Date: 2010-11-24 21:07:20 +0000 (Wed, 24 Nov 2010) Log Message: ----------- more updates now playing and pictures Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_next.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_pause.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_play.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previous.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_stop.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/cdcover.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/document.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/forward.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pause.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/rewind.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/stop.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java trunk/plugins/AndroidRemote/Release/nowplaying.jpg Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -19,6 +19,7 @@ <activity android:name=".pictures"></activity> <activity android:name=".picturesfullscreen"></activity> <activity android:name=".setup"></activity> + <activity android:name=".nowplaying"></activity> </application> <uses-sdk android:minSdkVersion="3" /> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_next.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_next.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_next.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_NEXT_ITEM</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_pause.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_pause.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_pause.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_PAUSE</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_play.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_play.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_play.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_PLAY</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previous.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previous.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previous.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_PREV_ITEM</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_stop.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_stop.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_stop.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_STOP</command> +</message> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-24 21:07:20 UTC (rev 3976) @@ -14,43 +14,64 @@ public static final int accept_icon=0x7f020000; public static final int back=0x7f020001; public static final int back_icon=0x7f020002; - public static final int close_icon=0x7f020003; - public static final int down_icon=0x7f020004; - public static final int folder=0x7f020005; - public static final int folderback=0x7f020006; - public static final int icon=0x7f020007; - public static final int music_logo=0x7f020008; - public static final int next_icon=0x7f020009; - public static final int nowplaying_logo=0x7f02000a; - public static final int picture=0x7f02000b; - public static final int pictures_logo=0x7f02000c; - public static final int play=0x7f02000d; - public static final int remote_logo=0x7f02000e; - public static final int splash=0x7f02000f; - public static final int up_icon=0x7f020010; - public static final int videos_logo=0x7f020011; + public static final int cdcover=0x7f020003; + public static final int close_icon=0x7f020004; + public static final int document=0x7f020005; + public static final int down_icon=0x7f020006; + public static final int folder=0x7f020007; + public static final int folderback=0x7f020008; + public static final int forward=0x7f020009; + public static final int icon=0x7f02000a; + public static final int music_logo=0x7f02000b; + public static final int next_icon=0x7f02000c; + public static final int nowplaying_logo=0x7f02000d; + public static final int pause=0x7f02000e; + public static final int picture=0x7f02000f; + public static final int pictures_logo=0x7f020010; + public static final int play=0x7f020011; + public static final int remote_logo=0x7f020012; + public static final int rewind=0x7f020013; + public static final int splash=0x7f020014; + public static final int stop=0x7f020015; + public static final int up_icon=0x7f020016; + public static final int videos_logo=0x7f020017; } public static final class id { public static final int GridView01=0x7f050009; public static final int ImageView01=0x7f05000b; + public static final int LinearLayout01=0x7f05000c; public static final int MainButton1=0x7f050003; public static final int MainButton2=0x7f050004; public static final int MainButton3=0x7f050005; public static final int MainButton4=0x7f050006; public static final int MainButton5=0x7f050007; - public static final int btnCancel=0x7f05000e; - public static final int btnDown=0x7f050010; - public static final int btnLeft=0x7f050012; - public static final int btnOk=0x7f05000f; - public static final int btnReturn=0x7f05000d; - public static final int btnReturnSetup=0x7f050015; - public static final int btnRight=0x7f050011; - public static final int btnUp=0x7f05000c; + public static final int btnCancel=0x7f05001d; + public static final int btnDown=0x7f05001f; + public static final int btnLeft=0x7f050021; + public static final int btnOk=0x7f05001e; + public static final int btnReturn=0x7f05001c; + public static final int btnReturnSetup=0x7f050024; + public static final int btnRight=0x7f050020; + public static final int btnUp=0x7f05001b; public static final int full_text=0x7f05000a; public static final int icon_image=0x7f050001; public static final int icon_text=0x7f050002; - public static final int server_ip=0x7f050013; - public static final int server_port=0x7f050014; + public static final int now_album=0x7f05000e; + public static final int now_artist=0x7f050014; + public static final int now_cd=0x7f05000f; + public static final int now_list=0x7f05001a; + public static final int now_next=0x7f050019; + public static final int now_pause=0x7f050017; + public static final int now_play=0x7f050018; + public static final int now_playing=0x7f05000d; + public static final int now_playing_right=0x7f050012; + public static final int now_playing_t_left=0x7f050011; + public static final int now_prev=0x7f050015; + public static final int now_progress=0x7f050010; + public static final int now_stop=0x7f050016; + public static final int now_title=0x7f050013; + public static final int server_ip=0x7f050022; + public static final int server_port=0x7f050023; public static final int widget0=0x7f050008; public static final int widget44=0x7f050000; } @@ -59,9 +80,10 @@ public static final int main=0x7f030001; public static final int pictures=0x7f030002; public static final int picturesfullscreen=0x7f030003; - public static final int remote=0x7f030004; - public static final int setup=0x7f030005; - public static final int splash=0x7f030006; + public static final int playingnow=0x7f030004; + public static final int remote=0x7f030005; + public static final int setup=0x7f030006; + public static final int splash=0x7f030007; } public static final class string { public static final int app_name=0x7f040001; Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/cdcover.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/cdcover.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/document.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/document.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/forward.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/forward.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pause.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pause.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/rewind.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/rewind.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/stop.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/stop.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -1,47 +1,37 @@ -<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:background="@drawable/back" - > - -<Button android:id="@+id/MainButton1" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:padding="0dp" + android:orientation="vertical" android:layout_width="fill_parent" + android:layout_height="fill_parent" android:background="@drawable/back"> + + <Button android:id="@+id/MainButton1" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:padding="0dp" android:background="@drawable/pictures_logo" /> - -<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> - -<Button android:id="@+id/MainButton2" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:padding="0dp" + + <View android:layout_height="2dp" android:layout_width="fill_parent" + android:background="#000" /> + + <Button android:id="@+id/MainButton2" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:padding="0dp" android:background="@drawable/music_logo" /> -<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> - -<Button android:id="@+id/MainButton3" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:padding="0dp" + <View android:layout_height="2dp" android:layout_width="fill_parent" + android:background="#000" /> + + <Button android:id="@+id/MainButton3" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:padding="0dp" android:background="@drawable/videos_logo" /> - -<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> - -<Button android:id="@+id/MainButton4" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:padding="0dp" + + <View android:layout_height="2dp" android:layout_width="fill_parent" + android:background="#000" /> + + <Button android:id="@+id/MainButton4" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:padding="0dp" android:background="@drawable/remote_logo" /> - -<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> - -<Button android:id="@+id/MainButton5" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:padding="0dp" + + <View android:layout_height="2dp" android:layout_width="fill_parent" + android:background="#000" /> + + <Button android:id="@+id/MainButton5" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:padding="0dp" android:background="@drawable/nowplaying_logo" /> - + </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -1,22 +1,12 @@ -<AbsoluteLayout -android:id="@+id/widget0" -android:layout_width="fill_parent" -android:layout_height="wrap_content" -android:background="@drawable/back" -xmlns:android="http://schemas.android.com/apk/res/android" -> -<GridView android:layout_y="0dip" - android:layout_x="0dip" - android:id="@+id/GridView01" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:columnWidth="90dp" - android:numColumns="auto_fit" - android:verticalSpacing="10dp" - android:horizontalSpacing="10dp" - android:stretchMode="columnWidth" - android:gravity="center" - > - </GridView> +<AbsoluteLayout android:id="@+id/widget0" + android:layout_width="fill_parent" android:layout_height="wrap_content" + android:background="@drawable/back" xmlns:android="http://schemas.android.com/apk/res/android"> + <GridView android:layout_y="0dip" android:layout_x="0dip" + android:id="@+id/GridView01" android:layout_width="fill_parent" + android:layout_height="fill_parent" android:columnWidth="90dp" + android:numColumns="auto_fit" android:verticalSpacing="10dp" + android:horizontalSpacing="10dp" android:stretchMode="columnWidth" + android:gravity="center"> + </GridView> </AbsoluteLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -1,21 +1,12 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:background="@drawable/back" - > -<TextView - android:id="@+id/full_text" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="name" - android:gravity="center_horizontal" - android:background="#FFFFFFFF" - android:textColor="#FF000000" - android:textColorHighlight="#FFFFFFFF"> -</TextView> + android:orientation="vertical" android:layout_width="fill_parent" + android:layout_height="fill_parent" android:background="@drawable/back"> + <TextView android:id="@+id/full_text" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="name" + android:gravity="center_horizontal" android:background="#FFFFFFFF" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF"> + </TextView> -<ImageView android:id="@+id/ImageView01" - android:layout_width="wrap_content" - android:layout_height="wrap_content"></ImageView> + <ImageView android:id="@+id/ImageView01" + android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView> </LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -0,0 +1,82 @@ +<LinearLayout android:id="@+id/LinearLayout01" + android:orientation="vertical" android:layout_width="fill_parent" + android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> + + <TextView android:id="@+id/now_playing" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="NOW PLAYING" + android:gravity="center_horizontal" android:background="#FFFFFFFF" + android:textColor="#FF000000" android:textSize="18dip" + android:textColorHighlight="#FFFFFFFF"> + </TextView> + + <TextView android:id="@+id/now_album" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="Album" + android:background="#F0F0F0FF" android:textColor="#FF000000" + android:textSize="18dip" android:textColorHighlight="#FFFFFFFF" + android:gravity="center_horizontal"> + </TextView> + + <ImageView android:id="@+id/now_cd" android:layout_width="250dip" + android:layout_height="250dip" android:scaleType="centerCrop" + android:background="@drawable/cdcover" android:layout_gravity="center_horizontal"> + </ImageView> + + <SeekBar android:id="@+id/now_progress" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:max="100" + android:paddingLeft="20dip" android:paddingRight="10dip" + android:paddingTop="0dip" android:thumbOffset="20dip" + android:layout_marginTop="-10dip" /> + + <LinearLayout android:layout_width="fill_parent" + android:layout_height="wrap_content" android:orientation="vertical" + android:layout_marginTop="-9dip"> + <RelativeLayout android:layout_width="fill_parent" + android:layout_height="wrap_content" android:layout_marginTop="10dip"> + <TextView android:id="@+id/now_playing_t_left" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:textSize="12dip" android:textColor="#FF8080ff" android:text="left" + android:gravity="left" /> + <TextView android:id="@+id/now_playing_right" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_alignParentRight="true" android:textSize="12dip" + android:textColor="#FF8080ff" android:gravity="right" android:text="right" + android:singleLine="true" /> + </RelativeLayout> + <TextView android:id="@+id/now_title" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:textSize="16dip" + android:background="#F0F0F0FF" android:textColor="#FF000000" + android:text="Artist" android:gravity="center_horizontal" + android:ellipsize="end" android:paddingLeft="25dip" + android:paddingRight="22dip" android:layout_marginTop="0dip" /> + <TextView android:id="@+id/now_artist" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:gravity="center_horizontal" + android:textSize="18dip" android:textColor="#FF000000" + android:background="#FFFFFFFF" android:text="Title" + android:layout_marginTop="0dip" /> + </LinearLayout> + + <LinearLayout android:layout_height="wrap_content" + android:orientation="horizontal" android:layout_width="fill_parent"> + <ImageButton android:id="@+id/now_prev" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/rewind" /> + <ImageButton android:id="@+id/now_stop" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/stop" /> + <ImageButton android:id="@+id/now_pause" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/pause" /> + <ImageButton android:id="@+id/now_play" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/play" /> + <ImageButton android:id="@+id/now_next" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/forward" /> + <ImageButton android:id="@+id/now_list" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/document"/> + </LinearLayout> + +</LinearLayout> + + + Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml 2010-11-24 21:07:20 UTC (rev 3976) @@ -1,12 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> - <ImageView - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:src="@drawable/splash" + android:orientation="vertical" android:layout_width="fill_parent" + android:layout_height="fill_parent"> + <ImageView android:layout_width="fill_parent" + android:layout_height="fill_parent" android:src="@drawable/splash" android:scaleType="fitXY"> - </ImageView> + </ImageView> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-24 21:07:20 UTC (rev 3976) @@ -1,6 +1,5 @@ package mediaportal.remote; -import java.io.BufferedInputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -14,11 +13,12 @@ import org.apache.http.util.ByteArrayBuffer; + import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Environment; -import android.widget.Toast; + public class httpHandler { String extStorageDirectory; @@ -86,16 +86,16 @@ try { InputStream in = openHttpConnection("http://192.168.0.30:8200/music/Clementi_Sonatina_Op.36_No.1_Movement_1.mp3"); - //BufferedInputStream bis = new BufferedInputStream(in); + // BufferedInputStream bis = new BufferedInputStream(in); ByteArrayBuffer baf = new ByteArrayBuffer(50); int current = 0; - + byte[] bb = new byte[1024]; - int l = in.read(bb,0,1024); - + int l = in.read(bb, 0, 1024); + while (l > -0) { baf.append(bb, 0, l); - l = in.read(bb,0,1024); + l = in.read(bb, 0, 1024); } OutputStream outStream = null; @@ -114,4 +114,5 @@ e.printStackTrace(); } } + } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-24 21:07:20 UTC (rev 3976) @@ -36,8 +36,8 @@ Button btnNowPlaying = (Button) findViewById(R.id.MainButton5); btnNowPlaying.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - httpHandler h = new httpHandler(); - h.DownloadFile(); + Intent myIntent = new Intent(view.getContext(), nowplaying.class); + startActivityForResult(myIntent, 0); } }); Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-11-24 21:07:20 UTC (rev 3976) @@ -0,0 +1,158 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; + +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.BasicHttpParams; +import org.apache.http.params.HttpConnectionParams; +import org.apache.http.params.HttpParams; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.AssetManager; +import android.os.Bundle; +import android.os.Handler; +import android.view.View; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.TextView; +import android.widget.Toast; + +public class nowplaying extends Activity{ + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.playingnow); + + update(); + + ImageButton btn1 = (ImageButton) findViewById(R.id.now_prev); + ImageButton btn2 = (ImageButton) findViewById(R.id.now_stop); + ImageButton btn3 = (ImageButton) findViewById(R.id.now_pause); + ImageButton btn4 = (ImageButton) findViewById(R.id.now_play); + ImageButton btn5 = (ImageButton) findViewById(R.id.now_next); + ImageButton btn6 = (ImageButton) findViewById(R.id.now_list); + + btn1.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("previous"); + } + }); + btn2.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("stop"); + } + }); + btn3.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("pause"); + } + }); + btn4.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("play"); + } + }); + btn5.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("next"); + } + }); + btn6.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + //show list + } + }); + + } + + private void update() + { + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); + + String HttpServer = settings.getString("Server", "192.168.0.30"); + String HttpPort = settings.getString("Port", "8200"); + + nowplayinghandler handler = nowplayinghandler.getinstance(); + handler.setconnection(HttpServer, HttpPort); + handler.fetchdata(); + + TextView txt1 = (TextView) findViewById(R.id.now_artist); + txt1.setText(handler.Artist); + TextView txt2 = (TextView) findViewById(R.id.now_title); + txt2.setText(handler.Title); + TextView txt3 = (TextView) findViewById(R.id.now_album); + txt3.setText(handler.Album); + + TextView txt4 = (TextView) findViewById(R.id.now_playing_t_left); + txt4.setText(handler.Actual); + TextView txt5 = (TextView) findViewById(R.id.now_playing_right); + txt5.setText(handler.Total); + + //todo progressbar + + } + + public void PostCommand(String button) { + + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE , MODE_PRIVATE); + + String HttpServer = settings.getString("Server", "192.168.0.30"); + String HttpPort = settings.getString("Port", "8200"); + + HttpParams httpParameters = new BasicHttpParams(); + HttpConnectionParams.setConnectionTimeout(httpParameters, 3000); + HttpConnectionParams.setSoTimeout(httpParameters, 3000); + + HttpClient httpclient = new DefaultHttpClient(httpParameters); + HttpPost httppost = new HttpPost("http://" + HttpServer + ":" + + HttpPort); + + try { + + AssetManager assetManager = getAssets(); + + InputStream inputStream = null; + inputStream = assetManager.open("cmd_" + button + ".xml"); + + int x = inputStream.read(); + + String xml = ""; + + while (x != -1) { + xml = xml + (char) x; + x = inputStream.read(); + } + + StringEntity se = new StringEntity(xml, "UTF-8"); + se.setContentType("application/atom+xml"); + + httppost.setEntity(se); + + // HttpResponse response; + // response = httpclient.execute(httppost); + httpclient.execute(httppost); + + } catch (ClientProtocolException e) { + Toast.makeText(nowplaying.this, "ERROR CONNECTION SERVER", + Toast.LENGTH_LONG).show(); + e.printStackTrace(); + } catch (IOException e) { + Toast.makeText(nowplaying.this, "TIME OUT SERVER", Toast.LENGTH_LONG) + .show(); + e.printStackTrace(); + } + } + +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java 2010-11-24 21:07:20 UTC (rev 3976) @@ -0,0 +1,60 @@ +package mediaportal.remote; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public class nowplayingXmlHandler extends DefaultHandler { + Boolean currentElement = false; + String currentValue = null; + + public static String Title; + public static String Artist; + public static String Album; + public static String Total; + public static String Actual; + public static String Track; + + /** + * Called when tag starts ( example:- <name>AndroidPeople</name> -- <name> ) + */ + @Override + public void startElement(String uri, String localName, String qName, + Attributes attributes) throws SAXException { + currentElement = true; + + } + + /** + * Called when tag closing ( example:- <name>AndroidPeople</name> -- </name> ) + */ + @Override + public void endElement(String uri, String localName, String qName) + throws SAXException { + + currentElement = false; + + /** set value */ + if (localName == "Artist") {Artist =currentValue;} + if (localName == "Title") {Title =currentValue;} + if (localName == "Album") {Album =currentValue;} + if (localName == "Track") {Track =currentValue;} + if (localName == "TotalTime") {Total =currentValue;} + if (localName == "ActualTime") {Actual =currentValue;} + } + + /** + * Called to get tag characters ( example:- <name>AndroidPeople</name> -- to get + * AndroidPeople Character ) + */ + @Override + public void characters(char[] ch, int start, int length) + throws SAXException { + if (currentElement) { + currentValue = new String(ch, start, length); + currentElement = false; + } + + } + +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java 2010-11-24 21:07:20 UTC (rev 3976) @@ -0,0 +1,120 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +import android.graphics.Bitmap; + +import mediaportal.remote.directoryItems; + +public class nowplayinghandler { + + private static nowplayinghandler instance; + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + private String _server; + private String _port; + + public String Title; + public String Artist; + public String Album; + public String Track; + public String Total; + public String Actual; + public String PlayerState; + + public static nowplayinghandler getinstance() { + if (instance == null) + instance = new nowplayinghandler(); + return instance; + } + + private nowplayinghandler() { + + } + + public void setconnection(String server, String port) { + _server = server; + _port = port; + } + + public void fetchdata() { + + String fileUrl = "http://" + _server + ":" + _port + "/nowplaying"; + + URL myFileUrl = null; + try { + myFileUrl = new URL(fileUrl); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + HttpURLConnection conn = (HttpURLConnection) myFileUrl + .openConnection(); + conn.setReadTimeout(10000); + conn.setDoInput(true); + conn.connect(); + // int length = conn.getContentLength(); + InputStream is = conn.getInputStream(); + + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser sp = null; + try { + sp = spf.newSAXParser(); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + XMLReader reader = null; + try { + reader = sp.getXMLReader(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + nowplayingXmlHandler handler = new nowplayingXmlHandler(); + + reader.setContentHandler(handler); + try { + reader.parse(new InputSource(is)); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + is.close(); + sp.reset(); + + Artist = nowplayingXmlHandler.Artist; + Title = nowplayingXmlHandler.Title; + Track = nowplayingXmlHandler.Track; + + Total = nowplayingXmlHandler.Total; + Actual = nowplayingXmlHandler.Actual; + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-24 21:07:20 UTC (rev 3976) @@ -12,7 +12,6 @@ import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.BaseAdapter; -import android.widget.Button; import android.widget.GridView; import android.widget.ImageView; import android.widget.TextView; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-24 21:07:20 UTC (rev 3976) @@ -2,15 +2,10 @@ import mediaportal.remote.R; import android.app.Activity; -import android.content.Intent; import android.os.Bundle; import android.view.GestureDetector; import android.view.GestureDetector.OnGestureListener; -import android.view.GestureDetector.SimpleOnGestureListener; -import android.view.LayoutInflater.Filter; import android.view.MotionEvent; -import android.view.View; -import android.view.View.OnClickListener; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; Added: trunk/plugins/AndroidRemote/Release/nowplaying.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/nowplaying.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-24 17:32:20 UTC (rev 3975) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-24 21:07:20 UTC (rev 3976) @@ -180,6 +180,32 @@ private void ExceuteCommand(string Message) { + if (Message.Contains("ACTION_PLAY")) + { + Action action = new Action(Action.ActionType.ACTION_PLAY, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_STOP")) + { + Action action = new Action(Action.ActionType.ACTION_STOP, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_PAUSE")) + { + Action action = new Action(Action.ActionType.ACTION_PAUSE, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_NEXT_ITEM")) + { + Action action = new Action(Action.ActionType.ACTION_NEXT_ITEM, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_PREV_ITEM")) + { + Action action = new Action(Action.ActionType.ACTION_PREV_ITEM, 0, 0); + GUIGraphicsContext.OnAction(action); + } + if (Message.Contains("ACTION_MOVE_RIGHT")) { Action action = new Action(Action.ActionType.ACTION_MOVE_RIGHT, 0, 0); @@ -281,7 +307,7 @@ } else { - SendServerError(filePath,"ReplyPictureFile"); + SendServerError(filePath, "ReplyPictureFile"); } } else @@ -398,6 +424,34 @@ private void ReplyNowPlaying() { + string title = GUIPropertyManager.GetProperty("#Play.Current.Title"); + string artist = GUIPropertyManager.GetProperty("#Play.Current.Artist"); + string album = GUIPropertyManager.GetProperty("#Play.Current.Album"); + string track = GUIPropertyManager.GetProperty("#Play.Current.Track"); + + string actual = GUIPropertyManager.GetProperty("#currentplaytime"); + string total = GUIPropertyManager.GetProperty("#duration"); + + string state = "unknown"; + if (MediaPortal.Player.g_Player.Player != null) + { + if (MediaPortal.Player.g_Player.Player.Playing) state = "playing"; + if (MediaPortal.Player.g_Player.Player.Stopped) state = "stopped"; + if (MediaPortal.Player.g_Player.Player.Paused) state = "paused"; + if (MediaPortal.Player.g_Player.Player.Ended) state = "ended"; + } + else + { + state = "no player active"; + actual = string.Empty; + total = string.Empty; + } + + artist = HttpUtility.HtmlEncode(artist); + album = HttpUtility.HtmlEncode(album); + title = HttpUtility.HtmlEncode(title); + + string msg = string.Empty; // header msg += "HTTP/1.0 200 Ok\r\n"; @@ -408,14 +462,16 @@ msg += "<?xml version=\"1.0\"?>\r\n"; msg += "<NowPlaying>\r\n"; - msg += "<PlayerState></PlayerState>\r\n"; + msg += "<PlayerState>" + state + "</PlayerState>\r\n"; - msg += "<Title></Title>\r\n"; - msg += "<Artist></Artist>\r\n"; + msg += "<Title>" + title + "</Title>\r\n"; + msg += "<Artist>" + artist + "</Artist>\r\n"; + msg += "<Album>" + album + "</Album>\r\n"; + msg += "<Track>" + track + "</Track>\r\n"; msg += "<Cover></Cover>\r\n"; - msg += "<ActualTime></ActualTime>\r\n"; - msg += "<TotalTime></TotalTime>\r\n"; + msg += "<ActualTime>" + actual + "</ActualTime>\r\n"; + msg += "<TotalTime>" + total + "</TotalTime>\r\n"; msg += "</NowPlaying>\r\n"; // send 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. |
From: <kro...@us...> - 2010-11-25 08:32:57
|
Revision: 3980 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3980&view=rev Author: kroko_koenig Date: 2010-11-25 08:32:51 +0000 (Thu, 25 Nov 2010) Log Message: ----------- fixed music and added playlist / play now xml also some documentation Modified Paths: -------------- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Release/Android Server communication.docx Added: trunk/plugins/AndroidRemote/Release/Android Server communication.docx =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/Android Server communication.docx ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs 2010-11-25 06:55:00 UTC (rev 3979) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs 2010-11-25 08:32:51 UTC (rev 3980) @@ -53,9 +53,7 @@ #region IPlugin public void Start() { - // - //Action action = new Action(Action.ActionType.ACTION_EXIT, 0, 0); - //GUIGraphicsContext.OnAction(action); + logInfo("Start server"); LoadSettings(); listen = new Thread(DoListen); @@ -63,6 +61,7 @@ } public void Stop() { + logInfo("Stop server"); } #endregion @@ -87,17 +86,18 @@ { try { - objServer_Log("Try to init command controler " + Server + ":" + Port); + logInfo("Try to init command controler " + Server + ":" + Port); myListener = new TcpListener(IPAddress.Parse(Server), Convert.ToInt32(Port)); myListener.Start(); myListener.BeginAcceptSocket(new AsyncCallback(DoAcceptSocketCallback), myListener); - objServer_Log("Command controler " + Server + ":" + Port + " is running"); + logInfo("Command controler " + Server + ":" + Port + " is running"); } catch { - objServer_Log("Failed to init command controler " + Server + ":" + Port); + logInfo("Failed to init command controler " + Server + ":" + Port); + logInfo("Check your IP and port settings."); } } private static void DoAcceptSocketCallback(IAsyncResult ar) @@ -106,6 +106,8 @@ TcpListener listener = (TcpListener)ar.AsyncState; Socket clientSocket = listener.EndAcceptSocket(ar); + logDebug("Listener accept connection from " + clientSocket.RemoteEndPoint.ToString()); + // work on request Request req = new Request(clientSocket); Thread thread = new Thread(new ThreadStart(req.DoWork)); @@ -170,10 +172,14 @@ #endregion - void objServer_Log(string message) + public static void logInfo(string message) { - Log.Info("Android remote: " + message); + Log.Info("Android remote | " + message); } + public static void logDebug(string message) + { + Log.Debug("Android remote | " + message); + } } } Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-25 06:55:00 UTC (rev 3979) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-25 08:32:51 UTC (rev 3980) @@ -45,8 +45,6 @@ private byte[] read; private byte[] buffer; - private static Dictionary<string, string> musicList = new Dictionary<string, string>(); - public Request(Socket Socket) { socket = Socket; @@ -143,7 +141,7 @@ if (req.EndsWith(".mp3")) { string orgPath = AndroidServer.MusicPath + "\\" + req; - ReplyMusicFile(Path.GetFileName(orgPath)); + ReplyMusicFile(orgPath); } else { @@ -154,12 +152,24 @@ #endregion #region nowplaying - else if (req.StartsWith("/nowplaying")) + else if (req.StartsWith("/nowplaying/now.xml")) { ReplyNowPlaying(); } + else if (req.StartsWith("/nowplaying/list.xml")) + { + ReplyNowPlayingPlaylist(); + } #endregion + #region favicon + else if (req.StartsWith("/favicon.ico")) + { + //todo use resource + ReplyPictureFile("c:\\favicon.ico"); + } + #endregion + else { SendErrorURL(req); @@ -255,13 +265,13 @@ string[] dirs = Directory.GetDirectories(dir, "*.*", SearchOption.TopDirectoryOnly); foreach (string f in dirs) { - msg += "<Folder>" + Path.GetFileName(f) + "</Folder>\r\n"; + msg += "<Folder>" + HttpUtility.HtmlEncode(Path.GetFileName(f)) + "</Folder>\r\n"; } //files string[] files = Directory.GetFiles(dir, "*.jpg", SearchOption.TopDirectoryOnly); foreach (string f in files) { - msg += "<File>" + Path.GetFileName(f) + "</File>\r\n"; + msg += "<File>" + HttpUtility.HtmlEncode(Path.GetFileName(f)) + "</File>\r\n"; } msg += "</Directory>\r\n"; // send @@ -355,8 +365,6 @@ { if (Directory.Exists(dir)) { - musicList.Clear(); - string msg = string.Empty; // header msg += "HTTP/1.0 200 Ok\r\n"; @@ -370,16 +378,13 @@ string[] dirs = Directory.GetDirectories(dir, "*.*", SearchOption.TopDirectoryOnly); foreach (string f in dirs) { - msg += "<Folder>" + Path.GetFileName(f) + "</Folder>\r\n"; + msg += "<Folder>" + HttpUtility.HtmlEncode(Path.GetFileName(f)) + "</Folder>\r\n"; } string[] files = Directory.GetFiles(dir, "*.mp3", SearchOption.TopDirectoryOnly); foreach (string f in files) { - string name = Path.GetFileName(f).ToLower(); - musicList.Add(name, f); - - msg += "<File>" + name + "</File>\r\n"; + msg += "<File>" + HttpUtility.HtmlEncode(Path.GetFileName(f)) + "</File>\r\n"; } msg += "</Directory>\r\n"; // send @@ -392,29 +397,20 @@ } private void ReplyMusicFile(string Filename) { - if (musicList.ContainsKey(Filename)) + if (File.Exists(Filename)) { - string path = musicList[Filename]; + byte[] b = FileToByteArray(Filename); - if (File.Exists(path)) - { - byte[] b = FileToByteArray(path); - - string msg = string.Empty; - // header - msg += "HTTP/1.0 200 Ok\r\n"; - msg += "Content-Type: audio/mpeg" + "\r\n"; - msg += "Content-Length: " + b.Length + "\r\n"; - msg += "Proxy-Connection: close" + "\r\n"; - msg += "\r\n"; - sendMessage(socket, msg); - // content - sendBytes(socket, b); - } - else - { - SendErrorFile(Filename); - } + string msg = string.Empty; + // header + msg += "HTTP/1.0 200 Ok\r\n"; + msg += "Content-Type: audio/mpeg" + "\r\n"; + msg += "Content-Length: " + b.Length + "\r\n"; + msg += "Proxy-Connection: close" + "\r\n"; + msg += "\r\n"; + sendMessage(socket, msg); + // content + sendBytes(socket, b); } else { @@ -477,7 +473,52 @@ // send sendMessage(socket, msg); } + private void ReplyNowPlayingPlaylist() + { + MediaPortal.Playlists.PlayListPlayer player = MediaPortal.Playlists.PlayListPlayer.SingletonPlayer; + MediaPortal.Playlists.PlayList list = player.GetPlaylist(player.CurrentPlaylistType); + int currentSong = player.CurrentSong; + + 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 += "<NowPlayingPlaylist>\r\n"; + + msg += "<CurrentItem>" + currentSong.ToString() + "</CurrentItem>\r\n"; + msg += "<TotalItem>" + list.Count.ToString() + "</TotalItem>\r\n"; + + foreach (MediaPortal.Playlists.PlayListItem item in list) + { + string desc = item.Description; + int duration = item.Duration; + string file = item.FileName; + bool played = item.Played; + string typ = item.Type.ToString(); + + desc = HttpUtility.HtmlEncode(desc); + + msg += "<Item>\r\n"; + + msg += "<Title>" + desc + "</Title>\r\n"; + msg += "<Duration>" + duration + "</Duration>\r\n"; + msg += "<Played>" + played.ToString() + "</Played>\r\n"; + msg += "<Typ>" + typ + "</Typ>\r\n"; + + msg += "</Item>\r\n"; + } + + msg += "</NowPlayingPlaylist>\r\n"; + // send + + sendMessage(socket, msg); + } + private void SendErrorURL(string Url) { System.Diagnostics.Debug.WriteLine("URL NOT FOUND " + Url); 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. |
From: <kro...@us...> - 2010-11-25 19:47:04
|
Revision: 3981 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3981&view=rev Author: kroko_koenig Date: 2010-11-25 19:46:56 +0000 (Thu, 25 Nov 2010) Log Message: ----------- playnow / playlist support Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/icon.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Release/Android Server communication.docx trunk/plugins/AndroidRemote/Release/nowplaying.jpg trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/border.ico trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/list_item.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java trunk/plugins/AndroidRemote/Release/nowplayingList.jpg trunk/plugins/AndroidRemote/Server/AndroidRemote/favicon.ico Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-25 19:46:56 UTC (rev 3981) @@ -20,6 +20,7 @@ <activity android:name=".picturesfullscreen"></activity> <activity android:name=".setup"></activity> <activity android:name=".nowplaying"></activity> + <activity android:name=".nowplaylist"></activity> </application> <uses-sdk android:minSdkVersion="3" /> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-25 19:46:56 UTC (rev 3981) @@ -14,76 +14,82 @@ public static final int accept_icon=0x7f020000; public static final int back=0x7f020001; public static final int back_icon=0x7f020002; - public static final int cdcover=0x7f020003; - public static final int close_icon=0x7f020004; - public static final int document=0x7f020005; - public static final int down_icon=0x7f020006; - public static final int folder=0x7f020007; - public static final int folderback=0x7f020008; - public static final int forward=0x7f020009; - public static final int icon=0x7f02000a; - public static final int music_logo=0x7f02000b; - public static final int next_icon=0x7f02000c; - public static final int nowplaying_logo=0x7f02000d; - public static final int pause=0x7f02000e; - public static final int picture=0x7f02000f; - public static final int pictures_logo=0x7f020010; - public static final int play=0x7f020011; - public static final int remote_logo=0x7f020012; - public static final int rewind=0x7f020013; - public static final int splash=0x7f020014; - public static final int stop=0x7f020015; - public static final int up_icon=0x7f020016; - public static final int videos_logo=0x7f020017; + public static final int border=0x7f020003; + public static final int cdcover=0x7f020004; + public static final int close_icon=0x7f020005; + public static final int document=0x7f020006; + public static final int down_icon=0x7f020007; + public static final int folder=0x7f020008; + public static final int folderback=0x7f020009; + public static final int forward=0x7f02000a; + public static final int icon=0x7f02000b; + public static final int music_logo=0x7f02000c; + public static final int next_icon=0x7f02000d; + public static final int nowplaying_logo=0x7f02000e; + public static final int pause=0x7f02000f; + public static final int picture=0x7f020010; + public static final int pictures_logo=0x7f020011; + public static final int play=0x7f020012; + public static final int remote_logo=0x7f020013; + public static final int rewind=0x7f020014; + public static final int splash=0x7f020015; + public static final int stop=0x7f020016; + public static final int up_icon=0x7f020017; + public static final int videos_logo=0x7f020018; } public static final class id { - public static final int GridView01=0x7f050009; - public static final int ImageView01=0x7f05000b; - public static final int LinearLayout01=0x7f05000c; - public static final int MainButton1=0x7f050003; - public static final int MainButton2=0x7f050004; - public static final int MainButton3=0x7f050005; - public static final int MainButton4=0x7f050006; - public static final int MainButton5=0x7f050007; - public static final int btnCancel=0x7f05001d; - public static final int btnDown=0x7f05001f; - public static final int btnLeft=0x7f050021; - public static final int btnOk=0x7f05001e; - public static final int btnReturn=0x7f05001c; - public static final int btnReturnSetup=0x7f050024; - public static final int btnRight=0x7f050020; - public static final int btnUp=0x7f05001b; - public static final int full_text=0x7f05000a; + public static final int GridView01=0x7f05000b; + public static final int ImageView01=0x7f05000d; + public static final int LinearLayout01=0x7f05000e; + public static final int ListView01=0x7f05001d; + public static final int MainButton1=0x7f050005; + public static final int MainButton2=0x7f050006; + public static final int MainButton3=0x7f050007; + public static final int MainButton4=0x7f050008; + public static final int MainButton5=0x7f050009; + public static final int TextView01=0x7f050003; + public static final int TextView02=0x7f050004; + public static final int btnCancel=0x7f050020; + public static final int btnDown=0x7f050022; + public static final int btnLeft=0x7f050024; + public static final int btnOk=0x7f050021; + public static final int btnReturn=0x7f05001f; + public static final int btnReturnSetup=0x7f050027; + public static final int btnRight=0x7f050023; + public static final int btnUp=0x7f05001e; + public static final int full_text=0x7f05000c; public static final int icon_image=0x7f050001; public static final int icon_text=0x7f050002; - public static final int now_album=0x7f05000e; - public static final int now_artist=0x7f050014; - public static final int now_cd=0x7f05000f; - public static final int now_list=0x7f05001a; - public static final int now_next=0x7f050019; - public static final int now_pause=0x7f050017; - public static final int now_play=0x7f050018; - public static final int now_playing=0x7f05000d; - public static final int now_playing_right=0x7f050012; - public static final int now_playing_t_left=0x7f050011; - public static final int now_prev=0x7f050015; - public static final int now_progress=0x7f050010; - public static final int now_stop=0x7f050016; - public static final int now_title=0x7f050013; - public static final int server_ip=0x7f050022; - public static final int server_port=0x7f050023; - public static final int widget0=0x7f050008; + public static final int now_album=0x7f050010; + public static final int now_artist=0x7f050016; + public static final int now_cd=0x7f050011; + public static final int now_list=0x7f05001c; + public static final int now_next=0x7f05001b; + public static final int now_pause=0x7f050019; + public static final int now_play=0x7f05001a; + public static final int now_playing=0x7f05000f; + public static final int now_playing_right=0x7f050014; + public static final int now_playing_t_left=0x7f050013; + public static final int now_prev=0x7f050017; + public static final int now_progress=0x7f050012; + public static final int now_stop=0x7f050018; + public static final int now_title=0x7f050015; + public static final int server_ip=0x7f050025; + public static final int server_port=0x7f050026; + public static final int widget0=0x7f05000a; public static final int widget44=0x7f050000; } public static final class layout { public static final int icon=0x7f030000; - public static final int main=0x7f030001; - public static final int pictures=0x7f030002; - public static final int picturesfullscreen=0x7f030003; - public static final int playingnow=0x7f030004; - public static final int remote=0x7f030005; - public static final int setup=0x7f030006; - public static final int splash=0x7f030007; + public static final int list_item=0x7f030001; + public static final int main=0x7f030002; + public static final int pictures=0x7f030003; + public static final int picturesfullscreen=0x7f030004; + public static final int playingnow=0x7f030005; + public static final int playnowlist=0x7f030006; + public static final int remote=0x7f030007; + public static final int setup=0x7f030008; + public static final int splash=0x7f030009; } public static final class string { public static final int app_name=0x7f040001; Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/border.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/border.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/icon.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/icon.xml 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/icon.xml 2010-11-25 19:46:56 UTC (rev 3981) @@ -1,23 +1,12 @@ -<LinearLayout -xmlns:android="http://schemas.android.com/apk/res/android" -android:id="@+id/widget44" -android:layout_width="wrap_content" -android:layout_height="wrap_content" -android:orientation="vertical" -android:layout_x="201px" -android:layout_y="165px" -android:gravity="center_horizontal"> -<ImageView -android:id="@+id/icon_image" -android:layout_width="wrap_content" -android:layout_height="wrap_content"> -</ImageView> -<TextView -android:id="@+id/icon_text" -android:layout_width="wrap_content" -android:layout_height="wrap_content" -android:text="TextView" -android:gravity="center_horizontal" -android:textColorHighlight="#656565"> -</TextView> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/widget44" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:orientation="vertical" + android:layout_x="201px" android:layout_y="165px" android:gravity="center_horizontal"> + <ImageView android:id="@+id/icon_image" android:layout_width="wrap_content" + android:layout_height="wrap_content"> + </ImageView> + <TextView android:id="@+id/icon_text" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:text="TextView" + android:gravity="center_horizontal" android:textColorHighlight="#656565"> + </TextView> </LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/list_item.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/list_item.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/list_item.xml 2010-11-25 19:46:56 UTC (rev 3981) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="wrap_content" android:gravity="left|center" + android:layout_width="wrap_content" android:paddingBottom="5px" + android:paddingTop="5px" android:paddingLeft="5px"> + <TextView android:id="@+id/TextView01" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:gravity="center" + android:background="@drawable/border" android:textColor="#000000" + android:text="hi"></TextView> + <TextView android:text="@+id/TextView02" android:id="@+id/TextView02" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginLeft="10px" android:textColor="#000000"></TextView> +</LinearLayout> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-11-25 19:46:56 UTC (rev 3981) @@ -1,6 +1,8 @@ <LinearLayout android:id="@+id/LinearLayout01" android:orientation="vertical" android:layout_width="fill_parent" - android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> + android:layout_height="fill_parent" + android:background="@drawable/back" + xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:id="@+id/now_playing" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="NOW PLAYING" Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml 2010-11-25 19:46:56 UTC (rev 3981) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="fill_parent" + android:layout_height="fill_parent"> + + <TextView android:id="@+id/TextView01" android:layout_height="wrap_content" + android:text="Actual playlist" + android:textStyle="normal|bold" android:gravity="center_vertical|center_horizontal" + android:layout_width="fill_parent"></TextView> + <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" + android:layout_width="fill_parent"> + </ListView> +</LinearLayout> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml 2010-11-25 19:46:56 UTC (rev 3981) @@ -1,72 +1,33 @@ <?xml version="1.0" encoding="utf-8"?> -<AbsoluteLayout -android:id="@+id/widget0" -android:layout_width="fill_parent" -android:layout_height="fill_parent" -android:background="@drawable/back" -xmlns:android="http://schemas.android.com/apk/res/android" -> -<Button -android:id="@+id/btnUp" -android:layout_width="wrap_content" -android:layout_height="wrap_content" -android:background="@drawable/up_icon" -android:layout_x="130px" -android:layout_y="100px" -> -</Button> -<Button -android:id="@+id/btnReturn" -android:layout_width="wrap_content" -android:layout_height="wrap_content" -android:text="Return" -android:layout_x="10px" -android:layout_y="8px" -> -</Button> -<Button -android:id="@+id/btnCancel" -android:layout_width="wrap_content" -android:layout_height="wrap_content" -android:background="@drawable/close_icon" -android:layout_x="260px" -android:layout_y="8px" -> -</Button> -<Button -android:id="@+id/btnOk" -android:layout_width="wrap_content" -android:layout_height="wrap_content" -android:background="@drawable/accept_icon" -android:layout_x="130px" -android:layout_y="175px" -> -</Button> -<Button -android:id="@+id/btnDown" -android:layout_width="wrap_content" -android:layout_height="wrap_content" -android:background="@drawable/down_icon" -android:layout_x="130px" -android:layout_y="250px" -> -</Button> -<Button -android:id="@+id/btnRight" -android:layout_width="wrap_content" -android:layout_height="wrap_content" -android:background="@drawable/next_icon" -android:layout_x="205px" -android:layout_y="175px" -> -</Button> -<Button -android:id="@+id/btnLeft" -android:layout_width="wrap_content" -android:layout_height="wrap_content" -android:background="@drawable/back_icon" -android:layout_x="55px" -android:layout_y="175px" -></Button> +<AbsoluteLayout android:id="@+id/widget0" + android:layout_width="fill_parent" android:layout_height="fill_parent" + android:background="@drawable/back" xmlns:android="http://schemas.android.com/apk/res/android"> + <Button android:id="@+id/btnUp" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:background="@drawable/up_icon" + android:layout_x="130px" android:layout_y="100px"> + </Button> + <Button android:id="@+id/btnReturn" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:text="Return" + android:layout_x="10px" android:layout_y="8px"> + </Button> + <Button android:id="@+id/btnCancel" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:background="@drawable/close_icon" + android:layout_x="260px" android:layout_y="8px"> + </Button> + <Button android:id="@+id/btnOk" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:background="@drawable/accept_icon" + android:layout_x="130px" android:layout_y="175px"> + </Button> + <Button android:id="@+id/btnDown" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:background="@drawable/down_icon" + android:layout_x="130px" android:layout_y="250px"> + </Button> + <Button android:id="@+id/btnRight" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:background="@drawable/next_icon" + android:layout_x="205px" android:layout_y="175px"> + </Button> + <Button android:id="@+id/btnLeft" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:background="@drawable/back_icon" + android:layout_x="55px" android:layout_y="175px"></Button> </AbsoluteLayout> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-11-25 19:46:56 UTC (rev 3981) @@ -1,32 +1,19 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:orientation="vertical" - android:padding="15dip" - android:background="@drawable/back"> -<TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="MediaPortal IP"></TextView> -<EditText android:id="@+id/server_ip" - android:layout_height="wrap_content" - android:layout_width="fill_parent" - android:text="192.168.0.30" - android:inputType="text"></EditText> -<TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="MediaPortal Port"></TextView> -<EditText android:id="@+id/server_port" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="8200" android:inputType="number|numberSigned"></EditText> -<Button - android:id="@+id/btnReturnSetup" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Return"></Button> - +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" android:layout_height="fill_parent" + android:orientation="vertical" android:padding="15dip" + android:background="@drawable/back"> + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="MediaPortal IP"></TextView> + <EditText android:id="@+id/server_ip" android:layout_height="wrap_content" + android:layout_width="fill_parent" android:text="192.168.0.30" + android:inputType="text"></EditText> + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="MediaPortal Port"></TextView> + <EditText android:id="@+id/server_port" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="8200" + android:inputType="number|numberSigned"></EditText> + <Button android:id="@+id/btnReturnSetup" android:layout_width="wrap_content" + android:layout_height="wrap_content" android:text="Return"></Button> + </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-25 19:46:56 UTC (rev 3981) @@ -13,7 +13,6 @@ import org.apache.http.util.ByteArrayBuffer; - import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Environment; @@ -88,7 +87,7 @@ // BufferedInputStream bis = new BufferedInputStream(in); ByteArrayBuffer baf = new ByteArrayBuffer(50); - int current = 0; + //int current = 0; byte[] bb = new byte[1024]; int l = in.read(bb, 0, 1024); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-11-25 19:46:56 UTC (rev 3981) @@ -18,15 +18,18 @@ import android.content.res.AssetManager; import android.os.Bundle; import android.os.Handler; +import android.os.SystemClock; import android.view.View; -import android.widget.Button; import android.widget.ImageButton; +import android.widget.SeekBar; import android.widget.TextView; import android.widget.Toast; -public class nowplaying extends Activity{ +public class nowplaying extends Activity { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + private Handler mHandler = new Handler(); /** Called when the activity is first created. */ @Override @@ -34,15 +37,13 @@ super.onCreate(savedInstanceState); setContentView(R.layout.playingnow); - update(); - ImageButton btn1 = (ImageButton) findViewById(R.id.now_prev); ImageButton btn2 = (ImageButton) findViewById(R.id.now_stop); ImageButton btn3 = (ImageButton) findViewById(R.id.now_pause); ImageButton btn4 = (ImageButton) findViewById(R.id.now_play); ImageButton btn5 = (ImageButton) findViewById(R.id.now_next); ImageButton btn6 = (ImageButton) findViewById(R.id.now_list); - + btn1.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { PostCommand("previous"); @@ -70,14 +71,36 @@ }); btn6.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - //show list + Intent myIntent = new Intent(view.getContext(), + nowplaylist.class); + startActivityForResult(myIntent, 0); } }); - + + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 1000); } + + @Override + public void onStart() { + super.onStart(); + update(); + } - private void update() - { + @Override + public void onPause() { + super.onPause(); + mHandler.removeCallbacks(mUpdateTimeTask); + } + + private Runnable mUpdateTimeTask = new Runnable() { + public void run() { + update(); + mHandler.postDelayed(mUpdateTimeTask, 1000); + } + }; + + private void update() { SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); @@ -87,26 +110,34 @@ nowplayinghandler handler = nowplayinghandler.getinstance(); handler.setconnection(HttpServer, HttpPort); handler.fetchdata(); - + TextView txt1 = (TextView) findViewById(R.id.now_artist); - txt1.setText(handler.Artist); + txt1.setText(nowplayinghandler.Artist); TextView txt2 = (TextView) findViewById(R.id.now_title); - txt2.setText(handler.Title); + txt2.setText(nowplayinghandler.Title); TextView txt3 = (TextView) findViewById(R.id.now_album); - txt3.setText(handler.Album); - + txt3.setText(nowplayinghandler.Album); + TextView txt4 = (TextView) findViewById(R.id.now_playing_t_left); - txt4.setText(handler.Actual); + txt4.setText(nowplayinghandler.Actual); TextView txt5 = (TextView) findViewById(R.id.now_playing_right); - txt5.setText(handler.Total); - - //todo progressbar - + txt5.setText(nowplayinghandler.Total); + + String[] p1 = nowplayinghandler.Actual.split(":"); + String[] p2 = nowplayinghandler.Total.split(":"); + if ((p1.length == 2) && (p1.length == 2)) { + int x1 = Integer.parseInt(p1[0]) * 60 + Integer.parseInt(p1[1]); + int x2 = Integer.parseInt(p2[0]) * 60 + Integer.parseInt(p2[1]); + int xy = x1 * 100 / x2; + SeekBar seek = (SeekBar) findViewById(R.id.now_progress); + seek.setProgress(xy); + } } - + public void PostCommand(String button) { - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE , MODE_PRIVATE); + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); String HttpServer = settings.getString("Server", "192.168.0.30"); String HttpPort = settings.getString("Port", "8200"); @@ -149,8 +180,8 @@ Toast.LENGTH_LONG).show(); e.printStackTrace(); } catch (IOException e) { - Toast.makeText(nowplaying.this, "TIME OUT SERVER", Toast.LENGTH_LONG) - .show(); + Toast.makeText(nowplaying.this, "TIME OUT SERVER", + Toast.LENGTH_LONG).show(); e.printStackTrace(); } } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java 2010-11-25 19:46:56 UTC (rev 3981) @@ -7,13 +7,6 @@ public class nowplayingXmlHandler extends DefaultHandler { Boolean currentElement = false; String currentValue = null; - - public static String Title; - public static String Artist; - public static String Album; - public static String Total; - public static String Actual; - public static String Track; /** * Called when tag starts ( example:- <name>AndroidPeople</name> -- <name> ) @@ -22,7 +15,7 @@ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { currentElement = true; - + currentValue = "..."; } /** @@ -35,12 +28,12 @@ currentElement = false; /** set value */ - if (localName == "Artist") {Artist =currentValue;} - if (localName == "Title") {Title =currentValue;} - if (localName == "Album") {Album =currentValue;} - if (localName == "Track") {Track =currentValue;} - if (localName == "TotalTime") {Total =currentValue;} - if (localName == "ActualTime") {Actual =currentValue;} + if (localName == "Artist") {nowplayinghandler.Artist =currentValue;} + if (localName == "Title") {nowplayinghandler.Title =currentValue;} + if (localName == "Album") {nowplayinghandler.Album =currentValue;} + if (localName == "Track") {nowplayinghandler.Track =currentValue;} + if (localName == "TotalTime") {nowplayinghandler.Total =currentValue;} + if (localName == "ActualTime") {nowplayinghandler.Actual =currentValue;} } /** Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java 2010-11-25 19:46:56 UTC (rev 3981) @@ -2,11 +2,9 @@ import java.io.IOException; import java.io.InputStream; -import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; -import java.net.URLEncoder; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; @@ -16,10 +14,6 @@ import org.xml.sax.SAXException; import org.xml.sax.XMLReader; -import android.graphics.Bitmap; - -import mediaportal.remote.directoryItems; - public class nowplayinghandler { private static nowplayinghandler instance; @@ -29,14 +23,14 @@ private String _server; private String _port; - public String Title; - public String Artist; - public String Album; - public String Track; - public String Total; - public String Actual; - public String PlayerState; - + public static String Title; + public static String Artist; + public static String Album; + public static String Track; + public static String Total; + public static String Actual; + public static String PlayerState; + public static nowplayinghandler getinstance() { if (instance == null) instance = new nowplayinghandler(); @@ -54,7 +48,7 @@ public void fetchdata() { - String fileUrl = "http://" + _server + ":" + _port + "/nowplaying"; + String fileUrl = "http://" + _server + ":" + _port + "/nowplaying/now.xml"; URL myFileUrl = null; try { @@ -103,13 +97,6 @@ } is.close(); sp.reset(); - - Artist = nowplayingXmlHandler.Artist; - Title = nowplayingXmlHandler.Title; - Track = nowplayingXmlHandler.Track; - - Total = nowplayingXmlHandler.Total; - Actual = nowplayingXmlHandler.Actual; } catch (IOException e) { // TODO Auto-generated catch block Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java 2010-11-25 19:46:56 UTC (rev 3981) @@ -0,0 +1,197 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; + +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.BasicHttpParams; +import org.apache.http.params.HttpConnectionParams; +import org.apache.http.params.HttpParams; + +import android.app.Activity; +import android.content.Context; +import android.content.SharedPreferences; +import android.content.res.AssetManager; +import android.graphics.Color; +import android.graphics.drawable.ColorDrawable; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.BaseAdapter; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +public class nowplaylist extends Activity { + + private static final String[] country = { "Iceland", "India", "Indonesia", + "Iran", "Iraq", "Ireland", "Israel", "Italy", "Laos", "Latvia", + "Lebanon", "Lesotho ", "Liberia", "Libya", "Lithuania", + "Luxembourg" }; + private static final String[] curr = { "ISK", "INR", "IDR", "IRR", "IQD", + "EUR", "ILS", "EUR", "LAK", "LVL", "LBP", "LSL ", "LRD", "LYD", + "LTL ", "EUR" }; + + private static class EfficientAdapter extends BaseAdapter { + + private LayoutInflater mInflater; + + public EfficientAdapter(Context context) { + mInflater = LayoutInflater.from(context); + } + + public int getCount() { + nowplaylisthandler handler = nowplaylisthandler.getinstance(); + return handler.PlayList.size(); + //return country.length; + } + + public Object getItem(int position) { + return position; + } + + public long getItemId(int position) { + return position; + } + + public View getView(int position, View convertView, ViewGroup parent) { + ViewHolder holder; + if (convertView == null) { + convertView = mInflater.inflate(R.layout.list_item, null); + holder = new ViewHolder(); + holder.text = (TextView) convertView + .findViewById(R.id.TextView01); + holder.text2 = (TextView) convertView + .findViewById(R.id.TextView02); + + convertView.setTag(holder); + } else { + holder = (ViewHolder) convertView.getTag(); + } + + nowplaylisthandler.PlayListItem item = nowplaylisthandler.PlayList.get(position); + + holder.text.setText(String.valueOf(position +1)); + holder.text2.setText(item.Title); + //holder.text.setText(curr[position]); + //holder.text2.setText(country[position]); + + convertView.setBackgroundColor((position & 1) == 1 ? Color.WHITE + : Color.LTGRAY); + + return convertView; + } + + static class ViewHolder { + TextView text; + TextView text2; + } + } + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.playnowlist); + + update(); + + ListView l1 = (ListView) findViewById(R.id.ListView01); + l1.setAdapter(new EfficientAdapter(this)); + l1.setOnItemClickListener(new AdapterView.OnItemClickListener() + { + //@override + public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, + long arg3) { + //Toast.makeText(getBaseContext(), "You clciked "+country[arg2], Toast.LENGTH_LONG).show(); + } + } + ); + + ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); + l1.setDivider(divcolor); + l1.setDividerHeight(2); + /* + * update(); + * + * int x = nowplaylisthandler.PlayList.size(); Log.d("Android remote", + * "read " + x); + * + * // setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, + * // COUNTRIES)); + */ + } + + private void update() { + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); + + String HttpServer = settings.getString("Server", "192.168.0.30"); + String HttpPort = settings.getString("Port", "8200"); + + nowplaylisthandler handler = nowplaylisthandler.getinstance(); + handler.setconnection(HttpServer, HttpPort); + handler.fetchdata(); + } + + public void PostCommand(String button) { + + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); + + String HttpServer = settings.getString("Server", "192.168.0.30"); + String HttpPort = settings.getString("Port", "8200"); + + HttpParams httpParameters = new BasicHttpParams(); + HttpConnectionParams.setConnectionTimeout(httpParameters, 3000); + HttpConnectionParams.setSoTimeout(httpParameters, 3000); + + HttpClient httpclient = new DefaultHttpClient(httpParameters); + HttpPost httppost = new HttpPost("http://" + HttpServer + ":" + + HttpPort); + + try { + + AssetManager assetManager = getAssets(); + + InputStream inputStream = null; + inputStream = assetManager.open("cmd_" + button + ".xml"); + + int x = inputStream.read(); + + String xml = ""; + + while (x != -1) { + xml = xml + (char) x; + x = inputStream.read(); + } + + StringEntity se = new StringEntity(xml, "UTF-8"); + se.setContentType("application/atom+xml"); + + httppost.setEntity(se); + + // HttpResponse response; + // response = httpclient.execute(httppost); + httpclient.execute(httppost); + + } catch (ClientProtocolException e) { + Toast.makeText(nowplaylist.this, "ERROR CONNECTION SERVER", + Toast.LENGTH_LONG).show(); + e.printStackTrace(); + } catch (IOException e) { + Toast.makeText(nowplaylist.this, "TIME OUT SERVER", + Toast.LENGTH_LONG).show(); + e.printStackTrace(); + } + } + +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java 2010-11-25 19:46:56 UTC (rev 3981) @@ -0,0 +1,69 @@ +package mediaportal.remote; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public class nowplaylistXmlHandler extends DefaultHandler { + Boolean currentElement = false; + String currentValue = null; + nowplaylisthandler.PlayListItem item = null; + + /** + * Called when tag starts ( example:- <name>AndroidPeople</name> -- <name> ) + */ + @Override + public void startElement(String uri, String localName, String qName, + Attributes attributes) throws SAXException { + currentElement = true; + currentValue = "..."; + + if (localName == "Item") + item = new nowplaylisthandler.PlayListItem(); + } + + /** + * Called when tag closing ( example:- <name>AndroidPeople</name> -- </name> + * ) + */ + @Override + public void endElement(String uri, String localName, String qName) + throws SAXException { + + currentElement = false; + + /** set value */ + if (localName == "Title") { + item.Title = currentValue; + } + if (localName == "Duration") { + item.Duration = currentValue; + } + if (localName == "Played") { + item.Played = currentValue; + } + if (localName == "Typ") { + item.Typ = currentValue; + } + if (localName == "Item") { + nowplaylisthandler.PlayList.add(item); + item = null; + } + + } + + /** + * Called to get tag characters ( example:- <name>AndroidPeople</name> -- to + * get AndroidPeople Character ) + */ + @Override + public void characters(char[] ch, int start, int length) + throws SAXException { + if (currentElement) { + currentValue = new String(ch, start, length); + currentElement = false; + } + + } + +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java 2010-11-25 19:46:56 UTC (rev 3981) @@ -0,0 +1,111 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +public class nowplaylisthandler { + + private static nowplaylisthandler instance; + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + private String _server; + private String _port; + +public static ArrayList<PlayListItem> PlayList = new ArrayList<PlayListItem>(); + + public static class PlayListItem + { + public String Title; + public String Duration; + public String Played; + public String Typ; + } + + public static nowplaylisthandler getinstance() { + if (instance == null) + instance = new nowplaylisthandler(); + return instance; + } + + private nowplaylisthandler() { + + } + + public void setconnection(String server, String port) { + _server = server; + _port = port; + } + + public void fetchdata() { + + PlayList = new ArrayList<PlayListItem>(); + String fileUrl = "http://" + _server + ":" + _port + "/nowplaying/list.xml"; + + URL myFileUrl = null; + try { + myFileUrl = new URL(fileUrl); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + HttpURLConnection conn = (HttpURLConnection) myFileUrl + .openConnection(); + conn.setReadTimeout(10000); + conn.setDoInput(true); + conn.connect(); + // int length = conn.getContentLength(); + InputStream is = conn.getInputStream(); + + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser sp = null; + try { + sp = spf.newSAXParser(); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + XMLReader reader = null; + try { + reader = sp.getXMLReader(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + nowplaylistXmlHandler handler = new nowplaylistXmlHandler(); + + reader.setContentHandler(handler); + try { + reader.parse(new InputSource(is)); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + is.close(); + sp.reset(); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-25 19:46:56 UTC (rev 3981) @@ -34,9 +34,6 @@ String HttpServer = settings.getString("Server", "192.168.0.30"); String HttpPort = settings.getString("Port", "8200"); - // ImageAdapter.downloadFile("http://" + HttpServer + ":" + HttpPort - // + "/pictures/2010/2008%2001%2023"); - picturehandler h = picturehandler.getinstance(); h.setconnection(HttpServer, HttpPort); h.getrootdirectory(); @@ -48,7 +45,7 @@ public void onItemClick(AdapterView<?> parent, View v, int position, long id) { - TextView tv = (TextView) v.findViewById(R.id.icon_text); + //TextView tv = (TextView) v.findViewById(R.id.icon_text); ImageView iv = (ImageView) v.findViewById(R.id.icon_image); picItem pic = (picItem) iv.getTag(); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-25 19:46:56 UTC (rev 3981) @@ -79,7 +79,6 @@ txt.setText(pic.selectedPictureName); } } catch (Exception e) { - String g = e.getStackTrace().toString(); // nothing } return false; Modified: trunk/plugins/AndroidRemote/Release/Android Server communication.docx =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Release/nowplaying.jpg =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Release/nowplayingList.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/nowplayingList.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj 2010-11-25 19:46:56 UTC (rev 3981) @@ -66,6 +66,9 @@ <DependentUpon>Setup.cs</DependentUpon> </EmbeddedResource> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="favicon.ico" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs 2010-11-25 19:46:56 UTC (rev 3981) @@ -70,7 +70,7 @@ string dir = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config); using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(dir + "\\MediaPortal.xml")) { - Server= xmlreader.GetValueAsString("android", "server", "192.168.0.30"); + Server = xmlreader.GetValueAsString("android", "server", "192.168.0.30"); Port = xmlreader.GetValueAsString("android", "port", "8200"); PicturePath = xmlreader.GetValueAsString("android", "pictures", Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-25 08:32:51 UTC (rev 3980) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-25 19:46:56 UTC (rev 3981) @@ -45,6 +45,8 @@ private byte[] read; private byte[] buffer; + private static Bitmap actualCover = null; + public Request(Socket Socket) { socket = Socket; @@ -62,6 +64,8 @@ if (clientmessage.Contains("Continue")) { + AndroidServer.logDebug("receive HTTP Continue"); + allMessage = allMessage + clientmessage.Substring(0, bytes); sendMessage(socket, "HTTP/1.0 100 Continue\r\n"); sendMessage(socket, "\r\n"); @@ -72,6 +76,8 @@ if (clientmessage.Contains("POST")) { + AndroidServer.logDebug("receive HTTP POST"); + sendMessage(socket, "HTTP/1.0 200 OK\r\n"); sendMessage(socket, "\r\n"); @@ -86,7 +92,7 @@ req = HttpUtility.UrlDecode(req); - System.Diagnostics.Debug.WriteLine("GET Request : " + req); + AndroidServer.logDebug("receive HTTP GET : " + req); #region pictures if (req.StartsWith("/pictures")) @@ -160,13 +166,16 @@ { ReplyNowPlayingPlaylist(); } + else if (req.StartsWith("/nowplaying/cover")) + { + ReplyNowCover(); + } #endregion #region favicon else if (req.StartsWith("/favicon.ico")) { - //todo use resource - ReplyPictureFile("c:\\favicon.ico"); + ReplyFavIcon(); } #endregion @@ -190,6 +199,7 @@ private void ExceuteCommand(string Message) { + AndroidServer.logDebug("execute command"); if (Message.Contains("ACTION_PLAY")) { Action action = new Action(Action.ActionType.ACTION_PLAY, 0, 0); @@ -276,6 +286,7 @@ msg += "</Directory>\r\n"; // send sendMessage(socket, msg); + AndroidServer.logDebug("Reply picture dir"); } else { @@ -314,6 +325,7 @@ sendMessage(socket, msg); // content sendBytes(socket, b); + AndroidServer.logDebug("Reply picture file"); } else { @@ -349,6 +361,7 @@ sendMessage(socket, msg); // content sendBytes(socket, b); + AndroidServer.logDebug("Reply picture thumb file"); } else { @@ -389,6 +402,7 @@ msg += "</Directory>\r\n"; // send sendMessage(socket, msg); + AndroidServer.logDebug("Reply music dir"); } else { @@ -411,6 +425,7 @@ sendMessage(socket, msg); // content sendBytes(socket, b); + AndroidServer.logDebug("Reply music file"); } else { @@ -425,6 +440,18 @@ string album = GUIPropertyManager.GetProperty("#Play.Current.Album"); string track = GUIPropertyManager.GetProperty("#Play.Current.Track"); + string cover = GUIPropertyManager.GetProperty("#Play.Current.Thumb"); + if (File.Exists(cover)) + { + try + { + actualCover = (Bitmap)Bitmap.FromFile(cover); + } + catch { }; + } + else + actualCover = null; + string actual = GUIPropertyManager.GetProperty("#currentplaytime"); string total = GUIPropertyManager.GetProperty("#duration"); @@ -447,7 +474,6 @@ album = HttpUtility.HtmlEncode(album); title = HttpUtility.HtmlEncode(title); - string msg = string.Empty; // header msg += "HTTP/1.0 200 Ok\r\n"; @@ -464,7 +490,10 @@ msg += "<Artist>" + artist + "</Artist>\r\n"; msg += "<Album>" + album + "</Album>\r\n"; msg += "<Track>" + track + "</Track>\r\n"; - msg += "<Cover></Cover>\r\n"; + if (actualCover != null) + msg += "<Cover>True</Cover>\r\n"; + else + msg += "<Cover>False</Cover>\r\n"; msg += "<ActualTime>" + actual + "</ActualTime>\r\n"; msg += "<TotalTime>" + total + "</TotalTime>\r\n"; @@ -472,6 +501,7 @@ msg += "</NowPlaying>\r\n"; // send sendMessage(socket, msg); + AndroidServer.logDebug("Reply now playing"); } private void ReplyNowPlayingPlaylist() { @@ -512,16 +542,58 @@ msg += "</Item>\r\n"; } + msg += "</NowPlayingPlaylist>\r\n"; - msg += "</NowPlayingPlaylist>\r\n"; // send - sendMessage(socket, msg); + AndroidServer.logDebug("Reply now playing list"); } + private void ReplyNowCover() + { + if (actualCover != null) + { + byte[] b; + if ((actualCover.Width > 250) || (actualCover.Height > 250)) + { + Bitmap thumb = (Bitmap)actualCover.Clone(); + thumb = MediaPortal.Util.BitmapResize.Resize(ref thumb, 250, 250, false, true); + + b = BildToByteArray((Image)thumb); + } + else + { + b = BildToByteArray((Image)actualCover); + } + + if (b != null) + { + string msg = string.Empty; + // header + msg += "HTTP/1.0 200 Ok\r\n"; + msg += "Content-Type: image/jpeg" + "\r\n"; + msg += "Content-Length: " + b.Length + "\r\n"; + msg += "Proxy-Connection: close" + "\r\n"; + msg += "\r\n"; + sendMessage(socket, msg); + // content + sendBytes(socket, b); + AndroidServer.logDebug("Reply play now cover file"); + } + else + { + SendServerError("play now cover", "ReplyNowThumb"); + } + } + else + { + SendErrorFile("thumb.jpg"); + } + } + private void SendErrorURL(string Url) { - System.Diagnostics.Debug.WriteLine("URL NOT FOUND " + Url); + AndroidServer.logDebug("URL NOT FOUND " + Url); string msg = string.Empty; // header msg += "HTTP/1.0 404 Not Found\r\n"; @@ -543,7 +615,7 @@ } private void SendErrorFile(string FileName) { - System.Diagnostics.Debug.WriteLine("FILE NOT FOUND " + FileName); + AndroidServer.logDebug("FILE NOT FOUND " + FileName); string msg = string.Empty; // header msg += "HTTP/1.0 404 Not Found\r\n"; @@ -565,7 +637,7 @@ } private void SendServerError(string Data, string Who) { - System.Diagnostics.Debug.WriteLine("Internal Server Error " + Who); + AndroidServer.logDebug("Internal Server Error " + Who + " / " + Data); string msg = string.Empty; // header msg += "HTTP/1.0 500 Internal Server Error\r\n"; @@ -586,6 +658,31 @@ sendMessage(socket, msg); } + private void ReplyFavIcon() + { + Stream stream = GetEmbeddedResourceStream("AndroidRemote.favicon.ico"); + byte[] b = StreamToByteArray(stream); + + if (b != null) + { + string msg = string.Empty; + // header + msg += "HTTP/1.0 200 Ok\r\n"; + msg += "Content-Type: image/jpeg" + "\r\n"; + msg += "Content-Length: " + b.Length + "\r\n"; + msg += "Proxy-Connection: close" + "\r\n"; + msg += "\r\n"; + sendMessage(socket, msg); + // content + sendBytes(socket, b); + AndroidServer.logDebug("Reply favicon"); + } + else + { + SendServerError("favicon.ico", "ReplyFavIcon"); + } + } + private int readmessage(byte[] ByteArray, ref Socket s, ref String clientmessage) { int bytes = s.Receive(ByteArray, 1024, 0); @@ -654,6 +751,36 @@ IS.Flush(); return IS.ToArray(); } + private byte[] StreamToByteArray(Stream stream) + { + byte[] _Buffer = null; + try + { + // attach stream to binary reader + System.IO.BinaryReader _BinaryReader = new System.IO.BinaryReader(stream); + + // get total byte length of the file + long _TotalBytes = stream.Length; + + // read entire file into buffer + _Buffer = _BinaryReader.ReadBytes((Int32)_TotalBytes); + + // close file reader + _BinaryReader.Close(); + } + catch (Exception _Exception) + { + // Error + Console.WriteLine("Exception caught in process: {0}", _Exception.ToString()); + } + + return _Buffer; + } + + protected Stream GetEmbeddedResourceStream(string ResourceName) + { + return System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(ResourceName); + } } } Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/favicon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Server/AndroidRemote/favicon.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream 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. |
From: <kro...@us...> - 2010-11-29 13:05:19
|
Revision: 3986 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3986&view=rev Author: kroko_koenig Date: 2010-11-29 13:05:10 +0000 (Mon, 29 Nov 2010) Log Message: ----------- update quite a lot Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayingXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturehandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java trunk/plugins/AndroidRemote/Release/Android Server communication.docx trunk/plugins/AndroidRemote/Release/remote.jpg trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.ltk.core.refactoring.prefs trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_contextMenu.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_forward.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_nextChannel.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_nextItem.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_parentDir.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevChannel.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevItem.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previousMenu.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_rewind.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_showInfo.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeDown.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeMute.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeUp.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/album.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/album_off.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/artist.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/artist_off.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/audio.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/foldertab.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/foldertab_off.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab1.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab2.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab3.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab4.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/song.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/song_off.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_album.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_results.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_song.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/musictab.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/title.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ScrollView.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/music.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musichandler.java trunk/plugins/AndroidRemote/Release/album.jpg trunk/plugins/AndroidRemote/Release/artist.jpg trunk/plugins/AndroidRemote/Release/music.jpg trunk/plugins/AndroidRemote/Release/song.jpg trunk/plugins/AndroidRemote/Release/splashupdate01.jpg Removed Paths: ------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_next.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previous.xml Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.ltk.core.refactoring.prefs =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.ltk.core.refactoring.prefs (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.ltk.core.refactoring.prefs 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,3 @@ +#Thu Nov 25 20:59:35 CET 2010 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-28 20:12:33 UTC (rev 3985) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -2,7 +2,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="mediaportal.remote" android:versionCode="1" android:versionName="1.0"> - <application android:icon="@drawable/icon" android:label="@string/app_name"> + <application android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar"> <activity android:name=".splash" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> @@ -18,11 +18,18 @@ <activity android:name=".remote"></activity> <activity android:name=".pictures"></activity> <activity android:name=".picturesfullscreen"></activity> + <activity android:name=".music"></activity> <activity android:name=".setup"></activity> <activity android:name=".nowplaying"></activity> <activity android:name=".nowplaylist"></activity> + <activity android:name=".musicArtist"></activity> + <activity android:name=".musicAlbum"></activity> + <activity android:name=".musicSong"></activity> + <activity android:name=".musicTab"></activity> + <activity android:name=".musicResults"></activity> </application> <uses-sdk android:minSdkVersion="3" /> <uses-permission android:name="android.permission.INTERNET"></uses-permission> + </manifest> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_contextMenu.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_contextMenu.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_contextMenu.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_CONTEXT_MENU</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_forward.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_forward.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_forward.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_FORWARD</command> +</message> \ No newline at end of file Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_next.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_next.xml 2010-11-28 20:12:33 UTC (rev 3985) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_next.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<message> - <command>ACTION_NEXT_ITEM</command> -</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_nextChannel.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_nextChannel.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_nextChannel.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_NEXT_CHANNEL</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_nextItem.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_nextItem.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_nextItem.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_NEXT_ITEM</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_parentDir.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_parentDir.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_parentDir.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_PARENT_DIR</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevChannel.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevChannel.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevChannel.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_PREV_CHANNEL</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevItem.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevItem.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevItem.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_PREV_ITEM</command> +</message> \ No newline at end of file Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml 2010-11-28 20:12:33 UTC (rev 3985) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<message> - <command>ACTION_PREVIOUS_MENU</command> -</message> \ No newline at end of file Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previous.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previous.xml 2010-11-28 20:12:33 UTC (rev 3985) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previous.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<message> - <command>ACTION_PREV_ITEM</command> -</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previousMenu.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previousMenu.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_previousMenu.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_PREVIOUS_MENU</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_rewind.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_rewind.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_rewind.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_REWIND</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_showInfo.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_showInfo.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_showInfo.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_SHOW_INFO</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeDown.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeDown.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeDown.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_VOLUME_DOWN</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeMute.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeMute.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeMute.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_VOLUME_MUTE</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeUp.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeUp.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_volumeUp.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_VOLUME_UP</command> +</message> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-28 20:12:33 UTC (rev 3985) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-29 13:05:10 UTC (rev 3986) @@ -12,36 +12,50 @@ } public static final class drawable { public static final int accept_icon=0x7f020000; - public static final int back=0x7f020001; - public static final int back_icon=0x7f020002; - public static final int border=0x7f020003; - public static final int cdcover=0x7f020004; - public static final int close_icon=0x7f020005; - public static final int document=0x7f020006; - public static final int down_icon=0x7f020007; - public static final int folder=0x7f020008; - public static final int folderback=0x7f020009; - public static final int forward=0x7f02000a; - public static final int icon=0x7f02000b; - public static final int music_logo=0x7f02000c; - public static final int next_icon=0x7f02000d; - public static final int nowplaying_logo=0x7f02000e; - public static final int pause=0x7f02000f; - public static final int picture=0x7f020010; - public static final int pictures_logo=0x7f020011; - public static final int play=0x7f020012; - public static final int remote_logo=0x7f020013; - public static final int rewind=0x7f020014; - public static final int splash=0x7f020015; - public static final int stop=0x7f020016; - public static final int up_icon=0x7f020017; - public static final int videos_logo=0x7f020018; + public static final int album=0x7f020001; + public static final int album_off=0x7f020002; + public static final int artist=0x7f020003; + public static final int artist_off=0x7f020004; + public static final int audio=0x7f020005; + public static final int back=0x7f020006; + public static final int back_icon=0x7f020007; + public static final int border=0x7f020008; + public static final int cdcover=0x7f020009; + public static final int close_icon=0x7f02000a; + public static final int document=0x7f02000b; + public static final int down_icon=0x7f02000c; + public static final int folder=0x7f02000d; + public static final int folderback=0x7f02000e; + public static final int foldertab=0x7f02000f; + public static final int foldertab_off=0x7f020010; + public static final int forward=0x7f020011; + public static final int ic_tab=0x7f020012; + public static final int ic_tab1=0x7f020013; + public static final int ic_tab2=0x7f020014; + public static final int ic_tab3=0x7f020015; + public static final int ic_tab4=0x7f020016; + public static final int icon=0x7f020017; + public static final int music_logo=0x7f020018; + public static final int next_icon=0x7f020019; + public static final int nowplaying_logo=0x7f02001a; + public static final int pause=0x7f02001b; + public static final int picture=0x7f02001c; + public static final int pictures_logo=0x7f02001d; + public static final int play=0x7f02001e; + public static final int remote_logo=0x7f02001f; + public static final int rewind=0x7f020020; + public static final int song=0x7f020021; + public static final int song_off=0x7f020022; + public static final int splash=0x7f020023; + public static final int stop=0x7f020024; + public static final int up_icon=0x7f020025; + public static final int videos_logo=0x7f020026; } public static final class id { - public static final int GridView01=0x7f05000b; - public static final int ImageView01=0x7f05000d; - public static final int LinearLayout01=0x7f05000e; - public static final int ListView01=0x7f05001d; + public static final int GridView01=0x7f050010; + public static final int ImageView01=0x7f050012; + public static final int LinearLayout01=0x7f050013; + public static final int ListView01=0x7f050022; public static final int MainButton1=0x7f050005; public static final int MainButton2=0x7f050006; public static final int MainButton3=0x7f050007; @@ -49,47 +63,74 @@ public static final int MainButton5=0x7f050009; public static final int TextView01=0x7f050003; public static final int TextView02=0x7f050004; - public static final int btnCancel=0x7f050020; - public static final int btnDown=0x7f050022; - public static final int btnLeft=0x7f050024; - public static final int btnOk=0x7f050021; - public static final int btnReturn=0x7f05001f; - public static final int btnReturnSetup=0x7f050027; - public static final int btnRight=0x7f050023; - public static final int btnUp=0x7f05001e; - public static final int full_text=0x7f05000c; + public static final int btnBack=0x7f050037; + public static final int btnDown=0x7f050036; + public static final int btnFBack=0x7f050024; + public static final int btnFForw=0x7f050026; + public static final int btnHome=0x7f05002d; + public static final int btnInfo=0x7f05002f; + public static final int btnLeft=0x7f050031; + public static final int btnMenu=0x7f050035; + public static final int btnOk=0x7f050032; + public static final int btnPause=0x7f05002a; + public static final int btnPlay=0x7f050025; + public static final int btnReturnSetup=0x7f05003a; + public static final int btnRight=0x7f050033; + public static final int btnSkipBack=0x7f050028; + public static final int btnSkipForw=0x7f05002b; + public static final int btnStop=0x7f050029; + public static final int btnUp=0x7f05002e; + public static final int full_text=0x7f050011; public static final int icon_image=0x7f050001; public static final int icon_text=0x7f050002; - public static final int now_album=0x7f050010; - public static final int now_artist=0x7f050016; - public static final int now_cd=0x7f050011; - public static final int now_list=0x7f05001c; - public static final int now_next=0x7f05001b; - public static final int now_pause=0x7f050019; - public static final int now_play=0x7f05001a; - public static final int now_playing=0x7f05000f; - public static final int now_playing_right=0x7f050014; - public static final int now_playing_t_left=0x7f050013; - public static final int now_prev=0x7f050017; - public static final int now_progress=0x7f050012; - public static final int now_stop=0x7f050018; - public static final int now_title=0x7f050015; - public static final int server_ip=0x7f050025; - public static final int server_port=0x7f050026; + public static final int list_album=0x7f05000c; + public static final int list_artist=0x7f05000d; + public static final int list_result=0x7f05000e; + public static final int list_song=0x7f05000f; + public static final int music_grid=0x7f05000b; + public static final int now_album=0x7f050015; + public static final int now_artist=0x7f05001b; + public static final int now_cd=0x7f050016; + public static final int now_list=0x7f050021; + public static final int now_next=0x7f050020; + public static final int now_pause=0x7f05001e; + public static final int now_play=0x7f05001f; + public static final int now_playing=0x7f050014; + public static final int now_playing_right=0x7f050019; + public static final int now_playing_t_left=0x7f050018; + public static final int now_prev=0x7f05001c; + public static final int now_progress=0x7f050017; + public static final int now_stop=0x7f05001d; + public static final int now_title=0x7f05001a; + public static final int server_ip=0x7f050038; + public static final int server_port=0x7f050039; + public static final int title=0x7f05003b; public static final int widget0=0x7f05000a; + public static final int widget00=0x7f050023; + public static final int widget01=0x7f050027; + public static final int widget02=0x7f05002c; + public static final int widget03=0x7f050030; + public static final int widget04=0x7f050034; public static final int widget44=0x7f050000; } public static final class layout { public static final int icon=0x7f030000; public static final int list_item=0x7f030001; public static final int main=0x7f030002; - public static final int pictures=0x7f030003; - public static final int picturesfullscreen=0x7f030004; - public static final int playingnow=0x7f030005; - public static final int playnowlist=0x7f030006; - public static final int remote=0x7f030007; - public static final int setup=0x7f030008; - public static final int splash=0x7f030009; + public static final int music=0x7f030003; + public static final int music_album=0x7f030004; + public static final int music_artist=0x7f030005; + public static final int music_results=0x7f030006; + public static final int music_song=0x7f030007; + public static final int musictab=0x7f030008; + public static final int pictures=0x7f030009; + public static final int picturesfullscreen=0x7f03000a; + public static final int playingnow=0x7f03000b; + public static final int playnowlist=0x7f03000c; + public static final int remote=0x7f03000d; + public static final int setup=0x7f03000e; + public static final int splash=0x7f03000f; + public static final int title=0x7f030010; } public static final class string { public static final int app_name=0x7f040001; Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/album.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/album.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/album_off.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/album_off.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/artist.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/artist.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/artist_off.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/artist_off.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/audio.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/audio.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/foldertab.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/foldertab.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/foldertab_off.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/foldertab_off.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <!-- When selected, use grey --> + <item android:drawable="@drawable/forward" + android:state_selected="true" /> + <!-- When not selected, use white--> + <item android:drawable="@drawable/rewind" /> +</selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab1.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab1.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab1.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <!-- When selected, use grey --> + <item android:drawable="@drawable/artist" + android:state_selected="true" /> + <!-- When not selected, use white--> + <item android:drawable="@drawable/artist_off" /> +</selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab2.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab2.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab2.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <!-- When selected, use grey --> + <item android:drawable="@drawable/album" + android:state_selected="true" /> + <!-- When not selected, use white--> + <item android:drawable="@drawable/album_off" /> +</selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab3.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab3.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab3.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <!-- When selected, use grey --> + <item android:drawable="@drawable/song" + android:state_selected="true" /> + <!-- When not selected, use white--> + <item android:drawable="@drawable/song_off" /> +</selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab4.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab4.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ic_tab4.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <!-- When selected, use grey --> + <item android:drawable="@drawable/foldertab" + android:state_selected="true" /> + <!-- When not selected, use white--> + <item android:drawable="@drawable/foldertab_off" /> +</selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/song.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/song.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/song_off.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/song_off.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-11-28 20:12:33 UTC (rev 3985) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -3,35 +3,33 @@ android:layout_height="fill_parent" android:background="@drawable/back"> <Button android:id="@+id/MainButton1" android:layout_width="fill_parent" - android:layout_height="wrap_content" android:padding="0dp" - android:background="@drawable/pictures_logo" /> + android:layout_height="70dip" android:background="@drawable/pictures_logo" /> - <View android:layout_height="2dp" android:layout_width="fill_parent" + <View android:layout_height="2dip" android:layout_width="fill_parent" android:background="#000" /> <Button android:id="@+id/MainButton2" android:layout_width="fill_parent" - android:layout_height="wrap_content" android:padding="0dp" - android:background="@drawable/music_logo" /> + android:layout_height="70dip" android:background="@drawable/music_logo" /> - <View android:layout_height="2dp" android:layout_width="fill_parent" + <View android:layout_height="2dip" android:layout_width="fill_parent" android:background="#000" /> <Button android:id="@+id/MainButton3" android:layout_width="fill_parent" - android:layout_height="wrap_content" android:padding="0dp" - android:background="@drawable/videos_logo" /> + android:layout_height="70dip" android:background="@drawable/videos_logo" /> - <View android:layout_height="2dp" android:layout_width="fill_parent" + <View android:layout_height="2dip" android:layout_width="fill_parent" android:background="#000" /> <Button android:id="@+id/MainButton4" android:layout_width="fill_parent" - android:layout_height="wrap_content" android:padding="0dp" - android:background="@drawable/remote_logo" /> + android:layout_height="70dip" android:background="@drawable/remote_logo" /> - <View android:layout_height="2dp" android:layout_width="fill_parent" + <View android:layout_height="2dip" android:layout_width="fill_parent" android:background="#000" /> <Button android:id="@+id/MainButton5" android:layout_width="fill_parent" - android:layout_height="wrap_content" android:padding="0dp" - android:background="@drawable/nowplaying_logo" /> + android:layout_height="70dip" android:background="@drawable/nowplaying_logo" /> + <View android:layout_height="2dip" android:layout_width="fill_parent" + android:background="#000" /> + </LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,12 @@ +<AbsoluteLayout android:id="@+id/widget0" + android:layout_width="fill_parent" android:layout_height="wrap_content" + android:background="@drawable/back" xmlns:android="http://schemas.android.com/apk/res/android"> + <GridView android:layout_y="0dip" android:layout_x="0dip" + android:id="@+id/music_grid" android:layout_width="fill_parent" + android:layout_height="fill_parent" android:columnWidth="90dp" + android:numColumns="auto_fit" android:verticalSpacing="10dp" + android:horizontalSpacing="10dp" android:stretchMode="columnWidth" + android:gravity="center"> + </GridView> +</AbsoluteLayout> + Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_album.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_album.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_album.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="fill_parent" + android:background="@drawable/back" + android:layout_height="fill_parent"> + + <ListView android:id="@+id/list_album" android:layout_height="wrap_content" + android:layout_width="fill_parent"> + </ListView> +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="fill_parent" + android:background="@drawable/back" + android:layout_height="fill_parent"> + + <ListView android:id="@+id/list_artist" android:layout_height="wrap_content" + android:layout_width="fill_parent"> + </ListView> +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_results.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_results.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_results.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="fill_parent" + android:background="@drawable/back" + android:layout_height="fill_parent"> + + <ListView android:id="@+id/list_result" android:layout_height="wrap_content" + android:layout_width="fill_parent"> + </ListView> +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_song.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_song.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_song.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="fill_parent" + android:background="@drawable/back" + android:layout_height="fill_parent"> + + <ListView android:id="@+id/list_song" android:layout_height="wrap_content" + android:layout_width="fill_parent"> + </ListView> +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/musictab.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/musictab.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/musictab.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<TabHost xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@android:id/tabhost" + android:layout_width="fill_parent" + android:layout_height="fill_parent"> + <LinearLayout + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:padding="5dp"> + <TabWidget + android:id="@android:id/tabs" + android:layout_width="fill_parent" + android:layout_height="wrap_content" /> + <FrameLayout + android:id="@android:id/tabcontent" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:padding="5dp" /> + </LinearLayout> +</TabHost> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-11-28 20:12:33 UTC (rev 3985) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -4,6 +4,7 @@ <TextView android:id="@+id/full_text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="name" android:gravity="center_horizontal" android:background="#FFFFFFFF" + android:textSize="20dip" android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF"> </TextView> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-11-28 20:12:33 UTC (rev 3985) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -18,9 +18,8 @@ android:gravity="center_horizontal"> </TextView> - <ImageView android:id="@+id/now_cd" android:layout_width="250dip" - android:layout_height="250dip" android:scaleType="centerCrop" - android:background="@drawable/cdcover" android:layout_gravity="center_horizontal"> + <ImageView android:id="@+id/now_cd" android:scaleType="centerCrop" + android:background="@drawable/cdcover" android:layout_gravity="center_horizontal" android:layout_height="200dip" android:layout_width="200dip" android:layout_marginTop="20dip" android:layout_marginBottom="20dip"> </ImageView> <SeekBar android:id="@+id/now_progress" android:layout_width="fill_parent" @@ -36,12 +35,12 @@ android:layout_height="wrap_content" android:layout_marginTop="10dip"> <TextView android:id="@+id/now_playing_t_left" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="12dip" android:textColor="#FF8080ff" android:text="left" + android:textSize="12dip" android:textColor="#FF8080ff" android:text="00:00" android:gravity="left" /> <TextView android:id="@+id/now_playing_right" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:textSize="12dip" - android:textColor="#FF8080ff" android:gravity="right" android:text="right" + android:textColor="#FF8080ff" android:gravity="right" android:text="00:00" android:singleLine="true" /> </RelativeLayout> <TextView android:id="@+id/now_title" android:layout_width="fill_parent" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml 2010-11-28 20:12:33 UTC (rev 3985) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" + android:background="@drawable/back" android:layout_height="fill_parent"> <TextView android:id="@+id/TextView01" android:layout_height="wrap_content" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml 2010-11-28 20:12:33 UTC (rev 3985) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -1,33 +1,142 @@ <?xml version="1.0" encoding="utf-8"?> -<AbsoluteLayout android:id="@+id/widget0" - android:layout_width="fill_parent" android:layout_height="fill_parent" - android:background="@drawable/back" xmlns:android="http://schemas.android.com/apk/res/android"> - <Button android:id="@+id/btnUp" android:layout_width="wrap_content" - android:layout_height="wrap_content" android:background="@drawable/up_icon" - android:layout_x="130px" android:layout_y="100px"> - </Button> - <Button android:id="@+id/btnReturn" android:layout_width="wrap_content" - android:layout_height="wrap_content" android:text="Return" - android:layout_x="10px" android:layout_y="8px"> - </Button> - <Button android:id="@+id/btnCancel" android:layout_width="wrap_content" - android:layout_height="wrap_content" android:background="@drawable/close_icon" - android:layout_x="260px" android:layout_y="8px"> - </Button> - <Button android:id="@+id/btnOk" android:layout_width="wrap_content" - android:layout_height="wrap_content" android:background="@drawable/accept_icon" - android:layout_x="130px" android:layout_y="175px"> - </Button> - <Button android:id="@+id/btnDown" android:layout_width="wrap_content" - android:layout_height="wrap_content" android:background="@drawable/down_icon" - android:layout_x="130px" android:layout_y="250px"> - </Button> - <Button android:id="@+id/btnRight" android:layout_width="wrap_content" - android:layout_height="wrap_content" android:background="@drawable/next_icon" - android:layout_x="205px" android:layout_y="175px"> - </Button> - <Button android:id="@+id/btnLeft" android:layout_width="wrap_content" - android:layout_height="wrap_content" android:background="@drawable/back_icon" - android:layout_x="55px" android:layout_y="175px"></Button> +<LinearLayout + android:id="@+id/widget0" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@drawable/back" + android:orientation="vertical" + xmlns:android="http://schemas.android.com/apk/res/android"> + + <LinearLayout + android:id="@+id/widget00" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + > + + <Button android:id="@+id/btnFBack" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="FBack"> + </Button> + + <Button android:id="@+id/btnPlay" + android:layout_width="160dip" + android:layout_height="60dip" + android:text="Play"> + </Button> + + <Button android:id="@+id/btnFForw" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="FForw"> + </Button> + + </LinearLayout> + + <LinearLayout + android:id="@+id/widget01" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + > + <Button android:id="@+id/btnSkipBack" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Skp -"> + </Button> + + <Button android:id="@+id/btnStop" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Stop"> + </Button> + + <Button android:id="@+id/btnPause" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Pause"> + </Button> + + <Button android:id="@+id/btnSkipForw" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Skp +"> + </Button> + + </LinearLayout> + + <LinearLayout + android:id="@+id/widget02" + android:layout_width="fill_parent" + android:layout_height="wrap_content"> + + <Button android:id="@+id/btnHome" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Home"> + </Button> + + <Button android:id="@+id/btnUp" + android:layout_width="160dip" + android:layout_height="60dip" + android:background="@drawable/up_icon"> + </Button> + + <Button android:id="@+id/btnInfo" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Info"> + </Button> + + </LinearLayout> -</AbsoluteLayout> \ No newline at end of file + <LinearLayout + android:id="@+id/widget03" + android:layout_width="fill_parent" + android:layout_height="wrap_content"> + + <Button android:id="@+id/btnLeft" + android:layout_width="80dip" + android:layout_height="120dip" + android:background="@drawable/back_icon"> + </Button> + + <Button android:id="@+id/btnOk" + android:layout_width="160dip" + android:layout_height="60dip" + android:background="@drawable/accept_icon"> + </Button> + + <Button android:id="@+id/btnRight" + android:layout_width="80dip" + android:layout_height="120dip" + android:background="@drawable/next_icon"> + </Button> + </LinearLayout> + + <LinearLayout + android:id="@+id/widget04" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + > + + <Button android:id="@+id/btnMenu" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Menu"> + </Button> + + <Button android:id="@+id/btnDown" + android:layout_width="160dip" + android:layout_height="60dip" + android:background="@drawable/down_icon"> + </Button> + + <Button android:id="@+id/btnBack" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Back"> + </Button> + + </LinearLayout> + +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/title.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/title.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/title.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,15 @@ +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="wrap_content" android:gravity="left|center" + android:layout_width="fill_parent" android:paddingBottom="0px" + android:paddingTop="0px" android:paddingLeft="0px"> + + <mediaportal.remote.ScrollView + android:id="@+id/title" android:gravity="center_vertical" + android:textColor="#000000" android:layout_alignParentRight="true" + android:background="#a0a0a0" android:layout_height="wrap_content" + android:layout_alignParentTop="true" android:padding="0dip" + android:layout_margin="0dip" android:textSize="20px" + android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" + android:singleLine="true" android:layout_width="fill_parent" + android:scrollHorizontally="true" android:text="New Title oder waht" /> +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,84 @@ +<LinearLayout android:id="@+id/LinearLayout01" + android:orientation="vertical" android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@drawable/back" + xmlns:android="http://schemas.android.com/apk/res/android"> + + <TextView android:id="@+id/now_playing" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="NOW PLAYING" + android:gravity="center_horizontal" android:background="#FFFFFFFF" + android:textColor="#FF000000" android:textSize="16dip" + android:textColorHighlight="#FFFFFFFF"> + </TextView> + + <TextView android:id="@+id/now_album" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="Album" + android:background="#F0F0F0FF" android:textColor="#FF000000" + android:textSize="16dip" android:textColorHighlight="#FFFFFFFF" + android:gravity="center_horizontal"> + </TextView> + + <ImageView android:id="@+id/now_cd" android:layout_width="200dip" + android:layout_height="200dip" android:scaleType="centerCrop" + android:background="@drawable/cdcover" android:layout_gravity="center_horizontal"> + </ImageView> + + <SeekBar android:id="@+id/now_progress" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:max="100" + android:paddingLeft="20dip" android:paddingRight="10dip" + android:paddingTop="0dip" android:thumbOffset="20dip" + android:layout_marginTop="-10dip" /> + + <LinearLayout android:layout_width="fill_parent" + android:layout_height="wrap_content" android:orientation="vertical" + android:layout_marginTop="-9dip"> + <RelativeLayout android:layout_width="fill_parent" + android:layout_height="wrap_content" android:layout_marginTop="10dip"> + <TextView android:id="@+id/now_playing_t_left" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:textSize="12dip" android:textColor="#FF8080ff" android:text="00:00" + android:gravity="left" /> + <TextView android:id="@+id/now_playing_right" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_alignParentRight="true" android:textSize="12dip" + android:textColor="#FF8080ff" android:gravity="right" android:text="00:00" + android:singleLine="true" /> + </RelativeLayout> + <TextView android:id="@+id/now_title" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:textSize="14dip" + android:background="#F0F0F0FF" android:textColor="#FF000000" + android:text="Artist" android:gravity="center_horizontal" + android:ellipsize="end" android:paddingLeft="25dip" + android:paddingRight="22dip" android:layout_marginTop="0dip" /> + <TextView android:id="@+id/now_artist" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:gravity="center_horizontal" + android:textSize="16dip" android:textColor="#FF000000" + android:background="#FFFFFFFF" android:text="Title" + android:layout_marginTop="0dip" /> + </LinearLayout> + + <LinearLayout android:layout_height="wrap_content" + android:orientation="horizontal" android:layout_width="fill_parent"> + <ImageButton android:id="@+id/now_prev" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/rewind" /> + <ImageButton android:id="@+id/now_stop" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/stop" /> + <ImageButton android:id="@+id/now_pause" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/pause" /> + <ImageButton android:id="@+id/now_play" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/play" /> + <ImageButton android:id="@+id/now_next" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/forward" /> + <ImageButton android:id="@+id/now_list" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/document"/> + </LinearLayout> + +</LinearLayout> + + + Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-11-29 13:05:10 UTC (rev 3986) @@ -0,0 +1,140 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; +import java.util.ArrayList; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +import mediaportal.remote.ReceiveDbXmlHandler.DbItems; + +public class ReceiveDbHandler { + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + private static ArrayList<DbItems> Result; + private static ReceiveDbHandler instance; + + private String _server; + private String _port; + + public int selectedMusic; + + public static ReceiveDbHandler getinstance() { + if (instance == null) + instance = new ReceiveDbHandler(); + return instance; + } + + public void setconnection(String server, String port) { + _server = server; + _port = port; + } + + public boolean GetAlbums() { + fetchData("album.xml"); + return true; + } + + public boolean GetArtist() { + fetchData("artist.xml"); + return true; + } + + public boolean GetSongs() { + fetchData("song.xml"); + return true; + } + + public boolean GetSongsByArtist(String Artist) { + fetchData(... [truncated message content] |
From: <kro...@us...> - 2010-11-30 07:11:33
|
Revision: 3987 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3987&view=rev Author: kroko_koenig Date: 2010-11-30 07:11:25 +0000 (Tue, 30 Nov 2010) Log Message: ----------- after some real test Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote02.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java Removed Paths: ------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-30 07:11:25 UTC (rev 3987) @@ -2,7 +2,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="mediaportal.remote" android:versionCode="1" android:versionName="1.0"> - <application android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar"> + <application android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar" android:debuggable="true"> <activity android:name=".splash" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> @@ -15,7 +15,8 @@ <category android:name="android.intent.category.VIEW" /> </intent-filter> </activity> - <activity android:name=".remote"></activity> + <activity android:name=".Remote_01"></activity> + <activity android:name=".Remote_02"></activity> <activity android:name=".pictures"></activity> <activity android:name=".picturesfullscreen"></activity> <activity android:name=".music"></activity> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -63,23 +63,23 @@ public static final int MainButton5=0x7f050009; public static final int TextView01=0x7f050003; public static final int TextView02=0x7f050004; - public static final int btnBack=0x7f050037; - public static final int btnDown=0x7f050036; - public static final int btnFBack=0x7f050024; - public static final int btnFForw=0x7f050026; - public static final int btnHome=0x7f05002d; - public static final int btnInfo=0x7f05002f; - public static final int btnLeft=0x7f050031; - public static final int btnMenu=0x7f050035; - public static final int btnOk=0x7f050032; - public static final int btnPause=0x7f05002a; - public static final int btnPlay=0x7f050025; - public static final int btnReturnSetup=0x7f05003a; - public static final int btnRight=0x7f050033; - public static final int btnSkipBack=0x7f050028; - public static final int btnSkipForw=0x7f05002b; - public static final int btnStop=0x7f050029; - public static final int btnUp=0x7f05002e; + public static final int btnBack=0x7f050038; + public static final int btnDown=0x7f050037; + public static final int btnFBack=0x7f050025; + public static final int btnFForw=0x7f050027; + public static final int btnHome=0x7f05002e; + public static final int btnInfo=0x7f050030; + public static final int btnLeft=0x7f050032; + public static final int btnMenu=0x7f050036; + public static final int btnOk=0x7f050033; + public static final int btnPause=0x7f05002b; + public static final int btnPlay=0x7f050026; + public static final int btnReturnSetup=0x7f05003b; + public static final int btnRight=0x7f050034; + public static final int btnSkipBack=0x7f050029; + public static final int btnSkipForw=0x7f05002c; + public static final int btnStop=0x7f05002a; + public static final int btnUp=0x7f05002f; public static final int full_text=0x7f050011; public static final int icon_image=0x7f050001; public static final int icon_text=0x7f050002; @@ -88,6 +88,7 @@ public static final int list_result=0x7f05000e; public static final int list_song=0x7f05000f; public static final int music_grid=0x7f05000b; + public static final int naviRemote_text=0x7f050023; public static final int now_album=0x7f050015; public static final int now_artist=0x7f05001b; public static final int now_cd=0x7f050016; @@ -102,15 +103,15 @@ public static final int now_progress=0x7f050017; public static final int now_stop=0x7f05001d; public static final int now_title=0x7f05001a; - public static final int server_ip=0x7f050038; - public static final int server_port=0x7f050039; - public static final int title=0x7f05003b; + public static final int server_ip=0x7f050039; + public static final int server_port=0x7f05003a; + public static final int title=0x7f05003c; public static final int widget0=0x7f05000a; - public static final int widget00=0x7f050023; - public static final int widget01=0x7f050027; - public static final int widget02=0x7f05002c; - public static final int widget03=0x7f050030; - public static final int widget04=0x7f050034; + public static final int widget00=0x7f050024; + public static final int widget01=0x7f050028; + public static final int widget02=0x7f05002d; + public static final int widget03=0x7f050031; + public static final int widget04=0x7f050035; public static final int widget44=0x7f050000; } public static final class layout { @@ -127,10 +128,11 @@ public static final int picturesfullscreen=0x7f03000a; public static final int playingnow=0x7f03000b; public static final int playnowlist=0x7f03000c; - public static final int remote=0x7f03000d; - public static final int setup=0x7f03000e; - public static final int splash=0x7f03000f; - public static final int title=0x7f030010; + public static final int remote01=0x7f03000d; + public static final int remote02=0x7f03000e; + public static final int setup=0x7f03000f; + public static final int splash=0x7f030010; + public static final int title=0x7f030011; } public static final class string { public static final int app_name=0x7f040001; Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml 2010-11-30 07:11:25 UTC (rev 3987) @@ -1,142 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout - android:id="@+id/widget0" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:background="@drawable/back" - android:orientation="vertical" - xmlns:android="http://schemas.android.com/apk/res/android"> - - <LinearLayout - android:id="@+id/widget00" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - > - - <Button android:id="@+id/btnFBack" - android:layout_width="80dip" - android:layout_height="60dip" - android:text="FBack"> - </Button> - - <Button android:id="@+id/btnPlay" - android:layout_width="160dip" - android:layout_height="60dip" - android:text="Play"> - </Button> - - <Button android:id="@+id/btnFForw" - android:layout_width="80dip" - android:layout_height="60dip" - android:text="FForw"> - </Button> - - </LinearLayout> - - <LinearLayout - android:id="@+id/widget01" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - > - <Button android:id="@+id/btnSkipBack" - android:layout_width="80dip" - android:layout_height="60dip" - android:text="Skp -"> - </Button> - - <Button android:id="@+id/btnStop" - android:layout_width="80dip" - android:layout_height="60dip" - android:text="Stop"> - </Button> - - <Button android:id="@+id/btnPause" - android:layout_width="80dip" - android:layout_height="60dip" - android:text="Pause"> - </Button> - - <Button android:id="@+id/btnSkipForw" - android:layout_width="80dip" - android:layout_height="60dip" - android:text="Skp +"> - </Button> - - </LinearLayout> - - <LinearLayout - android:id="@+id/widget02" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - - <Button android:id="@+id/btnHome" - android:layout_width="80dip" - android:layout_height="60dip" - android:text="Home"> - </Button> - - <Button android:id="@+id/btnUp" - android:layout_width="160dip" - android:layout_height="60dip" - android:background="@drawable/up_icon"> - </Button> - - <Button android:id="@+id/btnInfo" - android:layout_width="80dip" - android:layout_height="60dip" - android:text="Info"> - </Button> - - </LinearLayout> - - <LinearLayout - android:id="@+id/widget03" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - - <Button android:id="@+id/btnLeft" - android:layout_width="80dip" - android:layout_height="120dip" - android:background="@drawable/back_icon"> - </Button> - - <Button android:id="@+id/btnOk" - android:layout_width="160dip" - android:layout_height="60dip" - android:background="@drawable/accept_icon"> - </Button> - - <Button android:id="@+id/btnRight" - android:layout_width="80dip" - android:layout_height="120dip" - android:background="@drawable/next_icon"> - </Button> - </LinearLayout> - - <LinearLayout - android:id="@+id/widget04" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - > - - <Button android:id="@+id/btnMenu" - android:layout_width="80dip" - android:layout_height="60dip" - android:text="Menu"> - </Button> - - <Button android:id="@+id/btnDown" - android:layout_width="160dip" - android:layout_height="60dip" - android:background="@drawable/down_icon"> - </Button> - - <Button android:id="@+id/btnBack" - android:layout_width="80dip" - android:layout_height="60dip" - android:text="Back"> - </Button> - - </LinearLayout> - -</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml 2010-11-30 07:11:25 UTC (rev 3987) @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + android:id="@+id/widget0" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@drawable/back" + android:orientation="vertical" + xmlns:android="http://schemas.android.com/apk/res/android"> + + <TextView android:id="@+id/naviRemote_text" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="Remote 01" + android:gravity="center_horizontal" android:background="#FFFFFFFF" + android:textSize="15dip" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF"> + </TextView> + + <LinearLayout + android:id="@+id/widget00" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + > + + <Button android:id="@+id/btnFBack" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="FBack"> + </Button> + + <Button android:id="@+id/btnPlay" + android:layout_width="160dip" + android:layout_height="60dip" + android:text="Play"> + </Button> + + <Button android:id="@+id/btnFForw" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="FForw"> + </Button> + + </LinearLayout> + + <LinearLayout + android:id="@+id/widget01" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + > + <Button android:id="@+id/btnSkipBack" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Skp -"> + </Button> + + <Button android:id="@+id/btnStop" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Stop"> + </Button> + + <Button android:id="@+id/btnPause" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Pause"> + </Button> + + <Button android:id="@+id/btnSkipForw" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Skp +"> + </Button> + + </LinearLayout> + + <LinearLayout + android:id="@+id/widget02" + android:layout_width="fill_parent" + android:layout_height="wrap_content"> + + <Button android:id="@+id/btnHome" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Home"> + </Button> + + <Button android:id="@+id/btnUp" + android:layout_width="160dip" + android:layout_height="60dip" + android:background="@drawable/up_icon"> + </Button> + + <Button android:id="@+id/btnInfo" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Info"> + </Button> + + </LinearLayout> + + <LinearLayout + android:id="@+id/widget03" + android:layout_width="fill_parent" + android:layout_height="wrap_content"> + + <Button android:id="@+id/btnLeft" + android:layout_width="80dip" + android:layout_height="120dip" + android:background="@drawable/back_icon"> + </Button> + + <Button android:id="@+id/btnOk" + android:layout_width="160dip" + android:layout_height="60dip" + android:background="@drawable/accept_icon"> + </Button> + + <Button android:id="@+id/btnRight" + android:layout_width="80dip" + android:layout_height="120dip" + android:background="@drawable/next_icon"> + </Button> + </LinearLayout> + + <LinearLayout + android:id="@+id/widget04" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + > + + <Button android:id="@+id/btnMenu" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Menu"> + </Button> + + <Button android:id="@+id/btnDown" + android:layout_width="160dip" + android:layout_height="60dip" + android:background="@drawable/down_icon"> + </Button> + + <Button android:id="@+id/btnBack" + android:layout_width="80dip" + android:layout_height="60dip" + android:text="Back"> + </Button> + + </LinearLayout> + +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote02.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote02.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote02.xml 2010-11-30 07:11:25 UTC (rev 3987) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + android:id="@+id/widget0" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@drawable/back" + android:orientation="vertical" + xmlns:android="http://schemas.android.com/apk/res/android"> + + <TextView android:id="@+id/naviRemote_text" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="Menu 02" + android:gravity="center_horizontal" android:background="#FFFFFFFF" + android:textSize="15dip" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF"> + </TextView> + +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -0,0 +1,54 @@ +package mediaportal.remote; + +import java.io.IOException; + +import org.apache.http.HttpResponse; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.BasicHttpParams; +import org.apache.http.params.HttpConnectionParams; +import org.apache.http.params.HttpParams; + +public class PostWebserver { + + public String httpServer = ""; + public String httpPort = ""; + + public PostWebserver(String Server, String Port) { + httpServer = Server; + httpPort = Port; + } + + public boolean Post(String Data) { + + boolean result = false; + try { + HttpParams httpParameters = new BasicHttpParams(); + HttpConnectionParams.setConnectionTimeout(httpParameters, 5000); + HttpConnectionParams.setSoTimeout(httpParameters, 5000); + + DefaultHttpClient httpclient = new DefaultHttpClient(httpParameters); + HttpPost httppost = new HttpPost("http://" + httpServer + ":" + + httpPort); + + StringEntity se = new StringEntity(Data, "UTF-8"); + se.setContentType("application/atom+xml"); + + httppost.setEntity(se); + + @SuppressWarnings("unused") + HttpResponse response; + response = httpclient.execute(httppost); + + result = true; + } catch (ClientProtocolException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + return result; + } +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -0,0 +1,219 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; + +import mediaportal.remote.R; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.AssetManager; +import android.os.Bundle; +import android.view.GestureDetector; +import android.view.MotionEvent; +import android.view.View; +import android.view.GestureDetector.OnGestureListener; +import android.widget.Button; + +public class Remote_01 extends Activity implements OnGestureListener { + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + private String HttpServer = ""; + private String HttpPort = ""; + + private GestureDetector gestureScanner; + private static final int SWIPE_MIN_DISTANCE = 120; + private static final int SWIPE_MAX_OFF_PATH = 250; + private static final int SWIPE_THRESHOLD_VELOCITY = 200; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.remote01); + + gestureScanner = new GestureDetector(this); + + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); + + HttpServer = settings.getString("Server", "192.168.0.30"); + HttpPort = settings.getString("Port", "8200"); + + Button can = (Button) findViewById(R.id.btnBack); + can.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("previousMenu"); + } + }); + + Button menu = (Button) findViewById(R.id.btnMenu); + menu.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("contextMenu"); + } + }); + + Button home = (Button) findViewById(R.id.btnHome); + home.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("parentDir"); + } + }); + + Button info = (Button) findViewById(R.id.btnInfo); + info.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("showInfo"); + } + }); + + Button left = (Button) findViewById(R.id.btnLeft); + left.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveLeft"); + } + }); + + Button right = (Button) findViewById(R.id.btnRight); + right.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveRight"); + } + }); + + Button up = (Button) findViewById(R.id.btnUp); + up.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveUp"); + } + }); + + Button down = (Button) findViewById(R.id.btnDown); + down.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveDown"); + } + }); + + Button ok = (Button) findViewById(R.id.btnOk); + ok.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("selectItem"); + } + }); + + Button play = (Button) findViewById(R.id.btnPlay); + play.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("play"); + } + }); + + Button pause = (Button) findViewById(R.id.btnPause); + pause.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("pause"); + } + }); + + Button stop = (Button) findViewById(R.id.btnStop); + stop.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("stop"); + } + }); + + Button skipForw = (Button) findViewById(R.id.btnSkipForw); + skipForw.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("nextItem"); + } + }); + + Button skipBack = (Button) findViewById(R.id.btnSkipBack); + skipBack.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("prevItem"); + } + }); + + Button fForw = (Button) findViewById(R.id.btnFForw); + fForw.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("forward"); + } + }); + + Button fBackw = (Button) findViewById(R.id.btnFBack); + fBackw.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("rewind"); + } + }); + } + + public void PostCommand(String button) { + + PostWebserver post = new PostWebserver(HttpServer, HttpPort); + + AssetManager assetManager = getAssets(); + String xml = ""; + + try { + InputStream inputStream = null; + inputStream = assetManager.open("cmd_" + button + ".xml"); + + int x = inputStream.read(); + + while (x != -1) { + xml = xml + (char) x; + x = inputStream.read(); + } + post.Post(xml); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public boolean onTouchEvent(MotionEvent me) { + return gestureScanner.onTouchEvent(me); + } + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, + float velocityY) { + try { + if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) + return false; + // right to left swipe + if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE + && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + Intent myIntent = new Intent(this, Remote_02.class); + startActivityForResult(myIntent, 0); + + } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE + && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + + } + } catch (Exception e) { + // nothing + } + return false; + } + + public boolean onDown(MotionEvent arg0) { + return true; + } + public void onLongPress(MotionEvent arg0) { + } + public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2, + float arg3) { + return false; + } + public void onShowPress(MotionEvent arg0) { + } + public boolean onSingleTapUp(MotionEvent arg0) { + return false; + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -0,0 +1,109 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; + +import mediaportal.remote.R; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.AssetManager; +import android.os.Bundle; +import android.view.GestureDetector; +import android.view.MotionEvent; +import android.view.View; +import android.view.GestureDetector.OnGestureListener; +import android.widget.Button; + +public class Remote_02 extends Activity implements OnGestureListener { + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + private String HttpServer = ""; + private String HttpPort = ""; + + private GestureDetector gestureScanner; + private static final int SWIPE_MIN_DISTANCE = 120; + private static final int SWIPE_MAX_OFF_PATH = 250; + private static final int SWIPE_THRESHOLD_VELOCITY = 200; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.remote02); + + gestureScanner = new GestureDetector(this); + + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); + + HttpServer = settings.getString("Server", "192.168.0.30"); + HttpPort = settings.getString("Port", "8200"); + + } + + + public void PostCommand(String button) { + + PostWebserver post = new PostWebserver(HttpServer, HttpPort); + + AssetManager assetManager = getAssets(); + String xml = ""; + + try { + InputStream inputStream = null; + inputStream = assetManager.open("cmd_" + button + ".xml"); + + int x = inputStream.read(); + + while (x != -1) { + xml = xml + (char) x; + x = inputStream.read(); + } + post.Post(xml); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public boolean onTouchEvent(MotionEvent me) { + return gestureScanner.onTouchEvent(me); + } + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, + float velocityY) { + try { + if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) + return false; + // right to left swipe + if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE + && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + + + } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE + && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + Intent myIntent = new Intent(this, Remote_01.class); + startActivityForResult(myIntent, 0); + } + } catch (Exception e) { + // nothing + } + return false; + } + + public boolean onDown(MotionEvent arg0) { + return true; + } + public void onLongPress(MotionEvent arg0) { + } + public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2, + float arg3) { + return false; + } + public void onShowPress(MotionEvent arg0) { + } + public boolean onSingleTapUp(MotionEvent arg0) { + return false; + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -0,0 +1,11 @@ +package mediaportal.remote; + +public class Settings{ + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + public Settings() + { + + } +} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -36,7 +36,7 @@ Button btnRemote = (Button) findViewById(R.id.MainButton4); btnRemote.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), remote.class); + Intent myIntent = new Intent(view.getContext(), Remote_01.class); startActivityForResult(myIntent, 0); } }); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplayinghandler.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -65,8 +65,8 @@ HttpURLConnection conn = (HttpURLConnection) myFileUrl .openConnection(); - conn.setReadTimeout(3000); - conn.setConnectTimeout(3000); + conn.setReadTimeout(5000); + conn.setConnectTimeout(5000); conn.setDoInput(true); conn.connect(); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -67,7 +67,7 @@ HttpURLConnection conn = (HttpURLConnection) myFileUrl .openConnection(); - conn.setConnectTimeout(3000); + conn.setConnectTimeout(5000); conn.setReadTimeout(10000); conn.setDoInput(true); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -34,8 +34,7 @@ //getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title); //((TextView) findViewById(R.id.title)).setText("Pictures"); - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, - MODE_PRIVATE); + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); String HttpServer = settings.getString("Server", "192.168.0.30"); String HttpPort = settings.getString("Port", "8200"); @@ -47,20 +46,6 @@ GridView gridview = (GridView) findViewById(R.id.GridView01); gridview.setAdapter(new ImageAdapter2(this)); - gridview.setOnItemSelectedListener(new OnItemSelectedListener() { - public void onItemSelected(AdapterView<?> arg0, View arg1, - int arg2, long arg3) { - ImageView iv = (ImageView) arg1.findViewById(R.id.icon_image); - picItem pic = (picItem) iv.getTag(); - - ((TextView) findViewById(R.id.title)).setText(pic.title); - } - - public void onNothingSelected(AdapterView<?> arg0) { - // TODO Auto-generated method stub - } - }); - gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -32,20 +32,12 @@ TextView txt = (TextView) findViewById(R.id.full_text); txt.setText(pic.selectedPictureName); - - /* - * imagev.setOnClickListener(new View.OnClickListener() { public void - * onClick(View view) { Intent intent = new Intent(); - * setResult(RESULT_OK, intent); finish(); } }); - */ - } @Override public boolean onTouchEvent(MotionEvent me) { return gestureScanner.onTouchEvent(me); - } - + } public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { try { @@ -85,24 +77,17 @@ } public boolean onDown(MotionEvent arg0) { - // TODO Auto-generated method stub return true; } public void onLongPress(MotionEvent arg0) { - // TODO Auto-generated method stub - } public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2, float arg3) { - // TODO Auto-generated method stub return false; } public void onShowPress(MotionEvent arg0) { - // TODO Auto-generated method stub - } public boolean onSingleTapUp(MotionEvent arg0) { - // TODO Auto-generated method stub return false; } } \ No newline at end of file Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java 2010-11-30 07:11:25 UTC (rev 3987) @@ -1,200 +0,0 @@ -package mediaportal.remote; - -import java.io.IOException; -import java.io.InputStream; - -import mediaportal.remote.R; - -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.params.BasicHttpParams; -import org.apache.http.params.HttpConnectionParams; -import org.apache.http.params.HttpParams; - -import android.app.Activity; -import android.content.Intent; -import android.content.SharedPreferences; -import android.content.res.AssetManager; -import android.os.Bundle; -import android.view.View; -import android.widget.Button; -import android.widget.Toast; - -public class remote extends Activity { - - public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.remote); - - Button can = (Button) findViewById(R.id.btnBack); - can.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("previousMenu"); - } - }); - - Button menu = (Button) findViewById(R.id.btnMenu); - menu.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("contextMenu"); - } - }); - - Button home = (Button) findViewById(R.id.btnHome); - home.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("parentDir"); - } - }); - - Button info = (Button) findViewById(R.id.btnInfo); - info.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("showInfo"); - } - }); - - Button left = (Button) findViewById(R.id.btnLeft); - left.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("moveLeft"); - } - }); - - Button right = (Button) findViewById(R.id.btnRight); - right.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("moveRight"); - } - }); - - Button up = (Button) findViewById(R.id.btnUp); - up.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("moveUp"); - } - }); - - Button down = (Button) findViewById(R.id.btnDown); - down.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("moveDown"); - } - }); - - Button ok = (Button) findViewById(R.id.btnOk); - ok.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("selectItem"); - } - }); - - Button play = (Button) findViewById(R.id.btnPlay); - play.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("play"); - } - }); - - Button pause = (Button) findViewById(R.id.btnPause); - pause.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("pause"); - } - }); - - Button stop = (Button) findViewById(R.id.btnStop); - stop.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("stop"); - } - }); - - Button skipForw = (Button) findViewById(R.id.btnSkipForw); - skipForw.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("nextItem"); - } - }); - - Button skipBack = (Button) findViewById(R.id.btnSkipBack); - skipBack.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("prevItem"); - } - }); - - Button fForw = (Button) findViewById(R.id.btnFForw); - fForw.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("forward"); - } - }); - - Button fBackw = (Button) findViewById(R.id.btnFBack); - fBackw.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("rewind"); - } - }); - } - - public void PostCommand(String button) { - - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE , MODE_PRIVATE); - - String HttpServer = settings.getString("Server", "192.168.0.30"); - String HttpPort = settings.getString("Port", "8200"); - - HttpParams httpParameters = new BasicHttpParams(); - HttpConnectionParams.setConnectionTimeout(httpParameters, 3000); - HttpConnectionParams.setSoTimeout(httpParameters, 3000); - - HttpClient httpclient = new DefaultHttpClient(httpParameters); - HttpPost httppost = new HttpPost("http://" + HttpServer + ":" - + HttpPort); - - try { - - AssetManager assetManager = getAssets(); - - InputStream inputStream = null; - inputStream = assetManager.open("cmd_" + button + ".xml"); - - int x = inputStream.read(); - - String xml = ""; - - while (x != -1) { - xml = xml + (char) x; - x = inputStream.read(); - } - - StringEntity se = new StringEntity(xml, "UTF-8"); - se.setContentType("application/atom+xml"); - - httppost.setEntity(se); - - // HttpResponse response; - // response = httpclient.execute(httppost); - httpclient.execute(httppost); - - } catch (ClientProtocolException e) { - Toast.makeText(remote.this, "ERROR CONNECTION SERVER", - Toast.LENGTH_LONG).show(); - e.printStackTrace(); - } catch (IOException e) { - Toast.makeText(remote.this, "TIME OUT SERVER", Toast.LENGTH_LONG) - .show(); - e.printStackTrace(); - } - } - -} \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs 2010-11-30 07:11:25 UTC (rev 3987) @@ -102,18 +102,26 @@ } private static void DoAcceptSocketCallback(IAsyncResult ar) { - // get socket TcpListener listener = (TcpListener)ar.AsyncState; - Socket clientSocket = listener.EndAcceptSocket(ar); - logDebug("Listener accept connection from " + clientSocket.RemoteEndPoint.ToString()); + try + { + // get socket + Socket clientSocket = listener.EndAcceptSocket(ar); - // work on request - Request req = new Request(clientSocket); - Thread thread = new Thread(new ThreadStart(req.DoWork)); - thread.Priority = ThreadPriority.BelowNormal; - thread.Start(); + logDebug("Listener accept connection from " + clientSocket.RemoteEndPoint.ToString()); + // work on request + Request req = new Request(clientSocket); + Thread thread = new Thread(new ThreadStart(req.DoWork)); + thread.Priority = ThreadPriority.BelowNormal; + thread.Start(); + } + catch (Exception ex) + { + logDebug("Exception on DoAcceptSocketCallback : " + ex.Message); + } + // restart listener listener.BeginAcceptSocket(new AsyncCallback(DoAcceptSocketCallback), listener); } Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-29 13:05:10 UTC (rev 3986) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-11-30 07:11:25 UTC (rev 3987) @@ -71,8 +71,12 @@ AndroidServer.logDebug("receive HTTP Continue"); allMessage = allMessage + clientmessage.Substring(0, bytes); - sendMessage(socket, "HTTP/1.0 100 Continue\r\n"); - sendMessage(socket, "\r\n"); + + string msg = string.Empty; + msg += "HTTP/1.0 100 Continue\r\n"; + msg += "Proxy-Connection: close" + "\r\n"; + msg += "\r\n"; + sendMessage(socket, msg); } else { @@ -87,7 +91,7 @@ ExceuteCommand(allMessage); } - else + else if (clientmessage.Length>0) { // GET int index1 = clientmessage.IndexOf(' '); 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. |
From: <kro...@us...> - 2010-12-01 18:50:49
|
Revision: 3989 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3989&view=rev Author: kroko_koenig Date: 2010-12-01 18:50:41 +0000 (Wed, 01 Dec 2010) Log Message: ----------- more remote and gfx Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote02.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Release/Android Server communication.docx trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_exit.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_hibernate.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_restart.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_shutoff.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_suspend.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_close_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_close_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_hibernate_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_hibernate_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_restart_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_restart_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_shutdown_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_shutdown_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_standby_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_standby_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_wakeup_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_wakeup_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash02.jpg trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -15,12 +15,12 @@ <category android:name="android.intent.category.VIEW" /> </intent-filter> </activity> - <activity android:name=".Remote_01"></activity> - <activity android:name=".Remote_02"></activity> + <activity android:name=".Remote_01" android:launchMode="singleInstance"></activity> + <activity android:name=".Remote_02" android:launchMode="singleInstance"></activity> <activity android:name=".Pictures"></activity> - <activity android:name=".picturesfullscreen"></activity> + <activity android:name=".Picturesfullscreen"></activity> <activity android:name=".MusicDir"></activity> - <activity android:name=".Setup"></activity> + <activity android:name=".Setup" android:launchMode="singleInstance"></activity> <activity android:name=".nowplaying"></activity> <activity android:name=".nowplaylist"></activity> <activity android:name=".MusicArtist"></activity> @@ -32,5 +32,6 @@ <uses-sdk android:minSdkVersion="3" /> <uses-permission android:name="android.permission.INTERNET"></uses-permission> - + <uses-permission android:name="android.permission.VIBRATE"></uses-permission> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission> </manifest> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_exit.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_exit.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_exit.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_EXIT</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_hibernate.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_hibernate.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_hibernate.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_HIBERNATE</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_restart.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_restart.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_restart.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_REBOOT</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_shutoff.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_shutoff.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_shutoff.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_POWER_OFF</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_suspend.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_suspend.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_suspend.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_SUSPEND</command> +</message> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -20,36 +20,49 @@ public static final int back=0x7f020006; public static final int back_icon=0x7f020007; public static final int border=0x7f020008; - public static final int cdcover=0x7f020009; - public static final int close_icon=0x7f02000a; - public static final int document=0x7f02000b; - public static final int down_icon=0x7f02000c; - public static final int folder=0x7f02000d; - public static final int folderback=0x7f02000e; - public static final int foldertab=0x7f02000f; - public static final int foldertab_off=0x7f020010; - public static final int forward=0x7f020011; - public static final int ic_tab=0x7f020012; - public static final int ic_tab1=0x7f020013; - public static final int ic_tab2=0x7f020014; - public static final int ic_tab3=0x7f020015; - public static final int ic_tab4=0x7f020016; - public static final int icon=0x7f020017; - public static final int music_logo=0x7f020018; - public static final int next_icon=0x7f020019; - public static final int nowplaying_logo=0x7f02001a; - public static final int pause=0x7f02001b; - public static final int picture=0x7f02001c; - public static final int pictures_logo=0x7f02001d; - public static final int play=0x7f02001e; - public static final int remote_logo=0x7f02001f; - public static final int rewind=0x7f020020; - public static final int song=0x7f020021; - public static final int song_off=0x7f020022; - public static final int splash=0x7f020023; - public static final int stop=0x7f020024; - public static final int up_icon=0x7f020025; - public static final int videos_logo=0x7f020026; + public static final int button_close_focus=0x7f020009; + public static final int button_close_nofocus=0x7f02000a; + public static final int button_hibernate_focus=0x7f02000b; + public static final int button_hibernate_nofocus=0x7f02000c; + public static final int button_restart_focus=0x7f02000d; + public static final int button_restart_nofocus=0x7f02000e; + public static final int button_shutdown_focus=0x7f02000f; + public static final int button_shutdown_nofocus=0x7f020010; + public static final int button_standby_focus=0x7f020011; + public static final int button_standby_nofocus=0x7f020012; + public static final int button_wakeup_focus=0x7f020013; + public static final int button_wakeup_nofocus=0x7f020014; + public static final int cdcover=0x7f020015; + public static final int close_icon=0x7f020016; + public static final int document=0x7f020017; + public static final int down_icon=0x7f020018; + public static final int folder=0x7f020019; + public static final int folderback=0x7f02001a; + public static final int foldertab=0x7f02001b; + public static final int foldertab_off=0x7f02001c; + public static final int forward=0x7f02001d; + public static final int ic_tab=0x7f02001e; + public static final int ic_tab1=0x7f02001f; + public static final int ic_tab2=0x7f020020; + public static final int ic_tab3=0x7f020021; + public static final int ic_tab4=0x7f020022; + public static final int icon=0x7f020023; + public static final int music_logo=0x7f020024; + public static final int next_icon=0x7f020025; + public static final int nowplaying_logo=0x7f020026; + public static final int pause=0x7f020027; + public static final int picture=0x7f020028; + public static final int pictures_logo=0x7f020029; + public static final int play=0x7f02002a; + public static final int remote_logo=0x7f02002b; + public static final int rewind=0x7f02002c; + public static final int song=0x7f02002d; + public static final int song_off=0x7f02002e; + public static final int splash=0x7f02002f; + public static final int splash02=0x7f020030; + public static final int stop=0x7f020031; + public static final int up_icon=0x7f020032; + public static final int videos_logo=0x7f020033; } public static final class id { public static final int GridView01=0x7f050010; @@ -64,9 +77,13 @@ public static final int TextView01=0x7f050003; public static final int TextView02=0x7f050004; public static final int btnBack=0x7f050038; + public static final int btnChannelDown=0x7f05003d; + public static final int btnChannelUp=0x7f05003a; public static final int btnDown=0x7f050037; + public static final int btnExit=0x7f05003e; public static final int btnFBack=0x7f050025; public static final int btnFForw=0x7f050027; + public static final int btnHibernate=0x7f050040; public static final int btnHome=0x7f05002e; public static final int btnInfo=0x7f050030; public static final int btnLeft=0x7f050032; @@ -74,11 +91,18 @@ public static final int btnOk=0x7f050033; public static final int btnPause=0x7f05002b; public static final int btnPlay=0x7f050026; + public static final int btnRestart=0x7f050041; public static final int btnRight=0x7f050034; + public static final int btnShutOff=0x7f050042; public static final int btnSkipBack=0x7f050029; public static final int btnSkipForw=0x7f05002c; public static final int btnStop=0x7f05002a; + public static final int btnSuspend=0x7f05003f; public static final int btnUp=0x7f05002f; + public static final int btnVolumeDown=0x7f05003c; + public static final int btnVolumeMute=0x7f05003b; + public static final int btnVolumeUp=0x7f050039; + public static final int btnWakeOnLan=0x7f050043; public static final int full_text=0x7f050011; public static final int icon_image=0x7f050001; public static final int icon_text=0x7f050002; @@ -102,10 +126,10 @@ public static final int now_progress=0x7f050017; public static final int now_stop=0x7f05001d; public static final int now_title=0x7f05001a; - public static final int server_ip=0x7f050039; - public static final int server_macid=0x7f05003b; - public static final int server_port=0x7f05003a; - public static final int title=0x7f05003c; + public static final int server_ip=0x7f050044; + public static final int server_macid=0x7f050046; + public static final int server_port=0x7f050045; + public static final int title=0x7f050047; public static final int widget0=0x7f05000a; public static final int widget00=0x7f050024; public static final int widget01=0x7f050028; @@ -135,8 +159,7 @@ public static final int title=0x7f030011; } public static final class string { - public static final int app_name=0x7f040001; - public static final int hello=0x7f040000; + public static final int app_name=0x7f040000; } public static final class styleable { /** Attributes that can be used with a Gallery1. Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_close_focus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_close_focus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_close_nofocus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_close_nofocus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_hibernate_focus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_hibernate_focus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_hibernate_nofocus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_hibernate_nofocus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_restart_focus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_restart_focus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_restart_nofocus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_restart_nofocus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_shutdown_focus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_shutdown_focus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_shutdown_nofocus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_shutdown_nofocus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_standby_focus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_standby_focus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_standby_nofocus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_standby_nofocus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_wakeup_focus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_wakeup_focus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_wakeup_nofocus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_wakeup_nofocus.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash02.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash02.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -1,6 +1,6 @@ <AbsoluteLayout android:id="@+id/widget0" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:background="@drawable/back" xmlns:android="http://schemas.android.com/apk/res/android"> + xmlns:android="http://schemas.android.com/apk/res/android"> <GridView android:layout_y="0dip" android:layout_x="0dip" android:id="@+id/GridView01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:columnWidth="90dp" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -1,6 +1,6 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" - android:layout_height="fill_parent" android:background="@drawable/back"> + android:layout_height="fill_parent"> <TextView android:id="@+id/full_text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="name" android:gravity="center_horizontal" android:background="#FFFFFFFF" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -3,7 +3,6 @@ android:id="@+id/widget0" android:layout_width="fill_parent" android:layout_height="fill_parent" - android:background="@drawable/back" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> @@ -17,8 +16,7 @@ <LinearLayout android:id="@+id/widget00" android:layout_width="fill_parent" - android:layout_height="wrap_content" - > + android:layout_height="wrap_content" android:layout_marginTop="5dip"> <Button android:id="@+id/btnFBack" android:layout_width="80dip" @@ -78,20 +76,16 @@ <Button android:id="@+id/btnHome" android:layout_width="80dip" - android:layout_height="60dip" - android:text="Home"> + android:text="Home" android:layout_height="50dip"> </Button> <Button android:id="@+id/btnUp" - android:layout_width="160dip" - android:layout_height="60dip" - android:background="@drawable/up_icon"> + android:background="@drawable/up_icon" android:layout_width="160dip" android:layout_height="50dip"> </Button> <Button android:id="@+id/btnInfo" android:layout_width="80dip" - android:layout_height="60dip" - android:text="Info"> + android:text="Info" android:layout_height="50dip"> </Button> </LinearLayout> @@ -108,9 +102,7 @@ </Button> <Button android:id="@+id/btnOk" - android:layout_width="160dip" - android:layout_height="60dip" - android:background="@drawable/accept_icon"> + android:background="@drawable/accept_icon" android:layout_width="160dip" android:layout_height="80dip"> </Button> <Button android:id="@+id/btnRight" @@ -128,20 +120,17 @@ <Button android:id="@+id/btnMenu" android:layout_width="80dip" - android:layout_height="60dip" - android:text="Menu"> + android:text="Menu" android:layout_height="50dip"> </Button> <Button android:id="@+id/btnDown" android:layout_width="160dip" - android:layout_height="60dip" - android:background="@drawable/down_icon"> + android:background="@drawable/down_icon" android:layout_height="50dip"> </Button> <Button android:id="@+id/btnBack" android:layout_width="80dip" - android:layout_height="60dip" - android:text="Back"> + android:text="Back" android:layout_height="50dip"> </Button> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote02.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote02.xml 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote02.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -1,17 +1,100 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout - android:id="@+id/widget0" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:background="@drawable/back" - android:orientation="vertical" - xmlns:android="http://schemas.android.com/apk/res/android"> - - <TextView android:id="@+id/naviRemote_text" android:layout_width="fill_parent" - android:layout_height="wrap_content" android:text="Menu 02" - android:gravity="center_horizontal" android:background="#FFFFFFFF" - android:textSize="15dip" +<LinearLayout android:id="@+id/widget0" + android:layout_width="fill_parent" android:layout_height="fill_parent" + android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> + + <TextView android:id="@+id/naviRemote_text" + android:layout_width="fill_parent" android:layout_height="wrap_content" + android:text="Remote 02" android:gravity="center_horizontal" + android:background="#FFFFFFFF" android:textSize="15dip" android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF"> </TextView> - + + <LinearLayout android:id="@+id/widget00" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginTop="10dip" android:layout_gravity="center_horizontal"> + + <Button android:id="@+id/btnVolumeUp" android:layout_width="80dip" + android:layout_height="60dip" android:text="Vol. +"> + </Button> + + <Button android:id="@+id/btnChannelUp" android:layout_width="80dip" + android:layout_marginLeft="40dip" android:layout_height="60dip" + android:text="Ch. +"> + </Button> + </LinearLayout> + + <LinearLayout android:id="@+id/widget00" + android:layout_height="wrap_content" android:layout_width="wrap_content" + android:layout_gravity="center_vertical"> + + <Button android:layout_width="80dip" android:layout_height="60dip" + android:text="Mute" android:id="@+id/btnVolumeMute"> + </Button> + + </LinearLayout> + + <LinearLayout android:id="@+id/widget00" + android:layout_height="wrap_content" android:layout_width="wrap_content" + android:layout_gravity="center_vertical"> + + <Button android:id="@+id/btnVolumeDown" android:layout_width="80dip" + + android:layout_height="60dip" android:text="Vol.- -"> + </Button> + + <Button android:id="@+id/btnChannelDown" android:layout_width="80dip" + android:layout_marginLeft="40dip" android:layout_height="60dip" + android:text="Ch. -"> + </Button> + </LinearLayout> + + <LinearLayout android:id="@+id/widget00" + android:layout_width="fill_parent" android:layout_marginTop="20dip" + android:layout_height="wrap_content"> + + <Button android:layout_width="60dip" android:textSize="12dip" + android:layout_height="60dip" android:text="Exit" android:textColor="#FFFFFFFF" + android:id="@+id/btnExit" android:background="@drawable/button_close_nofocus" + android:gravity="bottom|center"> + </Button> + + <Button android:textSize="12dip" android:layout_height="60dip" + android:text="Suspend" android:textColor="#FFFFFFFF" android:id="@+id/btnSuspend" + android:background="@drawable/button_standby_focus" android:gravity="bottom|center" + android:layout_width="60dip"> + </Button> + + <Button android:layout_width="60dip" android:textSize="12dip" + android:layout_height="60dip" android:text="Hibernate" + android:textColor="#FFFFFFFF" android:id="@+id/btnHibernate" + android:background="@drawable/button_hibernate_focus" + android:gravity="bottom|center"> + </Button> + + <Button android:layout_width="60dip" android:textSize="12dip" + android:layout_height="60dip" android:text="Restart" + android:textColor="#FFFFFFFF" android:id="@+id/btnRestart" + android:background="@drawable/button_restart_focus" + android:gravity="bottom|center"> + </Button> + + <Button android:layout_width="60dip" android:textSize="12dip" + android:layout_height="60dip" android:text="Shut off" + android:textColor="#FFFFFFFF" android:id="@+id/btnShutOff" + android:background="@drawable/button_shutdown_focus" android:gravity="bottom|center"> + </Button> + </LinearLayout> + + <LinearLayout android:id="@+id/widget00" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginTop="10dip" android:layout_gravity="center_horizontal"> + + <Button android:layout_width="60dip" android:textSize="12dip" + android:layout_height="60dip" android:text="Wake On Lan" + android:textColor="#FFFFFFFF" android:id="@+id/btnWakeOnLan" + android:background="@drawable/button_wakeup_focus" android:gravity="bottom|center"> + </Button> + </LinearLayout> + </LinearLayout> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -3,7 +3,7 @@ android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:layout_width="fill_parent" - android:layout_height="fill_parent" android:src="@drawable/splash" + android:layout_height="fill_parent" android:src="@drawable/splash02" android:scaleType="fitXY"> </ImageView> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml 2010-12-01 18:50:41 UTC (rev 3989) @@ -1,5 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <string name="hello">Hello World, main!</string> <string name="app_name">MediaPortal Remote</string> </resources> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MediaPlayerControl.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -0,0 +1,44 @@ +package mediaportal.remote; + +import java.io.IOException; + +import android.media.MediaPlayer; + +public class MediaPlayerControl { + + private static MediaPlayerControl instance; + private static MediaPlayer mp; + + public static MediaPlayerControl getinstance() { + if (mp == null) + mp = new MediaPlayer(); + if (instance == null) + instance = new MediaPlayerControl(); + return instance; + } + + public void Stop() + { + mp.stop(); + } + public void Play(String Path) + { + + try { +// mp.stop(); + + mp.setDataSource(Path); + mp.prepare(); + mp.start(); + } catch (IllegalStateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + } + +} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -32,17 +32,18 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; import android.widget.TextView; +import android.widget.AdapterView.OnItemClickListener; import android.widget.Toast; public class MusicDir extends Activity { private Handler mHandler = new Handler(); private String actualDir = ""; - private static ArrayList<ReceiveDirectoryXmlHandler.DirItems> musicList; @Override @@ -50,48 +51,59 @@ super.onCreate(savedInstanceState); setContentView(R.layout.music); + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 100); + GridView gridview = (GridView) findViewById(R.id.music_grid); gridview.setAdapter(new ImageAdapter2(MusicDir.this)); + gridview.setOnItemClickListener(new OnItemClickListener() { + public void onItemClick(AdapterView<?> parent, View v, + int position, long id) { - /* - * gridview.setOnItemClickListener(new OnItemClickListener() { public - * void onItemClick(AdapterView<?> parent, View v, int position, long - * id) { - * - * // TextView tv = (TextView) v.findViewById(R.id.icon_text); ImageView - * iv = (ImageView) v.findViewById(R.id.icon_image); musicItem item = - * (musicItem) iv.getTag(); - * - * if (item.typ == "item") { ReceiveDirHandler h = - * ReceiveDirHandler.getinstance(); h.selectedMusic = position - 1; } - * - * if (item.typ == "folder") { - * - * musichandler h = musichandler.getinstance(); h.gotodir(item.title); - * - * GridView gridview = (GridView) findViewById(R.id.music_grid); - * gridview.setAdapter(new ImageAdapter2(parent.getContext())); - * - * parent.invalidate(); } - * - * if (item.typ == "oneup") { musichandler h = - * musichandler.getinstance(); h.oneup(); - * - * GridView gridview = (GridView) findViewById(R.id.music_grid); - * gridview.setAdapter(new ImageAdapter2(parent.getContext())); - * - * parent.invalidate(); } - * - * } }); - */ + // TextView tv = (TextView) v.findViewById(R.id.icon_text); + // ImageView + ImageView iv = (ImageView) v.findViewById(R.id.icon_image); + musicItem music = (musicItem) iv.getTag(); + + if (music.typ == "item") { + // Picturesfullscreen.selectedPicture = position - 1; + // Intent myIntent = new Intent(MusicDir.this, + // Picturesfullscreen.class); + // startActivityForResult(myIntent, 0); + } + + if (music.typ == "folder") { + actualDir += music.title + "/"; + + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 0); + } + + if (music.typ == "oneup") { + if (actualDir.endsWith("/")) + actualDir = actualDir.substring(0, + actualDir.length() - 1); + + int x = actualDir.lastIndexOf("/"); + if (x >= 0) { + actualDir = actualDir.substring(0, x + 1); + } else + actualDir = ""; + + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 0); + } + + } + }); } @Override public void onStart() { super.onStart(); - mHandler.removeCallbacks(mUpdateTimeTask); - mHandler.postDelayed(mUpdateTimeTask, 100); + // mHandler.removeCallbacks(mUpdateTimeTask); + // mHandler.postDelayed(mUpdateTimeTask, 100); } private Runnable mUpdateTimeTask = new Runnable() { @@ -102,7 +114,7 @@ private void update() { - Log.d("update music dir", "do update"); + Log.d("update music dir", "do update folder : " + actualDir); ReceiveDirHandler h = ReceiveDirHandler.getinstance(); musicList = h.getMusicDir(actualDir); @@ -110,10 +122,10 @@ if (musicList.size() == 0) { Toast.makeText(MusicDir.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) .show(); + } else { + GridView gridview = (GridView) findViewById(R.id.music_grid); + gridview.invalidateViews(); } - - GridView gridview = (GridView) findViewById(R.id.music_grid); - gridview.invalidateViews(); } public class ImageAdapter2 extends BaseAdapter { @@ -161,6 +173,7 @@ tv.setText(txtName); ImageView iv = (ImageView) v.findViewById(R.id.icon_image); + if (isFolder) { iv.setImageResource(R.drawable.folder); musicItem item = new musicItem(); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -21,6 +21,8 @@ package mediaportal.remote; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import java.util.ArrayList; import mediaportal.remote.ReceiveDbXmlHandler.DbItems; @@ -56,8 +58,15 @@ ReceiveDbXmlHandler handler = new ReceiveDbXmlHandler(); ReceiveHandler hand = new ReceiveHandler(handler); + + try { + Data = URLEncoder.encode(Data, "UTF-8"); + } catch (UnsupportedEncodingException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + hand.readValues("/db_music/" + Data); - return handler.DbList; } } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -41,6 +41,7 @@ public String AlbumArtist= ""; public String Track= ""; public String Rating= ""; + public String Filename= ""; } private DbItems currentDbItem; @@ -73,6 +74,7 @@ if (localName == "AlbumArtist") {currentDbItem.AlbumArtist =currentValue;} if (localName == "Track") {currentDbItem.Track =currentValue;} if (localName == "Rating") {currentDbItem.Rating =currentValue;} + if (localName == "Filename") {currentDbItem.Filename =currentValue;} if (localName == "Item")DbList.add(currentDbItem); } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDirectoryXmlHandler.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -26,6 +26,8 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; +import android.graphics.Bitmap; + public class ReceiveDirectoryXmlHandler extends DefaultHandler { Boolean currentElement = false; String currentValue = null; @@ -36,6 +38,7 @@ { public boolean isFolder = false; public String File= ""; + public Bitmap Picture = null; } private DirItems currentdirItem; @@ -69,7 +72,7 @@ DirList.add(currentdirItem); } if (localName == "File") { - currentdirItem.isFolder = true; + currentdirItem.isFolder = false; currentdirItem.File = currentValue; DirList.add(currentdirItem); } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -31,7 +31,9 @@ import android.os.Bundle; import android.view.GestureDetector; import android.view.MotionEvent; +import android.view.View; import android.view.GestureDetector.OnGestureListener; +import android.widget.Button; public class Remote_02 extends Activity implements OnGestureListener { @@ -57,7 +59,76 @@ HttpServer = settings.getString("Server", "192.168.0.30"); HttpPort = settings.getString("Port", "8200"); - + + Button btnVolumeUp = (Button) findViewById(R.id.btnVolumeUp); + btnVolumeUp.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("volumeUp"); + } + }); + Button btnVolumeDown = (Button) findViewById(R.id.btnVolumeDown); + btnVolumeDown.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("volumeDown"); + } + }); + Button btnVolumeMute = (Button) findViewById(R.id.btnVolumeMute); + btnVolumeMute.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("volumeMute"); + } + }); + + Button btnChannelUp = (Button) findViewById(R.id.btnChannelUp); + btnChannelUp.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("nextChannel"); + } + }); + Button btnChannelDown = (Button) findViewById(R.id.btnChannelDown); + btnChannelDown.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("prevChannel"); + } + }); + + Button btnExit = (Button) findViewById(R.id.btnExit); + btnExit.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("exit"); + } + }); + Button btnSuspend = (Button) findViewById(R.id.btnSuspend); + btnSuspend.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("suspend"); + } + }); + Button btnHibernate = (Button) findViewById(R.id.btnHibernate); + btnHibernate.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("hibernate"); + } + }); + Button btnRestart = (Button) findViewById(R.id.btnRestart); + btnRestart.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("restart"); + } + }); + Button btnShutOff = (Button) findViewById(R.id.btnShutOff); + btnShutOff.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("shutoff"); + } + }); + + Button btnWakeOnLan = (Button) findViewById(R.id.btnWakeOnLan); + btnWakeOnLan.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("wakeonlan"); + } + }); } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -82,7 +82,8 @@ .toString(); try { - InputStream in = openHttpConnection("http://192.168.0.30:8200/music/Clementi_Sonatina_Op.36_No.1_Movement_1.mp3"); + InputStream in = openHttpConnection("http://"+ Settings.Server + ":" + Settings.Port + + "/music/Clementi_Sonatina_Op.36_No.1_Movement_1.mp3"); // BufferedInputStream bis = new BufferedInputStream(in); ByteArrayBuffer baf = new ByteArrayBuffer(50); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -21,10 +21,13 @@ package mediaportal.remote; +import java.io.IOException; + import mediaportal.remote.R; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; +import android.media.MediaPlayer; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; @@ -34,18 +37,22 @@ public class Main extends Activity { private static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); - - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); + Settings.Server = settings.getString("Server", "192.168.0.30"); Settings.Port = settings.getString("Port", "8200"); Settings.MacId = settings.getString("MacId", "11-22-33-44-55-66"); - + + Toast.makeText(getBaseContext(), "Press 'menu' for settings", + Toast.LENGTH_LONG).show(); + Button btnPictures = (Button) findViewById(R.id.MainButton1); btnPictures.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { @@ -53,7 +60,7 @@ startActivityForResult(myIntent, 0); } }); - + Button btnMusic = (Button) findViewById(R.id.MainButton2); btnMusic.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { @@ -62,6 +69,31 @@ } }); + Button btnVideo = (Button) findViewById(R.id.MainButton3); + btnVideo.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + MediaPlayer mp = new MediaPlayer(); + try { + String p = "http://" + + Settings.Server + + ":" + + Settings.Port + + "/music/" + + "laserkraft_3d_-_nein_mann.mp3"; + mp.setDataSource(p); + mp.prepare(); + mp.start(); + } catch (IllegalStateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + Button btnRemote = (Button) findViewById(R.id.MainButton4); btnRemote.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { @@ -73,7 +105,8 @@ Button btnNowPlaying = (Button) findViewById(R.id.MainButton5); btnNowPlaying.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), nowplaying.class); + Intent myIntent = new Intent(view.getContext(), + nowplaying.class); startActivityForResult(myIntent, 0); } }); @@ -85,17 +118,17 @@ menu.add(0, 112, 0, "Exit"); return true; } - + @Override - public boolean onOptionsItemSelected (MenuItem item){ - switch (item.getItemId()){ + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { case 111: Intent myIntent = new Intent(this, Setup.class); startActivityForResult(myIntent, 0); - return true; + return true; case 112: this.finish(); - return true; + return true; } return true; } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -40,49 +40,60 @@ import android.widget.TextView; import android.widget.Toast; -public class MusicResults extends Activity{ - +public class MusicResults extends Activity { + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); - + private static ArrayList<ReceiveDbXmlHandler.DbItems> itemList; - + public static String Select = ""; - + public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.music_results); - - ListView l1 = (ListView) findViewById(R.id.list_result); - l1.setAdapter(new EfficientAdapter(MusicResults.this)); - - ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); - l1.setDivider(divcolor); - l1.setDividerHeight(2); - - registerForContextMenu(l1); - } - + super.onCreate(savedInstanceState); + setContentView(R.layout.music_results); + + ListView l1 = (ListView) findViewById(R.id.list_result); + l1.setAdapter(new EfficientAdapter(MusicResults.this)); + + ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); + l1.setDivider(divcolor); + l1.setDividerHeight(2); + + registerForContextMenu(l1); + } + @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle("Select action"); - + menu.add(0, 101, 0, "Add title to playlist"); menu.add(0, 102, 0, "Download title to SD"); menu.add(0, 103, 0, "Add all title to playlist"); menu.add(0, 104, 0, "Download all title to SD"); menu.add(0, 105, 0, "Close menu"); + + ListView l1 = (ListView) findViewById(R.id.list_result); + int x = l1.getSelectedItemPosition(); + if (x == -1) + x = 0; + if (itemList.size() > 0) { + ReceiveDbXmlHandler.DbItems itm = itemList.get(x); + + httpHandler http = new httpHandler(); + http.DownloadFile(); + } + x = 1; } - + @Override public boolean onContextItemSelected(MenuItem item) { // item.id == return true; } - @Override public void onStart() { super.onStart(); @@ -90,30 +101,31 @@ mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(mUpdateTimeTask, 100); } + private Runnable mUpdateTimeTask = new Runnable() { public void run() { update(); } }; - + private void update() { - + Log.d("update search", "do update"); - + ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); itemList = handler.GetSongsByArtist(Select); - + if (itemList.size() == 0) { Toast.makeText(MusicResults.this, "TIME OUT SERVER", Toast.LENGTH_LONG).show(); } - + ListView l1 = (ListView) findViewById(R.id.list_result); - l1.invalidateViews(); + l1.invalidateViews(); } - + private static class EfficientAdapter extends BaseAdapter { - + private LayoutInflater mInflater; public EfficientAdapter(Context context) { @@ -121,8 +133,10 @@ } public int getCount() { - if(itemList != null) return itemList.size(); - else return 0; + if (itemList != null) + return itemList.size(); + else + return 0; } public Object getItem(int position) { @@ -135,7 +149,7 @@ public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; - + if (convertView == null) { convertView = mInflater.inflate(R.layout.list_item, null); holder = new ViewHolder(); @@ -148,10 +162,10 @@ } else { holder = (ViewHolder) convertView.getTag(); } - + ReceiveDbXmlHandler.DbItems item = itemList.get(position); - - holder.text.setText(String.valueOf(position +1)); + + holder.text.setText(String.valueOf(position + 1)); holder.text2.setText(item.Title + " - " + item.Artist); convertView.setBackgroundColor((position & 1) == 1 ? Color.WHITE Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -24,6 +24,7 @@ import java.util.ArrayList; import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; @@ -32,31 +33,42 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; -public class MusicSong extends Activity{ - +public class MusicSong extends Activity { + private Handler mHandler = new Handler(); - + private static ArrayList<ReceiveDbXmlHandler.DbItems> songList; - + public static String Select = ""; - + public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.music_song); - - ListView l1 = (ListView) findViewById(R.id.list_song); - l1.setAdapter(new EfficientAdapter(MusicSong.this)); - - ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); - l1.setDivider(divcolor); - l1.setDividerHeight(2); - } - + super.onCreate(savedInstanceState); + setContentView(R.layout.music_song); + + ListView l1 = (ListView) findViewById(R.id.list_song); + l1.setAdapter(new EfficientAdapter(MusicSong.this)); + + ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); + l1.setDivider(divcolor); + l1.setDividerHeight(2); + + l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { + // @override + public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, + long arg3) { + + MediaPlayerControl mp = MediaPlayerControl.getinstance(); + mp.Play("http://" + Settings.Server + ":" + Settings.Port + "/music/" + "song-marianne-plays-on-piano-sense-and-sensibilit.mp3"); + } + }); + } + @Override public void onStart() { super.onStart(); @@ -64,30 +76,31 @@ mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(mUpdateTimeTask, 100); } + private Runnable mUpdateTimeTask = new Runnable() { public void run() { update(); } }; - + private void update() { - + Log.d("update song", "do update"); - + ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); songList = handler.GetSongs(); - + if (songList.size() == 0) { - Toast.makeText(MusicSong.this, "TIME OUT SERVER", - Toast.LENGTH_LONG).show(); + Toast.makeText(MusicSong.this, "TIME OUT SERVER", Toast.LENGTH_LONG) + .show(); } - + ListView l1 = (ListView) findViewById(R.id.list_song); - l1.invalidateViews(); + l1.invalidateViews(); } - + private static class EfficientAdapter extends BaseAdapter { - + private LayoutInflater mInflater; public EfficientAdapter(Context context) { @@ -95,8 +108,10 @@ } public int getCount() { - if(songList != null) return songList.size(); - else return 0; + if (songList != null) + return songList.size(); + else + return 0; } public Object getItem(int position) { @@ -109,7 +124,7 @@ public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; - + if (convertView == null) { convertView = mInflater.inflate(R.layout.list_item, null); holder = new ViewHolder(); @@ -122,10 +137,10 @@ } else { holder = (ViewHolder) convertView.getTag(); } - + ReceiveDbXmlHandler.DbItems item = songList.get(position); - - holder.text.setText(String.valueOf(position +1)); + + holder.text.setText(String.valueOf(position + 1)); holder.text2.setText(item.Title + " - " + item.Artist); convertView.setBackgroundColor((position & 1) == 1 ? Color.WHITE Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-30 12:17:31 UTC (rev 3988) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-01 18:50:41 UTC (rev 3989) @@ -26,77 +26,84 @@ import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; import android.widget.TextView; +import android.widget.AdapterView.OnItemClickListener; import android.widget.Toast; public class Pictures extends Activity { private Handler mHandler = new Handler(); - private String actualDir = ""; + public static String actualDir = ""; + public static ArrayList<ReceiveDirectoryXmlHandler.DirItems> pictureList; - private static ArrayList<ReceiveDirectoryXmlHandler.DirItems> pictureList; - - /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.pictures); + + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 100); GridView gridview = (GridView) findViewById(R.id.GridView01); - gridview.setAdapter(new ImageAdapter2(this)); + gridview.setOnItemClickListener(new OnItemClickListener() { + public void onItemClick(AdapterView<?> parent, View v, + int position, long id) { - /* - * gridview.setOnItemClickListener(new OnItemClickListener() { public - * void onItemClick(AdapterView<?> parent, View v, int position, long - * id) { - * - * // TextView tv = (TextView) v.findViewById(R.id.icon_text); ImageView - * iv = (ImageView) v.findViewById(R.id.icon_image); picItem pic = - * (picItem) iv.getTag(); - * - * if (pic.typ == "item") { picturehandler h = - * picturehandler.getinstance(); h.selectedPicture = position - 1; - * - * Intent myIntent = new Intent(v.getContext(), - * picturesfullscreen.class); startActivityForResult(myIntent, 0); } - * - * if (pic.typ == "folder") { - * - * picturehandler h = picturehandler.getinstance(); - * h.gotodir(pic... [truncated message content] |
From: <kro...@us...> - 2010-12-08 13:35:34
|
Revision: 4019 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4019&view=rev Author: kroko_koenig Date: 2010-12-08 13:35:27 +0000 (Wed, 08 Dec 2010) Log Message: ----------- removed the gesture code for pictures, add a readme Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/picturefullscreenmenu.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-07 21:55:14 UTC (rev 4018) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-08 13:35:27 UTC (rev 4019) @@ -15,11 +15,11 @@ <category android:name="android.intent.category.VIEW" /> </intent-filter> </activity> - <activity android:name=".Remote_01" android:launchMode="singleInstance"></activity> - <activity android:name=".Remote_02" android:launchMode="singleInstance"></activity> + <activity android:launchMode="singleInstance" android:name=".Remote_01"></activity> + <activity android:launchMode="singleInstance" android:name=".Remote_02"></activity> <activity android:name=".pictures" android:launchMode="singleInstance"></activity> <activity android:name=".picturesfullscreen" android:launchMode="singleInstance"></activity> - <activity android:name=".MusicDir" android:launchMode="singleInstance"></activity> + <activity android:launchMode="singleInstance" android:name=".musicDir"></activity> <activity android:name=".setup" android:launchMode="singleInstance"></activity> <activity android:name=".nowplaying" android:launchMode="singleInstance"></activity> <activity android:name=".nowplaylist" android:launchMode="singleInstance"></activity> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-07 21:55:14 UTC (rev 4018) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-08 13:35:27 UTC (rev 4019) @@ -65,10 +65,10 @@ public static final int videos_logo=0x7f020033; } public static final class id { - public static final int GridView01=0x7f060010; - public static final int ImageView01=0x7f060012; - public static final int LinearLayout01=0x7f060013; - public static final int ListView01=0x7f060022; + public static final int GridView01=0x7f060013; + public static final int ImageView01=0x7f060015; + public static final int LinearLayout01=0x7f060016; + public static final int ListView01=0x7f060024; public static final int MainButton1=0x7f060005; public static final int MainButton2=0x7f060006; public static final int MainButton3=0x7f060007; @@ -81,7 +81,7 @@ public static final int btnChannelUp=0x7f06003a; public static final int btnDown=0x7f060037; public static final int btnExit=0x7f06003e; - public static final int btnFBack=0x7f060025; + public static final int btnFBack=0x7f060026; public static final int btnFForw=0x7f060027; public static final int btnHibernate=0x7f060040; public static final int btnHome=0x7f06002e; @@ -90,7 +90,7 @@ public static final int btnMenu=0x7f060036; public static final int btnOk=0x7f060033; public static final int btnPause=0x7f06002b; - public static final int btnPlay=0x7f060026; + public static final int btnPlay=0x7f06000c; public static final int btnRestart=0x7f060041; public static final int btnRight=0x7f060034; public static final int btnShutOff=0x7f060042; @@ -103,38 +103,40 @@ public static final int btnVolumeMute=0x7f06003b; public static final int btnVolumeUp=0x7f060039; public static final int btnWakeOnLan=0x7f060043; - public static final int full_text=0x7f060011; + public static final int full_text=0x7f060014; public static final int icon_image=0x7f060001; public static final int icon_text=0x7f060002; - public static final int list_album=0x7f06000c; - public static final int list_artist=0x7f06000d; - public static final int list_result=0x7f06000e; - public static final int list_song=0x7f06000f; - public static final int music_grid=0x7f06000b; - public static final int naviRemote_text=0x7f060023; - public static final int now_album=0x7f060015; - public static final int now_artist=0x7f06001b; - public static final int now_cd=0x7f060016; - public static final int now_list=0x7f060021; - public static final int now_next=0x7f060020; - public static final int now_pause=0x7f06001e; - public static final int now_play=0x7f06001f; - public static final int now_playing=0x7f060014; - public static final int now_playing_right=0x7f060019; - public static final int now_playing_t_left=0x7f060018; - public static final int now_prev=0x7f06001c; - public static final int now_progress=0x7f060017; - public static final int now_stop=0x7f06001d; - public static final int now_title=0x7f06001a; + public static final int list_album=0x7f06000f; + public static final int list_artist=0x7f060010; + public static final int list_result=0x7f060011; + public static final int list_song=0x7f060012; + public static final int music_grid=0x7f06000e; + public static final int naviRemote_text=0x7f06000a; + public static final int now_album=0x7f060018; + public static final int now_artist=0x7f06001d; + public static final int now_cd=0x7f060019; + public static final int now_list=0x7f060023; + public static final int now_next=0x7f060022; + public static final int now_pause=0x7f060020; + public static final int now_play=0x7f060021; + public static final int now_playing=0x7f060017; + public static final int now_playing_right=0x7f06001b; + public static final int now_playing_t_left=0x7f06000b; + public static final int now_prev=0x7f06001e; + public static final int now_progress=0x7f06001a; + public static final int now_stop=0x7f06001f; + public static final int now_title=0x7f06001c; public static final int open=0x7f060049; + public static final int rslide=0x7f06004c; public static final int save=0x7f060048; public static final int send=0x7f06004a; public static final int server_ip=0x7f060044; public static final int server_macid=0x7f060046; public static final int server_port=0x7f060045; + public static final int slide=0x7f06004b; public static final int title=0x7f060047; - public static final int widget0=0x7f06000a; - public static final int widget00=0x7f060024; + public static final int widget0=0x7f06000d; + public static final int widget00=0x7f060025; public static final int widget01=0x7f060028; public static final int widget02=0x7f06002d; public static final int widget03=0x7f060031; Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme 2010-12-08 13:35:27 UTC (rev 4019) @@ -0,0 +1,22 @@ +Pictures section +---------------- + +implemented: + +browse folders (MP shares) +display thumbs + + +save to sd +open browser +send picture +slide show +random slide show + +wishes: + +gesture control for pictures (swipe) +save files from Android to MP + +Music section +------------- Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-12-07 21:55:14 UTC (rev 4018) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-12-08 13:35:27 UTC (rev 4019) @@ -1,19 +1,20 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" - android:layout_height="fill_parent" android:background="@drawable/back"> + android:layout_height="fill_parent" android:background="@drawable/back" + android:gravity="top"> - <Button android:id="@+id/MainButton1" android:layout_width="fill_parent" + <Button android:id="@+id/MainButton1" android:layout_width="fill_parent" android:layout_height="70dip" android:background="@drawable/pictures_logo" /> <View android:layout_height="2dip" android:layout_width="fill_parent" android:background="#000" /> - + <Button android:id="@+id/MainButton2" android:layout_width="fill_parent" android:layout_height="70dip" android:background="@drawable/music_logo" /> <View android:layout_height="2dip" android:layout_width="fill_parent" android:background="#000" /> - + <Button android:id="@+id/MainButton3" android:layout_width="fill_parent" android:layout_height="70dip" android:background="@drawable/videos_logo" /> @@ -22,14 +23,37 @@ <Button android:id="@+id/MainButton4" android:layout_width="fill_parent" android:layout_height="70dip" android:background="@drawable/remote_logo" /> - + <View android:layout_height="2dip" android:layout_width="fill_parent" android:background="#000" /> - <Button android:id="@+id/MainButton5" android:layout_width="fill_parent" + <Button android:id="@+id/MainButton5" android:layout_width="fill_parent" android:layout_height="70dip" android:background="@drawable/nowplaying_logo" /> + + <TextView android:id="@+id/naviRemote_text" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="nothing playing" + android:gravity="center_horizontal" android:background="#FFFFFFFF" + android:textSize="15dip" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF"> + </TextView> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" android:layout_width="fill_parent" + android:background="#000" android:layout_height="50dip"> - <View android:layout_height="2dip" android:layout_width="fill_parent" - android:background="#000" /> + <TextView android:id="@+id/now_playing_t_left" + android:layout_width="80dip" android:layout_height="50dip" + android:textSize="12dip" android:textColor="#FF8080ff" android:text="00:00" /> + + <Button android:id="@+id/btnPlay" android:layout_width="50dip" + android:layout_height="50dip" android:text="FBW"> + </Button> + <Button android:id="@+id/btnPlay" android:layout_width="50dip" + android:layout_height="50dip" android:text="Play"> + </Button> + <Button android:id="@+id/btnPlay" android:layout_width="50dip" + android:layout_height="50dip" android:text="FFW"> + </Button> + </LinearLayout> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/picturefullscreenmenu.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/picturefullscreenmenu.xml 2010-12-07 21:55:14 UTC (rev 4018) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/picturefullscreenmenu.xml 2010-12-08 13:35:27 UTC (rev 4019) @@ -6,4 +6,7 @@ android:title="Open in browser" /> <item android:id="@+id/send" android:title="Send Picture" /> + <item android:id="@+id/slide" + android:title="Slide show" android:checked="false" android:checkable="true"/> + <item android:title="Random slide show" android:id="@+id/rslide" android:checked="false" android:checkable="true"/> </menu> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-07 21:55:14 UTC (rev 4018) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-08 13:35:27 UTC (rev 4019) @@ -37,12 +37,12 @@ public class main extends Activity { private static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); - + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); @@ -110,6 +110,7 @@ startActivityForResult(myIntent, 0); } }); + } @Override Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-07 21:55:14 UTC (rev 4018) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-08 13:35:27 UTC (rev 4019) @@ -24,7 +24,6 @@ import java.util.ArrayList; import android.app.Activity; import android.content.Context; -import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-07 21:55:14 UTC (rev 4018) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-08 13:35:27 UTC (rev 4019) @@ -26,7 +26,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; - import mediaportal.remote.R; import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; import android.app.Activity; @@ -38,27 +37,18 @@ import android.os.Handler; import android.util.Log; import android.view.ContextMenu; -import android.view.GestureDetector; -import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.view.ContextMenu.ContextMenuInfo; -import android.view.GestureDetector.OnGestureListener; -import android.view.MotionEvent; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; -public class picturesfullscreen extends Activity implements OnGestureListener { +public class picturesfullscreen extends Activity { - private static final int SWIPE_MIN_DISTANCE = 120; - private static final int SWIPE_MAX_OFF_PATH = 250; - private static final int SWIPE_THRESHOLD_VELOCITY = 200; - - private GestureDetector gestureScanner; private Handler mHandler = new Handler(); private boolean slideShow; @@ -68,69 +58,35 @@ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + requestWindowFeature(Window.FEATURE_NO_TITLE); - getWindow().setFlags - (WindowManager.LayoutParams.FLAG_FULLSCREEN, - WindowManager.LayoutParams.FLAG_FULLSCREEN); - setContentView(R.layout.picturesfullscreen); - - //ImageView imagev = (ImageView) findViewById(R.id.ImageView01); - //registerForContextMenu(imagev); - - gestureScanner = new GestureDetector(this); + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN); + setContentView(R.layout.picturesfullscreen); - setPicture(); - Toast.makeText(picturesfullscreen .this, "left/right swipe possible", - Toast.LENGTH_SHORT).show(); + ImageView imagev = (ImageView) findViewById(R.id.ImageView01); + registerForContextMenu(imagev); + setPicture(); } private void setPicture() { ImageView imagev = (ImageView) findViewById(R.id.ImageView01); DirItems item = pictures.pictureList.get(pictures.selectedPicture); - if (!item.isFolder) - { + if (!item.isFolder) { httpHandler http = new httpHandler(); String file = "http://" + Settings.Server + ":" + Settings.Port + "/pictures/"; file += pictures.actualDir + item.File; item.Picture = http.DownloadImage(file.replaceAll(" ", "%20")); imagev.setImageBitmap(item.Picture); - + TextView txt = (TextView) findViewById(R.id.full_text); txt.setText(item.File); } } @Override - public boolean onCreateOptionsMenu(Menu menu) { - menu.add(0, 101, 0, "Slide show"); - menu.add(0, 102, 1, "Random slide show"); - menu.add(0, 103, 2, "Stop slide show"); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case 101: - slideShow = true; - randomShow = false; - return true; - case 102: - slideShow = true; - randomShow = true; - return true; - case 103: - slideShow = false; - randomShow = false; - return true; - } - return true; - } - - @Override public void onStart() { super.onStart(); @@ -142,25 +98,26 @@ public void run() { if (slideShow) { - if(!randomShow) - { - int max = pictures.pictureList.size(); + if (!randomShow) { + int max = pictures.pictureList.size(); - if (pictures.selectedPicture < max - 1) - pictures.selectedPicture++; - else - pictures.selectedPicture = 0; - setPicture(); - } - else - { - String req = "http://" + Settings.Server + ":" + Settings.Port +"/random/pictures/random.jpg"; + if (pictures.selectedPicture < max - 1) + pictures.selectedPicture++; + else + pictures.selectedPicture = 0; + setPicture(); + } else { + String req = "http://" + Settings.Server + ":" + + Settings.Port + "/random/pictures/random.jpg"; httpHandler handler = new httpHandler(); - + Bitmap pic = handler.DownloadImage(req); - + ImageView imagev = (ImageView) findViewById(R.id.ImageView01); imagev.setImageBitmap(pic); + + TextView txt = (TextView) findViewById(R.id.full_text); + txt.setText("Random slide show"); } } @@ -174,165 +131,131 @@ mHandler.removeCallbacks(mUpdateTimeTask); } - @Override - public boolean onTouchEvent(MotionEvent me) { - return gestureScanner.onTouchEvent(me); - } - + public void onCreateContextMenu(ContextMenu menu, View v, + ContextMenuInfo menuInfo) { + super.onCreateContextMenu(menu, v, menuInfo); + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.picturefullscreenmenu, menu); - public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, - float velocityY) { - try { + if (slideShow) { + if (randomShow) { + MenuItem item = menu.findItem(R.id.rslide); + item.setChecked(slideShow); + } else { + MenuItem item = menu.findItem(R.id.slide); + item.setChecked(slideShow); + } + } - int max = pictures.pictureList.size(); + } - if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) - return false; - // right to left swipe - if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE - && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + @Override + public boolean onContextItemSelected(MenuItem item) { - if (pictures.selectedPicture < max - 1) { - pictures.selectedPicture++; - setPicture(); - } else - Toast.makeText(picturesfullscreen.this, "reached end +", - Toast.LENGTH_SHORT).show(); + String title = (String) item.getTitle(); - } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE - && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - - if (pictures.selectedPicture > 0) { - pictures.selectedPicture--; - setPicture(); - } else - Toast.makeText(picturesfullscreen.this, "reached end -", - Toast.LENGTH_SHORT).show(); - + if (title.compareTo("Save to sd card") == 0) { + SavetoSDCard(); + return true; + } else if (title.compareTo("Open in browser") == 0) { + OpenURL(); + return true; + } else if (title.compareTo("Send Picture") == 0) { + SendPicture(); + return true; + } else if (title.compareTo("Slide show") == 0) { + if ((slideShow == false) || (slideShow && randomShow)) { + slideShow = true; + randomShow = false; + } else { + slideShow = false; } - } catch (Exception e) { - // nothing + return true; + } else if (title.compareTo("Random slide show") == 0) { + if ((slideShow == false) || (slideShow && !randomShow)) { + slideShow = true; + randomShow = true; + } else { + slideShow = false; + } + return true; } return false; } - public boolean onDown(MotionEvent arg0) { - return false; + // **************** + // Menu Functions + // ****************** + private void OpenURL() { + DirItems item = pictures.pictureList.get(pictures.selectedPicture); + String file = "http://" + Settings.Server + ":" + Settings.Port + + "/pictures/"; + file += pictures.actualDir + item.File; + String url = file.replaceAll(" ", "%20"); + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse(url)); + startActivity(i); } - public void onLongPress(MotionEvent arg0) { - } + private void SavetoSDCard() { + try { + DirItems item = pictures.pictureList.get(pictures.selectedPicture); + Bitmap bMap = item.Picture; + File fPath = Environment.getExternalStorageDirectory(); + OutputStream outStream = null; + try { - public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2, - float arg3) { - return false; - } + outStream = new FileOutputStream(fPath + "/" + + item.File.toString()); - public void onShowPress(MotionEvent arg0) { - } + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + + " |||| " + e.getLocalizedMessage().toString()); + } + bMap.compress(Bitmap.CompressFormat.JPEG, 100, outStream); + try { + outStream.flush(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + + " |||| " + e.getLocalizedMessage().toString()); + } + try { + outStream.close(); - public boolean onSingleTapUp(MotionEvent arg0) { - return false; + Toast.makeText(picturesfullscreen.this, "File saved.", + Toast.LENGTH_SHORT).show(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + + " |||| " + e.getLocalizedMessage().toString()); + } + } catch (Exception e) { + Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + + " |||| " + e.getLocalizedMessage().toString()); + // e.printStackTrace(); + } + } - - public void onCreateContextMenu(ContextMenu menu, View v, - ContextMenuInfo menuInfo) { - super.onCreateContextMenu(menu, v, menuInfo); - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.picturefullscreenmenu, menu); - } - - @Override - public boolean onContextItemSelected(MenuItem item) { - if(item.getTitle()=="Save to sd card"){ - SavetoSDCard(); - } - else if(item.getTitle()=="Open in browser"){ - OpenURL(); - } - else if(item.getTitle()=="Send Picture"){ - SendPicture(); - } - else { - return false; - } - return false; - } - - - //**************** - //Menu Functions - //****************** - private void OpenURL(){ - DirItems item = pictures.pictureList.get(pictures.selectedPicture); - String file = "http://" + Settings.Server + ":" + Settings.Port - + "/pictures/"; - file += pictures.actualDir + item.File; - String url = file.replaceAll(" ", "%20"); - Intent i = new Intent(Intent.ACTION_VIEW); - i.setData(Uri.parse(url)); - startActivity(i); - } - - private void SavetoSDCard(){ - try{ - DirItems item = pictures.pictureList.get(pictures.selectedPicture); - Bitmap bMap = item.Picture; - File fPath = Environment.getExternalStorageDirectory(); - OutputStream outStream = null; - try { - - outStream = new FileOutputStream(fPath + "/" + item.File.toString()); - - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString() ); - } - bMap.compress(Bitmap.CompressFormat.JPEG, 100, outStream); - try { - outStream.flush(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString() ); - } - try { - outStream.close(); - - Toast.makeText(picturesfullscreen.this, "File saved.", - Toast.LENGTH_SHORT).show(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString() ); - } - } - catch (Exception e) - { - Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString() ); - //e.printStackTrace(); - } - - } - - - - private void SendPicture(){ - try - { + private void SendPicture() { + try { DirItems item = pictures.pictureList.get(pictures.selectedPicture); - Intent picMessageIntent = new Intent(android.content.Intent.ACTION_SEND); - picMessageIntent.setType("image/jpeg"); + Intent picMessageIntent = new Intent( + android.content.Intent.ACTION_SEND); + picMessageIntent.setType("image/jpeg"); picMessageIntent.putExtra(Intent.EXTRA_STREAM, item.Picture); - startActivity(Intent.createChooser(picMessageIntent,"Send picture using:")); + startActivity(Intent.createChooser(picMessageIntent, + "Send picture using:")); + } catch (Exception e) { + Log.e("Debug", "SendPicture " + e.getMessage().toString() + + " |||| " + e.getLocalizedMessage().toString()); + // e.printStackTrace(); } - catch (Exception e) - { - Log.e("Debug", "SendPicture " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString() ); - //e.printStackTrace(); - } - } - + } + } \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj 2010-12-07 21:55:14 UTC (rev 4018) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj 2010-12-08 13:35:27 UTC (rev 4019) @@ -3,7 +3,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.30729</ProductVersion> + <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{E508BE47-8031-4202-9FD2-404732F86696}</ProjectGuid> <OutputType>Library</OutputType> @@ -37,7 +37,8 @@ </Reference> <Reference Include="Databases, Version=1.1.2.20596, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\Program Files (x86)\Team MediaPortal\MediaPortal\Databases.dll</HintPath> + <HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Databases.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> 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. |
From: <kro...@us...> - 2010-12-08 14:50:51
|
Revision: 4020 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4020&view=rev Author: kroko_koenig Date: 2010-12-08 14:50:44 +0000 (Wed, 08 Dec 2010) Log Message: ----------- using mp3 shares, random.jpg for all dirs Modified Paths: -------------- trunk/plugins/AndroidRemote/Release/Android Server communication.docx trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Modified: trunk/plugins/AndroidRemote/Release/Android Server communication.docx =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs 2010-12-08 13:35:27 UTC (rev 4019) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidServer.cs 2010-12-08 14:50:44 UTC (rev 4020) @@ -44,8 +44,6 @@ public static string Server = string.Empty; public static string Port = string.Empty; - public static string PicturePath = string.Empty; - public static string MusicPath = string.Empty; public static string VideoPath = string.Empty; private Thread listen; @@ -73,10 +71,6 @@ Server = xmlreader.GetValueAsString("android", "server", "192.168.0.30"); Port = xmlreader.GetValueAsString("android", "port", "8200"); - PicturePath = xmlreader.GetValueAsString("android", "pictures", - Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)); - MusicPath = xmlreader.GetValueAsString("android", "music", - Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)); VideoPath = xmlreader.GetValueAsString("android", "videos", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); } Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-08 13:35:27 UTC (rev 4019) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-08 14:50:44 UTC (rev 4020) @@ -55,12 +55,13 @@ private byte[] buffer; private static Bitmap actualCover = null; - private static string[] listAllPictures = null; private SQLiteClient sqlClient; private VirtualDirectory virtualDirectory = new VirtualDirectory(); - private Dictionary<string, string> dirList = new Dictionary<string, string>(); + private Dictionary<string, string> directoryList = new Dictionary<string, string>(); + private static List<string> allPicturesList = null; + public Request(Socket Socket) { socket = Socket; @@ -227,13 +228,13 @@ else if (req.StartsWith("/music")) { // handle pictures - req = req.Replace("/music", ""); + req = req.Substring(6); if (req.StartsWith("/")) req = req.Substring(1); if (req == "") { // root - ReplyMusicDir(AndroidServer.MusicPath, "root"); + ReplyMusicDir(""); } else { @@ -241,12 +242,11 @@ if (req.EndsWith(".mp3")) { - string orgPath = AndroidServer.MusicPath + "\\" + req; - ReplyMusicFile(orgPath, msgTyp); + ReplyMusicFile(req, msgTyp); } else { - ReplyMusicDir(AndroidServer.MusicPath + "\\" + req, req); + ReplyMusicDir(req); } } } @@ -556,8 +556,8 @@ private void ReplyPictureDir(string Request) { - GetPictureShare(); - string dir = GetLocalDir(Request); + directoryList = GetMpShare("pictures"); + string dir = GetLocalDir(Request, directoryList); if (Request == string.Empty) { @@ -574,7 +574,7 @@ msg += "<Directory>\r\n"; // folder - foreach (string key in dirList.Keys) + foreach (string key in directoryList.Keys) { msg += "<Folder>" + HttpUtility.HtmlEncode(key) + "</Folder>\r\n"; } @@ -633,8 +633,8 @@ } private void ReplyPictureFile(string filePath) { - GetPictureShare(); - string dir = GetLocalDir(filePath); + directoryList = GetMpShare("pictures"); + string dir = GetLocalDir(filePath, directoryList); if (File.Exists(dir)) { @@ -681,8 +681,8 @@ { filePath = filePath.Replace(".thb", ""); - GetPictureShare(); - string dir = GetLocalDir(filePath); + directoryList = GetMpShare("pictures"); + string dir = GetLocalDir(filePath, directoryList); if (File.Exists(dir)) { @@ -739,7 +739,7 @@ if (year != string.Empty) { msg += "<Item>\r\n"; - msg += "<Year>" + HttpUtility.HtmlEncode(year).Replace(" ","%20") + "</Year>\r\n"; + msg += "<Year>" + HttpUtility.HtmlEncode(year).Replace(" ", "%20") + "</Year>\r\n"; msg += "</Item>\r\n"; } } @@ -941,10 +941,15 @@ } } - private void ReplyMusicDir(string dir, string request) + private void ReplyMusicDir(string Request) { - if (Directory.Exists(dir)) + directoryList = GetMpShare("music"); + string dir = GetLocalDir(Request, directoryList); + + if (Request == string.Empty) { + #region root shares + string msg = string.Empty; // header msg += "HTTP/1.0 200 Ok\r\n"; @@ -955,27 +960,61 @@ msg += "<?xml version=\"1.0\"?>\r\n"; msg += "<Directory>\r\n"; - string[] dirs = Directory.GetDirectories(dir, "*.*", SearchOption.TopDirectoryOnly); - foreach (string f in dirs) + // folder + foreach (string key in directoryList.Keys) { - msg += "<Folder>" + HttpUtility.HtmlEncode(Path.GetFileName(f)) + "</Folder>\r\n"; + msg += "<Folder>" + HttpUtility.HtmlEncode(key) + "</Folder>\r\n"; } - string[] files = Directory.GetFiles(dir, "*.mp3", SearchOption.TopDirectoryOnly); - foreach (string f in files) - { - string fName = Path.GetFileName(f); - if ((fName.ToLower() != "folder.jpg") && (fName.ToLower() != "folder.png")) - msg += "<File>" + HttpUtility.HtmlEncode(fName) + "</File>\r\n"; - } msg += "</Directory>\r\n"; // send sendMessage(socket, msg); - AndroidServer.logDebug("Reply music dir"); + AndroidServer.logDebug("Reply music root dir"); + + #endregion } else { - SendErrorURL(request); + #region reply dirs + + if (Directory.Exists(dir)) + { + 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 += "<Directory>\r\n"; + + // folder + string[] dirs = Directory.GetDirectories(dir, "*.*", SearchOption.TopDirectoryOnly); + foreach (string f in dirs) + { + msg += "<Folder>" + HttpUtility.HtmlEncode(Path.GetFileName(f)) + "</Folder>\r\n"; + } + + //files + string[] files = Directory.GetFiles(dir, "*.mp3", SearchOption.TopDirectoryOnly); + foreach (string f in files) + { + string fName = Path.GetFileName(f); + msg += "<File>" + HttpUtility.HtmlEncode(fName) + "</File>\r\n"; + } + msg += "</Directory>\r\n"; + // send + sendMessage(socket, msg); + AndroidServer.logDebug("Reply music dir"); + } + else + { + // dir does not exist + SendErrorURL(Request); + } + + #endregion } } private void ReplyMusicFile(string Filename, string Mode) @@ -1344,15 +1383,30 @@ private void ReplyRandomPicture() { - if (listAllPictures == null) - listAllPictures = Directory.GetFiles(AndroidServer.PicturePath, "*.jpg", SearchOption.AllDirectories); + if (allPicturesList == null) + { + allPicturesList = new List<string>(); + directoryList = GetMpShare("pictures"); - if (listAllPictures.Length > 0) + foreach (string key in directoryList.Values) + { + if (Directory.Exists(key)) + { + string[] files = Directory.GetFiles(key, "*.jpg", SearchOption.AllDirectories); + foreach(string f in files) + { + allPicturesList.Add(f); + } + } + } + } + + if (allPicturesList.Count > 0) { Random rnd = new Random(); - int x = rnd.Next(listAllPictures.Length); + int x = rnd.Next(allPicturesList.Count); - Bitmap bit = (Bitmap)Bitmap.FromFile(listAllPictures[x]); + Bitmap bit = (Bitmap)Bitmap.FromFile(allPicturesList[x]); byte[] b; if ((bit.Width > 600) || (bit.Height > 600)) @@ -1383,7 +1437,7 @@ } else { - SendServerError(listAllPictures[x], "ReplyRandomPictureFile"); + SendServerError(allPicturesList[x], "ReplyRandomPictureFile"); } } else @@ -1684,8 +1738,10 @@ } } - private void GetPictureShare() + private Dictionary<string, string> GetMpShare(string Share) { + Dictionary<string, string> list = new Dictionary<string, string>(); + #region read virtual dir using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) { @@ -1699,9 +1755,9 @@ string shareType = String.Format("sharetype{0}", i); Share share = new Share(); - share.Path = xmlreader.GetValueAsString("pictures", sharePath, string.Empty); - share.Name = xmlreader.GetValueAsString("pictures", shareName, string.Empty); - share.IsFtpShare = xmlreader.GetValueAsBool("pictures", shareType, false); + share.Path = xmlreader.GetValueAsString(Share, sharePath, string.Empty); + share.Name = xmlreader.GetValueAsString(Share, shareName, string.Empty); + share.IsFtpShare = xmlreader.GetValueAsBool(Share, shareType, false); if (share.Path.Length > 0) { @@ -1709,7 +1765,7 @@ { if (!share.IsFtpShare) { - dirList.Add(share.Name, share.Path); + list.Add(share.Name, share.Path); } } } @@ -1718,10 +1774,12 @@ break; } } + + return list; } #endregion } - private string GetLocalDir(string Request) + private string GetLocalDir(string Request, Dictionary<string, string> List) { string folder = string.Empty; string baseFolder = string.Empty; @@ -1738,7 +1796,7 @@ } string dir = string.Empty; - foreach (KeyValuePair<string, string> pair in dirList) + foreach (KeyValuePair<string, string> pair in List) { if (pair.Key.ToLower() == (baseFolder.ToLower())) { 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. |
From: <kro...@us...> - 2010-12-08 18:46:36
|
Revision: 4023 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4023&view=rev Author: kroko_koenig Date: 2010-12-08 18:46:29 +0000 (Wed, 08 Dec 2010) Log Message: ----------- more playlist handling thats for today Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-08 17:25:21 UTC (rev 4022) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-08 18:46:29 UTC (rev 4023) @@ -42,6 +42,7 @@ public String Track= ""; public String Rating= ""; public String Filename= ""; + public String Duration= ""; } private DbItems currentDbItem; @@ -75,6 +76,7 @@ if (localName == "Track") {currentDbItem.Track =currentValue;} if (localName == "Rating") {currentDbItem.Rating =currentValue;} if (localName == "Filename") {currentDbItem.Filename =currentValue;} + if (localName == "Duration") {currentDbItem.Duration =currentValue;} if (localName == "Item")DbList.add(currentDbItem); } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-08 17:25:21 UTC (rev 4022) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-08 18:46:29 UTC (rev 4023) @@ -28,7 +28,6 @@ import android.app.Activity; import android.content.Intent; -import android.content.SharedPreferences; import android.content.res.AssetManager; import android.os.Bundle; import android.view.GestureDetector; @@ -40,8 +39,6 @@ public class Remote_01 extends Activity implements OnGestureListener { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - private String HttpServer = ""; - private String HttpPort = ""; private GestureDetector gestureScanner; private static final int SWIPE_MIN_DISTANCE = 120; @@ -55,13 +52,7 @@ setContentView(R.layout.remote01); gestureScanner = new GestureDetector(this); - - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, - MODE_PRIVATE); - HttpServer = settings.getString("Server", "192.168.0.30"); - HttpPort = settings.getString("Port", "8200"); - Button can = (Button) findViewById(R.id.btnBack); can.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { @@ -177,7 +168,7 @@ public void PostCommand(String button) { - PostWebserver post = new PostWebserver(HttpServer, HttpPort); + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); AssetManager assetManager = getAssets(); String xml = ""; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-08 17:25:21 UTC (rev 4022) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-08 18:46:29 UTC (rev 4023) @@ -26,7 +26,6 @@ import mediaportal.remote.R; import android.app.Activity; import android.content.Intent; -import android.content.SharedPreferences; import android.content.res.AssetManager; import android.os.Bundle; import android.view.GestureDetector; @@ -38,8 +37,6 @@ public class Remote_02 extends Activity implements OnGestureListener { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - private String HttpServer = ""; - private String HttpPort = ""; private GestureDetector gestureScanner; private static final int SWIPE_MIN_DISTANCE = 120; @@ -54,12 +51,6 @@ gestureScanner = new GestureDetector(this); - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, - MODE_PRIVATE); - - HttpServer = settings.getString("Server", "192.168.0.30"); - HttpPort = settings.getString("Port", "8200"); - Button btnVolumeUp = (Button) findViewById(R.id.btnVolumeUp); btnVolumeUp.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { @@ -134,7 +125,7 @@ public void PostCommand(String button) { - PostWebserver post = new PostWebserver(HttpServer, HttpPort); + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); AssetManager assetManager = getAssets(); String xml = ""; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-08 17:25:21 UTC (rev 4022) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-08 18:46:29 UTC (rev 4023) @@ -62,8 +62,11 @@ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { - MediaPlayerControl mp = MediaPlayerControl.getinstance(); - mp.Play("http://" + Settings.Server + ":" + Settings.Port + "/music/" + "song-marianne-plays-on-piano-sense-and-sensibilit.mp3"); + ReceiveDbXmlHandler.DbItems item = songList.get(arg2); + PostAddItem(item); + Toast.makeText(musicSong.this, + "Title " + item.Title + " has been added", + Toast.LENGTH_SHORT).show(); } }); } @@ -98,6 +101,38 @@ l1.invalidateViews(); } + public void PostClear() { + + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); + + String xml = ""; + + xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; + xml += "<message>"; + xml += "<command>CLEAR_PLAYLIST</command>"; + xml += "</message>"; + + post.Post(xml); + } + + public void PostAddItem(ReceiveDbXmlHandler.DbItems Item) { + + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); + + String xml = ""; + + xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; + xml += "<message>"; + xml += "<command>ADD_MUSIC</command>"; + xml += "<filename>" + Item.Filename + "</filename>"; + xml += "<artist>" + Item.Artist + "</artist>"; + xml += "<title>" + Item.Title + "</title>"; + xml += "<duration>" + Item.Duration + "</duration>"; + xml += "</message>"; + + post.Post(xml); + } + private static class EfficientAdapter extends BaseAdapter { private LayoutInflater mInflater; Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-08 17:25:21 UTC (rev 4022) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-08 18:46:29 UTC (rev 4023) @@ -1199,9 +1199,6 @@ { req = req.Replace("?artist=", ""); db.GetSongsByArtist(req, ref list); - - MediaPortal.Music.Database.Song song = new MediaPortal.Music.Database.Song(); - db.GetSongByFileName("C:\\MP3\\Charts_von_1985\\1985 - 086 - Alphaville - The Jet Set - CannaPower.mp3", ref song); } else if (req.StartsWith("?album=")) { @@ -1234,6 +1231,7 @@ msg += "<Track>" + HttpUtility.HtmlEncode(song.Track.ToString()) + "</Track>\r\n"; msg += "<Duration>" + HttpUtility.HtmlEncode(song.Duration.ToString()) + "</Duration>\r\n"; msg += "<Rating>" + HttpUtility.HtmlEncode(song.Rating.ToString()) + "</Rating>\r\n"; + msg += "<Filename>" + HttpUtility.HtmlEncode(song.FileName) + "</Filename>\r\n"; msg += "</Item>\r\n"; } 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. |
From: <kro...@us...> - 2010-12-09 15:12:02
|
Revision: 4024 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4024&view=rev Author: kroko_koenig Date: 2010-12-09 15:11:53 +0000 (Thu, 09 Dec 2010) Log Message: ----------- new gfx and some layout changes Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/forward.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pause.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/rewind.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/stop.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_album.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_results.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_song.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote02.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicTab.java trunk/plugins/AndroidRemote/Release/main.jpg trunk/plugins/AndroidRemote/Release/music.jpg trunk/plugins/AndroidRemote/Release/nowplaying.jpg trunk/plugins/AndroidRemote/Release/pictures.jpg trunk/plugins/AndroidRemote/Release/remote.jpg trunk/plugins/AndroidRemote/Release/settings.jpg Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/brush.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/channel_m.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/channel_p.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/exit.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/hibernate.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/home.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/info.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/left.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_music.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_now_playing.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_pictures.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_play.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_remote.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_settings.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_skp_back.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_skp_forw.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_video.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/menu.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/mute.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/now_playing.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/power_off.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/restart.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/right.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/select.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/settings.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/skip_back.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/skip_forward.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/suspend.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/video.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/volume_m.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/volume_p.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/wake_on_lan.png trunk/plugins/AndroidRemote/Release/pictures_menu.jpg trunk/plugins/AndroidRemote/Release/remote2.jpg Removed Paths: ------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_close_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_close_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_hibernate_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_hibernate_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_restart_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_restart_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_shutdown_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_shutdown_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_standby_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_standby_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_wakeup_focus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_wakeup_nofocus.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/nowplaying_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-08 18:46:29 UTC (rev 4023) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-09 15:11:53 UTC (rev 4024) @@ -11,136 +11,157 @@ public static final class attr { } public static final class drawable { - public static final int accept_icon=0x7f020000; - public static final int album=0x7f020001; - public static final int album_off=0x7f020002; - public static final int artist=0x7f020003; - public static final int artist_off=0x7f020004; - public static final int audio=0x7f020005; - public static final int back=0x7f020006; - public static final int back_icon=0x7f020007; - public static final int border=0x7f020008; - public static final int button_close_focus=0x7f020009; - public static final int button_close_nofocus=0x7f02000a; - public static final int button_hibernate_focus=0x7f02000b; - public static final int button_hibernate_nofocus=0x7f02000c; - public static final int button_restart_focus=0x7f02000d; - public static final int button_restart_nofocus=0x7f02000e; - public static final int button_shutdown_focus=0x7f02000f; - public static final int button_shutdown_nofocus=0x7f020010; - public static final int button_standby_focus=0x7f020011; - public static final int button_standby_nofocus=0x7f020012; - public static final int button_wakeup_focus=0x7f020013; - public static final int button_wakeup_nofocus=0x7f020014; - public static final int cdcover=0x7f020015; - public static final int close_icon=0x7f020016; - public static final int document=0x7f020017; - public static final int down_icon=0x7f020018; - public static final int folder=0x7f020019; - public static final int folderback=0x7f02001a; - public static final int foldertab=0x7f02001b; - public static final int foldertab_off=0x7f02001c; - public static final int forward=0x7f02001d; - public static final int ic_tab=0x7f02001e; - public static final int ic_tab1=0x7f02001f; - public static final int ic_tab2=0x7f020020; - public static final int ic_tab3=0x7f020021; - public static final int ic_tab4=0x7f020022; - public static final int icon=0x7f020023; - public static final int music_logo=0x7f020024; - public static final int next_icon=0x7f020025; - public static final int nowplaying_logo=0x7f020026; - public static final int pause=0x7f020027; - public static final int picture=0x7f020028; - public static final int pictures_logo=0x7f020029; - public static final int play=0x7f02002a; - public static final int remote_logo=0x7f02002b; - public static final int rewind=0x7f02002c; - public static final int song=0x7f02002d; - public static final int song_off=0x7f02002e; - public static final int splash=0x7f02002f; - public static final int splash02=0x7f020030; - public static final int stop=0x7f020031; - public static final int up_icon=0x7f020032; - public static final int videos_logo=0x7f020033; + public static final int album=0x7f020000; + public static final int album_off=0x7f020001; + public static final int artist=0x7f020002; + public static final int artist_off=0x7f020003; + public static final int audio=0x7f020004; + public static final int back=0x7f020005; + public static final int border=0x7f020006; + public static final int brush=0x7f020007; + public static final int cdcover=0x7f020008; + public static final int channel_m=0x7f020009; + public static final int channel_p=0x7f02000a; + public static final int document=0x7f02000b; + public static final int down=0x7f02000c; + public static final int exit=0x7f02000d; + public static final int folder=0x7f02000e; + public static final int folderback=0x7f02000f; + public static final int foldertab=0x7f020010; + public static final int foldertab_off=0x7f020011; + public static final int forward=0x7f020012; + public static final int hibernate=0x7f020013; + public static final int home=0x7f020014; + public static final int ic_tab=0x7f020015; + public static final int ic_tab1=0x7f020016; + public static final int ic_tab2=0x7f020017; + public static final int ic_tab3=0x7f020018; + public static final int ic_tab4=0x7f020019; + public static final int icon=0x7f02001a; + public static final int info=0x7f02001b; + public static final int left=0x7f02001c; + public static final int main_music=0x7f02001d; + public static final int main_now_playing=0x7f02001e; + public static final int main_pictures=0x7f02001f; + public static final int main_play=0x7f020020; + public static final int main_remote=0x7f020021; + public static final int main_settings=0x7f020022; + public static final int main_skp_back=0x7f020023; + public static final int main_skp_forw=0x7f020024; + public static final int main_video=0x7f020025; + public static final int menu=0x7f020026; + public static final int music=0x7f020027; + public static final int mute=0x7f020028; + public static final int now_playing=0x7f020029; + public static final int pause=0x7f02002a; + public static final int picture=0x7f02002b; + public static final int pictures=0x7f02002c; + public static final int play=0x7f02002d; + public static final int power_off=0x7f02002e; + public static final int remote=0x7f02002f; + public static final int restart=0x7f020030; + public static final int rewind=0x7f020031; + public static final int right=0x7f020032; + public static final int select=0x7f020033; + public static final int settings=0x7f020034; + public static final int skip_back=0x7f020035; + public static final int skip_forward=0x7f020036; + public static final int song=0x7f020037; + public static final int song_off=0x7f020038; + public static final int splash=0x7f020039; + public static final int splash02=0x7f02003a; + public static final int stop=0x7f02003b; + public static final int suspend=0x7f02003c; + public static final int up=0x7f02003d; + public static final int video=0x7f02003e; + public static final int volume_m=0x7f02003f; + public static final int volume_p=0x7f020040; + public static final int wake_on_lan=0x7f020041; } public static final class id { - public static final int GridView01=0x7f060013; - public static final int ImageView01=0x7f060015; - public static final int LinearLayout01=0x7f060016; - public static final int ListView01=0x7f060024; - public static final int MainButton1=0x7f060005; - public static final int MainButton2=0x7f060006; - public static final int MainButton3=0x7f060007; - public static final int MainButton4=0x7f060008; - public static final int MainButton5=0x7f060009; + public static final int GridView01=0x7f060017; + public static final int ImageView01=0x7f060019; + public static final int LinearLayout01=0x7f06001a; + public static final int ListView01=0x7f060029; + public static final int TableLayout01=0x7f060005; + public static final int TableRow01=0x7f060006; public static final int TextView01=0x7f060003; public static final int TextView02=0x7f060004; - public static final int btnBack=0x7f060038; - public static final int btnChannelDown=0x7f06003d; - public static final int btnChannelUp=0x7f06003a; - public static final int btnDown=0x7f060037; - public static final int btnExit=0x7f06003e; - public static final int btnFBack=0x7f060026; - public static final int btnFForw=0x7f060027; - public static final int btnHibernate=0x7f060040; - public static final int btnHome=0x7f06002e; - public static final int btnInfo=0x7f060030; - public static final int btnLeft=0x7f060032; - public static final int btnMenu=0x7f060036; - public static final int btnOk=0x7f060033; - public static final int btnPause=0x7f06002b; - public static final int btnPlay=0x7f06000c; - public static final int btnRestart=0x7f060041; - public static final int btnRight=0x7f060034; - public static final int btnShutOff=0x7f060042; - public static final int btnSkipBack=0x7f060029; - public static final int btnSkipForw=0x7f06002c; - public static final int btnStop=0x7f06002a; - public static final int btnSuspend=0x7f06003f; - public static final int btnUp=0x7f06002f; - public static final int btnVolumeDown=0x7f06003c; - public static final int btnVolumeMute=0x7f06003b; - public static final int btnVolumeUp=0x7f060039; - public static final int btnWakeOnLan=0x7f060043; - public static final int full_text=0x7f060014; + public static final int btnBack=0x7f06003f; + public static final int btnChannelDown=0x7f060044; + public static final int btnChannelUp=0x7f060041; + public static final int btnDown=0x7f06003e; + public static final int btnExit=0x7f060045; + public static final int btnFBack=0x7f06002c; + public static final int btnFForw=0x7f06002e; + public static final int btnHibernate=0x7f060047; + public static final int btnHome=0x7f060035; + public static final int btnInfo=0x7f060037; + public static final int btnLeft=0x7f060039; + public static final int btnMenu=0x7f06003d; + public static final int btnOk=0x7f06003a; + public static final int btnPause=0x7f060032; + public static final int btnPlay=0x7f06002d; + public static final int btnRestart=0x7f060048; + public static final int btnRight=0x7f06003b; + public static final int btnShutOff=0x7f060049; + public static final int btnSkipBack=0x7f060030; + public static final int btnSkipForw=0x7f060033; + public static final int btnStop=0x7f060031; + public static final int btnSuspend=0x7f060046; + public static final int btnUp=0x7f060036; + public static final int btnVolumeDown=0x7f060043; + public static final int btnVolumeMute=0x7f060042; + public static final int btnVolumeUp=0x7f060040; + public static final int btnWakeOnLan=0x7f06004a; + public static final int btn_main_music=0x7f060008; + public static final int btn_main_now_playing=0x7f06000b; + public static final int btn_main_pictures=0x7f060007; + public static final int btn_main_play=0x7f06000f; + public static final int btn_main_remote=0x7f06000a; + public static final int btn_main_settings=0x7f06000c; + public static final int btn_main_skp_back=0x7f06000e; + public static final int btn_main_skp_forw=0x7f060010; + public static final int btn_main_video=0x7f060009; + public static final int full_text=0x7f060018; public static final int icon_image=0x7f060001; public static final int icon_text=0x7f060002; - public static final int list_album=0x7f06000f; - public static final int list_artist=0x7f060010; - public static final int list_result=0x7f060011; - public static final int list_song=0x7f060012; - public static final int music_grid=0x7f06000e; - public static final int naviRemote_text=0x7f06000a; - public static final int now_album=0x7f060018; - public static final int now_artist=0x7f06001d; - public static final int now_cd=0x7f060019; - public static final int now_list=0x7f060023; - public static final int now_next=0x7f060022; - public static final int now_pause=0x7f060020; - public static final int now_play=0x7f060021; - public static final int now_playing=0x7f060017; - public static final int now_playing_right=0x7f06001b; - public static final int now_playing_t_left=0x7f06000b; - public static final int now_prev=0x7f06001e; - public static final int now_progress=0x7f06001a; - public static final int now_stop=0x7f06001f; - public static final int now_title=0x7f06001c; - public static final int open=0x7f060049; - public static final int rslide=0x7f06004c; - public static final int save=0x7f060048; - public static final int send=0x7f06004a; - public static final int server_ip=0x7f060044; - public static final int server_macid=0x7f060046; - public static final int server_port=0x7f060045; - public static final int slide=0x7f06004b; - public static final int title=0x7f060047; - public static final int widget0=0x7f06000d; - public static final int widget00=0x7f060025; - public static final int widget01=0x7f060028; - public static final int widget02=0x7f06002d; - public static final int widget03=0x7f060031; - public static final int widget04=0x7f060035; + public static final int list_album=0x7f060013; + public static final int list_artist=0x7f060014; + public static final int list_result=0x7f060015; + public static final int list_song=0x7f060016; + public static final int main_now_playing=0x7f06000d; + public static final int music_grid=0x7f060012; + public static final int naviRemote_text=0x7f06002a; + public static final int now_album=0x7f06001c; + public static final int now_artist=0x7f060022; + public static final int now_cd=0x7f06001d; + public static final int now_list=0x7f060028; + public static final int now_next=0x7f060027; + public static final int now_pause=0x7f060025; + public static final int now_play=0x7f060026; + public static final int now_playing=0x7f06001b; + public static final int now_playing_right=0x7f060020; + public static final int now_playing_t_left=0x7f06001f; + public static final int now_prev=0x7f060023; + public static final int now_progress=0x7f06001e; + public static final int now_stop=0x7f060024; + public static final int now_title=0x7f060021; + public static final int open=0x7f060050; + public static final int rslide=0x7f060053; + public static final int save=0x7f06004f; + public static final int send=0x7f060051; + public static final int server_ip=0x7f06004b; + public static final int server_macid=0x7f06004d; + public static final int server_port=0x7f06004c; + public static final int slide=0x7f060052; + public static final int title=0x7f06004e; + public static final int widget0=0x7f060011; + public static final int widget00=0x7f06002b; + public static final int widget01=0x7f06002f; + public static final int widget02=0x7f060034; + public static final int widget03=0x7f060038; + public static final int widget04=0x7f06003c; public static final int widget44=0x7f060000; } public static final class layout { Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/brush.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/brush.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_close_focus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_close_nofocus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_hibernate_focus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_hibernate_nofocus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_restart_focus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_restart_nofocus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_shutdown_focus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_shutdown_nofocus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_standby_focus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_standby_nofocus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_wakeup_focus.png =================================================================== (Binary files differ) Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/button_wakeup_nofocus.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/channel_m.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/channel_m.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/channel_p.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/channel_p.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/exit.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/exit.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/forward.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/hibernate.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/hibernate.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/home.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/home.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/info.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/info.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/left.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/left.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_music.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_music.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_music.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> + <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/music" /> <!-- pressed --> + <item android:state_focused="true" + android:drawable="@drawable/music" /> <!-- focused --> + <item android:drawable="@drawable/music" /> <!-- default --> + </selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_now_playing.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_now_playing.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_now_playing.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> + <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/now_playing" /> <!-- pressed --> + <item android:state_focused="true" + android:drawable="@drawable/now_playing" /> <!-- focused --> + <item android:drawable="@drawable/now_playing" /> <!-- default --> + </selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_pictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_pictures.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_pictures.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> + <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/pictures" /> <!-- pressed --> + <item android:state_focused="true" + android:drawable="@drawable/pictures" /> <!-- focused --> + <item android:drawable="@drawable/pictures" /> <!-- default --> + </selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_play.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_play.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_play.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> + <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/right" /> <!-- pressed --> + <item android:state_focused="true" + android:drawable="@drawable/right" /> <!-- focused --> + <item android:drawable="@drawable/right" /> <!-- default --> + </selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_remote.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_remote.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_remote.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> + <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/remote" /> <!-- pressed --> + <item android:state_focused="true" + android:drawable="@drawable/remote" /> <!-- focused --> + <item android:drawable="@drawable/remote" /> <!-- default --> + </selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_settings.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_settings.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_settings.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> + <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/settings" /> <!-- pressed --> + <item android:state_focused="true" + android:drawable="@drawable/settings" /> <!-- focused --> + <item android:drawable="@drawable/settings" /> <!-- default --> + </selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_skp_back.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_skp_back.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_skp_back.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> + <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/skip_back" /> <!-- pressed --> + <item android:state_focused="true" + android:drawable="@drawable/skip_back" /> <!-- focused --> + <item android:drawable="@drawable/skip_back" /> <!-- default --> + </selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_skp_forw.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_skp_forw.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_skp_forw.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> + <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/skip_forward" /> <!-- pressed --> + <item android:state_focused="true" + android:drawable="@drawable/skip_forward" /> <!-- focused --> + <item android:drawable="@drawable/skip_forward" /> <!-- default --> + </selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_video.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_video.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/main_video.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> + <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/video" /> <!-- pressed --> + <item android:state_focused="true" + android:drawable="@drawable/video" /> <!-- focused --> + <item android:drawable="@drawable/video" /> <!-- default --> + </selector> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/menu.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/menu.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/mute.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/mute.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/now_playing.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/now_playing.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/nowplaying_logo.png =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pause.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/power_off.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/power_off.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/restart.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/restart.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/rewind.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/right.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/right.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/select.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/select.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/settings.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/settings.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/skip_back.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/skip_back.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/skip_forward.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/skip_forward.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/stop.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/suspend.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/suspend.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/video.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/video.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png =================================================================== (Binary files differ) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/volume_m.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/volume_m.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/volume_p.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/volume_p.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/wake_on_lan.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/wake_on_lan.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-12-08 18:46:29 UTC (rev 4023) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -1,59 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" - android:layout_height="fill_parent" android:background="@drawable/back" - android:gravity="top"> + android:layout_height="fill_parent" android:background="@drawable/brush"> - <Button android:id="@+id/MainButton1" android:layout_width="fill_parent" - android:layout_height="70dip" android:background="@drawable/pictures_logo" /> +<TableLayout + android:id="@+id/TableLayout01" + xmlns:android="http://schemas.android.com/apk/res/android" - <View android:layout_height="2dip" android:layout_width="fill_parent" - android:background="#000" /> - - <Button android:id="@+id/MainButton2" android:layout_width="fill_parent" - android:layout_height="70dip" android:background="@drawable/music_logo" /> + android:layout_height="wrap_content" + android:layout_width="wrap_content" android:layout_gravity="center_horizontal"> + + +<TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dip" android:id="@+id/TableRow01"> + + <ImageButton android:src="@drawable/main_pictures" android:scaleType="fitXY" + android:layout_height="80dip" android:layout_width="80dip" + android:layout_marginRight="40dip" android:padding="5dip" android:id="@+id/btn_main_pictures"> + </ImageButton> + + <ImageButton android:layout_height="80dip" android:layout_width="80dip" + android:scaleType="fitXY" android:padding="5dip" + android:src="@drawable/main_music" android:id="@+id/btn_main_music"> + </ImageButton> + + </TableRow> + + <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dip" android:id="@+id/TableRow01"> + + <ImageButton android:scaleType="fitXY" + android:layout_height="80dip" android:layout_width="80dip" + android:padding="5dip" android:layout_marginRight="40dip" android:src="@drawable/main_video" android:id="@+id/btn_main_video"> + </ImageButton> + + <ImageButton android:layout_height="80dip" android:layout_width="80dip" + android:scaleType="fitXY" android:padding="5dip" android:src="@drawable/main_remote" android:id="@+id/btn_main_remote"> + </ImageButton> + + </TableRow> + + <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dip" android:id="@+id/TableRow01"> + + <ImageButton android:scaleType="fitXY" + android:layout_height="80dip" android:layout_width="80dip" + android:padding="5dip" android:layout_marginRight="40dip" android:src="@drawable/main_now_playing" android:id="@+id/btn_main_now_playing"> + </ImageButton> + + <ImageButton android:layout_height="80dip" android:layout_width="80dip" + android:scaleType="fitXY" android:padding="5dip" android:src="@drawable/main_settings" android:id="@+id/btn_main_settings"> + </ImageButton> + + </TableRow> - <View android:layout_height="2dip" android:layout_width="fill_parent" - android:background="#000" /> - - <Button android:id="@+id/MainButton3" android:layout_width="fill_parent" - android:layout_height="70dip" android:background="@drawable/videos_logo" /> +</TableLayout> - <View android:layout_height="2dip" android:layout_width="fill_parent" - android:background="#000" /> - - <Button android:id="@+id/MainButton4" android:layout_width="fill_parent" - android:layout_height="70dip" android:background="@drawable/remote_logo" /> - - <View android:layout_height="2dip" android:layout_width="fill_parent" - android:background="#000" /> - - <Button android:id="@+id/MainButton5" android:layout_width="fill_parent" - android:layout_height="70dip" android:background="@drawable/nowplaying_logo" /> - - <TextView android:id="@+id/naviRemote_text" android:layout_width="fill_parent" + <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="nothing playing" - android:gravity="center_horizontal" android:background="#FFFFFFFF" - android:textSize="15dip" - android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF"> + android:gravity="center_horizontal" android:textSize="15dip" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF" android:background="#FFA9A9A9" android:padding="5dip" android:id="@+id/main_now_playing"> </TextView> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="horizontal" android:layout_width="fill_parent" - android:background="#000" android:layout_height="50dip"> + android:orientation="horizontal" android:background="#0FF0FFFF" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:padding="5dip"> - <TextView android:id="@+id/now_playing_t_left" - android:layout_width="80dip" android:layout_height="50dip" - android:textSize="12dip" android:textColor="#FF8080ff" android:text="00:00" /> + - <Button android:id="@+id/btnPlay" android:layout_width="50dip" - android:layout_height="50dip" android:text="FBW"> - </Button> - <Button android:id="@+id/btnPlay" android:layout_width="50dip" - android:layout_height="50dip" android:text="Play"> - </Button> - <Button android:id="@+id/btnPlay" android:layout_width="50dip" - android:layout_height="50dip" android:text="FFW"> - </Button> - </LinearLayout> - + + + + <ImageButton android:src="@drawable/main_skp_back" android:scaleType="fitXY" + android:layout_height="60dip" android:layout_width="60dip" + android:id="@+id/btn_main_skp_back" android:padding="2dip" android:layout_marginRight="5dip"></ImageButton> + <ImageButton android:scaleType="fitXY" + android:layout_height="60dip" android:layout_width="60dip" + android:id="@+id/btn_main_play" android:src="@drawable/main_play" android:padding="2dip" android:layout_marginRight="5dip"></ImageButton> + <ImageButton android:scaleType="fitXY" + android:layout_height="60dip" android:layout_width="60dip" + android:id="@+id/btn_main_skp_forw" android:src="@drawable/main_skp_forw" android:padding="2dip"></ImageButton> +</LinearLayout> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml 2010-12-08 18:46:29 UTC (rev 4023) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -1,6 +1,6 @@ <AbsoluteLayout android:id="@+id/widget0" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:background="@drawable/back" xmlns:android="http://schemas.android.com/apk/res/android"> + xmlns:android="http://schemas.android.com/apk/res/android"> <GridView android:layout_y="0dip" android:layout_x="0dip" android:id="@+id/music_grid" android:layout_width="fill_parent" android:layout_height="fill_parent" android:columnWidth="90dp" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_album.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_album.xml 2010-12-08 18:46:29 UTC (rev 4023) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_album.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" - android:background="@drawable/back" android:layout_height="fill_parent"> <ListView android:id="@+id/list_album" android:layout_height="wrap_content" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml 2010-12-08 18:46:29 UTC (rev 4023) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_artist.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" - android:background="@drawable/back" android:layout_height="fill_parent"> <ListView android:id="@+id/list_artist" android:layout_height="wrap_content" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_results.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_results.xml 2010-12-08 18:46:29 UTC (rev 4023) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_results.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" - android:background="@drawable/back" android:layout_height="fill_parent"> <ListView android:id="@+id/list_result" android:layout_height="wrap_content" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_song.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_song.xml 2010-12-08 18:46:29 UTC (rev 4023) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/music_song.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" - android:background="@drawable/back" android:layout_height="fill_parent"> <ListView android:id="@+id/list_song" android:layout_height="wrap_content" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-12-08 18:46:29 UTC (rev 4023) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -1,7 +1,7 @@ <LinearLayout android:id="@+id/LinearLayout01" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" - android:background="@drawable/back" + android:background="@drawable/brush" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:id="@+id/now_playing" android:layout_width="fill_parent" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml 2010-12-08 18:46:29 UTC (rev 4023) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote01.xml 2010-12-09 15:11:53 UTC (rev 4024) @@ -4,13 +4,14 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" + android:background="@drawable/brush" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:id="@+id/naviRemote_text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Remote 01" - android:gravity="center_horizontal" android:background="#FFFFFFFF" + android:gravity="center_horizontal" android:background="#FFA9A9A9" android:textSize="15dip" - android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF"> + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF" android:padding="5dip"> </TextView> <LinearLayout @@ -21,19 +22,18 @@ <Button android:id="@+id/btnFBack" android:layout_width="80dip" android:layout_height="60dip" - android:text="FBack"> + android:background="@drawable/rewind"> </Button> <Button android:id="@+id/btnPlay" android:layout_width="160dip" android:layout_height="60dip" - android:text="Play"> + android:background="@drawable/play"> </Button> <Button android:id="@+id/btnFForw" android:layout_wi... [truncated message content] |
From: <kro...@us...> - 2010-12-10 08:51:53
|
Revision: 4025 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4025&view=rev Author: kroko_koenig Date: 2010-12-10 08:51:46 +0000 (Fri, 10 Dec 2010) Log Message: ----------- add installer for MP Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Release/AndroidRemote.mpe1 trunk/plugins/AndroidRemote/Release/AndroidRemote.xmp2 trunk/plugins/AndroidRemote/Release/AppsInstaller_icon.png Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-12-09 15:11:53 UTC (rev 4024) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-12-10 08:51:46 UTC (rev 4025) @@ -59,22 +59,17 @@ <LinearLayout android:layout_height="wrap_content" android:orientation="horizontal" android:layout_width="fill_parent"> <ImageButton android:id="@+id/now_prev" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/rewind" /> + android:background="@drawable/rewind" android:layout_height="60dip" android:layout_width="60dip"/> <ImageButton android:id="@+id/now_stop" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/stop" /> + android:background="@drawable/stop" android:layout_height="60dip" android:layout_width="60dip"/> <ImageButton android:id="@+id/now_pause" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/pause" /> + android:background="@drawable/pause" android:layout_width="60dip" android:layout_height="60dip"/> <ImageButton android:id="@+id/now_play" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/play" /> + android:layout_height="60dip" android:layout_width="60dip" android:background="@drawable/right"/> <ImageButton android:id="@+id/now_next" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/forward" /> + android:background="@drawable/forward" android:layout_width="60dip" android:layout_height="60dip"/> <ImageButton android:id="@+id/now_list" - android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/document"/> + android:background="@drawable/document" android:layout_width="60dip" android:layout_height="60dip"/> </LinearLayout> </LinearLayout> Added: trunk/plugins/AndroidRemote/Release/AndroidRemote.mpe1 =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/AndroidRemote.mpe1 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Release/AndroidRemote.xmp2 =================================================================== --- trunk/plugins/AndroidRemote/Release/AndroidRemote.xmp2 (rev 0) +++ trunk/plugins/AndroidRemote/Release/AndroidRemote.xmp2 2010-12-10 08:51:46 UTC (rev 4025) @@ -0,0 +1,201 @@ +<?xml version="1.0" encoding="utf-8"?> +<PackageClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Version>2.0</Version> + <Groups> + <Items> + <GroupItem Name="Default"> + <ParentGroup /> + <DisplayName>Default</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Default</Description> + <Files> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Server\AndroidRemote\bin\Release\AndroidRemote.dll</LocalFileName> + <ZipFileName>Installer{CopyFile}\{e035a37f-6b89-423d-b478-a1d7bbd1cce6}-AndroidRemote.dll</ZipFileName> + <DestinationFilename>%Plugins%\process\AndroidRemote.dll</DestinationFilename> + </FileItem> + </Items> + </Files> + </GroupItem> + </Items> + </Groups> + <Sections> + <Items> + <SectionItem Guid="79d67e40-5ae0-4c16-a7a1-a93f45fad15d" Name="Welcome Screen" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header text"> + <Value>Welcome to the Extension Installer for [Name]</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Description"> + <Value>This will install [Name] version [Version] on your computer. +It is recommended that you close all other applications before continuing. +Click Next to continue or Cancel to exit Setup.</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Left part image"> + <Value /> + <ValueType>File</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items /> + </Actions> + <IncludedGroups /> + <PanelName>Welcome Screen</PanelName> + <WizardButtonsEnum>NextCancel</WizardButtonsEnum> + </SectionItem> + <SectionItem Guid="18193bf3-6e40-4815-a472-5e126fde5a0d" Name="Install Section" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header Title"> + <Value /> + <ValueType>String</ValueType> + <Description>Header title</Description> + </SectionParam> + <SectionParam Name="Header description"> + <Value /> + <ValueType>String</ValueType> + <Description>Description of section, shown in under section title</Description> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items> + <ActionItem Name="InstallFiles" ActionType="InstallFiles" ConditionGroup=""> + <Params> + <Items /> + </Params> + <ExecuteLocation>AfterPanelShow</ExecuteLocation> + </ActionItem> + </Items> + </Actions> + <IncludedGroups /> + <PanelName>Install Section</PanelName> + <WizardButtonsEnum>Next</WizardButtonsEnum> + </SectionItem> + <SectionItem Guid="c8ccf7dc-f920-437f-b700-8850366ecd2c" Name="Setup Complete" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header text"> + <Value>The Extension Installer Wizard has successfully installed [Name].</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Left part image"> + <Value /> + <ValueType>File</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Show radio buttons"> + <Value /> + <ValueType>Bool</ValueType> + <Description>Use radiobutton in place of combobox</Description> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items /> + </Actions> + <IncludedGroups /> + <PanelName>Setup Complete</PanelName> + <WizardButtonsEnum>Finish</WizardButtonsEnum> + </SectionItem> + </Items> + </Sections> + <Dependencies> + <Items /> + </Dependencies> + <GeneralInfo> + <Name>Android Remote</Name> + <Id>d29419c3-1176-48fd-bed5-599a4ec93b7b</Id> + <Author>Mark Koenig (kroko) 2010</Author> + <HomePage>http://forum.team-mediaportal.com/</HomePage> + <ForumPage>http://forum.team-mediaportal.com/webservice-mobile-access-537/plugin-android-remote-89895/</ForumPage> + <UpdateUrl /> + <Version> + <Major>0</Major> + <Minor>1</Minor> + <Build>0</Build> + <Revision>0</Revision> + </Version> + <ExtensionDescription>Control your MediaPortal with yout Android. It can be used as a remote control or doing many other things like music, pictures and video control. +Gfx has been done by oddfella and some additional coding is from rolls1400. + +Have fun.</ExtensionDescription> + <VersionDescription>initial release</VersionDescription> + <DevelopmentStatus>Stable</DevelopmentStatus> + <OnlineLocation /> + <ReleaseDate>2010-12-09T16:17:18.1693243+01:00</ReleaseDate> + <Tags>android,remote</Tags> + <Params> + <Items> + <SectionParam Name="Icon"> + <Value /> + <ValueType>File</ValueType> + <Description>The icon file of the package (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Online Icon"> + <Value /> + <ValueType>String</ValueType> + <Description>The icon file of the package stored online (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Configuration file"> + <Value /> + <ValueType>Template</ValueType> + <Description>The file used to configure the extension. + If have .exe extension the will be executed + If have .dll extension used like MP plugin configuration</Description> + </SectionParam> + <SectionParam Name="Online Screenshots"> + <Value /> + <ValueType>String</ValueType> + <Description>Online stored screenshot urls separated by ; </Description> + </SectionParam> + <SectionParam Name="Force to uninstall on update"> + <Value>yes</Value> + <ValueType>Bool</ValueType> + <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description> + </SectionParam> + </Items> + </Params> + </GeneralInfo> + <UniqueFileList> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Server\AndroidRemote\bin\Release\AndroidRemote.dll</LocalFileName> + <ZipFileName>Installer{CopyFile}\{e035a37f-6b89-423d-b478-a1d7bbd1cce6}-AndroidRemote.dll</ZipFileName> + <DestinationFilename>%Plugins%\process\AndroidRemote.dll</DestinationFilename> + </FileItem> + </Items> + </UniqueFileList> + <ProjectSettings> + <FolderGroups /> + <ProjectFilename>C:\AAA\AndroidRemote2\Release\AndroidRemote.xmp2</ProjectFilename> + </ProjectSettings> +</PackageClass> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Release/AppsInstaller_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/AppsInstaller_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj 2010-12-09 15:11:53 UTC (rev 4024) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj 2010-12-10 08:51:46 UTC (rev 4025) @@ -33,7 +33,8 @@ <ItemGroup> <Reference Include="Core, Version=1.1.2.20593, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\Program Files (x86)\Team MediaPortal\MediaPortal\Core.dll</HintPath> + <HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Core.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="Databases, Version=1.1.2.20596, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> @@ -48,7 +49,8 @@ <Reference Include="System.Xml" /> <Reference Include="Utils, Version=2.2.7.20588, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\Program Files (x86)\Team MediaPortal\MediaPortal\Utils.dll</HintPath> + <HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Utils.dll</HintPath> + <Private>False</Private> </Reference> </ItemGroup> <ItemGroup> 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. |
From: <kro...@us...> - 2010-12-10 11:12:49
|
Revision: 4026 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4026&view=rev Author: kroko_koenig Date: 2010-12-10 11:12:42 +0000 (Fri, 10 Dec 2010) Log Message: ----------- vibration and small layout Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java trunk/plugins/AndroidRemote/Release/settings.jpg Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote01.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote02.xml Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-10 11:12:42 UTC (rev 4026) @@ -82,38 +82,38 @@ public static final int GridView01=0x7f060017; public static final int ImageView01=0x7f060019; public static final int LinearLayout01=0x7f06001a; - public static final int ListView01=0x7f060029; + public static final int ListView01=0x7f060028; public static final int TableLayout01=0x7f060005; public static final int TableRow01=0x7f060006; public static final int TextView01=0x7f060003; public static final int TextView02=0x7f060004; - public static final int btnBack=0x7f06003f; - public static final int btnChannelDown=0x7f060044; - public static final int btnChannelUp=0x7f060041; - public static final int btnDown=0x7f06003e; - public static final int btnExit=0x7f060045; - public static final int btnFBack=0x7f06002c; - public static final int btnFForw=0x7f06002e; - public static final int btnHibernate=0x7f060047; - public static final int btnHome=0x7f060035; - public static final int btnInfo=0x7f060037; - public static final int btnLeft=0x7f060039; - public static final int btnMenu=0x7f06003d; - public static final int btnOk=0x7f06003a; - public static final int btnPause=0x7f060032; - public static final int btnPlay=0x7f06002d; - public static final int btnRestart=0x7f060048; - public static final int btnRight=0x7f06003b; - public static final int btnShutOff=0x7f060049; - public static final int btnSkipBack=0x7f060030; - public static final int btnSkipForw=0x7f060033; - public static final int btnStop=0x7f060031; - public static final int btnSuspend=0x7f060046; - public static final int btnUp=0x7f060036; - public static final int btnVolumeDown=0x7f060043; - public static final int btnVolumeMute=0x7f060042; - public static final int btnVolumeUp=0x7f060040; - public static final int btnWakeOnLan=0x7f06004a; + public static final int btnBack=0x7f06003e; + public static final int btnChannelDown=0x7f060043; + public static final int btnChannelUp=0x7f060040; + public static final int btnDown=0x7f06003d; + public static final int btnExit=0x7f060044; + public static final int btnFBack=0x7f06002b; + public static final int btnFForw=0x7f06002d; + public static final int btnHibernate=0x7f060046; + public static final int btnHome=0x7f060034; + public static final int btnInfo=0x7f060036; + public static final int btnLeft=0x7f060038; + public static final int btnMenu=0x7f06003c; + public static final int btnOk=0x7f060039; + public static final int btnPause=0x7f060031; + public static final int btnPlay=0x7f06002c; + public static final int btnRestart=0x7f060047; + public static final int btnRight=0x7f06003a; + public static final int btnShutOff=0x7f060048; + public static final int btnSkipBack=0x7f06002f; + public static final int btnSkipForw=0x7f060032; + public static final int btnStop=0x7f060030; + public static final int btnSuspend=0x7f060045; + public static final int btnUp=0x7f060035; + public static final int btnVolumeDown=0x7f060042; + public static final int btnVolumeMute=0x7f060041; + public static final int btnVolumeUp=0x7f06003f; + public static final int btnWakeOnLan=0x7f060049; public static final int btn_main_music=0x7f060008; public static final int btn_main_now_playing=0x7f06000b; public static final int btn_main_pictures=0x7f060007; @@ -132,14 +132,13 @@ public static final int list_song=0x7f060016; public static final int main_now_playing=0x7f06000d; public static final int music_grid=0x7f060012; - public static final int naviRemote_text=0x7f06002a; + public static final int naviRemote_text=0x7f060029; public static final int now_album=0x7f06001c; public static final int now_artist=0x7f060022; public static final int now_cd=0x7f06001d; - public static final int now_list=0x7f060028; - public static final int now_next=0x7f060027; - public static final int now_pause=0x7f060025; - public static final int now_play=0x7f060026; + public static final int now_list=0x7f060027; + public static final int now_next=0x7f060026; + public static final int now_play=0x7f060025; public static final int now_playing=0x7f06001b; public static final int now_playing_right=0x7f060020; public static final int now_playing_t_left=0x7f06001f; @@ -151,17 +150,18 @@ public static final int rslide=0x7f060053; public static final int save=0x7f06004f; public static final int send=0x7f060051; - public static final int server_ip=0x7f06004b; - public static final int server_macid=0x7f06004d; - public static final int server_port=0x7f06004c; + public static final int server_ip=0x7f06004a; + public static final int server_macid=0x7f06004c; + public static final int server_port=0x7f06004b; public static final int slide=0x7f060052; public static final int title=0x7f06004e; + public static final int vibration=0x7f06004d; public static final int widget0=0x7f060011; - public static final int widget00=0x7f06002b; - public static final int widget01=0x7f06002f; - public static final int widget02=0x7f060034; - public static final int widget03=0x7f060038; - public static final int widget04=0x7f06003c; + public static final int widget00=0x7f06002a; + public static final int widget01=0x7f06002e; + public static final int widget02=0x7f060033; + public static final int widget03=0x7f060037; + public static final int widget04=0x7f06003b; public static final int widget44=0x7f060000; } public static final class layout { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme 2010-12-10 11:12:42 UTC (rev 4026) @@ -1,22 +1,37 @@ Pictures section ---------------- - -implemented: - browse folders (MP shares) display thumbs - - save to sd open browser send picture slide show random slide show -wishes: +Music section +------------- +browse folders (MP shares) +Video section +------------- +nothing yet + +NowPlaying +---------- +show actual title +show actual time +show actual cover + +Remote +------ +most functions as on my remote + + +Main issues +------------ +Vibration (on/off settings) +Vibration feedback +Check if WIFI is on gesture control for pictures (swipe) save files from Android to MP - -Music section -------------- +if the MP has no focus the remote doesnt work (normal) Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-12-10 11:12:42 UTC (rev 4026) @@ -35,13 +35,13 @@ android:layout_height="wrap_content" android:layout_marginTop="10dip"> <TextView android:id="@+id/now_playing_t_left" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="12dip" android:textColor="#FF8080ff" android:text="00:00" - android:gravity="left" /> + android:textSize="12dip" android:text="00:00" + android:gravity="left" android:textColor="#FF000000"/> <TextView android:id="@+id/now_playing_right" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:textSize="12dip" - android:textColor="#FF8080ff" android:gravity="right" android:text="00:00" - android:singleLine="true" /> + android:gravity="right" android:text="00:00" + android:singleLine="true" android:textColor="#FF000000"/> </RelativeLayout> <TextView android:id="@+id/now_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="16dip" @@ -57,19 +57,17 @@ </LinearLayout> <LinearLayout android:layout_height="wrap_content" - android:orientation="horizontal" android:layout_width="fill_parent"> + android:orientation="horizontal" android:layout_width="wrap_content" android:layout_gravity="center_horizontal"> <ImageButton android:id="@+id/now_prev" - android:background="@drawable/rewind" android:layout_height="60dip" android:layout_width="60dip"/> + android:layout_height="60dip" android:background="@drawable/skip_back" android:layout_width="60dip"/> <ImageButton android:id="@+id/now_stop" - android:background="@drawable/stop" android:layout_height="60dip" android:layout_width="60dip"/> - <ImageButton android:id="@+id/now_pause" - android:background="@drawable/pause" android:layout_width="60dip" android:layout_height="60dip"/> + android:background="@drawable/stop" android:layout_height="60dip" android:layout_width="60dip"/> <ImageButton android:id="@+id/now_play" - android:layout_height="60dip" android:layout_width="60dip" android:background="@drawable/right"/> + android:layout_height="60dip" android:background="@drawable/right" android:layout_width="60dip"/> <ImageButton android:id="@+id/now_next" - android:background="@drawable/forward" android:layout_width="60dip" android:layout_height="60dip"/> + android:layout_height="60dip" android:background="@drawable/skip_forward" android:layout_width="60dip"/> <ImageButton android:id="@+id/now_list" - android:background="@drawable/document" android:layout_width="60dip" android:layout_height="60dip"/> + android:background="@drawable/document" android:layout_height="60dip" android:layout_width="60dip"/> </LinearLayout> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-12-10 11:12:42 UTC (rev 4026) @@ -24,5 +24,6 @@ <EditText android:id="@+id/server_macid" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="12-34-56-78-90-12" android:inputType="number|numberSigned"></EditText> - + +<CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#000" android:textSize="18dip" android:id="@+id/vibration" android:text="use vibration feedback"></CheckBox> </LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/main.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/main.xml 2010-12-10 11:12:42 UTC (rev 4026) @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="fill_parent" + android:layout_height="fill_parent" android:background="@drawable/brush"> + +<TableLayout + android:id="@+id/TableLayout01" + xmlns:android="http://schemas.android.com/apk/res/android" + + android:layout_height="wrap_content" + android:layout_width="wrap_content" android:layout_gravity="center_horizontal"> + + +<TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01" android:padding="5dip"> + + <ImageButton android:src="@drawable/main_pictures" android:scaleType="fitXY" + android:layout_height="80dip" android:layout_width="80dip" + android:layout_marginRight="40dip" android:padding="5dip" android:id="@+id/btn_main_pictures"> + </ImageButton> + + <ImageButton android:layout_height="80dip" android:layout_width="80dip" + android:scaleType="fitXY" android:padding="5dip" + android:src="@drawable/main_music" android:id="@+id/btn_main_music"> + </ImageButton> + + </TableRow> + + <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01" android:padding="5dip"> + + <ImageButton android:scaleType="fitXY" + android:layout_height="80dip" android:layout_width="80dip" + android:padding="5dip" android:layout_marginRight="40dip" android:src="@drawable/main_video" android:id="@+id/btn_main_video"> + </ImageButton> + + <ImageButton android:layout_height="80dip" android:layout_width="80dip" + android:scaleType="fitXY" android:padding="5dip" android:src="@drawable/main_remote" android:id="@+id/btn_main_remote"> + </ImageButton> + + </TableRow> + + <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01" android:padding="5dip"> + + <ImageButton android:scaleType="fitXY" + android:layout_height="80dip" android:layout_width="80dip" + android:padding="5dip" android:layout_marginRight="40dip" android:src="@drawable/main_now_playing" android:id="@+id/btn_main_now_playing"> + </ImageButton> + + <ImageButton android:layout_height="80dip" android:layout_width="80dip" + android:scaleType="fitXY" android:padding="5dip" android:src="@drawable/main_settings" android:id="@+id/btn_main_settings"> + </ImageButton> + + </TableRow> + +</TableLayout> + + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="nothing playing" + android:gravity="center_horizontal" android:textSize="15dip" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF" android:background="#FFA9A9A9" android:padding="5dip" android:id="@+id/main_now_playing"> + </TextView> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" android:background="#0FF0FFFF" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:padding="5dip"> + + + + + + + <ImageButton android:src="@drawable/main_skp_back" android:scaleType="fitXY" + android:layout_height="60dip" android:layout_width="60dip" + android:id="@+id/btn_main_skp_back" android:padding="2dip" android:layout_marginRight="5dip"></ImageButton> + <ImageButton android:scaleType="fitXY" + android:layout_height="60dip" android:layout_width="60dip" + android:id="@+id/btn_main_play" android:src="@drawable/main_play" android:padding="2dip" android:layout_marginRight="5dip"></ImageButton> + <ImageButton android:scaleType="fitXY" + android:layout_height="60dip" android:layout_width="60dip" + android:id="@+id/btn_main_skp_forw" android:src="@drawable/main_skp_forw" android:padding="2dip"></ImageButton> +</LinearLayout> +</LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml 2010-12-10 11:12:42 UTC (rev 4026) @@ -1,7 +1,7 @@ <LinearLayout android:id="@+id/LinearLayout01" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" - android:background="@drawable/back" + android:background="@drawable/brush" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:id="@+id/now_playing" android:layout_width="fill_parent" @@ -36,13 +36,13 @@ android:layout_height="wrap_content" android:layout_marginTop="10dip"> <TextView android:id="@+id/now_playing_t_left" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="12dip" android:textColor="#FF8080ff" android:text="00:00" - android:gravity="left" /> + android:textSize="12dip" android:text="00:00" + android:gravity="left" android:textColor="#FF000000"/> <TextView android:id="@+id/now_playing_right" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:textSize="12dip" - android:textColor="#FF8080ff" android:gravity="right" android:text="00:00" - android:singleLine="true" /> + android:gravity="right" android:text="00:00" + android:singleLine="true" android:textColor="#FF000000"/> </RelativeLayout> <TextView android:id="@+id/now_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="14dip" @@ -58,24 +58,17 @@ </LinearLayout> <LinearLayout android:layout_height="wrap_content" - android:orientation="horizontal" android:layout_width="fill_parent"> + android:orientation="horizontal" android:layout_width="wrap_content" android:layout_gravity="center_horizontal"> <ImageButton android:id="@+id/now_prev" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/rewind" /> + android:background="@drawable/skip_back" android:layout_width="60dip" android:layout_height="40dip"/> <ImageButton android:id="@+id/now_stop" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/stop" /> - <ImageButton android:id="@+id/now_pause" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/pause" /> + android:background="@drawable/stop" android:layout_width="60dip" android:layout_height="40dip"/> <ImageButton android:id="@+id/now_play" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/play" /> + android:background="@drawable/right" android:layout_width="60dip" android:layout_height="40dip"/> <ImageButton android:id="@+id/now_next" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/forward" /> + android:background="@drawable/skip_forward" android:layout_width="60dip" android:layout_height="40dip"/> <ImageButton android:id="@+id/now_list" - android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/document"/> + android:background="@drawable/document" android:layout_width="60dip" android:layout_height="40dip"/> </LinearLayout> </LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote01.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote01.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote01.xml 2010-12-10 11:12:42 UTC (rev 4026) @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + android:id="@+id/widget0" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:orientation="vertical" + android:background="@drawable/brush" + xmlns:android="http://schemas.android.com/apk/res/android"> + + <TextView android:id="@+id/naviRemote_text" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="Remote 01" + android:gravity="center_horizontal" android:background="#FFA9A9A9" + android:textSize="15dip" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF" android:padding="5dip"> + </TextView> + + <LinearLayout + android:id="@+id/widget00" + android:layout_width="fill_parent" + android:layout_height="wrap_content" android:layout_marginTop="5dip"> + + <Button android:id="@+id/btnFBack" + android:layout_width="80dip" + android:layout_height="60dip" + android:background="@drawable/rewind"> + </Button> + + <Button android:id="@+id/btnPlay" + android:layout_width="160dip" + android:layout_height="60dip" + android:background="@drawable/play"> + </Button> + + <Button android:id="@+id/btnFForw" + android:layout_width="80dip" + android:layout_height="60dip" android:background="@drawable/forward"> + </Button> + + </LinearLayout> + + <LinearLayout + android:id="@+id/widget01" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + > + <Button android:id="@+id/btnSkipBack" + android:layout_width="80dip" + android:layout_height="60dip" + android:background="@drawable/skip_back"> + </Button> + + <Button android:id="@+id/btnStop" + android:layout_width="80dip" + android:layout_height="60dip" + android:background="@drawable/stop"> + </Button> + + <Button android:id="@+id/btnPause" + android:layout_width="80dip" + android:layout_height="60dip" + android:background="@drawable/pause"> + </Button> + + <Button android:id="@+id/btnSkipForw" + android:layout_width="80dip" + android:layout_height="60dip" + android:background="@drawable/skip_forward"> + </Button> + + </LinearLayout> + + <LinearLayout + android:id="@+id/widget02" + android:layout_width="fill_parent" + android:layout_height="wrap_content" android:paddingTop="10dip"> + + <Button android:id="@+id/btnHome" + android:layout_width="80dip" + android:background="@drawable/home" android:layout_height="50dip"> + </Button> + + <Button android:id="@+id/btnUp" + android:layout_width="160dip" android:background="@drawable/up" android:layout_height="50dip"> + </Button> + + <Button android:id="@+id/btnInfo" + android:layout_width="80dip" + android:background="@drawable/info" android:layout_height="50dip"> + </Button> + + </LinearLayout> + + <LinearLayout + android:id="@+id/widget03" + android:layout_width="fill_parent" + android:layout_height="wrap_content"> + + <Button android:id="@+id/btnLeft" + android:layout_width="80dip" + android:background="@drawable/left" android:layout_height="100dip"> + </Button> + + <Button android:id="@+id/btnOk" + android:layout_width="160dip" android:background="@drawable/select" android:layout_height="100dip"> + </Button> + + <Button android:id="@+id/btnRight" + android:layout_width="80dip" + android:background="@drawable/right" android:layout_height="100dip"> + </Button> + </LinearLayout> + + <LinearLayout + android:id="@+id/widget04" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + > + + <Button android:id="@+id/btnMenu" + android:layout_width="80dip" + android:background="@drawable/menu" android:layout_height="50dip"> + </Button> + + <Button android:id="@+id/btnDown" + android:layout_width="160dip" + android:background="@drawable/down" android:layout_height="50dip"> + </Button> + + <Button android:id="@+id/btnBack" + android:layout_width="80dip" + android:background="@drawable/back" android:layout_height="50dip"> + </Button> + + </LinearLayout> + +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote02.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote02.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/remote02.xml 2010-12-10 11:12:42 UTC (rev 4026) @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout android:id="@+id/widget0" + android:layout_width="fill_parent" android:layout_height="fill_parent" + android:background = "@drawable/brush" + android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> + + <TextView android:id="@+id/naviRemote_text" + android:layout_width="fill_parent" android:layout_height="wrap_content" + android:text="Remote 02" android:gravity="center_horizontal" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF" android:background="#FFA9A9A9" android:textSize="15dip" android:padding="2dip"> + </TextView> + + <LinearLayout android:id="@+id/widget00" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" android:layout_marginTop="0dip"> + + <Button android:id="@+id/btnVolumeUp" android:background="@drawable/volume_p" android:layout_height="50dip" android:layout_width="60dip"> + </Button> + + <Button android:id="@+id/btnChannelUp" android:layout_marginLeft="40dip" android:background="@drawable/channel_p" android:layout_height="50dip" android:layout_width="60dip"> + </Button> + </LinearLayout> + + <LinearLayout android:id="@+id/widget00" + android:layout_height="wrap_content" android:layout_width="wrap_content" + android:layout_gravity="center_vertical"> + + <Button android:id="@+id/btnVolumeMute" android:background="@drawable/mute" android:layout_height="50dip" android:layout_width="60dip"> + </Button> + + </LinearLayout> + + <LinearLayout android:id="@+id/widget00" + android:layout_height="wrap_content" android:layout_width="wrap_content" + android:layout_gravity="center_vertical" android:paddingBottom="5dip"> + + <Button android:id="@+id/btnVolumeDown" android:background="@drawable/volume_m" android:layout_height="50dip" android:layout_width="60dip"> + </Button> + + <Button android:id="@+id/btnChannelDown" android:layout_marginLeft="40dip" android:background="@drawable/channel_m" android:layout_height="50dip" android:layout_width="60dip"> + </Button> + </LinearLayout> + + <TextView android:id="@+id/naviRemote_text" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="Power control" + android:gravity="center_horizontal" android:textSize="15dip" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF" android:background="#FFA9A9A9" android:padding="2dip"> + </TextView> + + <LinearLayout android:id="@+id/widget00" + android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center_horizontal"> + + <Button android:layout_width="60dip" android:textSize="12dip" + android:layout_height="60dip" android:textColor="#FFFFFFFF" + android:id="@+id/btnExit" android:gravity="bottom|center" android:background="@drawable/exit"> + </Button> + + <Button android:textSize="12dip" android:layout_height="60dip" + android:textColor="#FFFFFFFF" android:id="@+id/btnSuspend" + android:gravity="bottom|center" + android:layout_width="60dip" android:background="@drawable/suspend"> + </Button> + + <Button android:layout_width="60dip" android:textSize="12dip" + android:layout_height="60dip" android:textColor="#FFFFFFFF" android:id="@+id/btnHibernate" + android:gravity="bottom|center" android:background="@drawable/hibernate"> + </Button> + + <Button android:layout_width="60dip" android:textSize="12dip" + android:layout_height="60dip" android:textColor="#FFFFFFFF" android:id="@+id/btnRestart" + android:gravity="bottom|center" android:background="@drawable/restart"> + </Button> + + <Button android:layout_width="60dip" android:textSize="12dip" + android:layout_height="60dip" android:textColor="#FFFFFFFF" android:id="@+id/btnShutOff" + android:gravity="bottom|center" android:background="@drawable/power_off"> + </Button> + </LinearLayout> + + <LinearLayout android:id="@+id/widget00" + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginTop="10dip" android:layout_gravity="center_horizontal"> + + <Button android:layout_width="60dip" android:textSize="12dip" + android:layout_height="60dip" android:textColor="#FFFFFFFF" android:id="@+id/btnWakeOnLan" + android:gravity="bottom|center" android:background="@drawable/wake_on_lan"> + </Button> + </LinearLayout> + +</LinearLayout> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-10 11:12:42 UTC (rev 4026) @@ -23,9 +23,7 @@ import java.io.IOException; import java.io.InputStream; - import mediaportal.remote.R; - import android.app.Activity; import android.content.Intent; import android.content.res.AssetManager; @@ -35,6 +33,7 @@ import android.view.View; import android.view.GestureDetector.OnGestureListener; import android.widget.Button; +import android.widget.Toast; public class Remote_01 extends Activity implements OnGestureListener { @@ -164,6 +163,10 @@ PostCommand("rewind"); } }); + + Toast.makeText(this, + "swipe to left for more", Toast.LENGTH_LONG) + .show(); } public void PostCommand(String button) { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Settings.java 2010-12-10 11:12:42 UTC (rev 4026) @@ -26,5 +26,5 @@ public static String Server = "192.168.0.30"; public static String Port = "8200"; public static String MacId = "11-22-33-44-55-66"; - + public static Boolean Vibrate= true; } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-10 11:12:42 UTC (rev 4026) @@ -21,23 +21,29 @@ package mediaportal.remote; +import java.io.IOException; +import java.io.InputStream; + import mediaportal.remote.R; import android.app.Activity; +import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.content.res.AssetManager; import android.os.Bundle; +import android.os.Vibrator; import android.view.View; import android.widget.*; public class main extends Activity { private static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); - + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); @@ -48,6 +54,7 @@ ImageButton btnPictures = (ImageButton) findViewById(R.id.btn_main_pictures); btnPictures.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); Intent myIntent = new Intent(view.getContext(), pictures.class); startActivityForResult(myIntent, 0); } @@ -56,6 +63,7 @@ ImageButton btnMusic = (ImageButton) findViewById(R.id.btn_main_music); btnMusic.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); Intent myIntent = new Intent(view.getContext(), musicTab.class); startActivityForResult(myIntent, 0); } @@ -64,13 +72,17 @@ ImageButton btnVideo = (ImageButton) findViewById(R.id.btn_main_video); btnVideo.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Toast.makeText(view.getContext(), "not implemented yet. Sorry !", Toast.LENGTH_LONG).show(); + DoVibrate(); + Toast.makeText(view.getContext(), + "not implemented yet. Sorry !", Toast.LENGTH_LONG) + .show(); } }); ImageButton btnRemote = (ImageButton) findViewById(R.id.btn_main_remote); btnRemote.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); Intent myIntent = new Intent(view.getContext(), Remote_01.class); startActivityForResult(myIntent, 0); } @@ -79,6 +91,7 @@ ImageButton btnNowPlaying = (ImageButton) findViewById(R.id.btn_main_now_playing); btnNowPlaying.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); Intent myIntent = new Intent(view.getContext(), nowplaying.class); startActivityForResult(myIntent, 0); @@ -88,12 +101,65 @@ ImageButton btnSettings = (ImageButton) findViewById(R.id.btn_main_settings); btnSettings.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), - setup.class); + DoVibrate(); + Intent myIntent = new Intent(view.getContext(), setup.class); startActivityForResult(myIntent, 0); } }); + + ImageButton skipForw = (ImageButton) findViewById(R.id.btn_main_skp_forw); + skipForw.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + DoVibrate(); + PostCommand("nextItem"); + } + }); + + ImageButton skipBack = (ImageButton) findViewById(R.id.btn_main_skp_back); + skipBack.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + DoVibrate(); + PostCommand("prevItem"); + } + }); + + ImageButton play = (ImageButton) findViewById(R.id.btn_main_play); + play.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + DoVibrate(); + PostCommand("play"); + } + }); } - + public void PostCommand(String button) { + + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); + + AssetManager assetManager = getAssets(); + String xml = ""; + + try { + InputStream inputStream = null; + inputStream = assetManager.open("cmd_" + button + ".xml"); + + int x = inputStream.read(); + + while (x != -1) { + xml = xml + (char) x; + x = inputStream.read(); + } + post.Post(xml); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void DoVibrate() { + if (Settings.Vibrate) { + // Get instance of Vibrator from current Context + Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); + v.vibrate(100); + } + } } \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-12-10 11:12:42 UTC (rev 4026) @@ -41,7 +41,6 @@ ImageButton btn1 = (ImageButton) findViewById(R.id.now_prev); ImageButton btn2 = (ImageButton) findViewById(R.id.now_stop); - ImageButton btn3 = (ImageButton) findViewById(R.id.now_pause); ImageButton btn4 = (ImageButton) findViewById(R.id.now_play); ImageButton btn5 = (ImageButton) findViewById(R.id.now_next); ImageButton btn6 = (ImageButton) findViewById(R.id.now_list); @@ -56,11 +55,7 @@ PostCommand("stop"); } }); - btn3.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - PostCommand("pause"); - } - }); + btn4.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { PostCommand("play"); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-12-10 11:12:42 UTC (rev 4026) @@ -25,6 +25,7 @@ import android.app.Activity; import android.content.SharedPreferences; import android.os.Bundle; +import android.widget.CheckBox; import android.widget.EditText; public class setup extends Activity { @@ -47,14 +48,17 @@ Settings.Server = settings.getString("Server", "192.168.0.30"); Settings.Port = settings.getString("Port", "8200"); Settings.MacId = settings.getString("MacId", "11-22-33-44-55-66"); + Settings.Vibrate = settings.getBoolean("Vibrate", true); EditText txt1 = (EditText)findViewById(R.id.server_ip); EditText txt2 = (EditText)findViewById(R.id.server_port); EditText txt3 = (EditText)findViewById(R.id.server_macid); + CheckBox chk = (CheckBox)findViewById(R.id.vibration); txt1.setText(Settings.Server); txt2.setText(Settings.Port); txt3.setText(Settings.MacId); + chk.setChecked(Settings.Vibrate); } @Override @@ -64,6 +68,7 @@ EditText txt1 = (EditText)findViewById(R.id.server_ip); EditText txt2 = (EditText)findViewById(R.id.server_port); EditText txt3 = (EditText)findViewById(R.id.server_macid); + CheckBox chk = (CheckBox)findViewById(R.id.vibration); SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); SharedPreferences.Editor prefEditor = settings.edit(); @@ -71,10 +76,12 @@ prefEditor.putString("Server", txt1.getText().toString()); prefEditor.putString("Port",txt2.getText().toString()); prefEditor.putString("MacId", txt3.getText().toString()); + prefEditor.putBoolean("Vibrate", chk.isChecked()); prefEditor.commit(); Settings.Server = settings.getString("Server", "192.168.0.30"); Settings.Port = settings.getString("Port", "8200"); Settings.MacId = settings.getString("MacId", "11-22-33-44-55-66"); + Settings.Vibrate = settings.getBoolean("Vibrate", true); } } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java 2010-12-10 08:51:46 UTC (rev 4025) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java 2010-12-10 11:12:42 UTC (rev 4026) @@ -29,7 +29,7 @@ public class splash extends Activity { - private final int SPLASH_DISPLAY_LENGHT = 1500; + private final int SPLASH_DISPLAY_LENGHT = 2000; @Override public void onCreate(Bundle icicle) { Modified: trunk/plugins/AndroidRemote/Release/settings.jpg =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2010-12-11 09:50:54
|
Revision: 4028 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4028&view=rev Author: kroko_koenig Date: 2010-12-11 09:50:46 +0000 (Sat, 11 Dec 2010) Log Message: ----------- music part almost... Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java trunk/plugins/AndroidRemote/Release/setup2.jpg trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/music_menu.xml Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-11 09:50:46 UTC (rev 4028) @@ -123,6 +123,7 @@ public static final int btn_main_skp_back=0x7f06000e; public static final int btn_main_skp_forw=0x7f060010; public static final int btn_main_video=0x7f060009; + public static final int clearplaylist=0x7f060050; public static final int full_text=0x7f060018; public static final int icon_image=0x7f060001; public static final int icon_text=0x7f060002; @@ -146,14 +147,16 @@ public static final int now_progress=0x7f06001e; public static final int now_stop=0x7f060024; public static final int now_title=0x7f060021; - public static final int open=0x7f060050; - public static final int rslide=0x7f060053; - public static final int save=0x7f06004f; - public static final int send=0x7f060051; + public static final int open=0x7f060053; + public static final int playlist=0x7f06004f; + public static final int rslide=0x7f060056; + public static final int save=0x7f060052; + public static final int sdcard=0x7f060051; + public static final int send=0x7f060054; public static final int server_ip=0x7f06004a; public static final int server_macid=0x7f06004c; public static final int server_port=0x7f06004b; - public static final int slide=0x7f060052; + public static final int slide=0x7f060055; public static final int title=0x7f06004e; public static final int vibration=0x7f06004d; public static final int widget0=0x7f060011; @@ -185,7 +188,8 @@ public static final int title=0x7f030011; } public static final class menu { - public static final int picturefullscreenmenu=0x7f050000; + public static final int music_menu=0x7f050000; + public static final int picturefullscreenmenu=0x7f050001; } public static final class string { public static final int app_name=0x7f040000; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playnowlist.xml 2010-12-11 09:50:46 UTC (rev 4028) @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" - android:background="@drawable/back" - android:layout_height="fill_parent"> + android:layout_height="fill_parent" + android:background="@drawable/brush"> <TextView android:id="@+id/TextView01" android:layout_height="wrap_content" android:text="Actual playlist" android:textStyle="normal|bold" android:gravity="center_vertical|center_horizontal" - android:layout_width="fill_parent"></TextView> + android:layout_width="fill_parent" android:background="#FFA9A9A9" android:textColor="#000" android:textSize="18dip"></TextView> <ListView android:id="@+id/ListView01" android:layout_height="wrap_content" android:layout_width="fill_parent"> </ListView> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml 2010-12-11 09:50:46 UTC (rev 4028) @@ -18,9 +18,8 @@ android:gravity="center_horizontal"> </TextView> - <ImageView android:id="@+id/now_cd" android:layout_width="200dip" - android:layout_height="200dip" android:scaleType="centerCrop" - android:background="@drawable/cdcover" android:layout_gravity="center_horizontal"> + <ImageView android:id="@+id/now_cd" android:scaleType="centerCrop" + android:background="@drawable/cdcover" android:layout_gravity="center_horizontal" android:layout_height="180dip" android:layout_width="180dip"> </ImageView> <SeekBar android:id="@+id/now_progress" android:layout_width="fill_parent" @@ -60,15 +59,15 @@ <LinearLayout android:layout_height="wrap_content" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_gravity="center_horizontal"> <ImageButton android:id="@+id/now_prev" - android:background="@drawable/skip_back" android:layout_width="60dip" android:layout_height="40dip"/> + android:background="@drawable/skip_back" android:layout_width="60dip" android:layout_height="60dip"/> <ImageButton android:id="@+id/now_stop" - android:background="@drawable/stop" android:layout_width="60dip" android:layout_height="40dip"/> + android:background="@drawable/stop" android:layout_width="60dip" android:layout_height="60dip"/> <ImageButton android:id="@+id/now_play" - android:background="@drawable/right" android:layout_width="60dip" android:layout_height="40dip"/> + android:background="@drawable/right" android:layout_width="60dip" android:layout_height="60dip"/> <ImageButton android:id="@+id/now_next" - android:background="@drawable/skip_forward" android:layout_width="60dip" android:layout_height="40dip"/> + android:background="@drawable/skip_forward" android:layout_width="60dip" android:layout_height="60dip"/> <ImageButton android:id="@+id/now_list" - android:background="@drawable/document" android:layout_width="60dip" android:layout_height="40dip"/> + android:background="@drawable/document" android:layout_width="60dip" android:layout_height="60dip"/> </LinearLayout> </LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/music_menu.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/music_menu.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/menu/music_menu.xml 2010-12-11 09:50:46 UTC (rev 4028) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + + + + + +<item android:id="@+id/playlist" android:title="Add to playlist"></item> +<item android:id="@+id/clearplaylist" android:title="Clear playlist"></item><item android:id="@+id/sdcard" android:title="Save to SD card"></item> + +</menu> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbHandler.java 2010-12-11 09:50:46 UTC (rev 4028) @@ -53,6 +53,10 @@ public ArrayList<DbItems> GetSongsByArtist(String Artist) { return fetchData("song.xml?artist=" + Artist); } + + public ArrayList<DbItems> GetSongsByAlbum(String AlbumArtist) { + return fetchData("song.xml?album=" + AlbumArtist); + } private ArrayList<DbItems> fetchData(String Data) { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-11 09:50:46 UTC (rev 4028) @@ -25,9 +25,11 @@ import java.io.InputStream; import mediaportal.remote.R; import android.app.Activity; +import android.content.Context; import android.content.Intent; import android.content.res.AssetManager; import android.os.Bundle; +import android.os.Vibrator; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; @@ -55,6 +57,7 @@ Button can = (Button) findViewById(R.id.btnBack); can.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("previousMenu"); } }); @@ -62,6 +65,7 @@ Button menu = (Button) findViewById(R.id.btnMenu); menu.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("contextMenu"); } }); @@ -69,6 +73,7 @@ Button home = (Button) findViewById(R.id.btnHome); home.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("parentDir"); } }); @@ -76,6 +81,7 @@ Button info = (Button) findViewById(R.id.btnInfo); info.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("showInfo"); } }); @@ -83,6 +89,7 @@ Button left = (Button) findViewById(R.id.btnLeft); left.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("moveLeft"); } }); @@ -90,6 +97,7 @@ Button right = (Button) findViewById(R.id.btnRight); right.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("moveRight"); } }); @@ -97,6 +105,7 @@ Button up = (Button) findViewById(R.id.btnUp); up.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("moveUp"); } }); @@ -104,6 +113,7 @@ Button down = (Button) findViewById(R.id.btnDown); down.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("moveDown"); } }); @@ -111,6 +121,7 @@ Button ok = (Button) findViewById(R.id.btnOk); ok.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("selectItem"); } }); @@ -125,6 +136,7 @@ Button pause = (Button) findViewById(R.id.btnPause); pause.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("pause"); } }); @@ -132,6 +144,7 @@ Button stop = (Button) findViewById(R.id.btnStop); stop.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("stop"); } }); @@ -139,6 +152,7 @@ Button skipForw = (Button) findViewById(R.id.btnSkipForw); skipForw.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("nextItem"); } }); @@ -146,6 +160,7 @@ Button skipBack = (Button) findViewById(R.id.btnSkipBack); skipBack.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("prevItem"); } }); @@ -153,6 +168,7 @@ Button fForw = (Button) findViewById(R.id.btnFForw); fForw.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("forward"); } }); @@ -160,6 +176,7 @@ Button fBackw = (Button) findViewById(R.id.btnFBack); fBackw.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("rewind"); } }); @@ -231,4 +248,12 @@ public boolean onSingleTapUp(MotionEvent arg0) { return false; } + + public void DoVibrate() { + if (Settings.Vibrate) { + // Get instance of Vibrator from current Context + Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); + v.vibrate(100); + } + } } \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-11 09:50:46 UTC (rev 4028) @@ -25,9 +25,11 @@ import java.io.InputStream; import mediaportal.remote.R; import android.app.Activity; +import android.content.Context; import android.content.Intent; import android.content.res.AssetManager; import android.os.Bundle; +import android.os.Vibrator; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; @@ -54,18 +56,21 @@ Button btnVolumeUp = (Button) findViewById(R.id.btnVolumeUp); btnVolumeUp.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("volumeUp"); } }); Button btnVolumeDown = (Button) findViewById(R.id.btnVolumeDown); btnVolumeDown.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("volumeDown"); } }); Button btnVolumeMute = (Button) findViewById(R.id.btnVolumeMute); btnVolumeMute.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("volumeMute"); } }); @@ -73,12 +78,14 @@ Button btnChannelUp = (Button) findViewById(R.id.btnChannelUp); btnChannelUp.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("nextChannel"); } }); Button btnChannelDown = (Button) findViewById(R.id.btnChannelDown); btnChannelDown.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("prevChannel"); } }); @@ -86,6 +93,7 @@ Button btnExit = (Button) findViewById(R.id.btnExit); btnExit.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("exit"); } }); @@ -98,12 +106,14 @@ Button btnHibernate = (Button) findViewById(R.id.btnHibernate); btnHibernate.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("hibernate"); } }); Button btnRestart = (Button) findViewById(R.id.btnRestart); btnRestart.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("restart"); } }); @@ -117,6 +127,7 @@ Button btnWakeOnLan = (Button) findViewById(R.id.btnWakeOnLan); btnWakeOnLan.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { + DoVibrate(); PostCommand("wakeonlan"); } }); @@ -185,4 +196,12 @@ public boolean onSingleTapUp(MotionEvent arg0) { return false; } + + public void DoVibrate() { + if (Settings.Vibrate) { + // Get instance of Vibrator from current Context + Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); + v.vibrate(100); + } + } } \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-11 09:50:46 UTC (rev 4028) @@ -25,6 +25,7 @@ import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; @@ -52,17 +53,25 @@ ListView l1 = (ListView) findViewById(R.id.list_album); l1.setAdapter(new EfficientAdapter(musicAlbum.this)); + l1.setOnItemClickListener(new AdapterView.OnItemClickListener() + { + //@override + public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, + long arg3) { + + ReceiveDbXmlHandler.DbItems item = albumList.get(arg2); + + musicResults.Select = item.Album + "&" + item.Artist; + musicResults.Mode = musicResults.SelectMode.Album; + + Intent myIntent = new Intent(arg1.getContext(), musicResults.class); + startActivityForResult(myIntent, 0); + } + }); + ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); l1.setDividerHeight(2); - - l1.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { - public boolean onItemLongClick(AdapterView<?> arg0, View arg1, - int arg2, long arg3) { - // TODO Auto-generated method stub - return false; - } - }); } @Override Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-11 09:50:46 UTC (rev 4028) @@ -60,7 +60,10 @@ long arg3) { ReceiveDbXmlHandler.DbItems item = artistList.get(arg2); + musicResults.Select = item.Artist; + musicResults.Mode = musicResults.SelectMode.Artist; + Intent myIntent = new Intent(arg1.getContext(), musicResults.class); startActivityForResult(myIntent, 0); } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-11 09:50:46 UTC (rev 4028) @@ -23,18 +23,18 @@ import java.util.ArrayList; import android.app.Activity; +import android.app.AlertDialog; import android.content.Context; +import android.content.DialogInterface; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.os.Handler; import android.util.Log; -import android.view.ContextMenu; import android.view.LayoutInflater; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.view.ContextMenu.ContextMenuInfo; +import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; @@ -42,13 +42,23 @@ public class musicResults extends Activity { + public static enum SelectMode + { + Artist,Album; + } + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); private static ArrayList<ReceiveDbXmlHandler.DbItems> itemList; public static String Select = ""; - + public static SelectMode Mode; + + ReceiveDbXmlHandler.DbItems selectedItem = null; + final CharSequence[] items = { "Add to playlist", "Clear playlist", + "Save to SD card", "Cancel" }; + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.music_results); @@ -60,37 +70,78 @@ l1.setDivider(divcolor); l1.setDividerHeight(2); - registerForContextMenu(l1); + l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { + // @override + public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, + long arg3) { + + selectedItem = itemList.get(arg2); + + AlertDialog.Builder builder = new AlertDialog.Builder(arg0 + .getContext()); + builder.setTitle(selectedItem.Title); + builder.setItems(items, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int item) { + switch (item) { + case 0: + PostAddItem(selectedItem); + Toast.makeText(musicResults.this, + selectedItem.Title + " has been added", Toast.LENGTH_SHORT).show(); + break; + case 1: + PostClear(); + Toast.makeText(musicResults.this, "Playlist has been cleared", Toast.LENGTH_SHORT).show(); + break; + case 2: + SavetoSDCard(); + Toast.makeText(musicResults.this, + selectedItem.Title + " has been transferd", Toast.LENGTH_SHORT).show(); + break; + } + } + }); + AlertDialog alert = builder.create(); + alert.show(); + } + }); } - @Override - public void onCreateContextMenu(ContextMenu menu, View v, - ContextMenuInfo menuInfo) { - super.onCreateContextMenu(menu, v, menuInfo); - menu.setHeaderTitle("Select action"); + public void PostClear() { - menu.add(0, 101, 0, "Add title to playlist"); - menu.add(0, 102, 0, "Download title to SD"); + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); - ListView l1 = (ListView) findViewById(R.id.list_result); - int x = l1.getSelectedItemPosition(); - if (x == -1) - x = 0; - if (itemList.size() > 0) { - ReceiveDbXmlHandler.DbItems itm = itemList.get(x); + String xml = ""; - httpHandler http = new httpHandler(); - http.DownloadFile(); - } - x = 1; + xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; + xml += "<message>"; + xml += "<command>CLEAR_PLAYLIST</command>"; + xml += "</message>"; + + post.Post(xml); } - @Override - public boolean onContextItemSelected(MenuItem item) { - // item.id == - return true; + public void PostAddItem(ReceiveDbXmlHandler.DbItems Item) { + + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); + + String xml = ""; + + xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; + xml += "<message>"; + xml += "<command>ADD_MUSIC</command>"; + xml += "<filename>" + Item.Filename + "</filename>"; + xml += "<artist>" + Item.Artist + "</artist>"; + xml += "<title>" + Item.Title + "</title>"; + xml += "<duration>" + Item.Duration + "</duration>"; + xml += "</message>"; + + post.Post(xml); } + private void SavetoSDCard() { + + } + @Override public void onStart() { super.onStart(); @@ -110,7 +161,10 @@ Log.d("update search", "do update"); ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); + if(Mode == SelectMode.Artist) itemList = handler.GetSongsByArtist(Select); + if(Mode == SelectMode.Album) + itemList = handler.GetSongsByAlbum(Select); if (itemList.size() == 0) { Toast.makeText(musicResults.this, "TIME OUT SERVER", Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-11 09:50:46 UTC (rev 4028) @@ -23,7 +23,9 @@ import java.util.ArrayList; import android.app.Activity; +import android.app.AlertDialog; import android.content.Context; +import android.content.DialogInterface; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; @@ -46,6 +48,10 @@ public static String Select = ""; + ReceiveDbXmlHandler.DbItems selectedItem = null; + final CharSequence[] items = { "Add to playlist", "Clear playlist", + "Save to SD card", "Cancel" }; + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.music_song); @@ -62,11 +68,33 @@ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { - ReceiveDbXmlHandler.DbItems item = songList.get(arg2); - PostAddItem(item); - Toast.makeText(musicSong.this, - "Title " + item.Title + " has been added", - Toast.LENGTH_SHORT).show(); + selectedItem = songList.get(arg2); + + AlertDialog.Builder builder = new AlertDialog.Builder(arg0 + .getContext()); + builder.setTitle(selectedItem.Title); + builder.setItems(items, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int item) { + switch (item) { + case 0: + PostAddItem(selectedItem); + Toast.makeText(musicSong.this, + selectedItem.Title + " has been added", Toast.LENGTH_SHORT).show(); + break; + case 1: + PostClear(); + Toast.makeText(musicSong.this, "Playlist has been cleared", Toast.LENGTH_SHORT).show(); + break; + case 2: + SavetoSDCard(); + Toast.makeText(musicSong.this, + selectedItem.Title + " has been transferd", Toast.LENGTH_SHORT).show(); + break; + } + } + }); + AlertDialog alert = builder.create(); + alert.show(); } }); } @@ -133,6 +161,10 @@ post.Post(xml); } + private void SavetoSDCard() { + + } + private static class EfficientAdapter extends BaseAdapter { private LayoutInflater mInflater; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java 2010-12-11 09:50:46 UTC (rev 4028) @@ -13,7 +13,9 @@ import org.apache.http.params.HttpParams; import android.app.Activity; +import android.app.AlertDialog; import android.content.Context; +import android.content.DialogInterface; import android.content.SharedPreferences; import android.content.res.AssetManager; import android.graphics.Color; @@ -89,6 +91,9 @@ public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); + final CharSequence[] items = { "Delete item", "Clear playlist", "Cancel" }; + private nowplaylisthandler.PlayListItem selectedItem; + /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { @@ -97,15 +102,38 @@ ListView l1 = (ListView) findViewById(R.id.ListView01); l1.setAdapter(new EfficientAdapter(this)); - l1.setOnItemClickListener(new AdapterView.OnItemClickListener() - { - //@override + + l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { + // @override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, - long arg3) { - //Toast.makeText(getBaseContext(), "You clicked "+country[arg2], Toast.LENGTH_LONG).show(); - } + long arg3) { + + selectedItem = nowplaylisthandler.PlayList.get(arg2); + + AlertDialog.Builder builder = new AlertDialog.Builder(arg0 + .getContext()); + builder.setTitle(selectedItem.Title); + builder.setItems(items, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int item) { + switch (item) { + case 0: + + mHandler.postDelayed(mUpdateTimeTask, 100); + Toast.makeText(nowplaylist.this, + selectedItem.Title + " has been deleted", Toast.LENGTH_SHORT).show(); + break; + case 1: + PostClear(); + mHandler.postDelayed(mUpdateTimeTask, 100); + Toast.makeText(nowplaylist.this, "Playlist has been cleared", Toast.LENGTH_SHORT).show(); + break; + } + } + }); + AlertDialog alert = builder.create(); + alert.show(); } - ); + }); ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); @@ -115,6 +143,38 @@ Toast.LENGTH_LONG).show(); } + public void PostClear() { + + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); + + String xml = ""; + + xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; + xml += "<message>"; + xml += "<command>CLEAR_PLAYLIST</command>"; + xml += "</message>"; + + post.Post(xml); + } + + public void PostAddItem(ReceiveDbXmlHandler.DbItems Item) { + + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); + + String xml = ""; + + xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; + xml += "<message>"; + xml += "<command>ADD_MUSIC</command>"; + xml += "<filename>" + Item.Filename + "</filename>"; + xml += "<artist>" + Item.Artist + "</artist>"; + xml += "<title>" + Item.Title + "</title>"; + xml += "<duration>" + Item.Duration + "</duration>"; + xml += "</message>"; + + post.Post(xml); + } + @Override public void onStart() { super.onStart(); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-12-11 09:50:46 UTC (rev 4028) @@ -23,38 +23,52 @@ import mediaportal.remote.R; import android.app.Activity; +import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; +import android.os.Vibrator; import android.widget.CheckBox; import android.widget.EditText; +import android.widget.CompoundButton; public class setup extends Activity { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - + /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.setup); + + CheckBox chk = (CheckBox) findViewById(R.id.vibration); + chk.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + public void onCheckedChanged(CompoundButton buttonView, + boolean isChecked) { + if (isChecked) { + DoVibrate(); + } + } + }); } - + @Override public void onResume() { super.onResume(); - - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); + Settings.Server = settings.getString("Server", "192.168.0.30"); Settings.Port = settings.getString("Port", "8200"); Settings.MacId = settings.getString("MacId", "11-22-33-44-55-66"); Settings.Vibrate = settings.getBoolean("Vibrate", true); - - EditText txt1 = (EditText)findViewById(R.id.server_ip); - EditText txt2 = (EditText)findViewById(R.id.server_port); - EditText txt3 = (EditText)findViewById(R.id.server_macid); - CheckBox chk = (CheckBox)findViewById(R.id.vibration); - + + EditText txt1 = (EditText) findViewById(R.id.server_ip); + EditText txt2 = (EditText) findViewById(R.id.server_port); + EditText txt3 = (EditText) findViewById(R.id.server_macid); + CheckBox chk = (CheckBox) findViewById(R.id.vibration); + txt1.setText(Settings.Server); txt2.setText(Settings.Port); txt3.setText(Settings.MacId); @@ -65,23 +79,32 @@ public void onPause() { super.onPause(); - EditText txt1 = (EditText)findViewById(R.id.server_ip); - EditText txt2 = (EditText)findViewById(R.id.server_port); - EditText txt3 = (EditText)findViewById(R.id.server_macid); - CheckBox chk = (CheckBox)findViewById(R.id.vibration); + EditText txt1 = (EditText) findViewById(R.id.server_ip); + EditText txt2 = (EditText) findViewById(R.id.server_port); + EditText txt3 = (EditText) findViewById(R.id.server_macid); + CheckBox chk = (CheckBox) findViewById(R.id.vibration); - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); SharedPreferences.Editor prefEditor = settings.edit(); - + prefEditor.putString("Server", txt1.getText().toString()); - prefEditor.putString("Port",txt2.getText().toString()); + prefEditor.putString("Port", txt2.getText().toString()); prefEditor.putString("MacId", txt3.getText().toString()); prefEditor.putBoolean("Vibrate", chk.isChecked()); prefEditor.commit(); - + Settings.Server = settings.getString("Server", "192.168.0.30"); Settings.Port = settings.getString("Port", "8200"); Settings.MacId = settings.getString("MacId", "11-22-33-44-55-66"); Settings.Vibrate = settings.getBoolean("Vibrate", true); } + + public void DoVibrate() { + if (Settings.Vibrate) { + // Get instance of Vibrator from current Context + Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); + v.vibrate(100); + } + } } Modified: trunk/plugins/AndroidRemote/Release/setup2.jpg =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs 2010-12-11 09:50:46 UTC (rev 4028) @@ -29,27 +29,16 @@ private void InitializeComponent() { this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label4 = new System.Windows.Forms.Label(); + this.btnCopy = new System.Windows.Forms.Button(); + this.txtMyIP = new System.Windows.Forms.Label(); this.txtPort = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.txtServer = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.btnSave = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.btnVideos = new System.Windows.Forms.Button(); - this.btnMusic = new System.Windows.Forms.Button(); - this.btnPic = new System.Windows.Forms.Button(); - this.txtVideos = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.txtMusic = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.txtPic = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.txtMyIP = new System.Windows.Forms.Label(); - this.btnCopy = new System.Windows.Forms.Button(); - this.label4 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); - this.groupBox2.SuspendLayout(); this.SuspendLayout(); // // groupBox1 @@ -68,6 +57,36 @@ this.groupBox1.TabStop = false; this.groupBox1.Text = "Command controller"; // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.Location = new System.Drawing.Point(286, 32); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(23, 16); + this.label4.TabIndex = 6; + this.label4.Text = "IP:"; + // + // btnCopy + // + this.btnCopy.Location = new System.Drawing.Point(287, 54); + this.btnCopy.Name = "btnCopy"; + this.btnCopy.Size = new System.Drawing.Size(75, 23); + this.btnCopy.TabIndex = 5; + this.btnCopy.Text = "use this IP"; + this.btnCopy.UseVisualStyleBackColor = true; + this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click); + // + // txtMyIP + // + this.txtMyIP.AutoSize = true; + this.txtMyIP.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtMyIP.Location = new System.Drawing.Point(315, 32); + this.txtMyIP.Name = "txtMyIP"; + this.txtMyIP.Size = new System.Drawing.Size(41, 16); + this.txtMyIP.TabIndex = 4; + this.txtMyIP.Text = "my IP"; + // // txtPort // this.txtPort.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -107,7 +126,7 @@ // btnSave // this.btnSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnSave.Location = new System.Drawing.Point(12, 296); + this.btnSave.Location = new System.Drawing.Point(12, 114); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(84, 29); this.btnSave.TabIndex = 1; @@ -118,7 +137,7 @@ // btnCancel // this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(419, 296); + this.btnCancel.Location = new System.Drawing.Point(419, 114); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(84, 29); this.btnCancel.TabIndex = 2; @@ -126,147 +145,11 @@ this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); // - // groupBox2 - // - this.groupBox2.Controls.Add(this.btnVideos); - this.groupBox2.Controls.Add(this.btnMusic); - this.groupBox2.Controls.Add(this.btnPic); - this.groupBox2.Controls.Add(this.txtVideos); - this.groupBox2.Controls.Add(this.label7); - this.groupBox2.Controls.Add(this.txtMusic); - this.groupBox2.Controls.Add(this.label5); - this.groupBox2.Controls.Add(this.txtPic); - this.groupBox2.Controls.Add(this.label3); - this.groupBox2.Location = new System.Drawing.Point(12, 114); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(491, 164); - this.groupBox2.TabIndex = 3; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Share"; - // - // btnVideos - // - this.btnVideos.Location = new System.Drawing.Point(445, 93); - this.btnVideos.Name = "btnVideos"; - this.btnVideos.Size = new System.Drawing.Size(40, 23); - this.btnVideos.TabIndex = 9; - this.btnVideos.Text = "..."; - this.btnVideos.UseVisualStyleBackColor = true; - this.btnVideos.Click += new System.EventHandler(this.btnVideos_Click); - // - // btnMusic - // - this.btnMusic.Location = new System.Drawing.Point(445, 61); - this.btnMusic.Name = "btnMusic"; - this.btnMusic.Size = new System.Drawing.Size(40, 23); - this.btnMusic.TabIndex = 8; - this.btnMusic.Text = "..."; - this.btnMusic.UseVisualStyleBackColor = true; - this.btnMusic.Click += new System.EventHandler(this.btnMusic_Click); - // - // btnPic - // - this.btnPic.Location = new System.Drawing.Point(445, 29); - this.btnPic.Name = "btnPic"; - this.btnPic.Size = new System.Drawing.Size(40, 23); - this.btnPic.TabIndex = 7; - this.btnPic.Text = "..."; - this.btnPic.UseVisualStyleBackColor = true; - this.btnPic.Click += new System.EventHandler(this.btnPic_Click); - // - // txtVideos - // - this.txtVideos.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtVideos.Location = new System.Drawing.Point(36, 96); - this.txtVideos.Name = "txtVideos"; - this.txtVideos.Size = new System.Drawing.Size(392, 16); - this.txtVideos.TabIndex = 6; - this.txtVideos.Text = "..."; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label7.Location = new System.Drawing.Point(14, 80); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(51, 16); - this.label7.TabIndex = 5; - this.label7.Text = "Videos"; - // - // txtMusic - // - this.txtMusic.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtMusic.Location = new System.Drawing.Point(36, 64); - this.txtMusic.Name = "txtMusic"; - this.txtMusic.Size = new System.Drawing.Size(392, 16); - this.txtMusic.TabIndex = 4; - this.txtMusic.Text = "..."; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label5.Location = new System.Drawing.Point(14, 48); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(43, 16); - this.label5.TabIndex = 3; - this.label5.Text = "Music"; - // - // txtPic - // - this.txtPic.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtPic.Location = new System.Drawing.Point(36, 32); - this.txtPic.Name = "txtPic"; - this.txtPic.Size = new System.Drawing.Size(392, 16); - this.txtPic.TabIndex = 2; - this.txtPic.Text = "..."; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label3.Location = new System.Drawing.Point(14, 16); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(56, 16); - this.label3.TabIndex = 1; - this.label3.Text = "Pictures"; - // - // txtMyIP - // - this.txtMyIP.AutoSize = true; - this.txtMyIP.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtMyIP.Location = new System.Drawing.Point(315, 32); - this.txtMyIP.Name = "txtMyIP"; - this.txtMyIP.Size = new System.Drawing.Size(41, 16); - this.txtMyIP.TabIndex = 4; - this.txtMyIP.Text = "my IP"; - // - // btnCopy - // - this.btnCopy.Location = new System.Drawing.Point(287, 54); - this.btnCopy.Name = "btnCopy"; - this.btnCopy.Size = new System.Drawing.Size(75, 23); - this.btnCopy.TabIndex = 5; - this.btnCopy.Text = "use this IP"; - this.btnCopy.UseVisualStyleBackColor = true; - this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click); - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label4.Location = new System.Drawing.Point(286, 32); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(23, 16); - this.label4.TabIndex = 6; - this.label4.Text = "IP:"; - // // Setup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(515, 337); - this.Controls.Add(this.groupBox2); + this.ClientSize = new System.Drawing.Size(511, 155); this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnSave); this.Controls.Add(this.groupBox1); @@ -281,8 +164,6 @@ this.Load += new System.EventHandler(this.Setup_Load); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); this.ResumeLayout(false); } @@ -296,16 +177,6 @@ private System.Windows.Forms.Label label1; private System.Windows.Forms.Button btnSave; private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.Button btnVideos; - private System.Windows.Forms.Button btnMusic; - private System.Windows.Forms.Button btnPic; - private System.Windows.Forms.Label txtVideos; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label txtMusic; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label txtPic; - private System.Windows.Forms.Label label3; private System.Windows.Forms.Label txtMyIP; private System.Windows.Forms.Button btnCopy; private System.Windows.Forms.Label label4; Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs 2010-12-11 06:12:57 UTC (rev 4027) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs 2010-12-11 09:50:46 UTC (rev 4028) @@ -61,13 +61,6 @@ { txtServer.Text = xmlreader.GetValueAsString("android", "server", "192.168.0.30"); txtPort.Text = xmlreader.GetValueAsString("android", "port", "8200"); - - txtPic.Text = xmlreader.GetValueAsString("android", "pictures", - Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)); - txtMusic.Text = xmlreader.GetValueAsString("android", "music", - Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)); - txtVideos.Text = xmlreader.GetValueAsString("android", "videos", - Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); } } private void SaveSettings() @@ -77,10 +70,6 @@ { xmlwriter.SetValue("android", "server", txtServer.Text); xmlwriter.SetValue("android", "port", txtPort.Text); - - xmlwriter.SetValue("android", "pictures", txtPic.Text); - xmlwriter.SetValue("android", "music", txtMusic.Text); - xmlwriter.SetValue("android", "videos", txtVideos.Text); } } @@ -94,39 +83,6 @@ this.Close(); } - private void btnPic_Click(object sender, EventArgs e) - { - FolderBrowserDialog folder = new FolderBrowserDialog(); - folder.SelectedPath = txtPic.Text; - - DialogResult res = folder.ShowDialog(); - if (res == DialogResult.OK) - { - txtPic.Text = folder.SelectedPath; - } - } - private void btnMusic_Click(object sender, EventArgs e) - { - FolderBrowserDialog folder = new FolderBrowserDialog(); - folder.SelectedPath = txtMusic.Text; - - DialogResult res = folder.ShowDialog(); - if (res == DialogResult.OK) - { - txtMusic.Text = folder.SelectedPath; - } - } - private void btnVideos_Click(object sender, EventArgs e) - { - FolderBrowserDialog folder = new FolderBrowserDialog(); - folder.SelectedPath = txtVideos.Text; - - DialogResult res = folder.ShowDialog(); - if (res == DialogResult.OK) - { - txtVideos.Text = folder.SelectedPath; - } - } private void btnCopy_Click(object sender, EventArgs e) { txtServer.Text = txtMyIP.Text; 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. |
From: <kro...@us...> - 2010-12-11 11:49:07
|
Revision: 4029 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4029&view=rev Author: kroko_koenig Date: 2010-12-11 11:49:00 +0000 (Sat, 11 Dec 2010) Log Message: ----------- so far... Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme 2010-12-11 09:50:46 UTC (rev 4028) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme 2010-12-11 11:49:00 UTC (rev 4029) @@ -11,6 +11,11 @@ Music section ------------- browse folders (MP shares) +browse MP database for artist,albums,songs +add title to playlist +view playlist +delete item from playlist +clear playlist Video section ------------- @@ -21,17 +26,19 @@ show actual title show actual time show actual cover +clear playlist +delete one item Remote ------ most functions as on my remote +two more buttons for subtitle / osd - Main issues ------------ -Vibration (on/off settings) -Vibration feedback +Vibration feedback (not completed) Check if WIFI is on -gesture control for pictures (swipe) +gesture control for pictures (swipe) / alertdialog save files from Android to MP if the MP has no focus the remote doesnt work (normal) +Progress is not displayed Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-11 09:50:46 UTC (rev 4028) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-11 11:49:00 UTC (rev 4029) @@ -44,8 +44,10 @@ private Handler mHandler = new Handler(); private String actualDir = ""; + private static ArrayList<ReceiveDirectoryXmlHandler.DirItems> musicList; - + private static ReceiveDirectoryXmlHandler.DirItems selectedItem; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -55,7 +57,7 @@ mHandler.postDelayed(mUpdateTimeTask, 100); GridView gridview = (GridView) findViewById(R.id.music_grid); - gridview.setAdapter(new ImageAdapter2(MusicDir.this)); + gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { @@ -66,14 +68,16 @@ musicItem music = (musicItem) iv.getTag(); if (music.typ == "item") { - // Picturesfullscreen.selectedPicture = position - 1; - // Intent myIntent = new Intent(MusicDir.this, - // Picturesfullscreen.class); - // startActivityForResult(myIntent, 0); + selectedItem = musicList.get(position); + PostAddFile(selectedItem.File); + + Toast.makeText(MusicDir.this, + selectedItem.File + " has been added", Toast.LENGTH_SHORT).show(); + } if (music.typ == "folder") { - actualDir += music.title + "/"; + actualDir += music.title.replaceAll(" ", "%20") + "/"; mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(mUpdateTimeTask, 0); @@ -93,17 +97,32 @@ mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(mUpdateTimeTask, 0); } - } }); } + public void PostAddFile(String Filename) { + + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); + + String xml = ""; + + xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; + xml += "<message>"; + xml += "<command>ADD_MUSIC</command>"; + xml += "<filename>" + Filename + "</filename>"; + xml += "<artist></artist>"; + xml += "<title>" + Filename + "</title>"; + xml += "<duration>0</duration>"; + xml += "</message>"; + + post.Post(xml); + } + + @Override public void onStart() { super.onStart(); - - // mHandler.removeCallbacks(mUpdateTimeTask); - // mHandler.postDelayed(mUpdateTimeTask, 100); } private Runnable mUpdateTimeTask = new Runnable() { @@ -124,7 +143,7 @@ .show(); } else { GridView gridview = (GridView) findViewById(R.id.music_grid); - gridview.invalidateViews(); + gridview.setAdapter(new ImageAdapter2(this)); } } @@ -158,52 +177,51 @@ if (convertView == null) { // if it's not recycled, initialize some // attributes - if (position > 0) { - position = position - 1; + LayoutInflater li = LayoutInflater.from(mContext); + v = li.inflate(R.layout.icon, null); + } else { + v = convertView; + } - DirItems item1 = musicList.get(position); + if (position > 0) { + position = position - 1; - String txtName = item1.File; - Boolean isFolder = item1.isFolder; + DirItems item1 = musicList.get(position); - LayoutInflater li = LayoutInflater.from(mContext); - v = li.inflate(R.layout.icon, null); + String txtName = item1.File; + Boolean isFolder = item1.isFolder; - TextView tv = (TextView) v.findViewById(R.id.icon_text); - tv.setText(txtName); + TextView tv = (TextView) v.findViewById(R.id.icon_text); + tv.setText(txtName); - ImageView iv = (ImageView) v.findViewById(R.id.icon_image); - - if (isFolder) { - iv.setImageResource(R.drawable.folder); - musicItem item = new musicItem(); - item.title = txtName; - item.typ = "folder"; - iv.setTag(item); - } else { - iv.setImageResource(R.drawable.audio); - musicItem item = new musicItem(); - item.title = txtName; - item.typ = "item"; - iv.setTag(item); - } - } else { - LayoutInflater li = LayoutInflater.from(mContext); - v = li.inflate(R.layout.icon, null); + ImageView iv = (ImageView) v.findViewById(R.id.icon_image); - TextView tv = (TextView) v.findViewById(R.id.icon_text); - tv.setText(".."); - - ImageView iv = (ImageView) v.findViewById(R.id.icon_image); - iv.setImageResource(R.drawable.folderback); + if (isFolder) { + iv.setImageResource(R.drawable.folder); musicItem item = new musicItem(); - item.title = ".."; - item.typ = "oneup"; + item.title = txtName; + item.typ = "folder"; iv.setTag(item); + } else { + iv.setImageResource(R.drawable.audio); + musicItem item = new musicItem(); + item.title = txtName; + item.typ = "item"; + iv.setTag(item); } + } else { + LayoutInflater li = LayoutInflater.from(mContext); + v = li.inflate(R.layout.icon, null); - } else { - v = convertView; + TextView tv = (TextView) v.findViewById(R.id.icon_text); + tv.setText(".."); + + ImageView iv = (ImageView) v.findViewById(R.id.icon_image); + iv.setImageResource(R.drawable.folderback); + musicItem item = new musicItem(); + item.title = ".."; + item.typ = "oneup"; + iv.setTag(item); } return v; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-11 09:50:46 UTC (rev 4028) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-11 11:49:00 UTC (rev 4029) @@ -31,6 +31,7 @@ import android.content.SharedPreferences; import android.content.res.AssetManager; import android.os.Bundle; +import android.os.Handler; import android.os.Vibrator; import android.view.View; import android.widget.*; @@ -38,7 +39,8 @@ public class main extends Activity { private static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - + private Handler mHandler = new Handler(); + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -162,4 +164,48 @@ v.vibrate(100); } } + + @Override + public void onStart() { + super.onStart(); + + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 1000); + } + + @Override + public void onPause() { + super.onPause(); + + mHandler.removeCallbacks(mUpdateTimeTask); + } + + private Runnable mUpdateTimeTask = new Runnable() { + public void run() { + update(); + mHandler.postDelayed(mUpdateTimeTask, 1000); + } + }; + + private void update() { + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); + + String HttpServer = settings.getString("Server", "192.168.0.30"); + String HttpPort = settings.getString("Port", "8200"); + + nowplayinghandler handler = nowplayinghandler.getinstance(); + handler.setconnection(HttpServer, HttpPort); + handler.fetchdata(); + + String display = "nothing playing"; + TextView txt0 = (TextView) findViewById(R.id.main_now_playing); + + if ((nowplayinghandler.PlayerState != null) && + (!nowplayinghandler.PlayerState.equals("no player active"))) { + display = nowplayinghandler.Artist + " - " + nowplayinghandler.Title; + } + txt0.setText(display); + } + } \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-12-11 09:50:46 UTC (rev 4028) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-12-11 11:49:00 UTC (rev 4029) @@ -47,7 +47,7 @@ btn1.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - PostCommand("previous"); + PostCommand("prevItem"); } }); btn2.setOnClickListener(new View.OnClickListener() { @@ -63,7 +63,7 @@ }); btn5.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - PostCommand("next"); + PostCommand("nextItem"); } }); btn6.setOnClickListener(new View.OnClickListener() { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java 2010-12-11 09:50:46 UTC (rev 4028) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylist.java 2010-12-11 11:49:00 UTC (rev 4029) @@ -117,7 +117,7 @@ public void onClick(DialogInterface dialog, int item) { switch (item) { case 0: - + PostDeleteItem(selectedItem.Filename); mHandler.postDelayed(mUpdateTimeTask, 100); Toast.makeText(nowplaylist.this, selectedItem.Title + " has been deleted", Toast.LENGTH_SHORT).show(); @@ -157,7 +157,7 @@ post.Post(xml); } - public void PostAddItem(ReceiveDbXmlHandler.DbItems Item) { + public void PostDeleteItem(String Filename) { PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); @@ -165,11 +165,8 @@ xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; xml += "<message>"; - xml += "<command>ADD_MUSIC</command>"; - xml += "<filename>" + Item.Filename + "</filename>"; - xml += "<artist>" + Item.Artist + "</artist>"; - xml += "<title>" + Item.Title + "</title>"; - xml += "<duration>" + Item.Duration + "</duration>"; + xml += "<command>DELETE_MUSIC</command>"; + xml += "<filename>" + Filename + "</filename>"; xml += "</message>"; post.Post(xml); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java 2010-12-11 09:50:46 UTC (rev 4028) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylistXmlHandler.java 2010-12-11 11:49:00 UTC (rev 4029) @@ -45,11 +45,13 @@ if (localName == "Typ") { item.Typ = currentValue; } + if (localName == "Filename") { + item.Filename = currentValue; + } if (localName == "Item") { nowplaylisthandler.PlayList.add(item); item = null; } - } /** Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java 2010-12-11 09:50:46 UTC (rev 4028) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaylisthandler.java 2010-12-11 11:49:00 UTC (rev 4029) @@ -31,6 +31,7 @@ public String Duration = ""; public String Played = ""; public String Typ = ""; + public String Filename = ""; } public static nowplaylisthandler getinstance() { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-11 09:50:46 UTC (rev 4028) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-11 11:49:00 UTC (rev 4029) @@ -59,6 +59,7 @@ mHandler.postDelayed(mUpdateTimeTask, 100); GridView gridview = (GridView) findViewById(R.id.GridView01); + gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-11 09:50:46 UTC (rev 4028) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-11 11:49:00 UTC (rev 4029) @@ -365,8 +365,28 @@ #region player if (data["command"] == "ACTION_PLAY") { - Action action = new Action(Action.ActionType.ACTION_PLAY, 0, 0); - GUIGraphicsContext.OnAction(action); + PlayListPlayer playlistPlayer = PlayListPlayer.SingletonPlayer; + + if (g_Player.Playing) + { + Action action = new Action(Action.ActionType.ACTION_PAUSE, 0, 0); + GUIGraphicsContext.OnAction(action); + } + else + { + if (playlistPlayer.CurrentPlaylistType == PlayListType.PLAYLIST_NONE) + { + playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC; + + PlayList playList = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); + if (playList.Count > 0) playlistPlayer.Play(0); + } + else + { + Action action = new Action(Action.ActionType.ACTION_PLAY, 0, 0); + GUIGraphicsContext.OnAction(action); + } + } } if (data["command"] == ("ACTION_STOP")) { @@ -517,6 +537,8 @@ #endregion #region playlist + + #region add a item if (data["command"] == ("ADD_MUSIC")) { // add music @@ -557,7 +579,22 @@ } } + #endregion + #region delete a item + if (data["command"] == ("DELETE_MUSIC")) + { + // deltete music + // parameter = filename + + PlayListPlayer playlistPlayer = PlayListPlayer.SingletonPlayer; + PlayList playList = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); + + playList.Remove(data["filename"]); + } + #endregion + + #region clear playlist if (data["command"] == ("REMOVE_PLAYLIST")) { // add music @@ -580,6 +617,7 @@ playList.Clear(); } + #endregion #endregion } @@ -1383,6 +1421,7 @@ msg += "<Duration>" + duration + "</Duration>\r\n"; msg += "<Played>" + played.ToString() + "</Played>\r\n"; msg += "<Typ>" + typ + "</Typ>\r\n"; + msg += "<Filename>" + file + "</Filename>\r\n"; msg += "</Item>\r\n"; } 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. |
From: <kro...@us...> - 2010-12-14 13:37:47
|
Revision: 4031 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4031&view=rev Author: kroko_koenig Date: 2010-12-14 13:37:39 +0000 (Tue, 14 Dec 2010) Log Message: ----------- changed post and add progress to music section Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Release/AndroidRemote.mpe1 trunk/plugins/AndroidRemote/Release/AndroidRemote.xmp2 trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote03.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java trunk/plugins/AndroidRemote/Release/remote3.jpg Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-12-14 13:37:39 UTC (rev 4031) @@ -17,6 +17,7 @@ </activity> <activity android:launchMode="singleInstance" android:name=".Remote_01"></activity> <activity android:launchMode="singleInstance" android:name=".Remote_02"></activity> + <activity android:launchMode="singleInstance" android:name=".Remote_03"></activity> <activity android:name=".pictures" android:launchMode="singleInstance"></activity> <activity android:name=".picturesfullscreen" android:launchMode="singleInstance"></activity> <activity android:launchMode="singleInstance" android:name=".MusicDir"></activity> @@ -32,6 +33,7 @@ <uses-sdk android:minSdkVersion="3" /> <uses-permission android:name="android.permission.INTERNET"></uses-permission> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission> <uses-permission android:name="android.permission.VIBRATE"></uses-permission> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission> </manifest> \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-14 13:37:39 UTC (rev 4031) @@ -79,9 +79,13 @@ public static final int wake_on_lan=0x7f020041; } public static final class id { + public static final int Button01=0x7f060060; public static final int GridView01=0x7f060017; public static final int ImageView01=0x7f060019; + public static final int LinearLayout00=0x7f06004a; public static final int LinearLayout01=0x7f06001a; + public static final int LinearLayout02=0x7f060055; + public static final int LinearLayout03=0x7f06005f; public static final int ListView01=0x7f060028; public static final int TableLayout01=0x7f060005; public static final int TableRow01=0x7f060006; @@ -123,7 +127,26 @@ public static final int btn_main_skp_back=0x7f06000e; public static final int btn_main_skp_forw=0x7f060010; public static final int btn_main_video=0x7f060009; - public static final int clearplaylist=0x7f060050; + public static final int btnkey01=0x7f06004b; + public static final int btnkey02=0x7f06004c; + public static final int btnkey03=0x7f06004d; + public static final int btnkey04=0x7f06004e; + public static final int btnkey05=0x7f06004f; + public static final int btnkey06=0x7f060050; + public static final int btnkey07=0x7f060051; + public static final int btnkey08=0x7f060052; + public static final int btnkey09=0x7f060053; + public static final int btnkey10=0x7f060054; + public static final int btnkey11=0x7f060056; + public static final int btnkey12=0x7f060057; + public static final int btnkey13=0x7f060058; + public static final int btnkey14=0x7f060059; + public static final int btnkey15=0x7f06005a; + public static final int btnkey16=0x7f06005b; + public static final int btnkey17=0x7f06005c; + public static final int btnkey18=0x7f06005d; + public static final int btnkey19=0x7f06005e; + public static final int clearplaylist=0x7f060067; public static final int full_text=0x7f060018; public static final int icon_image=0x7f060001; public static final int icon_text=0x7f060002; @@ -147,18 +170,18 @@ public static final int now_progress=0x7f06001e; public static final int now_stop=0x7f060024; public static final int now_title=0x7f060021; - public static final int open=0x7f060053; - public static final int playlist=0x7f06004f; - public static final int rslide=0x7f060056; - public static final int save=0x7f060052; - public static final int sdcard=0x7f060051; - public static final int send=0x7f060054; - public static final int server_ip=0x7f06004a; - public static final int server_macid=0x7f06004c; - public static final int server_port=0x7f06004b; - public static final int slide=0x7f060055; - public static final int title=0x7f06004e; - public static final int vibration=0x7f06004d; + public static final int open=0x7f06006a; + public static final int playlist=0x7f060066; + public static final int rslide=0x7f06006d; + public static final int save=0x7f060069; + public static final int sdcard=0x7f060068; + public static final int send=0x7f06006b; + public static final int server_ip=0x7f060061; + public static final int server_macid=0x7f060063; + public static final int server_port=0x7f060062; + public static final int slide=0x7f06006c; + public static final int title=0x7f060065; + public static final int vibration=0x7f060064; public static final int widget0=0x7f060011; public static final int widget00=0x7f06002a; public static final int widget01=0x7f06002e; @@ -183,9 +206,10 @@ public static final int playnowlist=0x7f03000c; public static final int remote01=0x7f03000d; public static final int remote02=0x7f03000e; - public static final int setup=0x7f03000f; - public static final int splash=0x7f030010; - public static final int title=0x7f030011; + public static final int remote03=0x7f03000f; + public static final int setup=0x7f030010; + public static final int splash=0x7f030011; + public static final int title=0x7f030012; } public static final class menu { public static final int music_menu=0x7f050000; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme 2010-12-14 13:37:39 UTC (rev 4031) @@ -37,7 +37,7 @@ Main issues ------------ Vibration feedback (not completed) -Check if WIFI is on +switch WIFI on (just msg now) gesture control for pictures (swipe) / alertdialog save files from Android to MP if the MP has no focus the remote doesnt work (normal) Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote03.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote03.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote03.xml 2010-12-14 13:37:39 UTC (rev 4031) @@ -0,0 +1,147 @@ +<?xml version="1.0" encoding="utf-8"?> + <LinearLayout android:id="@+id/LinearLayout00" + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" android:orientation="vertical" android:layout_height="wrap_content" android:background="@drawable/brush"> + + <TextView android:id="@+id/naviRemote_text" android:layout_width="fill_parent" + android:layout_height="wrap_content" android:text="Remote 03" + android:gravity="center_horizontal" android:background="#FFA9A9A9" + android:textSize="15dip" + android:textColor="#FF000000" android:textColorHighlight="#FFFFFFFF" android:padding="5dip"> + </TextView> + + <LinearLayout android:id="@+id/LinearLayout01" + android:layout_height="wrap_content" + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" android:paddingBottom="5dip" android:paddingTop="5dip"> + + <Button android:id="@+id/btnkey01" android:padding="0dip" + android:text="Q" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey02" android:padding="0dip" + android:text="W" android:layout_height="32dip" android:layout_width="32dip"> + </Button> + <Button android:id="@+id/btnkey03" android:padding="0dip" + android:text="E" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey04" android:padding="0dip" + android:text="R" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey05" android:padding="0dip" + android:text="T" android:layout_height="32dip" android:layout_width="32dip"> + </Button> + <Button android:id="@+id/btnkey06" android:padding="0dip" + android:text="Y" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey07" android:padding="0dip" + android:text="U" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey08" android:padding="0dip" + android:text="I" android:layout_height="32dip" android:layout_width="32dip"> + </Button> + <Button android:id="@+id/btnkey09" android:padding="0dip" + android:text="O" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey10" android:padding="0dip" + android:text="P" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + </LinearLayout> + + <LinearLayout android:id="@+id/LinearLayout02" + android:layout_height="wrap_content" + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_gravity="center_horizontal" + android:layout_width="wrap_content" + android:paddingBottom="5dip"> + + <Button android:id="@+id/btnkey11" android:padding="0dip" + android:text="A" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey12" android:padding="0dip" + android:text="S" android:layout_height="32dip" android:layout_width="32dip"> + </Button> + <Button android:id="@+id/btnkey13" android:padding="0dip" + android:text="D" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey14" android:padding="0dip" + android:text="F" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey15" android:padding="0dip" + android:text="G" android:layout_height="32dip" android:layout_width="32dip"> + </Button> + <Button android:id="@+id/btnkey16" android:padding="0dip" + android:text="H" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey17" android:padding="0dip" + android:text="J" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/btnkey18" android:padding="0dip" + android:text="K" android:layout_height="32dip" android:layout_width="32dip"> + </Button> + <Button android:id="@+id/btnkey19" android:padding="0dip" + android:text="L" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + </LinearLayout> + + <LinearLayout android:id="@+id/LinearLayout03" + android:layout_height="wrap_content" + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_gravity="center_horizontal" + android:layout_width="wrap_content" + android:paddingBottom="5dip"> + + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="Shift" android:layout_width="48dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="Z" android:layout_height="32dip" android:layout_width="32dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="X" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="C" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="V" android:layout_height="32dip" android:layout_width="32dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="B" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="N" android:layout_width="32dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="M" android:layout_height="32dip" android:layout_width="32dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="DEL" android:layout_width="48dip" android:layout_height="32dip"> + </Button> + </LinearLayout> + + <LinearLayout android:id="@+id/LinearLayout03" + android:layout_height="wrap_content" + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_gravity="center_horizontal" + android:layout_width="wrap_content" + android:paddingBottom="5dip"> + + <Button android:id="@+id/Button01" android:padding="0dip" + android:text=".?123" android:layout_width="64dip" android:layout_height="32dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:layout_height="32dip" android:layout_width="32dip" android:text="/"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="Space" android:layout_height="32dip" android:layout_width="64dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="." android:layout_height="32dip" android:layout_width="32dip"> + </Button> + <Button android:id="@+id/Button01" android:padding="0dip" + android:text="www" android:layout_width="64dip" android:layout_height="32dip"> + </Button> + + </LinearLayout> + +</LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/PostWebserver.java 2010-12-14 13:37:39 UTC (rev 4031) @@ -21,7 +21,13 @@ package mediaportal.remote; +import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.net.InetAddress; +import java.net.Socket; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; @@ -31,6 +37,8 @@ import org.apache.http.params.BasicHttpParams; import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; +import org.apache.http.params.HttpProtocolParams; +import org.apache.http.protocol.HTTP; public class PostWebserver { @@ -42,11 +50,55 @@ httpPort = Port; } - public boolean Post(String Data) { + public boolean Post(String data) { boolean result = false; + try { + InetAddress addr = InetAddress.getByName(Settings.Server); + Socket socket = new Socket(addr, 8200); + + // Send header String + String path = "/"; + BufferedWriter wr = new BufferedWriter(new OutputStreamWriter( + socket.getOutputStream(), "UTF8")); + wr.write("POST " + path + " HTTP/1.0\r\n"); + wr.write("Content-Length: " + data.length() + "\r\n"); + wr.write("Content-Type: application/xml\r\n"); + wr.write("\r\n"); + + // Send data + wr.write(data); + wr.flush(); + + // Get response + BufferedReader rd = new BufferedReader(new InputStreamReader( + socket.getInputStream())); + String line; + while ((line = rd.readLine()) != null) { + // Process line... + } + + wr.close(); + rd.close(); + + result = true; + + } catch (Exception e) { + } + + return result; + + } + + public boolean oldPost(String Data) { + + boolean result = false; + try { HttpParams httpParameters = new BasicHttpParams(); + HttpProtocolParams.setContentCharset(httpParameters, HTTP.UTF_8); + HttpProtocolParams.setUseExpectContinue(httpParameters, false); + HttpConnectionParams.setConnectionTimeout(httpParameters, 5000); HttpConnectionParams.setSoTimeout(httpParameters, 5000); @@ -54,8 +106,13 @@ HttpPost httppost = new HttpPost("http://" + httpServer + ":" + httpPort); + httppost.addHeader("Accept", "text/xml"); + httppost.addHeader("Content-Type", "application/xml"); + + Data = Data.replace("\\", "/"); + StringEntity se = new StringEntity(Data, "UTF-8"); - se.setContentType("application/atom+xml"); + se.setContentType("application/xml"); httppost.setEntity(se); @@ -72,4 +129,5 @@ return result; } + } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-14 13:37:39 UTC (rev 4031) @@ -169,8 +169,8 @@ // right to left swipe if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - - + Intent myIntent = new Intent(this, Remote_03.class); + startActivityForResult(myIntent, 0); } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { Intent myIntent = new Intent(this, Remote_01.class); Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java 2010-12-14 13:37:39 UTC (rev 4031) @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2005-2010 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.content.res.AssetManager; +import android.os.Bundle; +import android.os.Vibrator; +import android.view.GestureDetector; +import android.view.MotionEvent; +import android.view.View; +import android.view.GestureDetector.OnGestureListener; +import android.widget.Button; + +public class Remote_03 extends Activity implements OnGestureListener { + + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; + + private GestureDetector gestureScanner; + private static final int SWIPE_MIN_DISTANCE = 120; + private static final int SWIPE_MAX_OFF_PATH = 250; + private static final int SWIPE_THRESHOLD_VELOCITY = 200; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.remote03); + + gestureScanner = new GestureDetector(this); + + } + + public void PostCommand(String button) { + + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); + + AssetManager assetManager = getAssets(); + String xml = ""; + + try { + InputStream inputStream = null; + inputStream = assetManager.open("cmd_" + button + ".xml"); + + int x = inputStream.read(); + + while (x != -1) { + xml = xml + (char) x; + x = inputStream.read(); + } + post.Post(xml); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public boolean onTouchEvent(MotionEvent me) { + return gestureScanner.onTouchEvent(me); + } + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, + float velocityY) { + try { + if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) + return false; + // right to left swipe + if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE + && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + + } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE + && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { + Intent myIntent = new Intent(this, Remote_02.class); + startActivityForResult(myIntent, 0); + } + } catch (Exception e) { + // nothing + } + return false; + } + + public boolean onDown(MotionEvent arg0) { + return true; + } + public void onLongPress(MotionEvent arg0) { + } + public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2, + float arg3) { + return false; + } + public void onShowPress(MotionEvent arg0) { + } + public boolean onSingleTapUp(MotionEvent arg0) { + return false; + } + + public void DoVibrate() { + if (Settings.Vibrate) { + // Get instance of Vibrator from current Context + Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); + v.vibrate(100); + } + } +} \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-14 13:37:39 UTC (rev 4031) @@ -30,6 +30,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.res.AssetManager; +import android.net.ConnectivityManager; import android.os.Bundle; import android.os.Handler; import android.os.Vibrator; @@ -40,7 +41,7 @@ private static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); - + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -134,6 +135,29 @@ }); } + void chkStatus() { + final ConnectivityManager connMgr = (ConnectivityManager) this + .getSystemService(Context.CONNECTIVITY_SERVICE); + + final android.net.NetworkInfo wifi = connMgr + .getNetworkInfo(ConnectivityManager.TYPE_WIFI); + + final android.net.NetworkInfo mobile = connMgr + .getNetworkInfo(ConnectivityManager.TYPE_MOBILE); + + if (!wifi.isAvailable()) { + Toast.makeText(this, "Wifi is not available !", Toast.LENGTH_LONG).show(); + } + + /* + else if (mobile.isAvailable()) { + Toast.makeText(this, "Mobile 3G ", Toast.LENGTH_LONG).show(); + } else { + Toast.makeText(this, "No Network ", Toast.LENGTH_LONG).show(); + } + */ + } + public void PostCommand(String button) { PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); @@ -164,13 +188,16 @@ v.vibrate(100); } } - + @Override public void onStart() { super.onStart(); mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(mUpdateTimeTask, 1000); + + chkStatus(); + } @Override @@ -186,7 +213,7 @@ mHandler.postDelayed(mUpdateTimeTask, 1000); } }; - + private void update() { SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); @@ -197,13 +224,14 @@ nowplayinghandler handler = nowplayinghandler.getinstance(); handler.setconnection(HttpServer, HttpPort); handler.fetchdata(); - + String display = "nothing playing"; TextView txt0 = (TextView) findViewById(R.id.main_now_playing); - - if ((nowplayinghandler.PlayerState != null) && - (!nowplayinghandler.PlayerState.equals("no player active"))) { - display = nowplayinghandler.Artist + " - " + nowplayinghandler.Title; + + if ((nowplayinghandler.PlayerState != null) + && (!nowplayinghandler.PlayerState.equals("no player active"))) { + display = nowplayinghandler.Artist + " - " + + nowplayinghandler.Title; } txt0.setText(display); } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-14 13:37:39 UTC (rev 4031) @@ -22,12 +22,13 @@ package mediaportal.remote; import java.util.ArrayList; - import android.app.Activity; +import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; +import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.util.Log; @@ -50,12 +51,13 @@ super.onCreate(savedInstanceState); setContentView(R.layout.music_album); + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 100); + ListView l1 = (ListView) findViewById(R.id.list_album); - l1.setAdapter(new EfficientAdapter(musicAlbum.this)); l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { - //@override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { @@ -74,34 +76,45 @@ l1.setDividerHeight(2); } - @Override - public void onStart() { - super.onStart(); - - mHandler.removeCallbacks(mUpdateTimeTask); - mHandler.postDelayed(mUpdateTimeTask, 100); - } - private Runnable mUpdateTimeTask = new Runnable() { public void run() { - update(); + new update().execute(); } }; - private void update() { + private class update extends AsyncTask<String, Void, Void> { + private final ProgressDialog dialog = new ProgressDialog(musicAlbum.this); - Log.d("update album", "do update"); + // can use UI thread here + protected void onPreExecute() { + this.dialog.setMessage("Loading..."); + this.dialog.show(); + } - ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); - albumList = handler.GetAlbums(); + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { + Log.d("update album", "do update"); - if (albumList.size() == 0) { - Toast.makeText(musicAlbum.this, "TIME OUT SERVER", - Toast.LENGTH_LONG).show(); + ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); + albumList = handler.GetAlbums(); + + return null; } - ListView l1 = (ListView) findViewById(R.id.list_album); - l1.invalidateViews(); + // can use UI thread here + protected void onPostExecute(final Void unused) { + if (this.dialog.isShowing()) { + this.dialog.dismiss(); + } + + if (albumList.size() == 0) { + Toast.makeText(musicAlbum.this, "TIME OUT SERVER", + Toast.LENGTH_SHORT).show(); + } else { + ListView listview = (ListView) findViewById(R.id.list_album); + listview.setAdapter(new EfficientAdapter(musicAlbum.this)); + } + } } private static class EfficientAdapter extends BaseAdapter { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-14 13:37:39 UTC (rev 4031) @@ -23,10 +23,12 @@ import java.util.ArrayList; import android.app.Activity; +import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; +import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.util.Log; @@ -39,73 +41,85 @@ import android.widget.TextView; import android.widget.Toast; -public class musicArtist extends Activity{ - +public class musicArtist extends Activity { + public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); - + private static ArrayList<ReceiveDbXmlHandler.DbItems> artistList; - + public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.music_artist); - - ListView l1 = (ListView) findViewById(R.id.list_artist); - l1.setAdapter(new EfficientAdapter(musicArtist.this)); - - l1.setOnItemClickListener(new AdapterView.OnItemClickListener() - { - //@override + super.onCreate(savedInstanceState); + setContentView(R.layout.music_artist); + + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 100); + + ListView l1 = (ListView) findViewById(R.id.list_artist); + + l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, - long arg3) { - + long arg3) { + ReceiveDbXmlHandler.DbItems item = artistList.get(arg2); - + musicResults.Select = item.Artist; musicResults.Mode = musicResults.SelectMode.Artist; - - Intent myIntent = new Intent(arg1.getContext(), musicResults.class); - startActivityForResult(myIntent, 0); - } + + Intent myIntent = new Intent(arg1.getContext(), + musicResults.class); + startActivityForResult(myIntent, 0); } - ); - - ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); - l1.setDivider(divcolor); - l1.setDividerHeight(2); - } - - @Override - public void onStart() { - super.onStart(); + }); - mHandler.removeCallbacks(mUpdateTimeTask); - mHandler.postDelayed(mUpdateTimeTask, 100); + ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); + l1.setDivider(divcolor); + l1.setDividerHeight(2); } + private Runnable mUpdateTimeTask = new Runnable() { public void run() { - update(); + new update().execute(); } }; - private void update() { - - Log.d("update artist", "do update"); - - ReceiveDbHandler handler = ReceiveDbHandler .getinstance(); - artistList = handler.GetArtist(); - - if (artistList.size() == 0) { - Toast.makeText(musicArtist.this, "TIME OUT SERVER", - Toast.LENGTH_LONG).show(); + private class update extends AsyncTask<String, Void, Void> { + private final ProgressDialog dialog = new ProgressDialog(musicArtist.this); + + // can use UI thread here + protected void onPreExecute() { + this.dialog.setMessage("Loading..."); + this.dialog.show(); } - - ListView l1 = (ListView) findViewById(R.id.list_artist); - l1.invalidateViews(); + + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { + Log.d("update artist", "do update"); + + ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); + artistList = handler.GetArtist(); + + return null; + } + + // can use UI thread here + protected void onPostExecute(final Void unused) { + if (this.dialog.isShowing()) { + this.dialog.dismiss(); + } + + if (artistList.size() == 0) { + Toast.makeText(musicArtist.this, "TIME OUT SERVER", + Toast.LENGTH_SHORT).show(); + } else { + ListView listview = (ListView) findViewById(R.id.list_artist); + listview.setAdapter(new EfficientAdapter(musicArtist.this)); + } + } } - + private static class EfficientAdapter extends BaseAdapter { - + private LayoutInflater mInflater; public EfficientAdapter(Context context) { @@ -113,8 +127,10 @@ } public int getCount() { - if(artistList != null) return artistList.size(); - else return 0; + if (artistList != null) + return artistList.size(); + else + return 0; } public Object getItem(int position) { @@ -127,7 +143,7 @@ public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; - + if (convertView == null) { convertView = mInflater.inflate(R.layout.list_item, null); holder = new ViewHolder(); @@ -142,8 +158,8 @@ } ReceiveDbXmlHandler.DbItems item = artistList.get(position); - - holder.text.setText(String.valueOf(position +1)); + + holder.text.setText(String.valueOf(position + 1)); holder.text2.setText(item.Artist); convertView.setBackgroundColor((position & 1) == 1 ? Color.WHITE @@ -159,4 +175,3 @@ } } - Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-14 13:37:39 UTC (rev 4031) @@ -24,10 +24,12 @@ import java.util.ArrayList; import android.app.Activity; import android.app.AlertDialog; +import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; +import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.util.Log; @@ -63,15 +65,16 @@ super.onCreate(savedInstanceState); setContentView(R.layout.music_results); + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 100); + ListView l1 = (ListView) findViewById(R.id.list_result); - l1.setAdapter(new EfficientAdapter(musicResults.this)); ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); l1.setDivider(divcolor); l1.setDividerHeight(2); l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { - // @override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { @@ -119,13 +122,12 @@ post.Post(xml); } - public void PostAddItem(ReceiveDbXmlHandler.DbItems Item) { PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); String xml = ""; - + xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; xml += "<message>"; xml += "<command>ADD_MUSIC</command>"; @@ -137,44 +139,54 @@ post.Post(xml); } - private void SavetoSDCard() { } - @Override - public void onStart() { - super.onStart(); - - mHandler.removeCallbacks(mUpdateTimeTask); - mHandler.postDelayed(mUpdateTimeTask, 100); - } - private Runnable mUpdateTimeTask = new Runnable() { public void run() { - update(); + new update().execute(); } }; - private void update() { + private class update extends AsyncTask<String, Void, Void> { + private final ProgressDialog dialog = new ProgressDialog(musicResults.this); - Log.d("update search", "do update"); + // can use UI thread here + protected void onPreExecute() { + this.dialog.setMessage("Loading..."); + this.dialog.show(); + } - ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); - if(Mode == SelectMode.Artist) - itemList = handler.GetSongsByArtist(Select); - if(Mode == SelectMode.Album) - itemList = handler.GetSongsByAlbum(Select); + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { + Log.d("update search", "do update"); - if (itemList.size() == 0) { - Toast.makeText(musicResults.this, "TIME OUT SERVER", - Toast.LENGTH_LONG).show(); + ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); + if(Mode == SelectMode.Artist) + itemList = handler.GetSongsByArtist(Select); + if(Mode == SelectMode.Album) + itemList = handler.GetSongsByAlbum(Select); + + return null; } - ListView l1 = (ListView) findViewById(R.id.list_result); - l1.invalidateViews(); + // can use UI thread here + protected void onPostExecute(final Void unused) { + if (this.dialog.isShowing()) { + this.dialog.dismiss(); + } + + if (itemList.size() == 0) { + Toast.makeText(musicResults.this, "TIME OUT SERVER", + Toast.LENGTH_SHORT).show(); + } else { + ListView listview = (ListView) findViewById(R.id.list_result); + listview.setAdapter(new EfficientAdapter(musicResults.this)); + } + } } - + private static class EfficientAdapter extends BaseAdapter { private LayoutInflater mInflater; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-14 13:37:39 UTC (rev 4031) @@ -24,10 +24,12 @@ import java.util.ArrayList; import android.app.Activity; import android.app.AlertDialog; +import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; +import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.util.Log; @@ -56,15 +58,12 @@ super.onCreate(savedInstanceState); setContentView(R.layout.music_song); + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 100); + ListView l1 = (ListView) findViewById(R.id.list_song); - l1.setAdapter(new EfficientAdapter(musicSong.this)); - ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); - l1.setDivider(divcolor); - l1.setDividerHeight(2); - l1.setOnItemClickListener(new AdapterView.OnItemClickListener() { - // @override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { @@ -97,36 +96,51 @@ alert.show(); } }); + + ColorDrawable divcolor = new ColorDrawable(Color.DKGRAY); + l1.setDivider(divcolor); + l1.setDividerHeight(2); } - @Override - public void onStart() { - super.onStart(); - - mHandler.removeCallbacks(mUpdateTimeTask); - mHandler.postDelayed(mUpdateTimeTask, 100); - } - private Runnable mUpdateTimeTask = new Runnable() { public void run() { - update(); + new update().execute(); } }; - private void update() { + private class update extends AsyncTask<String, Void, Void> { + private final ProgressDialog dialog = new ProgressDialog(musicSong.this); - Log.d("update song", "do update"); + // can use UI thread here + protected void onPreExecute() { + this.dialog.setMessage("Loading..."); + this.dialog.show(); + } - ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); - songList = handler.GetSongs(); + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { + Log.d("update song", "do update"); - if (songList.size() == 0) { - Toast.makeText(musicSong.this, "TIME OUT SERVER", Toast.LENGTH_LONG) - .show(); + ReceiveDbHandler handler = ReceiveDbHandler.getinstance(); + songList = handler.GetSongs(); + + return null; } - ListView l1 = (ListView) findViewById(R.id.list_song); - l1.invalidateViews(); + // can use UI thread here + protected void onPostExecute(final Void unused) { + if (this.dialog.isShowing()) { + this.dialog.dismiss(); + } + + if (songList.size() == 0) { + Toast.makeText(musicSong.this, "TIME OUT SERVER", + Toast.LENGTH_SHORT).show(); + } else { + ListView listview = (ListView) findViewById(R.id.list_song); + listview.setAdapter(new EfficientAdapter(musicSong.this)); + } + } } public void PostClear() { @@ -142,7 +156,6 @@ post.Post(xml); } - public void PostAddItem(ReceiveDbXmlHandler.DbItems Item) { PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); @@ -160,7 +173,6 @@ post.Post(xml); } - private void SavetoSDCard() { } Modified: trunk/plugins/AndroidRemote/Release/AndroidRemote.mpe1 =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Release/AndroidRemote.xmp2 =================================================================== --- trunk/plugins/AndroidRemote/Release/AndroidRemote.xmp2 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Release/AndroidRemote.xmp2 2010-12-14 13:37:39 UTC (rev 4031) @@ -142,15 +142,16 @@ <Build>0</Build> <Revision>0</Revision> </Version> - <ExtensionDescription>Control your MediaPortal with yout Android. It can be used as a remote control or doing many other things like music, pictures and video control. -Gfx has been done by oddfella and some additional coding is from rolls1400. - + <ExtensionDescription>Control your MediaPortal with yout Android. It can be used as a remote control or doing many other things like music, pictures and video control. +Gfx has been done by oddfella and some additional coding is from rolls1400. + Have fun.</ExtensionDescription> <VersionDescription>initial release</VersionDescription> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation /> <ReleaseDate>2010-12-09T16:17:18.1693243+01:00</ReleaseDate> <Tags>android,remote</Tags> + <Location>C:\AAA\AndroidRemote2\Release\AndroidRemote.mpe1</Location> <Params> <Items> <SectionParam Name="Icon"> Added: trunk/plugins/AndroidRemote/Release/remote3.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Release/remote3.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-14 04:10:10 UTC (rev 4030) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-14 13:37:39 UTC (rev 4031) @@ -545,6 +545,8 @@ // parameter = filename,artist,title,duration PlayListPlayer playlistPlayer = PlayListPlayer.SingletonPlayer; + playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC; + PlayList playList = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); bool found = false; @@ -561,6 +563,8 @@ if (!found) { + AndroidServer.logDebug("add music : " + data["artist"] + " - " + data["title"]); + PlayListItem playlistItem = new PlayListItem(); playlistItem.Type = PlayListItem.PlayListItemType.Audio; playlistItem.FileName = fileName; @@ -597,10 +601,13 @@ #region clear playlist if (data["command"] == ("REMOVE_PLAYLIST")) { + AndroidServer.logDebug("remove from playlist : " + data["filename"]); // add music // parameter = filename PlayListPlayer playlistPlayer = PlayListPlayer.SingletonPlayer; + playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC; + PlayList playList = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); string fileName = data["filename"]; // TODO need to be converted to local name @@ -609,6 +616,7 @@ if (data["command"] == ("CLEAR_PLAYLIST")) { + AndroidServer.logDebug("clear playlist"); // clear playlist // parameter = none 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. |
From: <kro...@us...> - 2010-12-15 17:10:59
|
Revision: 4033 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4033&view=rev Author: kroko_koenig Date: 2010-12-15 17:10:53 +0000 (Wed, 15 Dec 2010) Log Message: ----------- add threads for main & MusicDir also thread safe start of the playlist player Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-14 15:07:00 UTC (rev 4032) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/MusicDir.java 2010-12-15 17:10:53 UTC (rev 4033) @@ -25,7 +25,9 @@ import mediaportal.remote.R; import mediaportal.remote.ReceiveDirectoryXmlHandler.DirItems; import android.app.Activity; +import android.app.ProgressDialog; import android.content.Context; +import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.util.Log; @@ -62,18 +64,15 @@ public void onItemClick(AdapterView<?> parent, View v, int position, long id) { - // TextView tv = (TextView) v.findViewById(R.id.icon_text); - // ImageView ImageView iv = (ImageView) v.findViewById(R.id.icon_image); musicItem music = (musicItem) iv.getTag(); if (music.typ == "item") { selectedItem = musicList.get(position); - PostAddFile(selectedItem.File); + PostAddFile(actualDir + selectedItem.File.replaceAll(" ", "%20")); Toast.makeText(MusicDir.this, - selectedItem.File + " has been added", Toast.LENGTH_SHORT).show(); - + selectedItem.File + " has been added", Toast.LENGTH_SHORT).show(); } if (music.typ == "folder") { @@ -109,7 +108,7 @@ xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; xml += "<message>"; - xml += "<command>ADD_MUSIC</command>"; + xml += "<command>ADD_MUSIC_FILE</command>"; xml += "<filename>" + Filename + "</filename>"; xml += "<artist></artist>"; xml += "<title>" + Filename + "</title>"; @@ -119,34 +118,47 @@ post.Post(xml); } - - @Override - public void onStart() { - super.onStart(); - } - private Runnable mUpdateTimeTask = new Runnable() { public void run() { - update(); + new update().execute(); } }; - private void update() { + private class update extends AsyncTask<String, Void, Void> { + private final ProgressDialog dialog = new ProgressDialog(MusicDir.this); - Log.d("update music dir", "do update folder : " + actualDir); + // can use UI thread here + protected void onPreExecute() { + this.dialog.setMessage("Loading..."); + this.dialog.show(); + } - ReceiveDirHandler h = ReceiveDirHandler.getinstance(); - musicList = h.getMusicDir(actualDir); + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { + Log.d("update music dir", "do update folder : " + actualDir); - if (musicList.size() == 0) { - Toast.makeText(MusicDir.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) - .show(); - } else { - GridView gridview = (GridView) findViewById(R.id.music_grid); - gridview.setAdapter(new ImageAdapter2(this)); + ReceiveDirHandler h = ReceiveDirHandler.getinstance(); + musicList = h.getMusicDir(actualDir); + + return null; } + + // can use UI thread here + protected void onPostExecute(final Void unused) { + if (this.dialog.isShowing()) { + this.dialog.dismiss(); + } + + if (musicList.size() == 0) { + Toast.makeText(MusicDir.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) + .show(); + } else { + GridView gridview = (GridView) findViewById(R.id.music_grid); + gridview.setAdapter(new ImageAdapter2(MusicDir.this)); + } + } } - + public class ImageAdapter2 extends BaseAdapter { private Context mContext; public static final int ACTIVITY_CREATE = 10; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-14 15:07:00 UTC (rev 4032) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-15 17:10:53 UTC (rev 4033) @@ -23,7 +23,6 @@ import java.io.IOException; import java.io.InputStream; - import mediaportal.remote.R; import android.app.Activity; import android.content.Context; @@ -31,6 +30,7 @@ import android.content.SharedPreferences; import android.content.res.AssetManager; import android.net.ConnectivityManager; +import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Vibrator; @@ -41,12 +41,18 @@ private static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); - + private static String display = "nothing playing"; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); + chkStatus(); + + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 1000); + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); @@ -76,6 +82,7 @@ btnVideo.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { DoVibrate(); + Toast.makeText(view.getContext(), "not implemented yet. Sorry !", Toast.LENGTH_LONG) .show(); @@ -146,7 +153,7 @@ .getNetworkInfo(ConnectivityManager.TYPE_MOBILE); if (!wifi.isAvailable()) { - Toast.makeText(this, "Wifi is not available !", Toast.LENGTH_LONG).show(); + Toast.makeText(this, "Wifi is not available !", Toast.LENGTH_SHORT).show(); } /* @@ -190,17 +197,6 @@ } @Override - public void onStart() { - super.onStart(); - - mHandler.removeCallbacks(mUpdateTimeTask); - mHandler.postDelayed(mUpdateTimeTask, 1000); - - chkStatus(); - - } - - @Override public void onPause() { super.onPause(); @@ -209,31 +205,43 @@ private Runnable mUpdateTimeTask = new Runnable() { public void run() { - update(); - mHandler.postDelayed(mUpdateTimeTask, 1000); + new update().execute(); } }; - private void update() { - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, - MODE_PRIVATE); + private class update extends AsyncTask<String, Void, Void> { + // can use UI thread here + protected void onPreExecute() { + } - String HttpServer = settings.getString("Server", "192.168.0.30"); - String HttpPort = settings.getString("Port", "8200"); + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { + SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, + MODE_PRIVATE); - nowplayinghandler handler = nowplayinghandler.getinstance(); - handler.setconnection(HttpServer, HttpPort); - handler.fetchdata(); + String HttpServer = settings.getString("Server", "192.168.0.30"); + String HttpPort = settings.getString("Port", "8200"); - String display = "nothing playing"; - TextView txt0 = (TextView) findViewById(R.id.main_now_playing); + nowplayinghandler handler = nowplayinghandler.getinstance(); + handler.setconnection(HttpServer, HttpPort); + handler.fetchdata(); - if ((nowplayinghandler.PlayerState != null) - && (!nowplayinghandler.PlayerState.equals("no player active"))) { - display = nowplayinghandler.Artist + " - " - + nowplayinghandler.Title; + if ((nowplayinghandler.PlayerState != null) + && (!nowplayinghandler.PlayerState.equals("no player active"))) { + display = nowplayinghandler.Artist + " - " + + nowplayinghandler.Title; + } + + return null; } - txt0.setText(display); + + // can use UI thread here + protected void onPostExecute(final Void unused) { + + TextView txt0 = (TextView) findViewById(R.id.main_now_playing); + txt0.setText(display); + + mHandler.postDelayed(mUpdateTimeTask, 1000); + } } - } \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-14 15:07:00 UTC (rev 4032) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-15 17:10:53 UTC (rev 4033) @@ -63,6 +63,8 @@ private Dictionary<string, string> directoryList = new Dictionary<string, string>(); private static List<string> allPicturesList = null; + private delegate void StartPlaylistPlayer(); + public Request(Socket Socket) { socket = Socket; @@ -338,6 +340,17 @@ } } + private void StartPlayer() + { + // we need to do this, we could crash external players because their are not thread safe. + PlayListPlayer playlistPlayer = PlayListPlayer.SingletonPlayer; + playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC; + + PlayList playList = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); + if (playList.Count > 0) playlistPlayer.Play(0); + + } + private void ExceuteCommand(string Message) { AndroidServer.logDebug("execute command"); @@ -376,10 +389,10 @@ { if (playlistPlayer.CurrentPlaylistType == PlayListType.PLAYLIST_NONE) { - playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC; + StartPlaylistPlayer del = new StartPlaylistPlayer(StartPlayer); + GUIGraphicsContext.form.Invoke(del, new object[] { }); - PlayList playList = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); - if (playList.Count > 0) playlistPlayer.Play(0); + } else { @@ -550,7 +563,7 @@ PlayList playList = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); bool found = false; - string fileName = data["filename"]; // TODO need to be converted to local name + string fileName = data["filename"]; foreach (PlayListItem item in playList) { @@ -581,7 +594,62 @@ playlistItem.MusicTag = tag; playList.Add(playlistItem); } + } + #endregion + #region add a item (file) + if (data["command"] == ("ADD_MUSIC_FILE")) + { + // add music + // parameter = filename,artist,title,duration + + PlayListPlayer playlistPlayer = PlayListPlayer.SingletonPlayer; + playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC; + + PlayList playList = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); + + bool found = false; + + string fileName = data["filename"]; + fileName = fileName.Replace("%20", " "); + fileName = fileName.Replace("/", "\\"); + + string artist = data["artist"].Replace("%20", " "); + string title = data["title"].Replace("%20", " "); + + directoryList = GetMpShare("music"); + string local = GetLocalDir(fileName, directoryList); + + foreach (PlayListItem item in playList) + { + if (item.FileName == local) + { + found = true; + break; + } + } + + if (!found) + { + AndroidServer.logDebug("add music : " + artist + " - " + title); + + PlayListItem playlistItem = new PlayListItem(); + playlistItem.Type = PlayListItem.PlayListItemType.Audio; + playlistItem.FileName = local; + playlistItem.Description = artist + " - " + title; + playlistItem.Duration = 0; + + MusicTag tag = new MusicTag(); + tag.Artist = artist; + tag.Title = title; + + tag.Duration = Convert.ToInt32(data["duration"]); + tag.FileName = local; + + playlistItem.MusicTag = tag; + playList.Add(playlistItem); + } + } #endregion 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. |
From: <kro...@us...> - 2010-12-16 13:22:09
|
Revision: 4036 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4036&view=rev Author: kroko_koenig Date: 2010-12-16 13:22:02 +0000 (Thu, 16 Dec 2010) Log Message: ----------- changed email adress to service.mediaportal + save to sd for mp3 from db Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme 2010-12-16 10:58:24 UTC (rev 4035) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/readme 2010-12-16 13:22:02 UTC (rev 4036) @@ -16,6 +16,7 @@ view playlist delete item from playlist clear playlist +save files from db to phone Video section ------------- @@ -38,7 +39,8 @@ ------------ Vibration feedback (not completed) switch WIFI on (just msg now) -gesture control for pictures (swipe) / alertdialog +gesture control for pictures (swipe) / alert dialog save files from Android to MP if the MP has no focus the remote doesnt work (normal) -Progress is not displayed +save huge files can cause out of memory, better save stream + Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-16 10:58:24 UTC (rev 4035) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ReceiveDbXmlHandler.java 2010-12-16 13:22:02 UTC (rev 4036) @@ -43,6 +43,7 @@ public String Rating= ""; public String Filename= ""; public String Duration= ""; + public String ID= ""; } private DbItems currentDbItem; @@ -77,6 +78,7 @@ if (localName == "Rating") {currentDbItem.Rating =currentValue;} if (localName == "Filename") {currentDbItem.Filename =currentValue;} if (localName == "Duration") {currentDbItem.Duration =currentValue;} + if (localName == "ID") {currentDbItem.ID =currentValue;} if (localName == "Item")DbList.add(currentDbItem); } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-16 10:58:24 UTC (rev 4035) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-12-16 13:22:02 UTC (rev 4036) @@ -76,13 +76,13 @@ return bitmap; } - public void DownloadFile() { - extStorageDirectory = Environment.getExternalStorageDirectory() - .toString(); - + public void DownloadFile(String Filename, String ID) { + + extStorageDirectory = Environment.getExternalStorageDirectory().toString(); + try { InputStream in = openHttpConnection("http://"+ Settings.Server + ":" + Settings.Port + - "/music/Clementi_Sonatina_Op.36_No.1_Movement_1.mp3"); + "/db_music/getfile?id=" + ID); // BufferedInputStream bis = new BufferedInputStream(in); ByteArrayBuffer baf = new ByteArrayBuffer(50); @@ -97,7 +97,7 @@ } OutputStream outStream = null; - File file = new File(extStorageDirectory, "test.mp3"); + File file = new File(extStorageDirectory, Filename); outStream = new FileOutputStream(file); outStream.write(baf.toByteArray()); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-16 10:58:24 UTC (rev 4035) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-16 13:22:02 UTC (rev 4036) @@ -75,6 +75,7 @@ } Thread.setDefaultUncaughtExceptionHandler(new TopExceptionHandler(this)); + chkStatus(); mHandler.removeCallbacks(mUpdateTimeTask); @@ -117,7 +118,7 @@ int x = 0; int y = 1; - int z = y / x; + int z = y / x; // we do a exception ;-) } }); @@ -176,6 +177,7 @@ private boolean reportExist() { try { + @SuppressWarnings("unused") BufferedReader reader = new BufferedReader(new InputStreamReader( this.openFileInput("stack.trace"))); return true; @@ -199,11 +201,11 @@ Intent sendIntent = new Intent(Intent.ACTION_SEND); String subject = "Error report"; - String body = "Mail this to mar...@go...: " + String body = "Mail this to ser...@go... : " + "\n\n" + trace + "\n\n"; sendIntent.putExtra(Intent.EXTRA_EMAIL, - new String[] { "mar...@go..." }); + new String[] { "ser...@go..." }); sendIntent.putExtra(Intent.EXTRA_TEXT, body); sendIntent.putExtra(Intent.EXTRA_SUBJECT, subject); sendIntent.setType("message/rfc822"); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-16 10:58:24 UTC (rev 4035) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicResults.java 2010-12-16 13:22:02 UTC (rev 4036) @@ -31,6 +31,7 @@ import android.graphics.drawable.ColorDrawable; import android.os.AsyncTask; import android.os.Bundle; +import android.os.Environment; import android.os.Handler; import android.util.Log; import android.view.LayoutInflater; @@ -96,7 +97,7 @@ Toast.makeText(musicResults.this, "Playlist has been cleared", Toast.LENGTH_SHORT).show(); break; case 2: - SavetoSDCard(); + SavetoSDCard(selectedItem); Toast.makeText(musicResults.this, selectedItem.Title + " has been transferd", Toast.LENGTH_SHORT).show(); break; @@ -139,8 +140,16 @@ post.Post(xml); } - private void SavetoSDCard() { - + private void SavetoSDCard(ReceiveDbXmlHandler.DbItems Item) { + + String filename = Item.Artist + " - " + Item.Title + ".mp3"; + String id = Item.ID; + + httpHandler h = new httpHandler(); + h.DownloadFile(filename,id); + + String sd = Environment.getExternalStorageDirectory().toString(); + MediaScannerNotifier not = new MediaScannerNotifier(this, sd + "/" + filename, "audio/mpeg"); } private Runnable mUpdateTimeTask = new Runnable() { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-16 10:58:24 UTC (rev 4035) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicSong.java 2010-12-16 13:22:02 UTC (rev 4036) @@ -31,6 +31,7 @@ import android.graphics.drawable.ColorDrawable; import android.os.AsyncTask; import android.os.Bundle; +import android.os.Environment; import android.os.Handler; import android.util.Log; import android.view.LayoutInflater; @@ -85,7 +86,7 @@ Toast.makeText(musicSong.this, "Playlist has been cleared", Toast.LENGTH_SHORT).show(); break; case 2: - SavetoSDCard(); + SavetoSDCard(selectedItem); Toast.makeText(musicSong.this, selectedItem.Title + " has been transferd", Toast.LENGTH_SHORT).show(); break; @@ -173,8 +174,16 @@ post.Post(xml); } - private void SavetoSDCard() { + private void SavetoSDCard(ReceiveDbXmlHandler.DbItems Item) { + String filename = Item.Artist + " - " + Item.Title + ".mp3"; + String id = Item.ID; + + httpHandler h = new httpHandler(); + h.DownloadFile(filename,id); + + String sd = Environment.getExternalStorageDirectory().toString(); + MediaScannerNotifier not = new MediaScannerNotifier(this, sd + "/" + filename, "audio/mpeg"); } private static class EfficientAdapter extends BaseAdapter { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-16 10:58:24 UTC (rev 4035) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-12-16 13:22:02 UTC (rev 4036) @@ -47,29 +47,27 @@ private Handler mHandler = new Handler(); public static String actualDir = ""; - + public static ArrayList<ReceiveDirectoryXmlHandler.DirItems> pictureList; public static int selectedPicture; - + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.pictures); - + mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(mUpdateTimeTask, 100); GridView gridview = (GridView) findViewById(R.id.GridView01); - + gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { - // TextView tv = (TextView) v.findViewById(R.id.icon_text); - // ImageView ImageView iv = (ImageView) v.findViewById(R.id.icon_image); picItem pic = (picItem) iv.getTag(); - + if (pic.typ == "item") { selectedPicture = position - 1; Intent myIntent = new Intent(pictures.this, @@ -103,60 +101,48 @@ }); } - @Override - public void onStart() { - super.onStart(); - - //mHandler.removeCallbacks(mUpdateTimeTask); - //mHandler.postDelayed(mUpdateTimeTask, 100); - } - private Runnable mUpdateTimeTask = new Runnable() { public void run() { - new update().execute(); - //update(); + new update().execute(); } }; - - - private class update extends AsyncTask<String, Void, Void> { - private final ProgressDialog dialog = new ProgressDialog(pictures.this); - - // can use UI thread here - protected void onPreExecute() { - this.dialog.setMessage("Loading..."); - this.dialog.show(); - } - - // automatically done on worker thread (separate from UI thread) - protected Void doInBackground(final String... args) { + private class update extends AsyncTask<String, Void, Void> { + private final ProgressDialog dialog = new ProgressDialog(pictures.this); + + // can use UI thread here + protected void onPreExecute() { + this.dialog.setMessage("Loading..."); + this.dialog.show(); + } + + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { Log.d("update pictures", "do update folder : " + actualDir); - + ReceiveDirHandler h = ReceiveDirHandler.getinstance(); pictureList = h.getPictureDir(actualDir); - return null; - } - - // can use UI thread here - protected void onPostExecute(final Void unused) { - if (this.dialog.isShowing()) { - this.dialog.dismiss(); - } + return null; + } - if (pictureList.size() == 0) { - Toast.makeText(pictures.this, "TIME OUT SERVER", Toast.LENGTH_SHORT) - .show(); + // can use UI thread here + protected void onPostExecute(final Void unused) { + if (this.dialog.isShowing()) { + this.dialog.dismiss(); + } + + if (pictureList.size() == 0) { + Toast.makeText(pictures.this, "TIME OUT SERVER", + Toast.LENGTH_SHORT).show(); } else { GridView gridview = (GridView) findViewById(R.id.GridView01); gridview.setAdapter(new ImageAdapter2(pictures.this)); } - } - } - - - public class ImageAdapter2 extends BaseAdapter { + } + } + + public class ImageAdapter2 extends BaseAdapter { private Context mContext; public static final int ACTIVITY_CREATE = 10; @@ -188,12 +174,10 @@ LayoutInflater li = LayoutInflater.from(mContext); v = li.inflate(R.layout.icon, null); - } - else - { + } else { v = convertView; } - + if (position > 0) { position = position - 1; @@ -220,7 +204,8 @@ String file = "http://" + Settings.Server + ":" + Settings.Port + "/pictures/"; file += actualDir + item.File + ".thb"; - item.Picture = http.DownloadImage(file.replaceAll(" ", "%20")); + item.Picture = http.DownloadImage(file.replaceAll(" ", + "%20")); iv.setImageBitmap(item.Picture); if (item.Picture == null) 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. |
From: <kro...@us...> - 2010-12-16 16:53:30
|
Revision: 4037 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4037&view=rev Author: kroko_koenig Date: 2010-12-16 16:53:23 +0000 (Thu, 16 Dec 2010) Log Message: ----------- so hopefully better playing now, also change icon play/pause Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote03.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-16 13:22:02 UTC (rev 4036) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-12-16 16:53:23 UTC (rev 4037) @@ -79,7 +79,6 @@ public static final int wake_on_lan=0x7f020041; } public static final class id { - public static final int Button01=0x7f060060; public static final int GridView01=0x7f060017; public static final int ImageView01=0x7f060019; public static final int LinearLayout00=0x7f06004a; @@ -146,7 +145,21 @@ public static final int btnkey17=0x7f06005c; public static final int btnkey18=0x7f06005d; public static final int btnkey19=0x7f06005e; - public static final int clearplaylist=0x7f060067; + public static final int btnkey20=0x7f060060; + public static final int btnkey21=0x7f060061; + public static final int btnkey22=0x7f060062; + public static final int btnkey23=0x7f060063; + public static final int btnkey24=0x7f060064; + public static final int btnkey25=0x7f060065; + public static final int btnkey26=0x7f060066; + public static final int btnkey27=0x7f060067; + public static final int btnkey28=0x7f060068; + public static final int btnkey29=0x7f060069; + public static final int btnkey30=0x7f06006a; + public static final int btnkey31=0x7f06006b; + public static final int btnkey32=0x7f06006c; + public static final int btnkey33=0x7f06006d; + public static final int clearplaylist=0x7f060074; public static final int full_text=0x7f060018; public static final int icon_image=0x7f060001; public static final int icon_text=0x7f060002; @@ -170,18 +183,18 @@ public static final int now_progress=0x7f06001e; public static final int now_stop=0x7f060024; public static final int now_title=0x7f060021; - public static final int open=0x7f06006a; - public static final int playlist=0x7f060066; - public static final int rslide=0x7f06006d; - public static final int save=0x7f060069; - public static final int sdcard=0x7f060068; - public static final int send=0x7f06006b; - public static final int server_ip=0x7f060061; - public static final int server_macid=0x7f060063; - public static final int server_port=0x7f060062; - public static final int slide=0x7f06006c; - public static final int title=0x7f060065; - public static final int vibration=0x7f060064; + public static final int open=0x7f060077; + public static final int playlist=0x7f060073; + public static final int rslide=0x7f06007a; + public static final int save=0x7f060076; + public static final int sdcard=0x7f060075; + public static final int send=0x7f060078; + public static final int server_ip=0x7f06006e; + public static final int server_macid=0x7f060070; + public static final int server_port=0x7f06006f; + public static final int slide=0x7f060079; + public static final int title=0x7f060072; + public static final int vibration=0x7f060071; public static final int widget0=0x7f060011; public static final int widget00=0x7f06002a; public static final int widget01=0x7f06002e; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-12-16 13:22:02 UTC (rev 4036) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-12-16 16:53:23 UTC (rev 4037) @@ -13,41 +13,41 @@ <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dip" android:id="@+id/TableRow01"> - <ImageButton android:src="@drawable/main_pictures" android:scaleType="fitXY" + <Button android:background="@drawable/main_pictures" android:scaleType="fitXY" android:layout_height="80dip" android:layout_width="80dip" android:layout_marginRight="40dip" android:padding="5dip" android:id="@+id/btn_main_pictures"> - </ImageButton> + </Button> - <ImageButton android:layout_height="80dip" android:layout_width="80dip" + <Button android:layout_height="80dip" android:layout_width="80dip" android:scaleType="fitXY" android:padding="5dip" - android:src="@drawable/main_music" android:id="@+id/btn_main_music"> - </ImageButton> + android:background="@drawable/main_music" android:id="@+id/btn_main_music"> + </Button> </TableRow> <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dip" android:id="@+id/TableRow01"> - <ImageButton android:scaleType="fitXY" + <Button android:scaleType="fitXY" android:layout_height="80dip" android:layout_width="80dip" - android:padding="5dip" android:layout_marginRight="40dip" android:src="@drawable/main_video" android:id="@+id/btn_main_video"> - </ImageButton> + android:padding="5dip" android:layout_marginRight="40dip" android:background="@drawable/main_video" android:id="@+id/btn_main_video"> + </Button> - <ImageButton android:layout_height="80dip" android:layout_width="80dip" - android:scaleType="fitXY" android:padding="5dip" android:src="@drawable/main_remote" android:id="@+id/btn_main_remote"> - </ImageButton> + <Button android:layout_height="80dip" android:layout_width="80dip" + android:scaleType="fitXY" android:padding="5dip" android:background="@drawable/main_remote" android:id="@+id/btn_main_remote"> + </Button> </TableRow> <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dip" android:id="@+id/TableRow01"> - <ImageButton android:scaleType="fitXY" + <Button android:scaleType="fitXY" android:layout_height="80dip" android:layout_width="80dip" - android:padding="5dip" android:layout_marginRight="40dip" android:src="@drawable/main_now_playing" android:id="@+id/btn_main_now_playing"> - </ImageButton> + android:padding="5dip" android:layout_marginRight="40dip" android:background="@drawable/main_now_playing" android:id="@+id/btn_main_now_playing"> + </Button> - <ImageButton android:layout_height="80dip" android:layout_width="80dip" - android:scaleType="fitXY" android:padding="5dip" android:src="@drawable/main_settings" android:id="@+id/btn_main_settings"> - </ImageButton> + <Button android:layout_height="80dip" android:layout_width="80dip" + android:scaleType="fitXY" android:padding="5dip" android:background="@drawable/main_settings" android:id="@+id/btn_main_settings"> + </Button> </TableRow> @@ -61,20 +61,16 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:background="#0FF0FFFF" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:padding="5dip"> - - - - - <ImageButton android:src="@drawable/main_skp_back" android:scaleType="fitXY" + <Button android:background="@drawable/main_skp_back" android:scaleType="fitXY" android:layout_height="60dip" android:layout_width="60dip" - android:id="@+id/btn_main_skp_back" android:padding="2dip" android:layout_marginRight="5dip"></ImageButton> + android:id="@+id/btn_main_skp_back" android:padding="2dip" android:layout_marginRight="5dip"></Button> <ImageButton android:scaleType="fitXY" android:layout_height="60dip" android:layout_width="60dip" - android:id="@+id/btn_main_play" android:src="@drawable/main_play" android:padding="2dip" android:layout_marginRight="5dip"></ImageButton> - <ImageButton android:scaleType="fitXY" + android:id="@+id/btn_main_play" android:background="@drawable/main_play" android:padding="2dip" android:layout_marginRight="5dip"></ImageButton> + <Button android:scaleType="fitXY" android:layout_height="60dip" android:layout_width="60dip" - android:id="@+id/btn_main_skp_forw" android:src="@drawable/main_skp_forw" android:padding="2dip"></ImageButton> + android:id="@+id/btn_main_skp_forw" android:background="@drawable/main_skp_forw" android:padding="2dip"></Button> </LinearLayout> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-12-16 13:22:02 UTC (rev 4036) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/playingnow.xml 2010-12-16 16:53:23 UTC (rev 4037) @@ -63,7 +63,7 @@ <ImageButton android:id="@+id/now_stop" android:background="@drawable/stop" android:layout_height="60dip" android:layout_width="60dip"/> <ImageButton android:id="@+id/now_play" - android:layout_height="60dip" android:background="@drawable/right" android:layout_width="60dip"/> + android:layout_height="60dip" android:background="@drawable/right" android:layout_width="60dip" android:scaleType="fitXY"/> <ImageButton android:id="@+id/now_next" android:layout_height="60dip" android:background="@drawable/skip_forward" android:layout_width="60dip"/> <ImageButton android:id="@+id/now_list" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote03.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote03.xml 2010-12-16 13:22:02 UTC (rev 4036) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote03.xml 2010-12-16 16:53:23 UTC (rev 4037) @@ -16,34 +16,34 @@ android:layout_width="fill_parent" android:paddingBottom="5dip" android:paddingTop="5dip"> <Button android:id="@+id/btnkey01" android:padding="0dip" - android:text="Q" android:layout_width="32dip" android:layout_height="32dip"> + android:text="Q" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey02" android:padding="0dip" - android:text="W" android:layout_height="32dip" android:layout_width="32dip"> + android:text="W" android:layout_height="48dip" android:layout_width="32dip"> </Button> <Button android:id="@+id/btnkey03" android:padding="0dip" - android:text="E" android:layout_width="32dip" android:layout_height="32dip"> + android:text="E" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey04" android:padding="0dip" - android:text="R" android:layout_width="32dip" android:layout_height="32dip"> + android:text="R" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey05" android:padding="0dip" - android:text="T" android:layout_height="32dip" android:layout_width="32dip"> + android:text="T" android:layout_height="48dip" android:layout_width="32dip"> </Button> <Button android:id="@+id/btnkey06" android:padding="0dip" - android:text="Y" android:layout_width="32dip" android:layout_height="32dip"> + android:text="Y" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey07" android:padding="0dip" - android:text="U" android:layout_width="32dip" android:layout_height="32dip"> + android:text="U" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey08" android:padding="0dip" - android:text="I" android:layout_height="32dip" android:layout_width="32dip"> + android:text="I" android:layout_height="48dip" android:layout_width="32dip"> </Button> <Button android:id="@+id/btnkey09" android:padding="0dip" - android:text="O" android:layout_width="32dip" android:layout_height="32dip"> + android:text="O" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey10" android:padding="0dip" - android:text="P" android:layout_width="32dip" android:layout_height="32dip"> + android:text="P" android:layout_width="32dip" android:layout_height="48dip"> </Button> </LinearLayout> @@ -55,31 +55,31 @@ android:paddingBottom="5dip"> <Button android:id="@+id/btnkey11" android:padding="0dip" - android:text="A" android:layout_width="32dip" android:layout_height="32dip"> + android:text="A" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey12" android:padding="0dip" - android:text="S" android:layout_height="32dip" android:layout_width="32dip"> + android:text="S" android:layout_height="48dip" android:layout_width="32dip"> </Button> <Button android:id="@+id/btnkey13" android:padding="0dip" - android:text="D" android:layout_width="32dip" android:layout_height="32dip"> + android:text="D" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey14" android:padding="0dip" - android:text="F" android:layout_width="32dip" android:layout_height="32dip"> + android:text="F" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey15" android:padding="0dip" - android:text="G" android:layout_height="32dip" android:layout_width="32dip"> + android:text="G" android:layout_height="48dip" android:layout_width="32dip"> </Button> <Button android:id="@+id/btnkey16" android:padding="0dip" - android:text="H" android:layout_width="32dip" android:layout_height="32dip"> + android:text="H" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey17" android:padding="0dip" - android:text="J" android:layout_width="32dip" android:layout_height="32dip"> + android:text="J" android:layout_width="32dip" android:layout_height="48dip"> </Button> <Button android:id="@+id/btnkey18" android:padding="0dip" - android:text="K" android:layout_height="32dip" android:layout_width="32dip"> + android:text="K" android:layout_height="48dip" android:layout_width="32dip"> </Button> <Button android:id="@+id/btnkey19" android:padding="0dip" - android:text="L" android:layout_width="32dip" android:layout_height="32dip"> + android:text="L" android:layout_width="32dip" android:layout_height="48dip"> </Button> </LinearLayout> @@ -90,32 +90,32 @@ android:layout_width="wrap_content" android:paddingBottom="5dip"> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="Shift" android:layout_width="48dip" android:layout_height="32dip"> + <Button android:id="@+id/btnkey20" android:padding="0dip" + android:text="Shift" android:layout_width="48dip" android:layout_height="48dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="Z" android:layout_height="32dip" android:layout_width="32dip"> + <Button android:id="@+id/btnkey21" android:padding="0dip" + android:text="Z" android:layout_height="48dip" android:layout_width="32dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="X" android:layout_width="32dip" android:layout_height="32dip"> + <Button android:id="@+id/btnkey22" android:padding="0dip" + android:text="X" android:layout_width="32dip" android:layout_height="48dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="C" android:layout_width="32dip" android:layout_height="32dip"> + <Button android:id="@+id/btnkey23" android:padding="0dip" + android:text="C" android:layout_width="32dip" android:layout_height="48dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="V" android:layout_height="32dip" android:layout_width="32dip"> + <Button android:id="@+id/btnkey24" android:padding="0dip" + android:text="V" android:layout_height="48dip" android:layout_width="32dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="B" android:layout_width="32dip" android:layout_height="32dip"> + <Button android:id="@+id/btnkey25" android:padding="0dip" + android:text="B" android:layout_width="32dip" android:layout_height="48dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="N" android:layout_width="32dip" android:layout_height="32dip"> + <Button android:id="@+id/btnkey26" android:padding="0dip" + android:text="N" android:layout_width="32dip" android:layout_height="48dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="M" android:layout_height="32dip" android:layout_width="32dip"> + <Button android:id="@+id/btnkey27" android:padding="0dip" + android:text="M" android:layout_height="48dip" android:layout_width="32dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="DEL" android:layout_width="48dip" android:layout_height="32dip"> + <Button android:id="@+id/btnkey28" android:padding="0dip" + android:text="DEL" android:layout_width="48dip" android:layout_height="48dip"> </Button> </LinearLayout> @@ -126,20 +126,20 @@ android:layout_width="wrap_content" android:paddingBottom="5dip"> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text=".?123" android:layout_width="64dip" android:layout_height="32dip"> + <Button android:id="@+id/btnkey29" android:padding="0dip" + android:text=".?123" android:layout_width="64dip" android:layout_height="48dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:layout_height="32dip" android:layout_width="32dip" android:text="/"> + <Button android:id="@+id/btnkey30" android:padding="0dip" + android:layout_height="48dip" android:layout_width="32dip" android:text="/"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="Space" android:layout_height="32dip" android:layout_width="64dip"> + <Button android:id="@+id/btnkey31" android:padding="0dip" + android:text="Space" android:layout_height="48dip" android:layout_width="64dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="." android:layout_height="32dip" android:layout_width="32dip"> + <Button android:id="@+id/btnkey32" android:padding="0dip" + android:text="." android:layout_height="48dip" android:layout_width="32dip"> </Button> - <Button android:id="@+id/Button01" android:padding="0dip" - android:text="www" android:layout_width="64dip" android:layout_height="32dip"> + <Button android:id="@+id/btnkey33" android:padding="0dip" + android:text="www" android:layout_width="64dip" android:layout_height="48dip"> </Button> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/main.xml 2010-12-16 13:22:02 UTC (rev 4036) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/main.xml 2010-12-16 16:53:23 UTC (rev 4037) @@ -13,41 +13,41 @@ <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01" android:padding="5dip"> - <ImageButton android:src="@drawable/main_pictures" android:scaleType="fitXY" + <Button android:background="@drawable/main_pictures" android:scaleType="fitXY" android:layout_height="80dip" android:layout_width="80dip" android:layout_marginRight="40dip" android:padding="5dip" android:id="@+id/btn_main_pictures"> - </ImageButton> + </Button> - <ImageButton android:layout_height="80dip" android:layout_width="80dip" + <Button android:layout_height="80dip" android:layout_width="80dip" android:scaleType="fitXY" android:padding="5dip" - android:src="@drawable/main_music" android:id="@+id/btn_main_music"> - </ImageButton> + android:background="@drawable/main_music" android:id="@+id/btn_main_music"> + </Button> </TableRow> <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01" android:padding="5dip"> - <ImageButton android:scaleType="fitXY" + <Button android:scaleType="fitXY" android:layout_height="80dip" android:layout_width="80dip" - android:padding="5dip" android:layout_marginRight="40dip" android:src="@drawable/main_video" android:id="@+id/btn_main_video"> - </ImageButton> + android:padding="5dip" android:layout_marginRight="40dip" android:background="@drawable/main_video" android:id="@+id/btn_main_video"> + </Button> - <ImageButton android:layout_height="80dip" android:layout_width="80dip" - android:scaleType="fitXY" android:padding="5dip" android:src="@drawable/main_remote" android:id="@+id/btn_main_remote"> - </ImageButton> + <Button android:layout_height="80dip" android:layout_width="80dip" + android:scaleType="fitXY" android:padding="5dip" android:background="@drawable/main_remote" android:id="@+id/btn_main_remote"> + </Button> </TableRow> <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01" android:padding="5dip"> - <ImageButton android:scaleType="fitXY" + <Button android:scaleType="fitXY" android:layout_height="80dip" android:layout_width="80dip" - android:padding="5dip" android:layout_marginRight="40dip" android:src="@drawable/main_now_playing" android:id="@+id/btn_main_now_playing"> - </ImageButton> + android:padding="5dip" android:layout_marginRight="40dip" android:background="@drawable/main_now_playing" android:id="@+id/btn_main_now_playing"> + </Button> - <ImageButton android:layout_height="80dip" android:layout_width="80dip" - android:scaleType="fitXY" android:padding="5dip" android:src="@drawable/main_settings" android:id="@+id/btn_main_settings"> - </ImageButton> + <Button android:layout_height="80dip" android:layout_width="80dip" + android:scaleType="fitXY" android:padding="5dip" android:background="@drawable/main_settings" android:id="@+id/btn_main_settings"> + </Button> </TableRow> @@ -63,18 +63,14 @@ android:orientation="horizontal" android:background="#0FF0FFFF" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:padding="5dip"> - - - - - <ImageButton android:src="@drawable/main_skp_back" android:scaleType="fitXY" + <Button android:background="@drawable/main_skp_back" android:scaleType="fitXY" android:layout_height="60dip" android:layout_width="60dip" - android:id="@+id/btn_main_skp_back" android:padding="2dip" android:layout_marginRight="5dip"></ImageButton> + android:id="@+id/btn_main_skp_back" android:padding="2dip" android:layout_marginRight="5dip"></Button> <ImageButton android:scaleType="fitXY" android:layout_height="60dip" android:layout_width="60dip" - android:id="@+id/btn_main_play" android:src="@drawable/main_play" android:padding="2dip" android:layout_marginRight="5dip"></ImageButton> - <ImageButton android:scaleType="fitXY" + android:id="@+id/btn_main_play" android:background="@drawable/main_play" android:padding="2dip" android:layout_marginRight="5dip"></ImageButton> + <Button android:scaleType="fitXY" android:layout_height="60dip" android:layout_width="60dip" - android:id="@+id/btn_main_skp_forw" android:src="@drawable/main_skp_forw" android:padding="2dip"></ImageButton> + android:id="@+id/btn_main_skp_forw" android:background="@drawable/main_skp_forw" android:padding="2dip"></Button> </LinearLayout> </LinearLayout> Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml 2010-12-16 13:22:02 UTC (rev 4036) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout-small/playingnow.xml 2010-12-16 16:53:23 UTC (rev 4037) @@ -63,7 +63,7 @@ <ImageButton android:id="@+id/now_stop" android:background="@drawable/stop" android:layout_width="60dip" android:layout_height="60dip"/> <ImageButton android:id="@+id/now_play" - android:background="@drawable/right" android:layout_width="60dip" android:layout_height="60dip"/> + android:background="@drawable/right" android:layout_width="60dip" android:layout_height="60dip" android:scaleType="fitXY"/> <ImageButton android:id="@+id/now_next" android:background="@drawable/skip_forward" android:layout_width="60dip" android:layout_height="60dip"/> <ImageButton android:id="@+id/now_list" Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java 2010-12-16 13:22:02 UTC (rev 4036) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java 2010-12-16 16:53:23 UTC (rev 4037) @@ -34,12 +34,13 @@ import android.view.MotionEvent; import android.view.View; import android.view.GestureDetector.OnGestureListener; +import android.view.View.OnClickListener; import android.widget.Button; public class Remote_03 extends Activity implements OnGestureListener { public static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; - + private GestureDetector gestureScanner; private static final int SWIPE_MIN_DISTANCE = 120; private static final int SWIPE_MAX_OFF_PATH = 250; @@ -52,36 +53,91 @@ setContentView(R.layout.remote03); gestureScanner = new GestureDetector(this); + + OnClickListener mClickListener = new OnClickListener() { + public void onClick(View v) { + Button btn = (Button)v; + PostKey(btn.getText().toString()); + } + }; + + Button btn01 = (Button) findViewById(R.id.btnkey01); + btn01.setOnClickListener(mClickListener); + Button btn02 = (Button) findViewById(R.id.btnkey02); + btn02.setOnClickListener(mClickListener); + Button btn03 = (Button) findViewById(R.id.btnkey03); + btn03.setOnClickListener(mClickListener); + Button btn04 = (Button) findViewById(R.id.btnkey04); + btn04.setOnClickListener(mClickListener); + Button btn05 = (Button) findViewById(R.id.btnkey05); + btn05.setOnClickListener(mClickListener); + Button btn06 = (Button) findViewById(R.id.btnkey06); + btn06.setOnClickListener(mClickListener); + Button btn07 = (Button) findViewById(R.id.btnkey07); + btn07.setOnClickListener(mClickListener); + Button btn08 = (Button) findViewById(R.id.btnkey08); + btn08.setOnClickListener(mClickListener); + Button btn09 = (Button) findViewById(R.id.btnkey09); + btn09.setOnClickListener(mClickListener); + Button btn10 = (Button) findViewById(R.id.btnkey10); + btn10.setOnClickListener(mClickListener); + Button btn11 = (Button) findViewById(R.id.btnkey11); + btn11.setOnClickListener(mClickListener); + Button btn12 = (Button) findViewById(R.id.btnkey12); + btn12.setOnClickListener(mClickListener); + Button btn13 = (Button) findViewById(R.id.btnkey13); + btn13.setOnClickListener(mClickListener); + Button btn14 = (Button) findViewById(R.id.btnkey14); + btn14.setOnClickListener(mClickListener); + Button btn15 = (Button) findViewById(R.id.btnkey15); + btn15.setOnClickListener(mClickListener); + Button btn16 = (Button) findViewById(R.id.btnkey16); + btn16.setOnClickListener(mClickListener); + Button btn17 = (Button) findViewById(R.id.btnkey17); + btn17.setOnClickListener(mClickListener); + Button btn18 = (Button) findViewById(R.id.btnkey18); + btn18.setOnClickListener(mClickListener); + Button btn19 = (Button) findViewById(R.id.btnkey19); + btn19.setOnClickListener(mClickListener); + + Button btn21 = (Button) findViewById(R.id.btnkey21); + btn21.setOnClickListener(mClickListener); + Button btn22 = (Button) findViewById(R.id.btnkey22); + btn22.setOnClickListener(mClickListener); + Button btn23 = (Button) findViewById(R.id.btnkey23); + btn23.setOnClickListener(mClickListener); + Button btn24 = (Button) findViewById(R.id.btnkey24); + btn24.setOnClickListener(mClickListener); + Button btn25 = (Button) findViewById(R.id.btnkey25); + btn25.setOnClickListener(mClickListener); + Button btn26 = (Button) findViewById(R.id.btnkey26); + btn26.setOnClickListener(mClickListener); + Button btn27 = (Button) findViewById(R.id.btnkey27); + btn27.setOnClickListener(mClickListener); } - public void PostCommand(String button) { - + private void PostKey(String Key) { + DoVibrate(); + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); - AssetManager assetManager = getAssets(); String xml = ""; - try { - InputStream inputStream = null; - inputStream = assetManager.open("cmd_" + button + ".xml"); + xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; + xml += "<message>"; + xml += "<command>ACTION_KEY</command>"; + xml += "<key>" + Key + "</key>"; + xml += "</message>"; - int x = inputStream.read(); - - while (x != -1) { - xml = xml + (char) x; - x = inputStream.read(); - } - post.Post(xml); - } catch (IOException e) { - e.printStackTrace(); - } + post.Post(xml); } @Override public boolean onTouchEvent(MotionEvent me) { return gestureScanner.onTouchEvent(me); - } + } + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { try { @@ -90,7 +146,7 @@ // right to left swipe if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - + } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { Intent myIntent = new Intent(this, Remote_02.class); @@ -101,22 +157,26 @@ } return false; } - + public boolean onDown(MotionEvent arg0) { return true; } + public void onLongPress(MotionEvent arg0) { } + public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2, float arg3) { return false; } + public void onShowPress(MotionEvent arg0) { } + public boolean onSingleTapUp(MotionEvent arg0) { return false; } - + public void DoVibrate() { if (Settings.Vibrate) { // Get instance of Vibrator from current Context Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-16 13:22:02 UTC (rev 4036) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-12-16 16:53:23 UTC (rev 4037) @@ -47,6 +47,7 @@ private static final String PREFS_PRIVATE = "PREFS_MP_REMOTE"; private Handler mHandler = new Handler(); private static String display = "nothing playing"; + private static String state = ""; @Override public void onCreate(Bundle savedInstanceState) { @@ -74,13 +75,9 @@ } - Thread.setDefaultUncaughtExceptionHandler(new TopExceptionHandler(this)); - + Thread.setDefaultUncaughtExceptionHandler(new TopExceptionHandler(this)); chkStatus(); - mHandler.removeCallbacks(mUpdateTimeTask); - mHandler.postDelayed(mUpdateTimeTask, 1000); - SharedPreferences settings = getSharedPreferences(PREFS_PRIVATE, MODE_PRIVATE); @@ -88,7 +85,7 @@ Settings.Port = settings.getString("Port", "8200"); Settings.MacId = settings.getString("MacId", "11-22-33-44-55-66"); - ImageButton btnPictures = (ImageButton) findViewById(R.id.btn_main_pictures); + Button btnPictures = (Button) findViewById(R.id.btn_main_pictures); btnPictures.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { DoVibrate(); @@ -97,7 +94,7 @@ } }); - ImageButton btnMusic = (ImageButton) findViewById(R.id.btn_main_music); + Button btnMusic = (Button) findViewById(R.id.btn_main_music); btnMusic.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { DoVibrate(); @@ -106,7 +103,7 @@ } }); - ImageButton btnVideo = (ImageButton) findViewById(R.id.btn_main_video); + Button btnVideo = (Button) findViewById(R.id.btn_main_video); btnVideo.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { DoVibrate(); @@ -114,15 +111,10 @@ Toast.makeText(view.getContext(), "not implemented yet. Sorry !", Toast.LENGTH_LONG) .show(); - - int x = 0; - int y = 1; - - int z = y / x; // we do a exception ;-) } }); - ImageButton btnRemote = (ImageButton) findViewById(R.id.btn_main_remote); + Button btnRemote = (Button) findViewById(R.id.btn_main_remote); btnRemote.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { DoVibrate(); @@ -131,7 +123,7 @@ } }); - ImageButton btnNowPlaying = (ImageButton) findViewById(R.id.btn_main_now_playing); + Button btnNowPlaying = (Button) findViewById(R.id.btn_main_now_playing); btnNowPlaying.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { DoVibrate(); @@ -141,7 +133,7 @@ } }); - ImageButton btnSettings = (ImageButton) findViewById(R.id.btn_main_settings); + Button btnSettings = (Button) findViewById(R.id.btn_main_settings); btnSettings.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { DoVibrate(); @@ -150,7 +142,7 @@ } }); - ImageButton skipForw = (ImageButton) findViewById(R.id.btn_main_skp_forw); + Button skipForw = (Button) findViewById(R.id.btn_main_skp_forw); skipForw.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { DoVibrate(); @@ -158,7 +150,7 @@ } }); - ImageButton skipBack = (ImageButton) findViewById(R.id.btn_main_skp_back); + Button skipBack = (Button) findViewById(R.id.btn_main_skp_back); skipBack.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { DoVibrate(); @@ -281,6 +273,14 @@ } @Override + public void onStart() { + super.onStart(); + + mHandler.removeCallbacks(mUpdateTimeTask); + mHandler.postDelayed(mUpdateTimeTask, 1000); + } + + @Override public void onPause() { super.onPause(); @@ -314,7 +314,9 @@ && (!nowplayinghandler.PlayerState .equals("no player active"))) { display = nowplayinghandler.Artist + " - " - + nowplayinghandler.Title; + + nowplayinghandler.Title + + " (" + nowplayinghandler.Actual + ")"; + state = nowplayinghandler.PlayerState; } return null; @@ -325,7 +327,19 @@ TextView txt0 = (TextView) findViewById(R.id.main_now_playing); txt0.setText(display); - + + ImageButton play = (ImageButton) findViewById(R.id.btn_main_play); + if(state.equals("playing")) + { + play.setImageDrawable(getResources() + .getDrawable(R.drawable.pause)); + } + else + { + play.setImageDrawable(getResources() + .getDrawable(R.drawable.right)); + } + mHandler.postDelayed(mUpdateTimeTask, 1000); } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-12-16 13:22:02 UTC (rev 4036) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/nowplaying.java 2010-12-16 16:53:23 UTC (rev 4037) @@ -118,6 +118,18 @@ } } txt0.setText(display); + + ImageButton play = (ImageButton) findViewById(R.id.now_play); + if(nowplayinghandler.PlayerState.equals("playing")) + { + play.setImageDrawable(getResources() + .getDrawable(R.drawable.pause)); + } + else + { + play.setImageDrawable(getResources() + .getDrawable(R.drawable.right)); + } TextView txt1 = (TextView) findViewById(R.id.now_artist); txt1.setText(nowplayinghandler.Artist); Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-16 13:22:02 UTC (rev 4036) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-16 16:53:23 UTC (rev 4037) @@ -34,6 +34,8 @@ using System.Xml; using System.Drawing; using System.Web; +using System.Windows.Forms; +using System.Runtime.InteropServices; using MediaPortal.GUI.Library; using MediaPortal.Utils; @@ -51,6 +53,10 @@ { public class Request { + // Activate an application window. + [DllImport("USER32.DLL")] + public static extern bool SetForegroundWindow(IntPtr hWnd); + private Socket socket; private byte[] read; private byte[] buffer; @@ -386,19 +392,9 @@ GUIGraphicsContext.OnAction(action); } else - { - if (playlistPlayer.CurrentPlaylistType == PlayListType.PLAYLIST_NONE) - { + { StartPlaylistPlayer del = new StartPlaylistPlayer(StartPlayer); - GUIGraphicsContext.form.Invoke(del, new object[] { }); - - - } - else - { - Action action = new Action(Action.ActionType.ACTION_PLAY, 0, 0); - GUIGraphicsContext.OnAction(action); - } + GUIGraphicsContext.form.Invoke(del, new object[] { }); } } if (data["command"] == ("ACTION_STOP")) @@ -696,6 +692,16 @@ #endregion #endregion + + #region virtual keyboard + if (data["command"] == ("ACTION_KEY")) + { + IntPtr handle = GUIGraphicsContext.form.Handle; + + SetForegroundWindow(handle); + SendKeys.SendWait(data["key"]); + } + #endregion } } } 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. |
From: <kro...@us...> - 2010-12-16 16:55:37
|
Revision: 4038 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4038&view=rev Author: kroko_koenig Date: 2010-12-16 16:55:31 +0000 (Thu, 16 Dec 2010) Log Message: ----------- updated installer Modified Paths: -------------- trunk/plugins/AndroidRemote/Release/AndroidRemote.mpe1 trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Modified: trunk/plugins/AndroidRemote/Release/AndroidRemote.mpe1 =================================================================== (Binary files differ) 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. |
From: <kro...@us...> - 2010-12-17 08:46:29
|
Revision: 4041 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4041&view=rev Author: kroko_koenig Date: 2010-12-17 08:46:22 +0000 (Fri, 17 Dec 2010) Log Message: ----------- small changes Modified Paths: -------------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/TopExceptionHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Release/AndroidRemote.mpe1 trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs trunk/plugins/AndroidRemote/Server/AndroidRemote.suo Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-16 20:51:21 UTC (rev 4040) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_01.java 2010-12-17 08:46:22 UTC (rev 4041) @@ -57,7 +57,6 @@ Button can = (Button) findViewById(R.id.btnBack); can.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("previousMenu"); } }); @@ -65,7 +64,6 @@ Button menu = (Button) findViewById(R.id.btnMenu); menu.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("contextMenu"); } }); @@ -73,7 +71,6 @@ Button home = (Button) findViewById(R.id.btnHome); home.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("parentDir"); } }); @@ -81,7 +78,6 @@ Button info = (Button) findViewById(R.id.btnInfo); info.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("showInfo"); } }); @@ -89,7 +85,6 @@ Button left = (Button) findViewById(R.id.btnLeft); left.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("moveLeft"); } }); @@ -97,7 +92,6 @@ Button right = (Button) findViewById(R.id.btnRight); right.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("moveRight"); } }); @@ -105,7 +99,6 @@ Button up = (Button) findViewById(R.id.btnUp); up.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("moveUp"); } }); @@ -113,7 +106,6 @@ Button down = (Button) findViewById(R.id.btnDown); down.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("moveDown"); } }); @@ -121,7 +113,6 @@ Button ok = (Button) findViewById(R.id.btnOk); ok.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("selectItem"); } }); @@ -136,7 +127,6 @@ Button pause = (Button) findViewById(R.id.btnPause); pause.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("pause"); } }); @@ -144,7 +134,6 @@ Button stop = (Button) findViewById(R.id.btnStop); stop.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("stop"); } }); @@ -152,7 +141,6 @@ Button skipForw = (Button) findViewById(R.id.btnSkipForw); skipForw.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("nextItem"); } }); @@ -160,7 +148,6 @@ Button skipBack = (Button) findViewById(R.id.btnSkipBack); skipBack.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("prevItem"); } }); @@ -168,7 +155,6 @@ Button fForw = (Button) findViewById(R.id.btnFForw); fForw.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("forward"); } }); @@ -176,7 +162,6 @@ Button fBackw = (Button) findViewById(R.id.btnFBack); fBackw.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("rewind"); } }); @@ -188,6 +173,8 @@ public void PostCommand(String button) { + DoVibrate(); + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); AssetManager assetManager = getAssets(); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-16 20:51:21 UTC (rev 4040) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_02.java 2010-12-17 08:46:22 UTC (rev 4041) @@ -56,21 +56,18 @@ Button btnVolumeUp = (Button) findViewById(R.id.btnVolumeUp); btnVolumeUp.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("volumeUp"); } }); Button btnVolumeDown = (Button) findViewById(R.id.btnVolumeDown); btnVolumeDown.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("volumeDown"); } }); Button btnVolumeMute = (Button) findViewById(R.id.btnVolumeMute); btnVolumeMute.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("volumeMute"); } }); @@ -78,14 +75,12 @@ Button btnChannelUp = (Button) findViewById(R.id.btnChannelUp); btnChannelUp.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("nextChannel"); } }); Button btnChannelDown = (Button) findViewById(R.id.btnChannelDown); btnChannelDown.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("prevChannel"); } }); @@ -93,7 +88,6 @@ Button btnExit = (Button) findViewById(R.id.btnExit); btnExit.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("exit"); } }); @@ -106,14 +100,12 @@ Button btnHibernate = (Button) findViewById(R.id.btnHibernate); btnHibernate.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("hibernate"); } }); Button btnRestart = (Button) findViewById(R.id.btnRestart); btnRestart.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("restart"); } }); @@ -127,7 +119,6 @@ Button btnWakeOnLan = (Button) findViewById(R.id.btnWakeOnLan); btnWakeOnLan.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { - DoVibrate(); PostCommand("wakeonlan"); } }); @@ -136,6 +127,8 @@ public void PostCommand(String button) { + DoVibrate(); + PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); AssetManager assetManager = getAssets(); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java 2010-12-16 20:51:21 UTC (rev 4040) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/Remote_03.java 2010-12-17 08:46:22 UTC (rev 4041) @@ -21,13 +21,11 @@ package mediaportal.remote; -import java.io.IOException; -import java.io.InputStream; + import mediaportal.remote.R; import android.app.Activity; import android.content.Context; import android.content.Intent; -import android.content.res.AssetManager; import android.os.Bundle; import android.os.Vibrator; import android.view.GestureDetector; @@ -45,7 +43,7 @@ private static final int SWIPE_MIN_DISTANCE = 120; private static final int SWIPE_MAX_OFF_PATH = 250; private static final int SWIPE_THRESHOLD_VELOCITY = 200; - + /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { @@ -101,6 +99,15 @@ Button btn19 = (Button) findViewById(R.id.btnkey19); btn19.setOnClickListener(mClickListener); + // shift + Button btn20 = (Button) findViewById(R.id.btnkey20); + btn20.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + DoVibrate(); + + } + }); + Button btn21 = (Button) findViewById(R.id.btnkey21); btn21.setOnClickListener(mClickListener); Button btn22 = (Button) findViewById(R.id.btnkey22); @@ -115,9 +122,26 @@ btn26.setOnClickListener(mClickListener); Button btn27 = (Button) findViewById(R.id.btnkey27); btn27.setOnClickListener(mClickListener); + + Button btn30 = (Button) findViewById(R.id.btnkey30); + btn30.setOnClickListener(mClickListener); + + // space + Button btn31 = (Button) findViewById(R.id.btnkey31); + btn31.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostKey(" "); + } + }); + + Button btn32 = (Button) findViewById(R.id.btnkey32); + btn32.setOnClickListener(mClickListener); + Button btn33 = (Button) findViewById(R.id.btnkey33); + btn33.setOnClickListener(mClickListener); } private void PostKey(String Key) { + DoVibrate(); PostWebserver post = new PostWebserver(Settings.Server, Settings.Port); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/TopExceptionHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/TopExceptionHandler.java 2010-12-16 20:51:21 UTC (rev 4040) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/TopExceptionHandler.java 2010-12-17 08:46:22 UTC (rev 4041) @@ -62,6 +62,8 @@ } report += "-------------------------------\n\n"; + report += "Remote Version : initial release\n\n"; + report += "-------------------------------\n\n"; report += "--------- Device ---------\n\n"; report += "Brand: " + Build.BRAND + "\n"; report += "Device: " + Build.DEVICE + "\n"; Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-16 20:51:21 UTC (rev 4040) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicAlbum.java 2010-12-17 08:46:22 UTC (rev 4041) @@ -31,6 +31,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; +import android.os.Vibrator; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -115,6 +116,14 @@ listview.setAdapter(new EfficientAdapter(musicAlbum.this)); } } + + public void DoVibrate() { + if (Settings.Vibrate) { + // Get instance of Vibrator from current Context + Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); + v.vibrate(100); + } + } } private static class EfficientAdapter extends BaseAdapter { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-16 20:51:21 UTC (rev 4040) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/musicArtist.java 2010-12-17 08:46:22 UTC (rev 4041) @@ -31,6 +31,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; +import android.os.Vibrator; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -65,7 +66,7 @@ musicResults.Select = item.Artist; musicResults.Mode = musicResults.SelectMode.Artist; - + Intent myIntent = new Intent(arg1.getContext(), musicResults.class); startActivityForResult(myIntent, 0); @@ -116,6 +117,14 @@ listview.setAdapter(new EfficientAdapter(musicArtist.this)); } } + + public void DoVibrate() { + if (Settings.Vibrate) { + // Get instance of Vibrator from current Context + Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); + v.vibrate(100); + } + } } private static class EfficientAdapter extends BaseAdapter { Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-16 20:51:21 UTC (rev 4040) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-12-17 08:46:22 UTC (rev 4041) @@ -40,22 +40,16 @@ import android.os.Environment; import android.os.Handler; import android.util.Log; -import android.view.ContextMenu; import android.view.GestureDetector; -import android.view.MenuInflater; -import android.view.MenuItem; import android.view.MotionEvent; -import android.view.View; import android.view.Window; import android.view.WindowManager; -import android.view.ContextMenu.ContextMenuInfo; import android.view.GestureDetector.OnGestureListener; -import android.view.View.OnCreateContextMenuListener; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; -public class picturesfullscreen extends Activity implements OnGestureListener { +public class picturesfullscreen extends Activity implements OnGestureListener { private Handler mHandler = new Handler(); private GestureDetector gestureScanner; @@ -77,22 +71,22 @@ WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.picturesfullscreen); - gestureScanner = new GestureDetector(picturesfullscreen.this); - new setPicture().execute(); } - private class setPicture extends AsyncTask<String, Void, Void> { - private final ProgressDialog dialog = new ProgressDialog(picturesfullscreen.this); + private final ProgressDialog dialog = new ProgressDialog( + picturesfullscreen.this); DirItems item = pictures.pictureList.get(pictures.selectedPicture); // can use UI thread here protected void onPreExecute() { - this.dialog.setMessage("Loading..."); - this.dialog.show(); + if (!slideShow) { + this.dialog.setMessage("Loading..."); + this.dialog.show(); + } } // automatically done on worker thread (separate from UI thread) @@ -100,7 +94,7 @@ if (!item.isFolder) { httpHandler http = new httpHandler(); String file = "http://" + Settings.Server + ":" + Settings.Port - + "/pictures/"; + + "/pictures/"; file += pictures.actualDir + item.File; item.Picture = http.DownloadImage(file.replaceAll(" ", "%20")); } @@ -114,17 +108,15 @@ this.dialog.dismiss(); } - if (item.isFolder != true){ + if (item.isFolder != true) { ImageView imagev = (ImageView) findViewById(R.id.ImageView01); imagev.setImageBitmap(item.Picture); TextView txt = (TextView) findViewById(R.id.full_text); txt.setText(item.File); } - } - } + } - @Override public void onStart() { super.onStart(); @@ -145,10 +137,9 @@ pictures.selectedPicture = 0; new setPicture().execute(); - } - else if (randomShow) { - String req = "http://" + Settings.Server + ":" - + Settings.Port + "/random/pictures/random.jpg"; + } else if (randomShow) { + String req = "http://" + Settings.Server + ":" + Settings.Port + + "/random/pictures/random.jpg"; httpHandler handler = new httpHandler(); Bitmap pic = handler.DownloadImage(req); @@ -171,7 +162,6 @@ mHandler.removeCallbacks(mUpdateTimeTask); } - @Override protected void onResume() { super.onResume(); @@ -180,14 +170,13 @@ mHandler.postDelayed(mUpdateTimeTask, SlideInterval); } - // **************** // Menu Functions // ****************** private void OpenURL() { DirItems item = pictures.pictureList.get(pictures.selectedPicture); String file = "http://" + Settings.Server + ":" + Settings.Port - + "/pictures/"; + + "/pictures/"; file += pictures.actualDir + item.File; String url = file.replaceAll(" ", "%20"); Intent i = new Intent(Intent.ACTION_VIEW); @@ -207,7 +196,6 @@ + item.File.toString()); } catch (FileNotFoundException e) { - // TODO Auto-generated catch block e.printStackTrace(); Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString()); @@ -216,7 +204,6 @@ try { outStream.flush(); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString()); @@ -224,10 +211,14 @@ try { outStream.close(); + @SuppressWarnings("unused") + MediaScannerNotifier media = new MediaScannerNotifier( + picturesfullscreen.this, fPath + "/" + + item.File.toString(), "image/jpeg"); + Toast.makeText(picturesfullscreen.this, "File saved.", Toast.LENGTH_SHORT).show(); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); Log.e("Debug", "SavetoSDCard " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString()); @@ -248,7 +239,7 @@ picMessageIntent.setType("image/jpeg"); picMessageIntent.putExtra(Intent.EXTRA_STREAM, item.Picture); startActivity(Intent.createChooser(picMessageIntent, - "Send picture using:")); + "Send picture using:")); } catch (Exception e) { Log.e("Debug", "SendPicture " + e.getMessage().toString() + " |||| " + e.getLocalizedMessage().toString()); @@ -256,6 +247,9 @@ } } + // **************** + // gesture control + // **************** @Override public boolean onTouchEvent(MotionEvent me) { @@ -274,12 +268,12 @@ if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { - if (pictures.selectedPicture < max - 1) { + if (pictures.selectedPicture < max - 1) { pictures.selectedPicture++; new setPicture().execute(); } else - Toast.makeText(this, "reached end +", - Toast.LENGTH_SHORT).show(); + Toast.makeText(this, "reached end +", Toast.LENGTH_SHORT) + .show(); return true; } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { @@ -288,8 +282,8 @@ pictures.selectedPicture--; new setPicture().execute(); } else - Toast.makeText(this, "reached end -", - Toast.LENGTH_SHORT).show(); + Toast.makeText(this, "reached end -", Toast.LENGTH_SHORT) + .show(); return true; } } catch (Exception e) { @@ -306,21 +300,21 @@ String slidestatus; String randomslidestatus; - if (slideShow == true) + if (slideShow == true) slidestatus = "Stop slideshow"; else slidestatus = "Start slideshow"; - if (randomShow == true) + if (randomShow == true) randomslidestatus = "Stop random slideshow"; else randomslidestatus = "Start random slideshow"; - final CharSequence[] items = { "Save to sd card", "Open in browser", - "Send Picture", slidestatus ,randomslidestatus, "Cancel" }; + "Send Picture", slidestatus, randomslidestatus, "Cancel" }; - AlertDialog.Builder builder = new AlertDialog.Builder(picturesfullscreen.this); + AlertDialog.Builder builder = new AlertDialog.Builder( + picturesfullscreen.this); builder.setTitle("Picture optoins"); builder.setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { @@ -368,28 +362,21 @@ } public boolean onSingleTapUp(MotionEvent arg0) { - if (slideShow == true || randomShow == true){ - if (SlideshowPaused == false) - { + if (slideShow == true || randomShow == true) { + if (SlideshowPaused == false) { onPause(); - Toast.makeText(this, "Pause slideshow", - Toast.LENGTH_SHORT).show(); + Toast.makeText(this, "Pause slideshow", Toast.LENGTH_SHORT) + .show(); return true; - } - else - { - onResume(); - Toast.makeText(this, "Resume slideshow", - Toast.LENGTH_SHORT).show(); + } else { + onResume(); + Toast.makeText(this, "Resume slideshow", Toast.LENGTH_SHORT) + .show(); return true; } - } - else - { + } else { return false; } } - - } \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Release/AndroidRemote.mpe1 =================================================================== (Binary files differ) Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-16 20:51:21 UTC (rev 4040) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2010-12-17 08:46:22 UTC (rev 4041) @@ -354,7 +354,16 @@ PlayList playList = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); if (playList.Count > 0) playlistPlayer.Play(0); + } + private void StartPlayerLast() + { + // we need to do this, we could crash external players because their are not thread safe. + PlayListPlayer playlistPlayer = PlayListPlayer.SingletonPlayer; + playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC; + PlayList playList = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); + if (playList.Count > 0) + playlistPlayer.Play(playList.Count - 1); } private void ExceuteCommand(string Message) @@ -392,9 +401,9 @@ GUIGraphicsContext.OnAction(action); } else - { - StartPlaylistPlayer del = new StartPlaylistPlayer(StartPlayer); - GUIGraphicsContext.form.Invoke(del, new object[] { }); + { + StartPlaylistPlayer del = new StartPlaylistPlayer(StartPlayer); + GUIGraphicsContext.form.Invoke(del, new object[] { }); } } if (data["command"] == ("ACTION_STOP")) @@ -589,6 +598,12 @@ playlistItem.MusicTag = tag; playList.Add(playlistItem); + + if (!g_Player.Playing) + { + StartPlaylistPlayer del = new StartPlaylistPlayer(StartPlayerLast); + GUIGraphicsContext.form.Invoke(del, new object[] { }); + } } } #endregion @@ -644,6 +659,12 @@ playlistItem.MusicTag = tag; playList.Add(playlistItem); + + if (!g_Player.Playing) + { + StartPlaylistPlayer del = new StartPlaylistPlayer(StartPlayerLast); + GUIGraphicsContext.form.Invoke(del, new object[] { }); + } } } @@ -866,7 +887,7 @@ byte[] b; Bitmap thumb = (Bitmap)bit.Clone(); - thumb = MediaPortal.Util.BitmapResize.Resize(ref thumb, 85, 85, false, true); + thumb = MediaPortal.Util.BitmapResize.Resize(ref thumb, 85, 60, false, true); b = BildToByteArray((Image)thumb); @@ -1088,7 +1109,7 @@ byte[] b; Bitmap thumb = (Bitmap)bit.Clone(); - thumb = MediaPortal.Util.BitmapResize.Resize(ref thumb, 85, 85, false, true); + thumb = MediaPortal.Util.BitmapResize.Resize(ref thumb, 85, 60, false, true); b = BildToByteArray((Image)thumb); 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. |