Commit 358443b9 authored by Thomas Krex's avatar Thomas Krex

-whiteboard-messages hinzugefügt

-annotion. draw(canvas) implementiert
-paint annotation zu ui handler hinzugefügt
parent 1a2019eb
eclipse.preferences.version=1
encoding//src/tttclient/connections/TTTConnection.java=UTF-8
encoding//src/tttclient/ttt/Constants.java=ISO-8859-1
# cache for current jar dependency. DO NOT EDIT.
# format is <lastModified> <length> <SHA-1> <path>
# Encoding is UTF-8
......@@ -23,24 +23,29 @@ public final class R {
public static final class drawable {
public static final int ic_launcher=0x7f020000;
public static final int my_border=0x7f020001;
public static final int selected_index_border=0x7f020002;
}
public static final class id {
public static final int action_settings=0x7f08000f;
public static final int add=0x7f08000e;
public static final int button_save=0x7f08000a;
public static final int extend=0x7f080011;
public static final int feedDetailsLv=0x7f08000c;
public static final int feed_list=0x7f08000b;
public static final int feedback_button=0x7f080002;
public static final int action_settings=0x7f080013;
public static final int add=0x7f080012;
public static final int button_save=0x7f08000e;
public static final int checkBox1=0x7f08000b;
public static final int connect_btn=0x7f08000a;
public static final int extend=0x7f080015;
public static final int feedDetailsLv=0x7f080010;
public static final int feed_list=0x7f08000f;
public static final int indexScrollView=0x7f080003;
public static final int liveChannel_button=0x7f080002;
public static final int playerView_extended=0x7f080004;
public static final int playerView_fullscreen=0x7f080006;
public static final int progressBar=0x7f08000d;
public static final int port_tx=0x7f080009;
public static final int progressBar=0x7f080011;
public static final int scrollView1=0x7f080005;
public static final int search=0x7f080010;
public static final int search=0x7f080014;
public static final int server_tx=0x7f080008;
public static final int test_button=0x7f080000;
public static final int tx_name=0x7f080009;
public static final int tx_url=0x7f080008;
public static final int tx_name=0x7f08000d;
public static final int tx_url=0x7f08000c;
public static final int viewSwitcher=0x7f080007;
public static final int watch_button=0x7f080001;
}
......@@ -49,9 +54,10 @@ public final class R {
public static final int activity_player_extended=0x7f030001;
public static final int activity_player_fullscreen=0x7f030002;
public static final int activity_player_main=0x7f030003;
public static final int dialog_feeds=0x7f030004;
public static final int feed_activity=0x7f030005;
public static final int feed_details_activity=0x7f030006;
public static final int dialog_connect=0x7f030004;
public static final int dialog_feeds=0x7f030005;
public static final int feed_activity=0x7f030006;
public static final int feed_details_activity=0x7f030007;
}
public static final class menu {
public static final int feed_menu=0x7f070000;
......@@ -61,7 +67,12 @@ public final class R {
public static final class string {
public static final int action_settings=0x7f050001;
public static final int app_name=0x7f050000;
public static final int connect=0x7f050004;
public static final int hello_world=0x7f050002;
public static final int multicast=0x7f050008;
public static final int port=0x7f050006;
public static final int prompt_title=0x7f050007;
public static final int server_adresse=0x7f050005;
public static final int wait=0x7f050003;
}
public static final class style {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke
android:width="5dip"
android:color="@android:color/black" >
</stroke>
</shape>
\ No newline at end of file
......@@ -18,7 +18,7 @@
android:text="Test" />
<Button
android:id="@+id/feedback_button"
android:id="@+id/liveChannel_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
......@@ -30,7 +30,7 @@
android:id="@+id/watch_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/feedback_button"
android:layout_below="@+id/liveChannel_button"
android:layout_centerHorizontal="true"
android:layout_marginTop="75dp"
android:text="Watch Lectures" />
......
......@@ -29,9 +29,10 @@
<ScrollView
android:id="@+id/indexScrollView"
android:layout_width="200dp"
android:layout_width="300dp"
android:layout_height="fill_parent"
android:layout_weight="3"
android:fillViewport="true"
android:paddingLeft="5dip" >
</ScrollView>
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/server_tx"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="63dp"
android:ems="10"
android:hint="@string/server_adresse" />
<EditText
android:id="@+id/port_tx"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/server_tx"
android:layout_marginTop="39dp"
android:ems="10"
android:hint="@string/port"
android:inputType="number" />
<Button
android:id="@+id/connect_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/checkBox1"
android:layout_centerHorizontal="true"
android:layout_marginTop="26dp"
android:text="@string/connect" />
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/port_tx"
android:layout_marginTop="27dp"
android:text="@string/multicast" />
</RelativeLayout>
\ No newline at end of file
......@@ -5,5 +5,10 @@
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="wait">Please Wait. Reading File</string>
<string name="connect"> Connect</string>
<string name="server_adresse">Server Adresse</string>
<string name="port">Port</string>
<string name="prompt_title">Connect to a Lecture</string>
<string name="multicast">Enabling Multicast</string>
</resources>
</resources>
\ No newline at end of file
package tttclient.activities;
import java.net.InetAddress;
import java.net.UnknownHostException;
import tttclient.services.DownloadService;
import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import com.example.test.R;
......@@ -45,20 +51,49 @@ public class MainActivity extends Activity {
}
});
// Thread t = new Thread(new Runnable() {
//
// @Override
// public void run() {
// FeedParser parser = new FeedParser(
// "http://ttt.in.tum.de/lectures/rss.php?prefix=Programmoptimierung&formats=ttt_a");
// Feed feed = parser.parse();
//
// Log.d("rss", feed.toString());
//
// }
// });
// t.start();
Button connectButton = (Button) findViewById(R.id.liveChannel_button);
connectButton.setOnClickListener(new OnClickListener() {
}
@Override
public void onClick(View v) {
// get prompts.xml view
Dialog dialog = new Dialog(MainActivity.this);
dialog.setTitle(getString(R.string.prompt_title));
dialog.setContentView(R.layout.dialog_connect);
final EditText severInput = (EditText) dialog
.findViewById(R.id.server_tx);
final EditText portInput = (EditText) dialog
.findViewById(R.id.port_tx);
final Button connectButton = (Button) dialog
.findViewById(R.id.connect_btn);
final CheckBox checkBox = (CheckBox) dialog
.findViewById(R.id.checkBox1);
connectButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
try {
InetAddress serverAdress = InetAddress
.getByName(severInput.getText().toString());
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
int port = Integer.parseInt(portInput.getText()
.toString());
final boolean multicast = checkBox.isChecked();
}
});
dialog.show();
}
});
}
}
......@@ -108,6 +108,7 @@ public class PlayerActivity extends Activity implements MediaPlayerControl {
prevListener);
audioController.setAnchorView(imgV);
// dialog.dismiss();
} catch (IOException e) {
// TODO Auto-generated catch block
......
package tttclient.connections;
/*
* MODIFIED VERSION OF
*
* @(#)AVReceive2.java 1.3 01/03/13
*
* Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
*
* Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
* modify and redistribute this software in source and binary code form,
* provided that i) this copyright notice and license appear on all copies of
* the software; and ii) Licensee does not utilize the software in a manner
* which is disparaging to Sun.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
* IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
* LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
* LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
* INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
* OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* This software is not designed or intended for use in on-line control of
* aircraft, air traffic, aircraft navigation or aircraft communications; or in
* the design, construction, operation or maintenance of any nuclear
* facility. Licensee represents and warrants that it will not use or
* redistribute the Software for such purposes.
*/
/**
* AVReceive2 to receive RTP transmission using the new RTP API.
*/
public class AVReceiveSimple {
// String sessions = null;
// RTPManager mgrs = null;
// Vector playerWindows = null;
// Player player = null;
//
// boolean dataReceived = false;
// Object dataSync = new Object();
// Window rootFrame;
//
// public AVReceiveSimple(String sessions) {
// this.sessions = sessions;
// }
//
// protected boolean initialize() {
//
// try {
// InetAddress ipAddr;
// SessionAddress localAddr = new SessionAddress();
// SessionAddress destAddr;
//
// playerWindows = new Vector();
//
// SessionLabel session;
//
// // Parse the session addresses.
// try {
// session = new SessionLabel(sessions);
// } catch (IllegalArgumentException e) {
// System.err
// .println("Failed to parse the session address given: "
// + sessions);
// return false;
// }
//
// System.err.println(" - Open RTP session for: addr: "
// + session.addr + " port: " + session.port + " ttl: "
// + session.ttl);
//
// mgrs = (RTPManager) RTPManager.newInstance();
// mgrs.addSessionListener(this);
// mgrs.addReceiveStreamListener(this);
//
// ipAddr = InetAddress.getByName(session.addr);
//
// if (ipAddr.isMulticastAddress()) {
// // local and remote address pairs are identical:
// localAddr = new SessionAddress(ipAddr, session.port,
// session.ttl);
// destAddr = new SessionAddress(ipAddr, session.port, session.ttl);
// } else {
// localAddr = new SessionAddress(InetAddress.getLocalHost(),
// session.port);
// destAddr = new SessionAddress(ipAddr, session.port);
// }
//
// mgrs.initialize(localAddr);
//
// // You can try out some other buffer size to see
// // if you can get better smoothness.
// BufferControl bc = (BufferControl) mgrs
// .getControl("javax.media.control.BufferControl");
// if (bc != null)
// bc.setBufferLength(350);
//
// mgrs.addTarget(destAddr);
//
// } catch (Exception e) {
// System.err.println("Cannot create the RTP Session: "
// + e.getMessage());
// return false;
// }
//
// // Wait for data to arrive before moving on.
//
// long then = System.currentTimeMillis();
// long waitingPeriod = 10000; // wait for a maximum of 10 secs.
//
// try {
// synchronized (dataSync) {
// while (!dataReceived
// && System.currentTimeMillis() - then < waitingPeriod) {
// if (!dataReceived)
// System.err
// .println(" - Waiting for RTP data to arrive...");
// dataSync.wait(1000);
// }
// }
// } catch (Exception e) {
// }
//
// if (!dataReceived) {
// System.err.println("No RTP data was received.");
// close();
// return false;
// }
//
// return true;
// }
//
// public boolean isDone() {
// return playerWindows.size() == 0;
// }
//
// /**
// * Close the players and the session managers.
// */
protected void close() {
try {
// player.close();
} catch (Exception e) {
}
// close the RTP session.
// for (int i = 0; i < mgrs.length; i++) {
// if (mgrs != null) {
// mgrs.removeTargets("Closing session from AVReceive");
// mgrs.dispose();
// mgrs = null;
// }
// }
}
//
// /**
// * SessionListener.
// */
// public synchronized void update(SessionEvent evt) {
// }
//
// /**
// * ReceiveStreamListener
// */
// public synchronized void update(ReceiveStreamEvent evt) {
//
// ReceiveStream stream = evt.getReceiveStream(); // could be null.
//
// if (evt instanceof RemotePayloadChangeEvent) {
//
// System.err.println(" - Received an RTP PayloadChangeEvent.");
// System.err.println("Sorry, cannot handle payload change.");
// System.exit(0);
//
// } else if (evt instanceof NewReceiveStreamEvent) {
//
// try {
// stream = ((NewReceiveStreamEvent) evt).getReceiveStream();
// DataSource ds = stream.getDataSource();
//
// // Find out the formats.
// RTPControl ctl = (RTPControl) ds
// .getControl("javax.media.rtp.RTPControl");
// if (ctl != null) {
// System.err.println(" - Recevied new RTP stream: "
// + ctl.getFormat());
// } else
// System.err.println(" - Recevied new RTP stream");
//
// // create a player by passing datasource to the Media Manager
// player = javax.media.Manager.createPlayer(ds);
// if (player == null)
// return;
//
// player.addControllerListener(this);
// player.realize();
//
// // Notify intialize() that a new stream had arrived.
// synchronized (dataSync) {
// dataReceived = true;
// dataSync.notifyAll();
// }
//
// } catch (Exception e) {
// System.err.println("NewReceiveStreamEvent exception "
// + e.getMessage());
// return;
// }
//
// }
// }
//
// /**
// * ControllerListener for the Players.
// */
// public synchronized void controllerUpdate(ControllerEvent ce) {
// }
//
// /**
// * A utility class to parse the session addresses.
// */
// class SessionLabel {
//
// public String addr = null;
// public int port;
// public int ttl = 1;
//
// SessionLabel(String session) throws IllegalArgumentException {
//
// int off;
// String portStr = null, ttlStr = null;
//
// if (session != null && session.length() > 0) {
// while (session.length() > 1 && session.charAt(0) == '/')
// session = session.substring(1);
//
// // Now see if there's a addr specified.
// off = session.indexOf('/');
// if (off == -1) {
// if (!session.equals(""))
// addr = session;
// } else {
// addr = session.substring(0, off);
// session = session.substring(off + 1);
// // Now see if there's a port specified
// off = session.indexOf('/');
// if (off == -1) {
// if (!session.equals(""))
// portStr = session;
// } else {
// portStr = session.substring(0, off);
// session = session.substring(off + 1);
// // Now see if there's a ttl specified
// off = session.indexOf('/');
// if (off == -1) {
// if (!session.equals(""))
// ttlStr = session;
// } else {
// ttlStr = session.substring(0, off);
// }
// }
// }
// }
//
// if (addr == null)
// throw new IllegalArgumentException();
//
// if (portStr != null) {
// try {
// Integer integer = Integer.valueOf(portStr);
// if (integer != null)
// port = integer.intValue();
// } catch (Throwable t) {
// throw new IllegalArgumentException();
// }
// } else
// throw new IllegalArgumentException();
//
// if (ttlStr != null) {
// try {
// Integer integer = Integer.valueOf(ttlStr);
// if (integer != null)
// ttl = integer.intValue();
// } catch (Throwable t) {
// throw new IllegalArgumentException();
// }
// }
// }
// }
//
public static AVReceiveSimple createPlayer(String sessionAddress) {
// AVReceiveSimple avReceive = new AVReceiveSimple(sessionAddress);
// if (!avReceive.initialize()) {
// System.err.println("Failed to initialize the sessions.");
// avReceive = null;
// }
// return avReceive;
return null;
}
}
// TeleTeachingTool - Presentation Recording With Automated Indexing
//
// Copyright (C) 2003-2008 Peter Ziewer - Technische Universit?t M?nchen
//
// This file is part of TeleTeachingTool.
//
// TeleTeachingTool 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 3 of the License, or
// (at your option) any later version.
//
// TeleTeachingTool 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 TeleTeachingTool. If not, see <http://www.gnu.org/licenses/>.
package tttclient.connections;
/**
* @author Peter Ziewer (University of Trier,Germany)
* sending alive messages to server periodically
*/
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.util.Timer;
import java.util.TimerTask;
public class AliveDaemon extends TimerTask {
DatagramSocket socket;
DatagramPacket packet;
byte[] msg = { (byte) 42 };
Timer timer;
AliveDaemon(InetAddress address, int port) {
System.out.println("AliveDaemon: " + address + ":" + port);
try {
socket = new DatagramSocket();
packet = new DatagramPacket(msg, 0, address, port);
socket.send(packet);
timer = new Timer(true);
timer.scheduleAtFixedRate(this, 30000, 60000);
} catch (Exception e) {
System.err.println("Couldn't start AliveDaemon: " + e);
}
}
void terminate() throws IOException {
timer.cancel();
// send terminate message
packet.setLength(1);
socket.send(packet);
}
@Override
public void run() {
try {
socket.send(packet);
} catch (Exception e) {
System.err.println(e);
// javax.swing.JOptionPane.showMessageDialog(null,
// "Server is done. Exiting.");
}
}
}
This diff is collapsed.
This diff is collapsed.
// TeleTeachingTool - Presentation Recording With Automated Indexing
//
// Copyright (C) 2003-2008 Peter Ziewer - Technische Universit?t M?nchen
//
// This file is part of TeleTeachingTool.
//
// TeleTeachingTool 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 3 of the License, or
// (at your option) any later version.
//
// TeleTeachingTool 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 TeleTeachingTool. If not, see <http://www.gnu.org/licenses/>.
package tttclient.connections;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;