Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

setting up repository

  • Loading branch information...
commit d59b7cfd8e0f6a2fdb8f4c15f5811c970dfa0689 1 parent 51f2f82
@shiffman authored
Showing with 379 additions and 0 deletions.
  1. BIN  processing/mpe/.DS_Store
  2. BIN  processing/mpe/examples/.DS_Store
  3. BIN  processing/mpe/examples/OneScreen/.DS_Store
  4. +37 −0 processing/mpe/examples/OneScreen/Ball.pde
  5. +39 −0 processing/mpe/examples/OneScreen/OneScreen.pde
  6. BIN  processing/mpe/examples/mpeTest/.DS_Store
  7. +40 −0 processing/mpe/examples/mpeTest/Ball.pde
  8. BIN  processing/mpe/examples/mpeTest/client0app/.DS_Store
  9. +7 −0 processing/mpe/examples/mpeTest/client0app/mpe.ini
  10. +75 −0 processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/Info.plist
  11. BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/MacOS/JavaApplicationStub
  12. BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/MacOS/JavaApplicationStub64
  13. +1 −0  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/PkgInfo
  14. BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/Resources/Java/core.jar
  15. BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/Resources/Java/mpe.jar
  16. BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/Resources/Java/mpeTest.jar
  17. BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/Resources/sketch.icns
  18. BIN  processing/mpe/examples/mpeTest/client1app/.DS_Store
  19. +7 −0 processing/mpe/examples/mpeTest/client1app/mpe.ini
  20. +75 −0 processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/Info.plist
  21. BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/MacOS/JavaApplicationStub
  22. BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/MacOS/JavaApplicationStub64
  23. +1 −0  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/PkgInfo
  24. BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/Resources/Java/core.jar
  25. BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/Resources/Java/mpe.jar
  26. BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/Resources/Java/mpeTest.jar
  27. BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/Resources/sketch.icns
  28. +14 −0 processing/mpe/examples/mpeTest/mpe.ini
  29. +83 −0 processing/mpe/examples/mpeTest/mpeTest.pde
  30. BIN  processing/mpe/library/mpe.jar
  31. BIN  processing/mpe/server/mpeServer.jar
View
BIN  processing/mpe/.DS_Store
Binary file not shown
View
BIN  processing/mpe/examples/.DS_Store
Binary file not shown
View
BIN  processing/mpe/examples/OneScreen/.DS_Store
Binary file not shown
View
37 processing/mpe/examples/OneScreen/Ball.pde
@@ -0,0 +1,37 @@
+/**
+ * Ball class for simple bouncing ball demo
+ * <http://http://code.google.com/p/mostpixelsever/>
+ * @author Shiffman
+ */
+
+class Ball {
+
+ float x = 0; // Ellipse x location
+ float y = 0; // Ellipse y location
+ float xdir = 1; // x velocity
+ float ydir = 1; // y velocity
+
+ float r = 24; // size
+
+ Ball(float _x, float _y){
+ xdir = random(-5,5);
+ ydir = random(-5,5);
+ x = _x;
+ y = _y;
+ }
+
+ // A simple bounce across the screen
+ void calc(){
+ if (x < 0 || x > width) xdir *= -1;
+ if (y < 0 || y > height) ydir *= -1;
+ x += xdir;
+ y += ydir;
+ }
+
+ void display(){
+ stroke(0);
+ fill(0,100);
+ ellipse(x,y,r,r);
+ }
+}
+
View
39 processing/mpe/examples/OneScreen/OneScreen.pde
@@ -0,0 +1,39 @@
+/**
+ * Simple Bouncing Ball Demo
+ * <http://code.google.com/p/mostpixelsever/>
+ * @author Shiffman
+ */
+
+
+// The list of balls
+ArrayList balls;
+
+
+void setup() {
+ size(320,240);
+ smooth();
+
+ // Start with 10 balls
+ balls = new ArrayList();
+ for (int i = 0; i < 10; i++) {
+ Ball ball= new Ball(random(width),random(height));
+ balls.add(ball);
+ }
+}
+
+
+public void draw() {
+
+ background(255);
+
+ for (int i = 0; i < balls.size(); i++) {
+ Ball ball = (Ball) balls.get(i);
+ ball.calc();
+ ball.display();
+ }
+}
+
+public void mousePressed() {
+ balls.add(new Ball(mouseX,mouseY));
+}
+
View
BIN  processing/mpe/examples/mpeTest/.DS_Store
Binary file not shown
View
40 processing/mpe/examples/mpeTest/Ball.pde
@@ -0,0 +1,40 @@
+/**
+ * Ball class for simple bouncing ball demo
+ * <http://http://code.google.com/p/mostpixelsever/>
+ */
+
+//--------------------------------------
+// A Ball moves and bounces off walls.
+class Ball {
+ //--------------------------------------
+ float x = 0; // center x position
+ float y = 0; // center y position
+ float xDir = 1; // x velocity
+ float yDir = 1; // y velocity
+ float d = 36; // diameter
+
+ //--------------------------------------
+ public Ball(float _x, float _y) {
+ x = _x;
+ y = _y;
+ xDir = random(-5,5);
+ yDir = random(-5,5);
+ }
+
+ //--------------------------------------
+ // Moves and changes direction if it hits a wall.
+ public void calc() {
+ if (x < 0 || x > client.getMWidth()) xDir *= -1;
+ if (y < 0 || y > client.getMHeight()) yDir *= -1;
+ x += xDir;
+ y += yDir;
+ }
+
+ //--------------------------------------
+ public void draw() {
+ stroke(0);
+ fill(0, 100);
+ ellipse(x, y, d, d);
+ }
+}
+
View
BIN  processing/mpe/examples/mpeTest/client0app/.DS_Store
Binary file not shown
View
7 processing/mpe/examples/mpeTest/client0app/mpe.ini
@@ -0,0 +1,7 @@
+id=0;
+server=localhost;
+port=9002;
+localScreenSize=200,400;
+localLocation=0,0;
+masterDimensions=400,400;
+debug=1;
View
75 processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/Info.plist
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+ <dict>
+ <key>CFBundleName</key>
+ <string>mpeTest</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>CFBundleAllowMixedLocalizations</key>
+ <string>true</string>
+ <key>CFBundleExecutable</key>
+ <string>JavaApplicationStub</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleIconFile</key>
+ <string>sketch.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>mpeTest</string>
+
+ <!-- http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/PListKeys.html#//apple_ref/doc/uid/20001431-113616 -->
+ <key>LSUIPresentationMode</key>
+ <integer>0</integer>
+
+ <!-- make sure that applications open in 32-bit mode on Snow Leopard,
+ otherwise video and most other native libraries will choke
+ http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW1 -->
+ <key>LSArchitecturePriority</key>
+ <array>
+ <string>i386</string>
+ <string>ppc</string>
+ </array>
+
+ <key>Java</key>
+ <dict>
+ <key>VMOptions</key>
+ <string> -Xms64m -Xmx1024m</string>
+ <key>MainClass</key>
+ <string>mpeTest</string>
+ <key>JVMVersion</key>
+ <string>1.5*</string>
+ <key>JVMArchs</key>
+ <array>
+ <string>i386</string>
+ <string>ppc</string>
+ </array>
+ <key>ClassPath</key>
+ <string>$JAVAROOT/mpeTest.jar:$JAVAROOT/core.jar:$JAVAROOT/mpe.jar</string>
+
+ <!-- http://developer.apple.com/releasenotes/Java/java141/system_properties/chapter_4_section_1.html#//apple_ref/doc/uid/TP30000285 -->
+ <key>Properties</key>
+ <dict>
+ <key>apple.laf.useScreenMenuBar</key>
+ <string>true</string>
+ <key>apple.awt.showGrowBox</key>
+ <string>false</string>
+ <key>com.apple.smallTabs</key>
+ <string>true</string>
+ <key>apple.awt.Antialiasing</key>
+ <string>false</string>
+ <key>apple.awt.TextAntialiasing</key>
+ <string>true</string>
+ <key>com.apple.hwaccel</key>
+ <string>true</string>
+ <key>apple.awt.use-file-dialog-packages</key>
+ <string>false</string>
+ </dict>
+ </dict>
+ </dict>
+</plist>
View
BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/MacOS/JavaApplicationStub
Binary file not shown
View
BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/MacOS/JavaApplicationStub64
Binary file not shown
View
1  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/PkgInfo
@@ -0,0 +1 @@
+APPL????
View
BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/Resources/Java/core.jar
Binary file not shown
View
BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/Resources/Java/mpe.jar
Binary file not shown
View
BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/Resources/Java/mpeTest.jar
Binary file not shown
View
BIN  processing/mpe/examples/mpeTest/client0app/mpeTest.app/Contents/Resources/sketch.icns
Binary file not shown
View
BIN  processing/mpe/examples/mpeTest/client1app/.DS_Store
Binary file not shown
View
7 processing/mpe/examples/mpeTest/client1app/mpe.ini
@@ -0,0 +1,7 @@
+id=1;
+server=localhost;
+port=9002;
+localScreenSize=200,400;
+localLocation=200,0;
+masterDimensions=400,400;
+debug=1;
View
75 processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/Info.plist
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+ <dict>
+ <key>CFBundleName</key>
+ <string>mpeTest</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>CFBundleAllowMixedLocalizations</key>
+ <string>true</string>
+ <key>CFBundleExecutable</key>
+ <string>JavaApplicationStub</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleIconFile</key>
+ <string>sketch.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>mpeTest</string>
+
+ <!-- http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/PListKeys.html#//apple_ref/doc/uid/20001431-113616 -->
+ <key>LSUIPresentationMode</key>
+ <integer>0</integer>
+
+ <!-- make sure that applications open in 32-bit mode on Snow Leopard,
+ otherwise video and most other native libraries will choke
+ http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW1 -->
+ <key>LSArchitecturePriority</key>
+ <array>
+ <string>i386</string>
+ <string>ppc</string>
+ </array>
+
+ <key>Java</key>
+ <dict>
+ <key>VMOptions</key>
+ <string> -Xms64m -Xmx1024m</string>
+ <key>MainClass</key>
+ <string>mpeTest</string>
+ <key>JVMVersion</key>
+ <string>1.5*</string>
+ <key>JVMArchs</key>
+ <array>
+ <string>i386</string>
+ <string>ppc</string>
+ </array>
+ <key>ClassPath</key>
+ <string>$JAVAROOT/mpeTest.jar:$JAVAROOT/core.jar:$JAVAROOT/mpe.jar</string>
+
+ <!-- http://developer.apple.com/releasenotes/Java/java141/system_properties/chapter_4_section_1.html#//apple_ref/doc/uid/TP30000285 -->
+ <key>Properties</key>
+ <dict>
+ <key>apple.laf.useScreenMenuBar</key>
+ <string>true</string>
+ <key>apple.awt.showGrowBox</key>
+ <string>false</string>
+ <key>com.apple.smallTabs</key>
+ <string>true</string>
+ <key>apple.awt.Antialiasing</key>
+ <string>false</string>
+ <key>apple.awt.TextAntialiasing</key>
+ <string>true</string>
+ <key>com.apple.hwaccel</key>
+ <string>true</string>
+ <key>apple.awt.use-file-dialog-packages</key>
+ <string>false</string>
+ </dict>
+ </dict>
+ </dict>
+</plist>
View
BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/MacOS/JavaApplicationStub
Binary file not shown
View
BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/MacOS/JavaApplicationStub64
Binary file not shown
View
1  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/PkgInfo
@@ -0,0 +1 @@
+APPL????
View
BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/Resources/Java/core.jar
Binary file not shown
View
BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/Resources/Java/mpe.jar
Binary file not shown
View
BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/Resources/Java/mpeTest.jar
Binary file not shown
View
BIN  processing/mpe/examples/mpeTest/client1app/mpeTest.app/Contents/Resources/sketch.icns
Binary file not shown
View
14 processing/mpe/examples/mpeTest/mpe.ini
@@ -0,0 +1,14 @@
+# Client ID (0,1,2,etc.)
+id=0;
+# Server address (localhost for testing)
+server=localhost;
+# Server port
+port=9002;
+# What are the client window dimensions?
+localScreenSize=200,400;
+# Where is the client located in the master dimensions?
+localLocation=0,0;
+# What are the master dimensions?
+masterDimensions=400,400;
+# Turn to 0 to turn off all the console printing
+debug=1;
View
83 processing/mpe/examples/mpeTest/mpeTest.pde
@@ -0,0 +1,83 @@
+/**
+ * Simple Bouncing Ball Demo
+ * <http://code.google.com/p/mostpixelsever/>
+ */
+
+import mpe.client.*;
+
+// The list of balls
+ArrayList balls;
+
+// A client object
+TCPClient client;
+
+// Stays false until all clients have connected
+boolean start = false;
+
+//--------------------------------------
+ void setup() {
+ // make a new Client using an INI file
+ // sketchPath() is used so that the INI file is local to the sketch
+ client = new TCPClient(sketchPath("mpe.ini"), this);
+
+ // the size is determined by the client's local width and height
+ size(client.getLWidth(), client.getLHeight());
+
+ // the random seed must be identical for all clients
+ randomSeed(1);
+
+ smooth();
+ background(255);
+
+ // add a "randomly" placed ball
+ balls = new ArrayList();
+ Ball ball = new Ball(random(client.getMWidth()), random(client.getMHeight()));
+ balls.add(ball);
+
+ // IMPORTANT, YOU MUST START THE CLIENT!
+ client.start();
+}
+
+//--------------------------------------
+// Keep the motor running... draw() needs to be added in auto mode, even if
+// it is empty to keep things rolling.
+ void draw() {
+}
+
+//--------------------------------------
+// Triggered by the client whenever a new frame should be rendered.
+// All synchronized drawing should be done here when in auto mode.
+ void frameEvent(TCPClient c) {
+ // clear the screen
+ background(255);
+
+ // move and draw all the balls
+ for (int i = 0; i < balls.size(); i++) {
+ Ball ball = (Ball)balls.get(i);
+ ball.calc();
+ ball.draw();
+ }
+
+ // read any incoming messages
+ if (c.messageAvailable()) {
+ String[] msg = c.getDataMessage();
+ String[] xy = msg[0].split(",");
+ float x = Integer.parseInt(xy[0]);
+ float y = Integer.parseInt(xy[1]);
+ balls.add(new Ball(x, y));
+ }
+
+}
+
+//--------------------------------------
+// Adds a Ball to the stage at the position of the mouse click.
+ void mousePressed() {
+ // never include a ":" when broadcasting your message
+ int x = mouseX + client.getXoffset();
+ int y = mouseY + client.getYoffset();
+ client.broadcast(x + "," + y);
+}
+
+
+
+
View
BIN  processing/mpe/library/mpe.jar
Binary file not shown
View
BIN  processing/mpe/server/mpeServer.jar
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.