Permalink
Browse files

Initial commit

  • Loading branch information...
Mike Elson
Mike Elson committed Dec 22, 2011
0 parents commit cb911acf288c96cd2f5f7f4b2d0e5f23a9427419
Showing with 3,772 additions and 0 deletions.
  1. +18 −0 .gitignore
  2. +1 −0 CHANGES.txt
  3. +674 −0 LICENSE.txt
  4. +139 −0 README.txt
  5. +39 −0 android/AndroidManifest.xml
  6. +40 −0 android/proguard.cfg
  7. +11 −0 android/project.properties
  8. BIN android/res/drawable-hdpi/carrie.png
  9. +178 −0 android/res/layout/main.xml
  10. +5 −0 android/res/menu/menu.xml
  11. +23 −0 android/res/values/strings.xml
  12. +14 −0 android/res/xml/settings.xml
  13. +290 −0 android/src/org/ohthehumanity/carrie/CarrieActivity.java
  14. +19 −0 android/src/org/ohthehumanity/carrie/settings/Settings.java
  15. +7 −0 bin/carrie
  16. +1 −0 carrie/__init__.py
  17. +134 −0 carrie/daemon.py
  18. +50 −0 carrie/log.py
  19. +338 −0 carrie/main.py
  20. BIN carrie/static/favicon.png
  21. +3 −0 carrie/static/index.css
  22. +45 −0 carrie/static/index.js
  23. +4 −0 carrie/static/jquery-1.7.min.js
  24. BIN carrie/static/jquery-ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
  25. BIN carrie/static/jquery-ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
  26. BIN carrie/static/jquery-ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
  27. BIN carrie/static/jquery-ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
  28. BIN carrie/static/jquery-ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
  29. BIN carrie/static/jquery-ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
  30. BIN carrie/static/jquery-ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
  31. BIN carrie/static/jquery-ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  32. BIN carrie/static/jquery-ui/css/smoothness/images/ui-icons_222222_256x240.png
  33. BIN carrie/static/jquery-ui/css/smoothness/images/ui-icons_2e83ff_256x240.png
  34. BIN carrie/static/jquery-ui/css/smoothness/images/ui-icons_454545_256x240.png
  35. BIN carrie/static/jquery-ui/css/smoothness/images/ui-icons_888888_256x240.png
  36. BIN carrie/static/jquery-ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png
  37. +327 −0 carrie/static/jquery-ui/css/smoothness/jquery-ui-1.8.16.custom.css
  38. +61 −0 carrie/static/jquery-ui/js/jquery-ui-1.8.16.custom.min.js
  39. +27 −0 carrie/templates/index.html
  40. +376 −0 carrie/xorg.py
  41. +48 −0 carrie/xscreensaver.py
  42. +485 −0 distribute_setup.py
  43. +340 −0 extras/pylintrc
  44. +75 −0 setup.py
@@ -0,0 +1,18 @@
+carrie.org
+setup.sh
+android/local.properties
+android/.classpath
+android/.project
+android/.settings
+android/ant.properties
+android/bin
+android/gen
+android/build.xml
+carrie-release.keystore
+dist
+carrie.egg-info
+*#
+.#*
+build
+*.pyc
+env
@@ -0,0 +1 @@
+v0.1, <date> -- Initial release.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,139 @@
+-*- mode: rst -*-
+
+Carrie Remote Control
+=====================
+
+Introduction
+------------
+
+This project is a remote control tool to give some basic control of certain media types (listed below) running on a Linux computer. The user can send commands using either a web browser on another machine, or an Android application.
+
+The players supported are:
+
+- Youtube on Firefox or Chromium browser.
+- BBC iPlayer on Firefox or Chromium.
+- mplayer
+
+This project is not a media center. There is no functionality for starting media playback or changing the file being played. The only functions available are:
+
+- Play/pause
+- Toggle full screen
+- Volume up annd down
+
+For mplayer clients only these functions are also available:
+
+- Skip forwards/backwards
+- Toggle fullscreen, OSD, subtitle visibility
+- Change subtitle language.
+
+How does it work?
+-----------------
+
+`carrie` is a process running on the machine doing the media playback. It opens a port (5505 by default) and supplied a simple web interface to any browsers which connect. Alternatively the `carrie` Android application can send commands to the same port.
+
+When a command is received the server will attempt to send it to a web browser running a Flash video. If one is not found then the server will try to send the same command to mplayer via a FIFO object - this uses the 'slave mode' feature of `mplayer`. `mplayer` must be configured in advance to listen on the FIFO.
+
+Limitations
+-----------
+
+There is no proper API for communicating with Flash video. The server process send fake mouse events for control. This has to be configured for each combination of browser and video site.
+
+Why not just use x/y/z remote control instead of this?
+------------------------------------------------------
+
+There are other far better remote control tools than this around, with features such a full media center or providing full remote control of another machine. `carrie` is for users who already have another method they use to start media playback, and just want to add a basic remote function without changing anything else. And for me, it is a way to learn some new techniques and libraries.
+
+Other remote controls I would recommend are:
+
+- sshmote: A media center for Android. Does not need any special server software except a Unix compatible OS except an SSH server.
+- teamviewer: Take control of a Windows or Linux machine from a web browser or phone. Has good features for operating over the Internet.
+
+Requirements
+------------
+
+To run the server:
+
+ * Python 2.7+ (programming language)
+ * Flask (lightweight Python web server framework)
+ * xdotool (command line tool to fake mouse and keyboard events)
+ * xwininfo (command line tool to read window information)
+
+To control the server:
+
+ * Any modern web browser
+
+To use the mobile phone applet:
+
+ * Mobile phone running Android Froyo or later
+
+Installation
+------------
+
+First install the server:
+
+ > git clone xxx
+ > cd xxx
+ > python setup.py build
+ > sudo python setup.py install
+
+And optionally configure mplayer by editing $HOME/.mplayer/config and adding the line:
+
+ input=file=/tmp/mplayer.fifo
+
+Any new instances of mplayer will connect to the FIFO and listen to commands. This doesn't affect normal mplayer usage.
+
+Start the server
+----------------
+
+Run:
+
+ > carrie
+
+This will start up the server, running in the foreground, listening on port 5505, using a FIFO on /tmp/mplayer.fif to communicate with mplayer. The FIFO will be created if it doesn't already exist.
+
+Run:
+
+ > carrie -h
+
+to see available options.
+
+Control via browser
+-------------------
+
+Open a web browser on http://<server>:5505
+
+Control from Android device
+---------------------------
+
+Install the Android application:
+
+It requires internet access permission to connect to the server.
+
+Press the MENU button and specify the server name or IP address and port before using it.
+
+Development - server
+--------------------
+
+May wish to install:
+
+ * python-pip
+ * python-distribute
+
+Development - Android application
+---------------------------------
+
+On Debian install: android sdk (manually), ant, openjdk-6-jdk
+
+Compiling and installing the code should be the same as a standard Android application - either use Eclipse, or command line tools.
+
+Directory layout
+----------------
+
+ * android/
+ Android controller application
+ * carrie/
+ Python HTTP server code
+ * bin/
+ Startup script
+ * README.txt
+ This file
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.ohthehumanity.carrie"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <!-- SDK 7 not supported you get errors like:
+Error: String types not allowed (at layout_height with value 'match_parent')
+Error: String types not allowed (at layout_width with value 'match_parent')
+
+because it needs fill_parent instead.
+
+And maybe other issues...
+
+So we target API 8 Froyo and above only.
+
+-->
+
+ <uses-sdk android:minSdkVersion="8" />
+
+ <uses-permission android:name="android.permission.INTERNET" />
+
+ <application
+ android:icon="@drawable/carrie"
+ android:label="@string/app_name" >
+ <activity
+ android:name=".CarrieActivity" >
+ android:label="@string/title"
+ <intent-filter >
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity
+ android:name=".settings.Settings"
+ android:label="@string/settings_title">
+ </activity>
+ </application>
+</manifest>
@@ -0,0 +1,40 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+ public void *(android.view.View);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
@@ -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,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-8
Binary file not shown.
Oops, something went wrong.

0 comments on commit cb911ac

Please sign in to comment.