Commit 3f1cb5cf authored by thurner's avatar thurner

html5 postprocessing

git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@109 0463f305-d864-43cb-8a47-61cf597d4139
parent fc41548b
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin" path="java"/>
<classpathentry kind="var" path="JRE_LIB" sourcepath="JRE_SRC"/>
<classpathentry kind="con" path="bin"/>
<classpathentry kind="con" path="lib"/>
<classpathentry kind="lib" path="lib/itext-1.4.8.jar"/>
<classpathentry kind="lib" path="lib/jsch-0.1.32-patched.jar"/>
<classpathentry kind="lib" path="lib/swing-layout-1.0.2.jar"/>
<classpathentry kind="lib" path="lib/jmf-2.1.1e.jar"/>
<classpathentry kind="lib" path="lib/mp3plugin.jar"/>
<classpathentry kind="lib" path="lib/v4l4j.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="TTT/native/linux32"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/lti-civil.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin" path="java"/>
<classpathentry kind="var" path="JRE_LIB" sourcepath="JRE_SRC"/>
<classpathentry kind="con" path="bin"/>
<classpathentry kind="con" path="lib"/>
<classpathentry kind="lib" path="lib/itext-1.4.8.jar"/>
<classpathentry kind="lib" path="lib/jsch-0.1.32-patched.jar"/>
<classpathentry kind="lib" path="lib/swing-layout-1.0.2.jar"/>
<classpathentry kind="lib" path="lib/jmf-2.1.1e.jar"/>
<classpathentry kind="lib" path="lib/mp3plugin.jar"/>
<classpathentry kind="lib" path="lib/v4l4j.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="TTT/native/linux32"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/lti-civil.jar"/>
<classpathentry kind="lib" path="C:/Users/Pat Bateman/Downloads/base64coder/target/base64coder.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
......@@ -104,6 +104,20 @@ public class ProtocolPreferences {
public void setEncodings(int[] encodings) {
this.encodings = encodings;
}
public String toJson() {
return "{\"framebufferWidth\":"+this.framebufferWidth+","
+"\"framebufferHeight\":"+this.framebufferHeight+","
+"\"bytesPerPixel\":"+this.bytesPerPixel+","
+"\"bitsPerPixel\":"+this.bitsPerPixel+","
+"\"bigEndian\":"+this.bigEndian+","
+"\"redMax\":"+this.redMax+","
+"\"redShift\":"+this.redShift+","
+"\"blueMax\":"+this.blueMax+","
+"\"blueShift\":"+this.blueShift+","
+"\"greenMax\":"+this.greenMax+","
+"\"greenShift\":"+this.greenShift+"}";
}
public String toString() {
return "Desktop: " + name + "\n" + "Size: " + framebufferWidth + " x " + framebufferHeight + " (" + depth
......
......@@ -36,12 +36,11 @@ import ttt.TTT;
/**
* Helper class for using the mp3 encoder <a href="http://lame.sourceforge.net/">lame</a> via system calls. <br>
* Created on 29. June 2009, 14:15
* @author Christof Angermueller
* @author Christof Angermueller
*/
public class LameEncoder {
private static final String LAME = "lame";
private static final String LAME = "C:\\dev\\bin\\lame.exe";
public static void main(String[] args) throws Exception{
......@@ -82,7 +81,8 @@ public class LameEncoder {
final Exec exec = new Exec();
int i;
if (!batch) {
final ProgressMonitor progressMonitor = new ProgressMonitor(TTT.getRootComponent(),null,"encoding mp3 file",0,100);
String msg = !options.contains("-d") ? "encoding mp3 file" : "decoding mp3 file to wav";
final ProgressMonitor progressMonitor = new ProgressMonitor(TTT.getRootComponent(),null,msg,0,100);
progressMonitor.setMillisToDecideToPopup(100);
progressMonitor.setMillisToPopup(100);
//the progress depends on the current outFile size in comparison to the expected outFile size
......
// 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 ttt.audio;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import javax.swing.ProgressMonitor;
import javax.swing.Timer;
import ttt.Constants;
import ttt.TTT;
/**
* Helper class for using the ogg vorbis encoder via system calls, based on LameEncoder
* Created on 03-23-2012
* @author Manuel Thurner
*/
public class OggVorbisEncoder {
private static final String OGGVORBIS = "C:\\dev\\bin\\oggenc.exe";
public static void main(String[] args) throws Exception{
String[] oggVorbisArgs = Arrays.copyOf(args, 3);
if (oggVorbisArgs[0] == null || oggVorbisArgs[1] == null) {
System.out.println("OggVorbisEncoder inputFile outputFile [options]");
return;
}
OggVorbisEncoder.convertAudioFile(new File(oggVorbisArgs[0]),new File(oggVorbisArgs[1]),oggVorbisArgs[2] == null ? "" : oggVorbisArgs[2],true);
}
/**Checks whether oggVorbis is available
* @return True if oggVorbis is available
* */
public static boolean isOggVorbisAvailable() {
return Exec.getCommand(OGGVORBIS) != null;
}
/**Allows converting audio files using oggenc
* @return True: Conversion succeeded.<br>False: Canceled by user
*/
public static boolean convertAudioFile(File inFile, File outFile, String options, boolean batch) throws Exception {
if(TTT.verbose){
System.out.println("----------------------------------------------");
System.out.println("OggEncoder");
System.out.println("----------------------------------------------");
System.out.println("Encoding oggvorbis file");
}
long startTime = System.currentTimeMillis(); //time measurement
String oggencCmd = Exec.getCommand(OGGVORBIS); //get oggenc command
if (oggencCmd == null) {
throw new IOException("oggenc not found");
}
outFile.delete(); //delete outFile in order to test success after encoding
final Exec exec = new Exec();
int i;
if (!batch) {
final ProgressMonitor progressMonitor = new ProgressMonitor(TTT.getRootComponent(),null,"encoding ogg vorbis file",0,100);
progressMonitor.setMillisToDecideToPopup(100);
progressMonitor.setMillisToPopup(100);
//the progress depends on the current outFile size in comparison to the expected outFile size
progressMonitor.setMaximum((int)(inFile.length()>>10)/12); //>>10 to get the file size in kb and 12 as the expected compression rate
final File outFileFinal = outFile;
Timer timer = new Timer(250, new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (progressMonitor.isCanceled()) {
exec.abort();
}
int length = (int)outFileFinal.length()>>10;
while (length >= progressMonitor.getMaximum()) {
length = progressMonitor.getMaximum()-1;
}
progressMonitor.setProgress(length);
}
});
timer.start();
//call oggenc
exec.createListenerStream();
i = exec.exec(new String[] {oggencCmd, options, "-o "+outFile.getPath(), inFile.getPath()});
timer.stop();
if (progressMonitor.isCanceled()) {
progressMonitor.close();
outFile.delete(); //delete the partly encoded outFile
if(TTT.verbose){
System.out.println("Canceled by user");
}
return false;
}
progressMonitor.close();
} else {
//call oggenc
exec.createListenerStream();
i = exec.exec(new String[] {oggencCmd, options, "-o "+outFile.getPath(), inFile.getPath()});
}
if (i != 0 || outFile.length() == 0) { //check success
if(TTT.verbose){
System.out.println("Unable to encode audio file using oggenc:");
}
System.out.println(exec.getListenerStream());
outFile.delete();
throw new IOException("unable to encode audio file using oggenc");
}
if(TTT.verbose){
System.out.println("Done in " + Constants.getStringFromTime((int)(System.currentTimeMillis()-startTime)));
System.out.println("----------------------------------------------");
}
return true;
}
/**Allows converting audio files using oggenc determining suitable options automatically
* @return True: Conversion succeeded.<br>False: Canceled by user
*/
public static boolean convertAudioFile(File inFile, File outFile, boolean batch) throws Exception {
//define quality depending on the file size
int length = (int)inFile.length()>>20; //file size in mb
int q;
if (length < 20) {
q = 6; //high quality
} else if (length < 40) {
q = 4; //average quality
} else if (length < 80) {
q = 2; //acceptable quality and fast
} else {
q = 0; //acceptable quality and very fast
}
return convertAudioFile(inFile,outFile,"-q " + q, batch);
}
}
......@@ -38,6 +38,8 @@ import ttt.Constants;
import ttt.TTT;
import ttt.gui.GraphicsContext;
import ttt.postprocessing.flash.FlashContext;
import ttt.postprocessing.html5.Html5Context;
import biz.source_code.base64Coder.Base64Coder;
import com.anotherbigidea.flash.SWFConstants;
import com.anotherbigidea.flash.movie.ImageUtil;
......@@ -318,4 +320,30 @@ public class CursorMessage extends FramebufferUpdateMessage {
cursorInstance = flashContext.frame.placeSymbol(shapeCursor, x, y, FlashContext.cursorDepth);
}
}
@Override
public void writeToJson(Html5Context html5Context) throws IOException {
html5Context.recording.graphicsContext.enableRefresh(false);
//reset input stream and handle message data
byteArrayInputStream.reset();
handleCursorShapeUpdate(html5Context.recording.graphicsContext, is, null, getEncoding(), x, y, width, height);
Image softCursor = html5Context.recording.graphicsContext.softCursor;
this.writeToJsonBegin(html5Context);
html5Context.out.write(",");
html5Context.out.write("\"x\":"+this.x+",");
html5Context.out.write("\"y\":"+this.y+",");
html5Context.out.write("\"width\":"+this.width+",");
html5Context.out.write("\"height\":"+this.height+",");
html5Context.out.write("\"image\":\"data:image/"+Html5Context.thumbnailImageFormat+";base64,");
if (softCursor != null) {
html5Context.out.write(Base64Coder.encode(Html5Context.imageToByte(softCursor)));
}
html5Context.out.write("\"");
this.writeToJsonEnd(html5Context);
}
}
......@@ -31,6 +31,7 @@ import java.io.IOException;
import ttt.Constants;
import ttt.gui.GraphicsContext;
import ttt.postprocessing.flash.FlashContext;
import ttt.postprocessing.html5.Html5Context;
public class CursorPositionMessage extends FramebufferUpdateMessage {
// TODO: think about superclass
......@@ -118,4 +119,13 @@ public class CursorPositionMessage extends FramebufferUpdateMessage {
lastCursorY = y;
lastCursorFrame = flashContext.frame;
}
@Override
public void writeToJson(Html5Context html5Context) throws IOException {
this.writeToJsonBegin(html5Context);
html5Context.out.write(",");
html5Context.out.write("\"x\":"+this.x+",");
html5Context.out.write("\"y\":"+this.y);
this.writeToJsonEnd(html5Context);
}
}
......@@ -32,6 +32,7 @@ import java.io.IOException;
import ttt.Constants;
import ttt.gui.GraphicsContext;
import ttt.postprocessing.flash.FlashContext;
import ttt.postprocessing.html5.Html5Context;
public class DeleteAllAnnotation extends Annotation {
......@@ -95,5 +96,10 @@ public class DeleteAllAnnotation extends Annotation {
// should never be called b/c messaging does not send delete annotations
return "";
}
@Override
public void writeToJson(Html5Context html5Context) throws IOException {
this.writeToJsonBegin(html5Context);
this.writeToJsonEnd(html5Context);
}
}
......@@ -34,6 +34,7 @@ import java.io.OutputStream;
import ttt.Constants;
import ttt.gui.GraphicsContext;
import ttt.postprocessing.flash.FlashContext;
import ttt.postprocessing.html5.Html5Context;
public class DeleteAnnotation extends Annotation {
......@@ -111,6 +112,15 @@ public class DeleteAnnotation extends Annotation {
flashContext.removeAnnotationsAt(x, y);
}
@Override
public void writeToJson(Html5Context html5Context) throws IOException {
this.writeToJsonBegin(html5Context);
html5Context.out.write(",");
html5Context.out.write("\"x\":"+this.x+",");
html5Context.out.write("\"y\":"+this.y);
this.writeToJsonEnd(html5Context);
}
// MODMSG
@Override
public String getXMLString() {
......
......@@ -40,6 +40,7 @@ import java.util.ArrayList;
import ttt.Constants;
import ttt.postprocessing.flash.FlashContext;
import ttt.postprocessing.html5.Html5Context;
import com.anotherbigidea.flash.movie.Instance;
import com.anotherbigidea.flash.structs.AlphaColor;
......@@ -165,10 +166,11 @@ public class FreehandAnnotation extends Annotation {
public com.anotherbigidea.flash.movie.Frame frame = null;
public void writeToFlash(FlashContext flashContext) throws IOException {
// converting Path to ArrayList for points
// TODO: use path directly
ArrayList<Point> pointList = new ArrayList<Point>();
// converting Path to ArrayList for points
// TODO: use path directly
private ArrayList<Point> pathToPointList() {
ArrayList<Point> pointList = new ArrayList<Point>();
PathIterator iterator = path.getPathIterator(null);
double[] pointOfPath = new double[6];
for (int i = 0; i < count; i++) {
......@@ -176,6 +178,12 @@ public class FreehandAnnotation extends Annotation {
pointList.add(new Point((int) pointOfPath[0], (int) pointOfPath[1]));
iterator.next();
}
return pointList;
}
public void writeToFlash(FlashContext flashContext) throws IOException {
ArrayList<Point> pointList = pathToPointList();
flashContext.symbolCount++;
flashContext.checkNextFrame(this.getTimestamp());
......@@ -209,6 +217,28 @@ public class FreehandAnnotation extends Annotation {
flashContext.addAnnotations(annot, instanceFreeHand);
}
@Override
public void writeToJson(Html5Context html5Context) throws IOException {
Color freehandColor = annotationColors[color];
ArrayList<Point> pointList = pathToPointList();
this.writeToJsonBegin(html5Context);
html5Context.out.write(",");
html5Context.out.write("\"color\":\""+colorToCssString(freehandColor)+"\",");
html5Context.out.write("\"points\":[");
for (int i = 0; i < pointList.size(); i++) {
if (i > 0) {
html5Context.out.write(",");
}
html5Context.out.write("{\"x\":"+pointList.get(i).x+",\"y\":"+pointList.get(i).y+"}");
}
html5Context.out.write("]");
this.writeToJsonEnd(html5Context);
}
// MODMSG
@Override
public String getXMLString() {
......
......@@ -27,8 +27,8 @@ package ttt.messages;
import java.awt.Color;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.awt.image.RasterFormatException;
import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
......@@ -39,6 +39,8 @@ import java.util.Random;
import ttt.Constants;
import ttt.gui.GraphicsContext;
import ttt.postprocessing.flash.FlashContext;
import ttt.postprocessing.html5.Html5Context;
import biz.source_code.base64Coder.Base64Coder;
import com.anotherbigidea.flash.SWFConstants;
import com.anotherbigidea.flash.movie.ImageUtil;
......@@ -140,6 +142,20 @@ public class HextileMessage extends FramebufferUpdateMessage {
// graphicsContext.handleUpdatedPixels(x, y, w, h);
graphicsContext.refresh(x, y, w, h);
}
static private void hextileRectToJson(GraphicsContext graphicsContext, BufferedWriter out, DataInputStream is, int x, int y, int w, int h, boolean updateFlag) throws IOException {
byte[] read = new byte[16];
int isEof = is.read(read);
while(isEof != -1) {
out.write(Base64Coder.encode(read));
isEof = is.read(read);
if (isEof != -1) {
out.write("\",\"");
}
}
}
// Handle one tile in the Hextile-encoded data.
static private void handleHextileSubrect(GraphicsContext graphicsContext, DataInputStream is, DataOutputStream os,
......@@ -396,6 +412,29 @@ public class HextileMessage extends FramebufferUpdateMessage {
writeToFlashORIG(flashContext);
//writeToFlashNEWER(flashContext);
}
@Override
public void writeToJson(Html5Context html5Context) throws IOException {
this.writeToJsonBegin(html5Context);
html5Context.out.write(",");
html5Context.out.write("\"x\":"+this.x+",");
html5Context.out.write("\"y\":"+this.y+",");
html5Context.out.write("\"width\":"+this.width+",");
html5Context.out.write("\"height\":"+this.height+",");
html5Context.out.write("\"hextiles\":"+"[\"");
// rset input stream and handle message data
byteArrayInputStream.reset();
try {
hextileRectToJson(html5Context.recording.graphicsContext, html5Context.out, is, x, y, width, height, updateFlag);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
html5Context.out.write("\"]");
this.writeToJsonEnd(html5Context);
}
public void writeToFlashORIG(FlashContext flashContext) throws IOException {
......
......@@ -8,15 +8,17 @@ import java.io.IOException;
import org.w3c.dom.Element;
import com.anotherbigidea.flash.movie.Image;
import com.anotherbigidea.flash.movie.ImageUtil;
import com.anotherbigidea.flash.movie.Instance;
import com.anotherbigidea.flash.movie.Shape;
import ttt.Constants;
import ttt.helper.Base64Codec;
import ttt.helper.ImageHelper;
import ttt.postprocessing.flash.FlashContext;
import ttt.postprocessing.html5.Html5Context;
import biz.source_code.base64Coder.Base64Coder;
import com.anotherbigidea.flash.movie.Image;
import com.anotherbigidea.flash.movie.ImageUtil;
import com.anotherbigidea.flash.movie.Instance;
import com.anotherbigidea.flash.movie.Shape;
/**
* Annotation which displays an image.
......@@ -122,4 +124,17 @@ public class ImageAnnotation extends Annotation {
flashContext.addAnnotations(this, instanceImg);
}
@Override
public void writeToJson(Html5Context html5Context) throws IOException {
this.writeToJsonBegin(html5Context);
html5Context.out.write(",");
html5Context.out.write("\"x\":"+this.posX+",");
html5Context.out.write("\"y\":"+this.posY+",");
html5Context.out.write("\"image\":\"data:image/jpeg;base64,");
html5Context.out.write(Base64Coder.encode(this.imgData));
html5Context.out.write("\"");
this.writeToJsonEnd(html5Context);
}
}
......@@ -24,6 +24,7 @@
*/
package ttt.messages;
import java.awt.Color;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
......@@ -32,6 +33,7 @@ import ttt.Constants;
import ttt.ProtocolPreferences;
import ttt.gui.GraphicsContext;
import ttt.postprocessing.flash.FlashContext;
import ttt.postprocessing.html5.Html5Context;
public abstract class Message {
......@@ -244,4 +246,25 @@ public abstract class Message {
// TODO: should be abstract
public void writeToFlash(FlashContext flashContext) throws IOException {};
protected void writeToJsonBegin(Html5Context html5Context) throws IOException {
html5Context.out.write("{\"type\":\""+this.getClass().getSimpleName()+"\",");
html5Context.out.write("\"time\":"+this.getTimestamp());
}
protected void writeToJsonEnd(Html5Context html5Context) throws IOException {
html5Context.out.write("}");
}
protected String colorToCssString(Color color) {
return "rgb("+color.getRed()+","+color.getGreen()+","+color.getBlue()+")";
}
public void writeToJson(Html5Context html5Context) throws IOException {
System.out.println("Unimplemented Msg: "+this.getClass().getSimpleName());
this.writeToJsonBegin(html5Context);
this.writeToJsonEnd(html5Context);
}
}
......@@ -24,12 +24,15 @@
*/
package ttt.messages;
import java.awt.Color;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.io.DataOutputStream;
import java.io.IOException;
import ttt.postprocessing.html5.Html5Context;
public abstract class SimpleAnnotation extends Annotation {
int color;
......@@ -121,5 +124,20 @@ public abstract class SimpleAnnotation extends Annotation {
sb.append(" />\n");
return sb.toString();
}
@Override
public void writeToJson(Html5Context html5Context) throws IOException {
Color fillColor = annotationColors[color];
this.writeToJsonBegin(html5Context);
html5Context.out.write(",");
html5Context.out.write("\"color\":\""+colorToCssString(fillColor)+"\",");
html5Context.out.write("\"startX\":"+this.startx+",");
html5Context.out.write("\"startY\":"+this.starty+",");
html5Context.out.write("\"endX\":"+this.endx+",");
html5Context.out.write("\"endY\":"+this.endy);
this.writeToJsonEnd(html5Context);
}
}
package ttt.messages;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.font.FontRenderContext;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextAttribute;
......@@ -16,20 +18,18 @@ import java.io.UnsupportedEncodingException;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
import javax.swing.JFrame;
import javax.swing.JTextField;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import ttt.Constants;
import ttt.postprocessing.flash.FlashContext;
import ttt.postprocessing.html5.Html5Context;
import com.anotherbigidea.flash.movie.Font.NoGlyphException;
import com.anotherbigidea.flash.movie.FontDefinition;
import com.anotherbigidea.flash.movie.FontLoader;
import com.anotherbigidea.flash.movie.Instance;
import com.anotherbigidea.flash.movie.Text;
import com.anotherbigidea.flash.movie.Font.NoGlyphException;
import ttt.Constants;
import ttt.postprocessing.flash.FlashContext;
/**
* Annotation which displays a text string.
......@@ -281,6 +281,18 @@ public final class TextAnnotation extends Annotation{
calculateBounds();
}
}
/*@Override
public String writeToJson() {
String s = "{\"type\":\"TextAnnotation\",";
s += "\"color\":"+color+",";
s += "\"text\":\""+text+"\",";
s += "\"bText\":\""+bText+"\",";
s += "\"posX\":"+posX+",";
s += "\"posY\":"+posY+",";
s += "\"maxWidth\":"+maxWidth+"}\n";
return s;
}*/
@Override
public void writeToFlash(FlashContext flashContext) throws IOException {
......@@ -328,6 +340,20 @@ public final class TextAnnotation extends Annotation{
// flashEdit.setTextColor(new AlphaColor(255,0,0,0));
}
@Override
public void writeToJson(Html5Context html5Context) throws IOException {
Color fillColor = annotationColors[color];
this.writeToJsonBegin(html5Context);
html5Context.out.write(",");
html5Context.out.write("\"color\":\""+colorToCssString(fillColor)+"\",");
html5Context.out.write("\"x\":"+this.posX+",");
html5Context.out.write("\"y\":"+this.posY+",");
html5Context.out.write("\"text\":\""+this.text+"\"");
this.writeToJsonEnd(html5Context);
}
private void getTextBytes() {
try {
bText = text.getBytes("UTF-8");
......
......@@ -31,6 +31,7 @@ import ttt.Constants;
import ttt.ProtocolPreferences;
import ttt.gui.GraphicsContext;
import ttt.postprocessing.flash.FlashContext;
import ttt.postprocessing.html5.Html5Context;
// must extend FramebufferUpdate or index generation will not detect Whiteboard pages
public class WhiteboardMessage extends FramebufferUpdateMessage {
......@@ -108,4 +109,12 @@ public class WhiteboardMessage extends FramebufferUpdateMessage {
}
}
}
@Override
public void writeToJson(Html5Context html5Context) throws IOException {
this.writeToJsonBegin(html5Context);
html5Context.out.write(",");
html5Context.out.write("\"pageNumber\":"+this.pageNumber);
this.writeToJsonEnd(html5Context);
}
}
This diff is collapsed.