From: <kro...@us...> - 2011-01-21 16:49:39
|
Revision: 4075 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4075&view=rev Author: kroko_koenig Date: 2011-01-21 16:49:31 +0000 (Fri, 21 Jan 2011) Log Message: ----------- play video local and on the MP 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/communication/SendCommand.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directory/ReceiveDirHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures/Picturesfullscreen.java trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj trunk/plugins/AndroidRemote/Server/AndroidRemote/Content/ExecuteCommand.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.suo Added Paths: ----------- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/movie.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movies.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/movies/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/movies/Movies.java trunk/plugins/AndroidRemote/Server/AndroidRemote/Content/VideoHandler.cs Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2011-01-21 16:49:31 UTC (rev 4075) @@ -32,6 +32,7 @@ <activity android:launchMode="singleInstance" android:name=".music.MusicResults"></activity> <activity android:launchMode="singleInstance" android:name=".multimedia.Webradio"></activity> <activity android:name=".MediaPlayerControl" android:launchMode="singleInstance"></activity> + <activity android:name=".movies.Movies" android:launchMode="singleInstance"></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 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2011-01-21 16:49:31 UTC (rev 4075) @@ -51,46 +51,47 @@ public static final int main_settings=0x7f020022; public static final int main_video=0x7f020023; public static final int menu=0x7f020024; - public static final int music=0x7f020025; - public static final int mute=0x7f020026; - public static final int n_asr=0x7f020027; - public static final int n_full=0x7f020028; - public static final int n_menu=0x7f020029; - public static final int n_osd=0x7f02002a; - public static final int n_sub=0x7f02002b; - public static final int now_playing=0x7f02002c; - public static final int pause=0x7f02002d; - public static final int picture=0x7f02002e; - public static final int pictures=0x7f02002f; - public static final int play=0x7f020030; - public static final int plugins=0x7f020031; - public static final int power_off=0x7f020032; - public static final int remote=0x7f020033; - public static final int restart=0x7f020034; - public static final int rewind=0x7f020035; - public static final int right=0x7f020036; - public static final int sel_play=0x7f020037; - public static final int sel_skp_back=0x7f020038; - public static final int sel_skp_forw=0x7f020039; - public static final int select=0x7f02003a; - public static final int select2=0x7f02003b; - public static final int settings=0x7f02003c; - public static final int skip_back=0x7f02003d; - public static final int skip_forward=0x7f02003e; - public static final int song=0x7f02003f; - public static final int song_off=0x7f020040; - public static final int splash=0x7f020041; - public static final int splash02=0x7f020042; - public static final int stop=0x7f020043; - public static final int suspend=0x7f020044; - public static final int up=0x7f020045; - public static final int video=0x7f020046; - public static final int volume_m=0x7f020047; - public static final int volume_p=0x7f020048; - public static final int wake_on_lan=0x7f020049; + public static final int movie=0x7f020025; + public static final int music=0x7f020026; + public static final int mute=0x7f020027; + public static final int n_asr=0x7f020028; + public static final int n_full=0x7f020029; + public static final int n_menu=0x7f02002a; + public static final int n_osd=0x7f02002b; + public static final int n_sub=0x7f02002c; + public static final int now_playing=0x7f02002d; + public static final int pause=0x7f02002e; + public static final int picture=0x7f02002f; + public static final int pictures=0x7f020030; + public static final int play=0x7f020031; + public static final int plugins=0x7f020032; + public static final int power_off=0x7f020033; + public static final int remote=0x7f020034; + public static final int restart=0x7f020035; + public static final int rewind=0x7f020036; + public static final int right=0x7f020037; + public static final int sel_play=0x7f020038; + public static final int sel_skp_back=0x7f020039; + public static final int sel_skp_forw=0x7f02003a; + public static final int select=0x7f02003b; + public static final int select2=0x7f02003c; + public static final int settings=0x7f02003d; + public static final int skip_back=0x7f02003e; + public static final int skip_forward=0x7f02003f; + public static final int song=0x7f020040; + public static final int song_off=0x7f020041; + public static final int splash=0x7f020042; + public static final int splash02=0x7f020043; + public static final int stop=0x7f020044; + public static final int suspend=0x7f020045; + public static final int up=0x7f020046; + public static final int video=0x7f020047; + public static final int volume_m=0x7f020048; + public static final int volume_p=0x7f020049; + public static final int wake_on_lan=0x7f02004a; } public static final class id { - public static final int GridView01=0x7f07001b; + public static final int GridView01=0x7f070014; public static final int ImageView01=0x7f07001d; public static final int LinearLayout00=0x7f07005c; public static final int LinearLayout01=0x7f070024; @@ -114,8 +115,8 @@ public static final int btnHibernate=0x7f070058; public static final int btnIpSettings=0x7f07008e; public static final int btnRestart=0x7f070059; - public static final int btnSelDown=0x7f070018; - public static final int btnSelUp=0x7f070019; + public static final int btnSelDown=0x7f07001a; + public static final int btnSelUp=0x7f07001b; public static final int btnShutOff=0x7f07005a; public static final int btnSuspend=0x7f070057; public static final int btnVolumeDown=0x7f070054; @@ -204,12 +205,12 @@ public static final int full_text=0x7f07001c; public static final int icon_image=0x7f070001; public static final int icon_text=0x7f070002; - public static final int list_album=0x7f070014; - public static final int list_artist=0x7f070015; - public static final int list_result=0x7f070016; - public static final int list_song=0x7f070017; + public static final int list_album=0x7f070016; + public static final int list_artist=0x7f070017; + public static final int list_result=0x7f070018; + public static final int list_song=0x7f070019; public static final int main_now_playing=0x7f07000e; - public static final int music_grid=0x7f070013; + public static final int music_grid=0x7f070015; public static final int naviRemote_text=0x7f070050; public static final int now_album=0x7f070026; public static final int now_artist=0x7f07002c; @@ -242,7 +243,7 @@ public static final int slide=0x7f0700a0; public static final int text_kb_streamed=0x7f07001e; public static final int title=0x7f070094; - public static final int txtDirectory=0x7f07001a; + public static final int txtDirectory=0x7f070013; public static final int txtFile=0x7f07001f; public static final int txtInstance=0x7f070006; public static final int txtIntanceName=0x7f070092; @@ -257,26 +258,27 @@ public static final int icon=0x7f030000; public static final int list_item=0x7f030001; public static final int main=0x7f030002; - 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 player=0x7f03000b; - public static final int playingnow=0x7f03000c; - public static final int playnowlist=0x7f03000d; - public static final int remote01=0x7f03000e; - public static final int remote02=0x7f03000f; - public static final int remote03=0x7f030010; - public static final int remote03b=0x7f030011; - public static final int setup=0x7f030012; - public static final int setup_ip=0x7f030013; - public static final int splash=0x7f030014; - public static final int title=0x7f030015; - public static final int webradio=0x7f030016; + public static final int movies=0x7f030003; + public static final int music=0x7f030004; + public static final int music_album=0x7f030005; + public static final int music_artist=0x7f030006; + public static final int music_results=0x7f030007; + public static final int music_song=0x7f030008; + public static final int musictab=0x7f030009; + public static final int pictures=0x7f03000a; + public static final int picturesfullscreen=0x7f03000b; + public static final int player=0x7f03000c; + public static final int playingnow=0x7f03000d; + public static final int playnowlist=0x7f03000e; + public static final int remote01=0x7f03000f; + public static final int remote02=0x7f030010; + public static final int remote03=0x7f030011; + public static final int remote03b=0x7f030012; + public static final int setup=0x7f030013; + public static final int setup_ip=0x7f030014; + public static final int splash=0x7f030015; + public static final int title=0x7f030016; + public static final int webradio=0x7f030017; } public static final class menu { public static final int music_menu=0x7f060000; Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/movie.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/movie.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movies.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movies.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/movies.xml 2011-01-21 16:49:31 UTC (rev 4075) @@ -0,0 +1,19 @@ +<LinearLayout android:id="@+id/widget0" + android:layout_width="fill_parent" android:layout_height="wrap_content" + xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"> + + <TextView android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="Actual: ..." android:textColor="#FFFFFFFF" + android:textSize="20dip" + android:id="@+id/txtDirectory" android:paddingBottom="5dip"></TextView> + + <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> +</LinearLayout> + Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/SendCommand.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/SendCommand.java 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/communication/SendCommand.java 2011-01-21 16:49:31 UTC (rev 4075) @@ -185,5 +185,24 @@ post.Post(xml); } + + public static void PostPlayFile(String Filename, String MediaTyp) { + Filename = Entity.AddEntity(Filename); + + Log.d("MediaPortal", "PostPlayFile : " + Filename); + + PostWebserver post = new PostWebserver(AppSettings.getServer(), AppSettings.getPort()); + String xml = ""; + + xml += "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"; + xml += "<message>\r\n"; + xml += "<command>PlayFile</command>\r\n"; + xml += "<filename>" + Filename + "</filename>\r\n"; + xml += "<mediatyp>" + MediaTyp + "</mediatyp>\r\n"; + xml += "</message>\r\n"; + + post.Post(xml); + } + } Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directory/ReceiveDirHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directory/ReceiveDirHandler.java 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directory/ReceiveDirHandler.java 2011-01-21 16:49:31 UTC (rev 4075) @@ -46,7 +46,12 @@ return fetchData("/pictures/" + Dir); } + + public ArrayList<DirItems> getMoviesDir(String Dir) { + return fetchData("/movies/" + Dir); + } + public ArrayList<DirItems> gotodir(String dir) { actualDir += "/" + dir; return fetchData(actualDir); Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2011-01-21 16:49:31 UTC (rev 4075) @@ -30,6 +30,7 @@ import mediaportal.remote.R; import mediaportal.remote.communication.SendCommand; import mediaportal.remote.control.Remote_01; +import mediaportal.remote.movies.Movies; import mediaportal.remote.music.MusicTab; import mediaportal.remote.nowPlaying.NowPlaying; import mediaportal.remote.nowPlaying.NowPlayingXmlHandler; @@ -46,7 +47,6 @@ import android.content.DialogInterface; import android.content.Intent; import android.net.ConnectivityManager; -import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.os.Environment; @@ -147,17 +147,8 @@ btnVideo.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Vibration.vibrateShort(); - - //Toast.makeText(view.getContext(), - // "not implemented yet. Sorry !", Toast.LENGTH_SHORT) - // .show(); - - // Intent myIntent = new Intent(view.getContext(), - // MediaPlayerControl.class); - // startActivity(myIntent); - - startActivity(new Intent(Intent.ACTION_VIEW, - Uri.parse("rtsp://" + AppSettings.getServer() + ":5554/android.sdp"))); + Intent myIntent = new Intent(view.getContext(), Movies.class); + startActivity(myIntent); } }); Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/movies/Movies.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/movies/Movies.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/movies/Movies.java 2011-01-21 16:49:31 UTC (rev 4075) @@ -0,0 +1,349 @@ +/* + * Copyright (C) 2005-2011 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.movies; + +import java.util.ArrayList; +import mediaportal.remote.R; +import mediaportal.remote.communication.SendCommand; +import mediaportal.remote.directory.ReceiveDirHandler; +import mediaportal.remote.directory.ReceiveDirectoryXmlHandler; +import mediaportal.remote.directory.ReceiveDirectoryXmlHandler.DirItems; +import mediaportal.remote.utils.AppSettings; +import mediaportal.remote.utils.Vibration; +import android.app.Activity; +import android.app.AlertDialog; +import android.app.ProgressDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.net.Uri; +import android.os.AsyncTask; +import android.os.Bundle; +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 Movies extends Activity { + + public static String actualDir = ""; + + public static ArrayList<ReceiveDirectoryXmlHandler.DirItems> moviesList; + + public static int selectedMovie; + public static String File; + + private BaseAdapter adapter; + + private update taskFetchData; + private startVideo taskStartVideo; + + final CharSequence[] items = { "Play file locally", "Play file on MP" }; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.pictures); + + adapter = new ImageAdapter2(Movies.this); + + taskFetchData = new update(); + taskFetchData.execute(); + + GridView gridview = (GridView) findViewById(R.id.GridView01); + + gridview.setOnItemClickListener(new OnItemClickListener() { + public void onItemClick(AdapterView<?> parent, View v, + int position, long id) { + + ImageView iv = (ImageView) v.findViewById(R.id.icon_image); + movieItem movie = (movieItem) iv.getTag(); + + Vibration.vibrateShort(); + + if (movie.typ == "item") { + selectedMovie = position - 1; + File = actualDir + movie.title.replaceAll(" ", "%20"); + + AlertDialog.Builder builder = new AlertDialog.Builder( + Movies.this); + + builder.setTitle("Movies options"); + + builder.setItems(items, + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, + int item) { + switch (item) { + case 0: + SendCommand.PostStreamFile(File, + "video"); + + taskStartVideo = new startVideo(); + taskStartVideo.execute(); + break; + case 1: + SendCommand.PostPlayFile(File, "video"); + break; + + } + } + }); + AlertDialog alert = builder.create(); + alert.show(); + } + + if (movie.typ == "folder") { + actualDir += movie.title.replaceAll(" ", "%20") + "/"; + + taskFetchData = new update(); + taskFetchData.execute(); + } + + if (movie.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 = ""; + + taskFetchData = new update(); + taskFetchData.execute(); + } + } + }); + } + + private class update extends AsyncTask<String, Void, Void> { + private final ProgressDialog dialog = new ProgressDialog(Movies.this); + + // can use UI thread here + protected void onPreExecute() { + try { + this.dialog.setMessage("Loading..."); + this.dialog.show(); + + String dsp = actualDir; + int len = dsp.length(); + + if (dsp == "") + dsp = "root"; + if (len > 25) + dsp = "..." + dsp.substring(len - 20, len); + + TextView txt = (TextView) findViewById(R.id.txtDirectory); + txt.setText("Act: " + dsp); + + } catch (Exception ex) { + } + } + + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { + Log.d("MediaPortal", "pictures do read folder : " + actualDir); + + ReceiveDirHandler h = ReceiveDirHandler.getinstance(); + moviesList = h.getMoviesDir(actualDir); + + return null; + } + + // can use UI thread here + protected void onPostExecute(final Void unused) { + if (this.dialog.isShowing()) { + try { + this.dialog.dismiss(); + } catch (Exception ex) { + } + } + + Log.d("MediaPortal", "movies read folder finished"); + + if (moviesList == null) { + Toast.makeText(Movies.this, "TIME OUT SERVER", + Toast.LENGTH_SHORT).show(); + } else { + if (moviesList.size() == 0) { + Toast.makeText(Movies.this, "no items", Toast.LENGTH_SHORT) + .show(); + } + + GridView gridview = (GridView) findViewById(R.id.GridView01); + gridview.setAdapter(adapter); + } + } + } + + private class startVideo extends AsyncTask<String, Void, Void> { + private final ProgressDialog dialog = new ProgressDialog(Movies.this); + + // can use UI thread here + protected void onPreExecute() { + try { + this.dialog.setMessage("Please wait..."); + this.dialog.show(); + } catch (Exception ex) { + } + } + + // automatically done on worker thread (separate from UI thread) + protected Void doInBackground(final String... args) { + try { + Thread.sleep(3000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } + + // can use UI thread here + protected void onPostExecute(final Void unused) { + if (this.dialog.isShowing()) { + try { + this.dialog.dismiss(); + } catch (Exception ex) { + } + + String link = "rtsp://" + AppSettings.getServer() + + ":5554/MediaPortal.sdp"; + + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(link)); + startActivity(intent); + } + + Log.d("MediaPortal", "movies read folder finished"); + + if (moviesList == null) { + Toast.makeText(Movies.this, "TIME OUT SERVER", + Toast.LENGTH_SHORT).show(); + } else { + if (moviesList.size() == 0) { + Toast.makeText(Movies.this, "no items", Toast.LENGTH_SHORT) + .show(); + } + + GridView gridview = (GridView) findViewById(R.id.GridView01); + gridview.setAdapter(adapter); + } + } + } + + public class ImageAdapter2 extends BaseAdapter { + private Context mContext; + public static final int ACTIVITY_CREATE = 10; + + public ImageAdapter2(Context c) { + mContext = c; + } + + public int getCount() { + if (moviesList != null) + return moviesList.size() + 1; + else + return 0; + } + + 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 + + LayoutInflater li = LayoutInflater.from(mContext); + v = li.inflate(R.layout.icon, null); + } else { + v = convertView; + } + + if (position > 0) { + position = position - 1; + + DirItems item = moviesList.get(position); + + String txtName = item.File; + Boolean isFolder = item.isFolder; + + 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); + movieItem pic = new movieItem(); + pic.title = txtName; + pic.typ = "folder"; + iv.setTag(pic); + } else { + iv.setImageResource(R.drawable.movie); + + movieItem pic = new movieItem(); + 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(".."); + + ImageView iv = (ImageView) v.findViewById(R.id.icon_image); + iv.setImageResource(R.drawable.folderback); + movieItem mov = new movieItem(); + mov.title = ".."; + mov.typ = "oneup"; + iv.setTag(mov); + } + + return v; + } + } + + public class movieItem { + public String title; + public String typ; + } + +} Modified: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures/Picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures/Picturesfullscreen.java 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures/Picturesfullscreen.java 2011-01-21 16:49:31 UTC (rev 4075) @@ -416,7 +416,7 @@ randomslidestatus = "Start random slideshow"; final CharSequence[] items = { "Save to sd card", "Open in browser", - "Send Picture", slidestatus, randomslidestatus, "Cancel" }; + "Send Picture", slidestatus, randomslidestatus }; AlertDialog.Builder builder = new AlertDialog.Builder( Picturesfullscreen.this); Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/AndroidRemote.csproj 2011-01-21 16:49:31 UTC (rev 4075) @@ -58,6 +58,7 @@ </ItemGroup> <ItemGroup> <Compile Include="AndroidServer.cs" /> + <Compile Include="Content\VideoHandler.cs" /> <Compile Include="Content\MusicHandler.cs" /> <Compile Include="Content\NowPlayingHandler.cs" /> <Compile Include="Content\PictureHandler.cs" /> Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Content/ExecuteCommand.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Content/ExecuteCommand.cs 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Content/ExecuteCommand.cs 2011-01-21 16:49:31 UTC (rev 4075) @@ -30,6 +30,7 @@ using System.Runtime.InteropServices; using System.IO; using System.Net.Sockets; +using System.Web; using MediaPortal.GUI.Library; using MediaPortal.Utils; @@ -50,6 +51,7 @@ private delegate void DoActionHandler(Action action); private delegate void DoFullscreenHandler(); + private delegate void DoStartFileHandler(string file); private delegate void StartPlaylistPlayer(); private static Dictionary<string, string> directoryList = new Dictionary<string, string>(); @@ -563,7 +565,6 @@ if (AndroidServer.vlc != null) { if (AndroidServer.vlc.IsPlaying) AndroidServer.vlc.Stop(); - AndroidServer.vlc = null; } string sVlcPath; @@ -577,53 +578,65 @@ { "--audio-desync=-50", "--no-sout-rtp-sap", - "--sout-transcode-fps=25", + "--sout-transcode-fps=15", "--sout-rtp-caching=2000", "--sout-transcode-threads=4", "--sout-transcode-high-priority", "--sout-keep", - "--sout=#duplicate{dst='transcode{venc=x264{profile=baseline,level=3,keyint=50,bframes=0,no-cabac,ref=1,no-interlaced,vbv-maxrate=512,vbv-bufsize=256,aq-mode=0,no-mbtree,partitions=none,no-weightb,weightp=0,me=dia,subme=0,no-mixed-refs,no-8x8dct,trellis=0},vcodec=h264,vb=600,vfilter=canvas{width=480,height=320,aspect=480:320,padd},soverlay,aenc=ffmpeg{aac-profile=low},acodec=mp4a,ab=128,channels=2,audio-sync}:gather:rtp{sdp=rtsp://0.0.0.0:5554/android.sdp,mp4a-latm}',dst='transcode{vcodec=null,acodec=mp3,ab=160,channels=2}:gather:std{access=http,mux=raw,dst=0.0.0.0:8081}'}", + "--sout=#duplicate{dst='transcode{venc=x264{profile=baseline,level=3,keyint=30,bframes=0,no-cabac,ref=1,no-interlaced,vbv-maxrate=512,vbv-bufsize=256,aq-mode=0,no-mbtree,partitions=none,no-weightb,weightp=0,me=dia,subme=0,no-mixed-refs,no-8x8dct,trellis=0},vcodec=h264,vb=512,vfilter=canvas{width=320,height=160,aspect=320:160,padd},soverlay,aenc=ffmpeg{aac-profile=low},acodec=mp4a,ab=96,channels=2,audio-sync}:gather:rtp{sdp=rtsp://0.0.0.0:5554/MediaPortal.sdp,mp4a-latm}',dst='transcode{vcodec=null,acodec=mp3,ab=160,channels=2}:gather:std{access=http,mux=raw,dst=0.0.0.0:8081}'}", "-I", "dumy", "--no-ignore-config", "--no-osd", - "--plugin-path=" + System.IO.Path.Combine(sVlcPath , "plugins") + //"--plugin-path=" + System.IO.Path.Combine(sVlcPath , "plugins") }; - AndroidServer.vlc = new VideoLan.VlcControl(args); - } - if (!data["filename"].StartsWith("webradio")) - AndroidServer.vlc.Open(data["filename"]); - else - { - string dir = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config); - string radio1 = string.Empty; - string radio2 = string.Empty; - string radio3 = string.Empty; - string radio4 = string.Empty; + if (AndroidServer.vlc == null) + AndroidServer.vlc = new VideoLan.VlcControl(args); - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(dir + "\\MediaPortal.xml")) - { - radio1 = xmlreader.GetValueAsString("android", "radio01", "http://ndrstream.ic.llnwd.net/stream/ndrstream_n-joy_hi_mp3"); - radio2 = xmlreader.GetValueAsString("android", "radio02", "http://ndrstream.ic.llnwd.net/stream/ndrstream_ndr2_hi_mp3"); - radio3 = xmlreader.GetValueAsString("android", "radio03", "http://www.fritz.de/live.m3u"); - radio4 = xmlreader.GetValueAsString("android", "radio04", "http://listen.to.techno4ever.net"); - } - if (data["filename"].StartsWith("webradio_1")) - AndroidServer.vlc.Open(radio1); - if (data["filename"].StartsWith("webradio_2")) - AndroidServer.vlc.Open(radio2); - if (data["filename"].StartsWith("webradio_3")) - AndroidServer.vlc.Open(radio3); - if (data["filename"].StartsWith("webradio_4")) - AndroidServer.vlc.Open(radio4); + string filename = data["filename"].Replace("/", "\\"); + + directoryList = GetMpShare("movies"); + string local = GetLocalDir(filename, directoryList); + local = HttpUtility.UrlDecode(local); + + AndroidServer.logDebug("StreamFile play: " + local); + + AndroidServer.vlc.Open(local); AndroidServer.vlc.Play(); } } catch { + // why ever + } + } + #endregion + + #region play video file + if (data["command"] == ("PlayFile")) + { + AndroidServer.logDebug("MP play video: " + data["filename"]); + // parameter = filename + + try + { + string filename = data["filename"].Replace("/", "\\"); + + directoryList = GetMpShare("movies"); + string local = GetLocalDir(filename, directoryList); + local = HttpUtility.UrlDecode(local); + + AndroidServer.logDebug("MP play video: " + local); + + DoStartFileHandler del = new DoStartFileHandler(StartFile); + GUIGraphicsContext.form.Invoke(del, local); } + catch + { + // why ever + } } #endregion @@ -650,6 +663,15 @@ if (playList.Count > 0) playlistPlayer.Play(playList.Count - 1); } + + private void StartFile(string File) + { + g_Player.Stop(); + g_Player.Play(File, g_Player.MediaType.Video); + + GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); + } + private void DoAction(Action action) { GUIGraphicsContext.OnAction(action); Added: trunk/plugins/AndroidRemote/Server/AndroidRemote/Content/VideoHandler.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Content/VideoHandler.cs (rev 0) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Content/VideoHandler.cs 2011-01-21 16:49:31 UTC (rev 4075) @@ -0,0 +1,160 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +/* + * Copyright (C) 2005-2011 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 + * + */ +#endregion + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Net.Sockets; +using System.IO; +using System.Drawing; +using System.Web; + +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using MediaPortal.Database; +using SQLite.NET; + +namespace AndroidRemote.Content +{ + public class VideoHandler + { + private static Dictionary<string, string> directoryList = new Dictionary<string, string>(); + + public static void ReplyVideoDir(Socket sock, string request) + { + directoryList = SomeUtils.GetMpShare("movies"); + string dir = SomeUtils.GetLocalDir(request, directoryList); + + SocketHandler handler = new SocketHandler(); + + if (request == string.Empty) + { + #region root shares + + 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 + foreach (string key in directoryList.Keys) + { + msg += "<Folder>" + SomeUtils.EncodeString(key) + "</Folder>\r\n"; + } + msg += "</Directory>\r\n"; + + // send + handler.SendMessage(sock, msg); + + AndroidServer.logDebug("Reply video root dir"); + + #endregion + } + else + { + #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>" + SomeUtils.EncodeString(Path.GetFileName(f)) + "</Folder>\r\n"; + } + + //files + + ArrayList list = getAllpattern(dir); + + foreach (string f in list) + { + string fName = Path.GetFileName(f); + msg += "<File>" + SomeUtils.EncodeString(fName) + "</File>\r\n"; + } + + msg += "</Directory>\r\n"; + + // send + handler.SendMessage(sock, msg); + + AndroidServer.logDebug("Reply video dir : " + dir); + } + else + { + // dir does not exist + //SendErrorURL(Request); + + 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"; + msg += "</Directory>\r\n"; + + // send + handler.SendMessage(sock, msg); + + AndroidServer.logDebug("Reply empty picture dir"); + } + + #endregion + } + } + + private static ArrayList getAllpattern(string Dir) + { + string[] filters = { "*.avi", "*.mpg", "*.flv" , "*.mp4" }; + ArrayList files = new ArrayList(); + + foreach (string filter in filters) + { + files.AddRange(Directory.GetFiles(Dir, filter)); + } + + return files; + } + + } +} Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Request.cs 2011-01-21 16:49:31 UTC (rev 4075) @@ -268,6 +268,26 @@ #endregion + #region movies + else if (req.StartsWith("/movies")) + { + // handle movies + req = req.Substring(7); + if (req.StartsWith("/")) req = req.Substring(1); + + if (req == "") + { + // root + VideoHandler.ReplyVideoDir(socket, ""); + } + else + { + req = req.Replace("/", "\\"); + VideoHandler.ReplyVideoDir(socket, req); + } + } + #endregion + #region nowplaying else if (req.StartsWith("/nowplaying/now.xml")) { Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.Designer.cs 2011-01-21 16:49:31 UTC (rev 4075) @@ -39,20 +39,7 @@ this.btnSave = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.btnStop = new System.Windows.Forms.Button(); - this.btnPlay04 = new System.Windows.Forms.Button(); - this.btnPlay03 = new System.Windows.Forms.Button(); - this.btnPlay02 = new System.Windows.Forms.Button(); - this.btnPlay01 = new System.Windows.Forms.Button(); - this.label7 = new System.Windows.Forms.Label(); - this.txtRadio04 = new System.Windows.Forms.TextBox(); - this.label6 = new System.Windows.Forms.Label(); - this.txtRadio03 = new System.Windows.Forms.TextBox(); - this.label5 = new System.Windows.Forms.Label(); - this.txtRadio02 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); - this.txtRadio01 = new System.Windows.Forms.TextBox(); - this.label8 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); @@ -142,7 +129,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, 391); + this.btnSave.Location = new System.Drawing.Point(12, 186); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(84, 29); this.btnSave.TabIndex = 1; @@ -153,7 +140,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(104, 391); + this.btnCancel.Location = new System.Drawing.Point(104, 186); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(84, 29); this.btnCancel.TabIndex = 2; @@ -163,165 +150,29 @@ // // groupBox2 // - this.groupBox2.Controls.Add(this.label8); - this.groupBox2.Controls.Add(this.btnStop); - this.groupBox2.Controls.Add(this.btnPlay04); - this.groupBox2.Controls.Add(this.btnPlay03); - this.groupBox2.Controls.Add(this.btnPlay02); - this.groupBox2.Controls.Add(this.btnPlay01); - this.groupBox2.Controls.Add(this.label7); - this.groupBox2.Controls.Add(this.txtRadio04); - this.groupBox2.Controls.Add(this.label6); - this.groupBox2.Controls.Add(this.txtRadio03); - this.groupBox2.Controls.Add(this.label5); - this.groupBox2.Controls.Add(this.txtRadio02); this.groupBox2.Controls.Add(this.label3); - this.groupBox2.Controls.Add(this.txtRadio01); this.groupBox2.Location = new System.Drawing.Point(12, 114); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(487, 271); + this.groupBox2.Size = new System.Drawing.Size(491, 66); this.groupBox2.TabIndex = 3; this.groupBox2.TabStop = false; - this.groupBox2.Text = "Webradio"; + this.groupBox2.Text = "Streaming"; // - // btnStop - // - this.btnStop.Location = new System.Drawing.Point(338, 233); - this.btnStop.Name = "btnStop"; - this.btnStop.Size = new System.Drawing.Size(135, 32); - this.btnStop.TabIndex = 19; - this.btnStop.Text = "STOP"; - this.btnStop.UseVisualStyleBackColor = true; - this.btnStop.Click += new System.EventHandler(this.btnStop_Click); - // - // btnPlay04 - // - this.btnPlay04.Location = new System.Drawing.Point(398, 185); - this.btnPlay04.Name = "btnPlay04"; - this.btnPlay04.Size = new System.Drawing.Size(75, 23); - this.btnPlay04.TabIndex = 18; - this.btnPlay04.Text = "Test"; - this.btnPlay04.UseVisualStyleBackColor = true; - this.btnPlay04.Click += new System.EventHandler(this.btnPlay04_Click); - // - // btnPlay03 - // - this.btnPlay03.Location = new System.Drawing.Point(398, 137); - this.btnPlay03.Name = "btnPlay03"; - this.btnPlay03.Size = new System.Drawing.Size(75, 23); - this.btnPlay03.TabIndex = 17; - this.btnPlay03.Text = "Test"; - this.btnPlay03.UseVisualStyleBackColor = true; - this.btnPlay03.Click += new System.EventHandler(this.btnPlay03_Click); - // - // btnPlay02 - // - this.btnPlay02.Location = new System.Drawing.Point(398, 93); - this.btnPlay02.Name = "btnPlay02"; - this.btnPlay02.Size = new System.Drawing.Size(75, 23); - this.btnPlay02.TabIndex = 16; - this.btnPlay02.Text = "Test"; - this.btnPlay02.UseVisualStyleBackColor = true; - this.btnPlay02.Click += new System.EventHandler(this.btnPlay02_Click); - // - // btnPlay01 - // - this.btnPlay01.Location = new System.Drawing.Point(398, 46); - this.btnPlay01.Name = "btnPlay01"; - this.btnPlay01.Size = new System.Drawing.Size(75, 23); - this.btnPlay01.TabIndex = 15; - this.btnPlay01.Text = "Test"; - this.btnPlay01.UseVisualStyleBackColor = true; - this.btnPlay01.Click += new System.EventHandler(this.btnPlay01_Click); - // - // 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, 168); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(85, 16); - this.label7.TabIndex = 14; - this.label7.Text = "Webradio 04"; - // - // txtRadio04 - // - this.txtRadio04.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtRadio04.Location = new System.Drawing.Point(100, 186); - this.txtRadio04.Name = "txtRadio04"; - this.txtRadio04.Size = new System.Drawing.Size(292, 22); - this.txtRadio04.TabIndex = 13; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label6.Location = new System.Drawing.Point(14, 120); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(85, 16); - this.label6.TabIndex = 12; - this.label6.Text = "Webradio 03"; - // - // txtRadio03 - // - this.txtRadio03.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtRadio03.Location = new System.Drawing.Point(100, 138); - this.txtRadio03.Name = "txtRadio03"; - this.txtRadio03.Size = new System.Drawing.Size(292, 22); - this.txtRadio03.TabIndex = 11; - // - // 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, 75); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(85, 16); - this.label5.TabIndex = 10; - this.label5.Text = "Webradio 02"; - // - // txtRadio02 - // - this.txtRadio02.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtRadio02.Location = new System.Drawing.Point(100, 93); - this.txtRadio02.Name = "txtRadio02"; - this.txtRadio02.Size = new System.Drawing.Size(292, 22); - this.txtRadio02.TabIndex = 9; - // // 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, 29); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(85, 16); - this.label3.TabIndex = 8; - this.label3.Text = "Webradio 01"; + this.label3.Size = new System.Drawing.Size(396, 16); + this.label3.TabIndex = 7; + this.label3.Text = "VLC parameter can be found in the vlc.par in the process directory"; // - // txtRadio01 - // - this.txtRadio01.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtRadio01.Location = new System.Drawing.Point(100, 47); - this.txtRadio01.Name = "txtRadio01"; - this.txtRadio01.Size = new System.Drawing.Size(292, 22); - this.txtRadio01.TabIndex = 7; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label8.ForeColor = System.Drawing.Color.DarkRed; - this.label8.Location = new System.Drawing.Point(118, 22); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(252, 16); - this.label8.TabIndex = 20; - this.label8.Text = "VLC 1.x need to be installed for streaming"; - // // Setup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(511, 432); + this.ClientSize = new System.Drawing.Size(514, 227); this.Controls.Add(this.groupBox2); this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnSave); @@ -357,19 +208,6 @@ private System.Windows.Forms.Button btnCopy; private System.Windows.Forms.Label label4; private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.Button btnPlay04; - private System.Windows.Forms.Button btnPlay03; - private System.Windows.Forms.Button btnPlay02; - private System.Windows.Forms.Button btnPlay01; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.TextBox txtRadio04; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.TextBox txtRadio03; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.TextBox txtRadio02; private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox txtRadio01; - private System.Windows.Forms.Button btnStop; - private System.Windows.Forms.Label label8; } } \ No newline at end of file Modified: trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs =================================================================== --- trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs 2011-01-21 11:52:48 UTC (rev 4074) +++ trunk/plugins/AndroidRemote/Server/AndroidRemote/Setup.cs 2011-01-21 16:49:31 UTC (rev 4075) @@ -40,8 +40,6 @@ { public partial class Setup : Form { - private VideoLan.VlcControl vlc; - public Setup() { InitializeComponent(); @@ -65,11 +63,6 @@ { txtServer.Text = xmlreader.GetValueAsString("android", "server", "192.168.0.30"); txtPort.Text = xmlreader.GetValueAsString("android", "port", "8200"); - - txtRadio01.Text = xmlreader.GetValueAsString("android", "radio01", "http://ndrstream.ic.llnwd.net/stream/ndrstream_n-joy_hi_mp3"); - txtRadio02.Text = xmlreader.GetValueAsString("android", "radio02", "http://ndrstream.ic.llnwd.net/stream/ndrstream_ndr2_hi_mp3"); - txtRadio03.Text = xmlreader.GetValueAsString("android", "radio03", "http://hotmixradio80.hotmixradio.com"); - txtRadio04.Text = xmlreader.GetValueAsString("android", "radio04", "http://listen.to.techno4ever.net"); } } private void SaveSettings() @@ -79,11 +72,6 @@ { xmlwriter.SetValue("android", "server", txtServer.Text); xmlwriter.SetValue("android", "port", txtPort.Text); - - xmlwriter.SetValue("android", "radio01", txtRadio01.Text); - xmlwriter.SetValue("android", "radio02", txtRadio02.Text); - xmlwriter.SetValue("android", "radio03", txtRadio03.Text); - xmlwriter.SetValue("android", "radio04", txtRadio04.Text); } } @@ -102,62 +90,9 @@ txtServer.Text = txtMyIP.Text; } - private void btnPlay01_Click(object sender, EventArgs e) - { - PlayStream(txtRadio01.Text); - } - private void btnPlay02_Click(object sender, EventArgs e) - { - PlayStream(txtRadio02.Text); - } - private void btnPlay03_Click(object sender, EventArgs e) - { - PlayStream(txtRadio03.Text); - } - private void btnPlay04_Click(object sender, EventArgs e) - { - PlayStream(txtRadio04.Text); - } - - private void btnStop_Click(object sender, EventArgs e) - { - if (vlc != null) - { - if (vlc.IsPlaying) vlc.Stop(); - } - } - - private void PlayStream(string stream) - { - if (vlc == null) - { - Microsoft.Win32.RegistryKey regkeyVlcInstallPathKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\VideoLAN\VLC"); - if (regkeyVlcInstallPathKey != null) - { - vlc = new VideoLan.VlcControl(); - - vlc.Visible = false; - this.Controls.Add(vlc); - } - } - - if (vlc != null) - { - if (vlc.IsPlaying) vlc.Stop(); - - vlc.Open(stream); - vlc.Play(); - } - } - private void Setup_FormClosing(object sender, FormClosingEventArgs e) { - if (vlc != null) - { - if (vlc.IsPlaying) vlc.Stop(); - } + } - - } } 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. |