Commit efc5633b authored by daFischer's avatar daFischer

Added HighlightAnnoation

parent 38d7a67d
......@@ -41,20 +41,14 @@ Controls::Controls(Video* video, AudioInterface* audio) {
surfVolume=SDL_LoadBMP("Assets/volume.bmp");
surfVolume2=SDL_LoadBMP("Assets/volume2.bmp");
surfFullscreen=SDL_LoadBMP("Assets/fullscreen.bmp");
font = TTF_OpenFont("/Assets/arial.ttf",20);
#else
surfPlay=SDL_LoadBMP("/home/user/NetBeansProjects/TTTPlayer/emBuild/Assets/PlayPause.bmp");
surfVolume=SDL_LoadBMP("/home/user/NetBeansProjects/TTTPlayer/emBuild/Assets/volume.bmp");
surfVolume2=SDL_LoadBMP("/home/user/NetBeansProjects/TTTPlayer/emBuild/Assets/volume2.bmp");
surfFullscreen=SDL_LoadBMP("/home/user/NetBeansProjects/TTTPlayer/emBuild/Assets/fullscreen.bmp");
font = TTF_OpenFont("/home/user/NetBeansProjects/TTTPlayer/emBuild//Assets/arial.ttf",20);
#endif
if(surfPlay==NULL||surfVolume==NULL||surfVolume2==NULL||surfFullscreen==NULL)
printf("BMPs ARE NULL\n");
if(font==NULL)
printf("FONT IS NULL\n");
else
printf("font is ok\n");
}
Controls::~Controls() {
......@@ -62,7 +56,6 @@ Controls::~Controls() {
SDL_FreeSurface(surfVolume);
SDL_FreeSurface(surfVolume2);
SDL_FreeSurface(surfFullscreen);
TTF_CloseFont(font);
audio=NULL;
video=NULL;
}
......@@ -209,17 +202,41 @@ void Controls::draw(SDL_Surface *screen, bool hasDrawn){
SDL_FillRect(screen, &rect, emColor(0xaa0000));
//draw "time / duration"
SDL_Color color = {0xff,0xff,0xff,0xff};
SDL_Color white = {0xff,0xff,0xff,0xff};
ostringstream oss;
oss << currentPosition/60 << ":" << ((currentPosition%60<10) ? "0" : "") << currentPosition%60 << "/" << duration/60 << ":" << ((duration%60<10) ? "0" : "") << duration%60;
SDL_Surface* times=TTF_RenderText_Solid(font,oss.str().c_str(),color);
redefineRect(&rect,192,y+timeLineHeight+4,times->w+4,times->h+4);
SDL_Surface* times=TTF_RenderText_Solid(Player::font,oss.str().c_str(),white);
#ifdef EMSCRIPTEN
drawScaledText(screen,times,width-64-times->w*2,y+timeLineHeight+8,2);
#else
redefineRect(&rect,width-64-times->w,y+timeLineHeight+4,times->w+4,times->h+4);
SDL_BlitSurface(times,NULL,screen,&rect);
#endif
SDL_FreeSurface(times);
if(mouseY>=y&&mouseY<y+timeLineHeight)
{
video->drawThumbnail(duration*mouseX/width*1000,mouseX,y);
//draw time at cursor position
ostringstream oss2;
oss2 << duration*mouseX/width/60 << ":" << (((duration*mouseX/width)%60<10) ? "0" : "") << (duration*mouseX/width)%60;
SDL_Color black={0,0,0,0xff};
/*TTF_SetFontOutline(Player::font,2);
times=TTF_RenderText_Solid(Player::font,oss2.str().c_str(),black);
redefineRect(&rect,max(0,min(width-times->w,mouseX-times->w/2 - 2)),y-24,times->w+4,times->h+4);
SDL_BlitSurface(times,NULL,screen,&rect);
SDL_FreeSurface(times);
TTF_SetFontOutline(Player::font,0);*/
times=TTF_RenderText_Solid(Player::font,oss2.str().c_str(),black);
#ifdef EMSCRIPTEN
drawScaledText(screen,times,max(0,min(width-times->w*2,mouseX-times->w - 2)),y-22,2);
#else
redefineRect(&rect,max(0,min(width-times->w,mouseX-times->w/2 - 2)),y-24,times->w+4,times->h+4);
SDL_BlitSurface(times,NULL,screen,&rect);
#endif
SDL_FreeSurface(times);
}
SDL_UpdateRect(screen, 0,y,width,screenHeight-y);
//SDL_Flip(screen);
......@@ -237,6 +254,31 @@ Uint32 Controls::emColor(unsigned int color){
#endif
}
Uint32 Controls::readPixel(SDL_Surface* source, int x, int y){
switch(source->format->BytesPerPixel)
{
case 1:
return ((unsigned char*)source->pixels)[x+source->w*y];
case 2:
return ((unsigned short*)source->pixels)[x+source->w*y];
default:
return ((unsigned int*)source->pixels)[x+source->w*y];
}
}
void Controls::drawScaledText(SDL_Surface* screen, SDL_Surface* text, short x, short y, char factor) {
SDL_Rect rect={0,0,factor,factor};
SDL_LockSurface(text);
for(int i=0;i<text->w;i++)
for(int j=0;j<text->h;j++)
{
rect.x=x+i*factor;
rect.y=y+j*factor;
SDL_FillRect(screen,&rect,readPixel(text,i,j));
}
SDL_UnlockSurface(text);
}
void Controls::redefineRect(SDL_Rect* rect, int x, int y, int w, int h){
rect->x=x;
rect->y=y;
......
......@@ -9,7 +9,6 @@
#define CONTROLS_H
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <sstream>
#include "AudioInterface.h"
......@@ -47,6 +46,8 @@ private:
Uint32 emColor(Uint32);
void redefineRect(SDL_Rect* rect, int x, int y, int w, int h);
void changeVolume(float volume);
void drawScaledText(SDL_Surface* screen, SDL_Surface* text, short x, short y, char factor);
Uint32 readPixel(SDL_Surface* source, int x, int y);
Video* video;
AudioInterface* audio;
......@@ -64,7 +65,6 @@ private:
SDL_Surface* surfVolume;
SDL_Surface* surfVolume2;
SDL_Surface* surfFullscreen;
TTF_Font* font;
};
//#ifdef EMSCRIPTEN
......
......@@ -6,10 +6,12 @@
*/
#include "Annotation.h"
#include "WhiteboardMessage.h"
ColorConverter Annotation::con;
bool Annotation::mustRedraw=false;
list<Annotation*> Annotation::annotations;
WhiteboardMessage* Annotation::lastWhiteboard =NULL;
Annotation::Annotation() {
}
......@@ -18,6 +20,7 @@ Annotation::~Annotation() {
}
void Annotation::paint(SDL_Surface* screen, ProtocolPreferences* prefs) {
//printf("Pushed Annotation at (%d, %d)\n",x,y);
annotations.push_back(this);
//try to avoid useless drawing
......@@ -38,13 +41,15 @@ void Annotation::redraw(SDL_Surface *screen ,ProtocolPreferences *prefs) {
mustRedraw=false;
if(WhiteboardMessage::number>0)
lastWhiteboard->draw(screen,prefs);
//redraw all active Annotations
for(list<Annotation*>::iterator it = annotations.begin(); it!= annotations.end(); it++)
(*it)->draw(screen,prefs);
}
void Annotation::drawLine(SDL_Surface* screen, Uint32 color, short startX, short startY, short endX, short endY) {
SDL_Rect pixel={startX-1,startY-1,3,3};
SDL_Rect pixel={startX-linewidth/2,startY-linewidth/2,linewidth,linewidth};
if(startX == endX && startY == endY)
{
//just a point
......@@ -52,7 +57,7 @@ void Annotation::drawLine(SDL_Surface* screen, Uint32 color, short startX, short
return;
}
if(abs(startX-endX)>abs(startY-endY))
for(int i=min(startX,endX);i<max(startX,endX);i++)
for(int i=min(startX,endX);i<=max(startX,endX);i++)
{
if((startX<endX)==(startY<endY)) //down right or left up
pixel.x=i-1;
......@@ -62,7 +67,7 @@ void Annotation::drawLine(SDL_Surface* screen, Uint32 color, short startX, short
SDL_FillRect(screen,&pixel,color);
}
else
for(int i=min(startY,endY);i<max(startY,endY);i++)
for(int i=min(startY,endY);i<=max(startY,endY);i++)
{
pixel.x=min(startX,endX)+abs(startX-endX)*(i-min(startY,endY))/abs(startY-endY)-1;
if((startX<endX)==(startY<endY)) //down right or left up
......
......@@ -14,6 +14,8 @@
using namespace std;
class WhiteboardMessage;
class Annotation : public Message{
public:
Annotation();
......@@ -27,13 +29,13 @@ public:
static void drawLine(SDL_Surface *screen, Uint32 color, short startX, short startY, short endX, short endY);
static ColorConverter con;
static list<Annotation*> annotations;
static WhiteboardMessage* lastWhiteboard;
protected:
//static void addAnnotation(Annotation* annotation);
const static char linewidth=2;
static void deleteAnnotation(int x, int y);
private:
};
#endif /* ANNOTATION_H */
......
......@@ -19,7 +19,7 @@ DeleteAnnotation::~DeleteAnnotation() {
void DeleteAnnotation::paint(SDL_Surface *screen, ProtocolPreferences* prefs)
{
//printf("Delete Annotation\n");
//printf("Deleted Annotation at (%d, %d)\n",x,y);
deleteAnnotation(x,y);
mustRedraw=true;
}
......@@ -32,7 +32,7 @@ FreehandAnnotation::FreehandAnnotation(int timestamp, Inflater* in) {
}
void FreehandAnnotation::draw(SDL_Surface* screen, ProtocolPreferences* prefs) {
printf("Draw FreehandAnnotation\n");
//printf("Draw FreehandAnnotation\n");
std::list<Point*>::iterator it=points.begin();
short startX,startY,endX,endY;
......
/*
* File: HighlightAnnotation.cpp
* Author: user
*
* Created on July 28, 2014, 4:26 PM
*/
#include "HighlightAnnotation.h"
HighlightAnnotation::HighlightAnnotation(int timestamp, Inflater* in) {
this->timestamp=timestamp;
in->readByte(&color);
short endX,endY;
in->readShort(&x);
in->readShort(&y);
in->readShort(&endX);
in->readShort(&endY);
w=abs(x-endX);
if(x>endX)
x-=w;
h=abs(y-endY);
if(y>endY)
y-=h;
}
void HighlightAnnotation::draw(SDL_Surface* screen, ProtocolPreferences* prefs) {
//printf("draw HighlightAnnotation(%d,%d,%d,%d)\n",x,y,w,h);
Uint32 drawColor=ColorConverter::getAnnotationColor(color,screen->format);
SDL_Rect rect = {x,y,w,h}; //left
SDL_FillRect(screen, &rect, drawColor);
drawColor=(drawColor& ~ProtocolPreferences::format->Amask) | (ProtocolPreferences::format->Amask & (ProtocolPreferences::format->Amask>>1));
SDL_Rect rect1 = {x-linewidth, y-linewidth, linewidth, h+2*linewidth}; //left
SDL_FillRect(screen, &rect1, drawColor);
SDL_Rect rect2 = {x, y-linewidth, w+linewidth, linewidth}; //upper
SDL_FillRect(screen, &rect2, drawColor);
SDL_Rect rect3 = {x+w, y, linewidth, h+linewidth}; //right
SDL_FillRect(screen, &rect3, drawColor);
SDL_Rect rect4 = {x, y+h, w, linewidth}; //bottom
SDL_FillRect(screen, &rect4, drawColor);
SDL_UpdateRect(screen,x-linewidth,y-linewidth,w+2*linewidth,h+2*linewidth);
}
HighlightAnnotation::~HighlightAnnotation() {
}
/*
* File: HighlightAnnotation.h
* Author: user
*
* Created on July 28, 2014, 4:26 PM
*/
#ifndef HIGHLIGHTANNOTATION_H
#define HIGHLIGHTANNOTATION_H
#include "Annotation.h"
class HighlightAnnotation : public Annotation{
public:
HighlightAnnotation(int timestamp, Inflater* in);
~HighlightAnnotation();
void draw(SDL_Surface *screen, ProtocolPreferences* prefs);
private:
char color;
};
#endif /* HIGHLIGHTANNOTATION_H */
......@@ -14,11 +14,10 @@ LineAnnotation::LineAnnotation(int timestamp, Inflater* in) {
in->readShort(&startY);
in->readShort(&endX);
in->readShort(&endY);
printf("LineAnnotation at %d\n",timestamp);
}
void LineAnnotation::draw(SDL_Surface* screen, ProtocolPreferences* prefs) {
printf("Painted line from (%d,%d) to (%d,%d)\n",startX,startY,endX,endY);
//printf("Painted line from (%d,%d) to (%d,%d)\n",startX,startY,endX,endY);
drawLine(screen,ColorConverter::getAnnotationColor(color,ProtocolPreferences::format),startX,startY,endX,endY);
}
......
......@@ -17,6 +17,7 @@
#include "CursorPositionMessage.h"
#include "LineAnnotation.h"
#include "FreehandAnnotation.h"
#include "HighlightAnnotation.h"
int number;
int total;
......@@ -96,7 +97,7 @@ list<Message*> readMessages(Inflater* in, ProtocolPreferences* prefs){
case ENCODINGWHITEBOARD:
containsWhiteboard = true;
message->type=RAW;
message->type=ANNOTATION;
break;
case ENCODINGTTTRICHCURSOR:
......@@ -155,9 +156,9 @@ Message* readMessage(Inflater* in, ProtocolPreferences* prefs){
message = new RectangleAnnotation(timestamp, in);
break;
/*case ANNOTATIONHIGHLIGHT:
case ANNOTATIONHIGHLIGHT:
message = new HighlightAnnotation(timestamp, in);
break;*/
break;
case ANNOTATIONLINE:
message = new LineAnnotation(timestamp, in);
......@@ -184,9 +185,7 @@ Message* readMessage(Inflater* in, ProtocolPreferences* prefs){
break;
case ENCODINGWHITEBOARD:
//TODO:test
printf("ENCODINGWHITEBOARD\n");
in->readByte(&byte);
in->readByte(&byte);//pageNumber
message = new WhiteboardMessage(timestamp, byte, prefs);
break;
......
......@@ -24,7 +24,6 @@ public:
private:
const static char linewidth=2;
char color;
};
......
......@@ -6,21 +6,47 @@
*/
#include "WhiteboardMessage.h"
SDL_Surface* WhiteboardMessage::numberSurface;
int WhiteboardMessage::number;
WhiteboardMessage::WhiteboardMessage(int timestamp, int pageNumber, ProtocolPreferences* prefs) {
this->timestamp=timestamp;
this->pageNumber=pageNumber;
number=-1;
}
WhiteboardMessage::~WhiteboardMessage() {
if(number==pageNumber)
{
number=-1;
SDL_FreeSurface(numberSurface);
numberSurface=NULL;
}
}
void WhiteboardMessage::paint(SDL_Surface *screen, ProtocolPreferences* prefs)
{
printf("paint Whiteboard\n");
SDL_Rect rect = {0,0,screen->w,screen->h};
SDL_FillRect(screen, &rect, 0xffffffff);
SDL_UpdateRect(screen, 0,0,screen->w,screen->h);
printf("paint Whiteboard at %d\n",timestamp);
mustRedraw=true;
annotations.clear();
if(pageNumber>0)
{
if(number!=-1)
SDL_FreeSurface(numberSurface);
ostringstream oss;
oss << "#" << pageNumber;
SDL_Color color = {0,0,0,0xff};
numberSurface=TTF_RenderText_Solid(Player::font,oss.str().c_str(),color);
lastWhiteboard=this;
number=pageNumber;
}
else
number=min(number,pageNumber);
}
void WhiteboardMessage::draw(SDL_Surface* screen, ProtocolPreferences* prefs) {
SDL_Rect rect={ProtocolPreferences::framebufferWidth-20-numberSurface->w,20,numberSurface->w,numberSurface->h};
SDL_BlitSurface(numberSurface,NULL,screen,&rect);
}
bool WhiteboardMessage::completeScreen(int w, int h){
......
......@@ -8,21 +8,26 @@
#ifndef WHITEBOARDMESSAGE_H
#define WHITEBOARDMESSAGE_H
//#include "Message.h"
#include "Annotation.h"
#include <SDL/SDL.h>
#include <sstream>
#include "../Player.h"
#include "Message.h"
#include <SDL/SDL.h>
class WhiteboardMessage : public Message {
class WhiteboardMessage : public Annotation {
public:
WhiteboardMessage(int timestamp, int pageNumber, ProtocolPreferences* prefs);
~WhiteboardMessage();
void paint(SDL_Surface *screen, ProtocolPreferences* prefs);
void draw(SDL_Surface* screen, ProtocolPreferences* prefs);
bool completeScreen(int w, int h);
int getArea();
static SDL_Surface* numberSurface;
static int number;
private:
int pageNumber;
};
#endif /* WHITEBOARDMESSAGE_H */
......
......@@ -10,7 +10,7 @@
#include "Controls.h"
Player *player;
//TTF_Font* font;
TTF_Font* Player::font;
Player::Player(const char* cpath, const char* cfilename) {
......@@ -34,6 +34,17 @@ Player::Player(const char* cpath, const char* cfilename) {
return;
}
#ifdef EMSCRIPTEN
font = TTF_OpenFont("/Assets/arial.ttf",20);
#else
font = TTF_OpenFont("/home/user/NetBeansProjects/TTTPlayer/emBuild//Assets/arial.ttf",20);
#endif
if(font==NULL)
{
printf("No font\n");
return;
}
video=new Video((path+"/"+filename+"_a/"+filename+".ttt").c_str());
#ifdef EMSCRIPTEN
audio=new AudioJS();
......@@ -115,9 +126,11 @@ Player::~Player() {
audio=NULL;
delete(controls);
controls=NULL;
TTF_CloseFont(font);
#ifdef EMSCRIPTEN
emscripten_cancel_main_loop();
#else
//function doesn't exist in emscripten for some reason
TTF_Quit();
#endif
SDL_Quit();
......
......@@ -15,6 +15,7 @@
#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
#include <SDL/SDL_ttf.h>
#include <stdio.h>
#include <fstream>
......@@ -37,7 +38,7 @@ public:
void loop();
virtual ~Player();
//static TTF_Font* font;
static TTF_Font* font;
private:
AudioInterface *audio;
......
......@@ -9,6 +9,7 @@
#include "Controls.h"
#include "Messages/Annotation.h"
#include "Messages/CursorMessage.h"
#include "Messages/WhiteboardMessage.h"
Video::Video(const char* path) {
......@@ -21,7 +22,8 @@ Video::Video(const char* path) {
Inflater* inflater=new Inflater(f);
if(readServerInit(inflater))
printf("Video Initialization success: \n%s\n", prefs.name);
if(VERBOSE)
printf("Video Initialization success: \n%s\n", prefs.name);
index=NULL;
......@@ -43,10 +45,12 @@ Video::Video(const char* path) {
m.pop_front();
}
printf("Read %d messages successfully\n", numMessages);
if(VERBOSE)
printf("Read %d messages successfully\n", numMessages);
delete(inflater);
printf("%d x %d, color depth: %d\n",prefs.framebufferWidth, prefs.framebufferHeight, prefs.bytesPerPixel);
if(VERBOSE)
printf("%d x %d, color depth: %d\n",prefs.framebufferWidth, prefs.framebufferHeight, prefs.bytesPerPixel);
screen = SDL_SetVideoMode(prefs.framebufferWidth, prefs.framebufferHeight, prefs.bitsPerPixel, SDL_ANYFORMAT|SDL_DOUBLEBUF);
//prefs.format->Amask=0xffffffff-screen->format->Rmask-screen->format->Gmask-screen->format->Bmask;
rawScreen=SDL_CreateRGBSurface(screen->flags,screen->w,screen->h,screen->format->BitsPerPixel,screen->format->Rmask,screen->format->Gmask,screen->format->Bmask,0xffffffff-screen->format->Rmask-screen->format->Gmask-screen->format->Bmask);
......@@ -71,7 +75,6 @@ void Video::update(int zeit, Controls* controls)
{
bool blitRaw=false;
bool blitAnn=false;
Annotation* annotation;
//check whether audio has restarted
if(zeit<=2 && (currentMessage>0 && messages[currentMessage-1]->timestamp>zeit*1000+5000))
currentMessage=0;
......@@ -87,8 +90,7 @@ void Video::update(int zeit, Controls* controls)
switch(messages[currentMessage]->type){
case ANNOTATION:
blitAnn=true;
annotation=reinterpret_cast<Annotation*>(messages[currentMessage]);
annotation->paint(annScreen, &prefs);
messages[currentMessage]->paint(annScreen, &prefs);
break;
case RAW:
blitRaw=true;
......@@ -113,8 +115,8 @@ void Video::update(int zeit, Controls* controls)
if(blitAnn)
{
//redraw annScreen if needed, doesn't matter which annotation does it
if(annotation->mustRedraw)
annotation->redraw(annScreen,&prefs);
if(Annotation::mustRedraw)
Annotation::redraw(annScreen,&prefs);
}
redrawScreen(controls, blitAnn||blitRaw);
}
......@@ -124,7 +126,10 @@ void Video::redrawScreen(Controls* controls, bool fully) {
{
//redraw screen completely
SDL_Rect rect = {0,0,screen->w,controls->videoUpdate.y+controls->videoUpdate.h};
SDL_BlitSurface(rawScreen,&rect,screen,&rect);
if(WhiteboardMessage::number>0)
SDL_FillRect(screen,&rect,SDL_MapRGBA(ProtocolPreferences::format,0xff,0xff,0xff,0xff));
else
SDL_BlitSurface(rawScreen,&rect,screen,&rect);
SDL_BlitSurface(annScreen,&rect,screen,&rect);
if(CursorMessage::showCursor)
{
......@@ -137,7 +142,10 @@ void Video::redrawScreen(Controls* controls, bool fully) {
if(lastThumbnail.w!=0)
{
//redraw screen where thumbnail was before
SDL_BlitSurface(rawScreen,&lastThumbnail,screen,&lastThumbnail);
if(WhiteboardMessage::number>0)
SDL_FillRect(screen,&lastThumbnail,SDL_MapRGBA(ProtocolPreferences::format,0xff,0xff,0xff,0xff));
else
SDL_BlitSurface(rawScreen,&lastThumbnail,screen,&lastThumbnail);
SDL_BlitSurface(annScreen,&lastThumbnail,screen,&lastThumbnail);
if(CursorMessage::showCursor)
{
......@@ -149,7 +157,10 @@ void Video::redrawScreen(Controls* controls, bool fully) {
if(controls->videoUpdate.h!=0)
{
//only redraw the part that controls releases when moving downwards
SDL_BlitSurface(rawScreen,&controls->videoUpdate,screen,&controls->videoUpdate);
if(WhiteboardMessage::number>0)
SDL_FillRect(screen,&controls->videoUpdate,SDL_MapRGBA(ProtocolPreferences::format,0xff,0xff,0xff,0xff));
else
SDL_BlitSurface(rawScreen,&controls->videoUpdate,screen,&controls->videoUpdate);
SDL_BlitSurface(annScreen,&controls->videoUpdate,screen,&controls->videoUpdate);
if(CursorMessage::showCursor)
{
......@@ -191,20 +202,27 @@ void Video::seekPosition(int position, Controls* controls){
max=(min+max)/2;
else
min=(min+max)/2+1;
currentMessage=min-1;
IndexEntry* indexEntry=index->lastBefore(messages[currentMessage]->timestamp);
min--;
IndexEntry* indexEntry=index->lastBefore(messages[min]->timestamp);
int lastEntry=indexEntry->timestamp;
WhiteboardMessage::number=std::min(WhiteboardMessage::number,0);
int firstAnnotation=0;
int firstRaw=0;
bool foundCursor=false;
for(int i= currentMessage;i>=0;i--)
for(int i= min;i>=0;i--)
{
//printf("%s\n",messages[i]->type);
if( (firstRaw!=0 || (lastEntry >= messages[i]->timestamp && indexEntry->hasImages)) &&
(firstAnnotation!=0 || !containsAnnotations) &&
(foundCursor || !containsCursorMessages))
break;
if(i==currentMessage && currentMessage<=min)
{
firstRaw=std::max(i,firstRaw);
firstAnnotation=std::max(i,firstAnnotation);
break;
}
switch(messages[i]->type){
case ANNOTATION:
......@@ -212,9 +230,8 @@ void Video::seekPosition(int position, Controls* controls){
firstAnnotation=i;
break;
case RAW:
if(firstRaw==0 && (lastEntry < messages[i]->timestamp || !indexEntry->hasImages))
if(messages[i]->completeScreen(prefs.framebufferWidth, prefs.framebufferHeight))
firstRaw=i;
if((lastEntry >= messages[i]->timestamp && indexEntry->hasImages) || (firstRaw==0 && messages[i]->completeScreen(prefs.framebufferWidth, prefs.framebufferHeight)))
firstRaw=i;
break;
case CURSOR:
if(!foundCursor)
......@@ -224,25 +241,30 @@ void Video::seekPosition(int position, Controls* controls){
}
}
//after the search, Annotations must be redrawn
Annotation::mustRedraw=true;
Annotation::annotations.clear();
//printf("IndexEntry at %d has%s Images\n",lastEntry, indexEntry->hasImages ? "" : " no");
if(lastEntry>=messages[firstRaw]->timestamp && indexEntry->hasImages)
{
indexEntry->paintWaypoint(rawScreen);
//firstRaw=lastEntry;
}
for(int i=firstRaw;i<currentMessage;i++)
for(int i=firstRaw;i<min;i++)
if(messages[i]->type==RAW)
messages[i]->paint(rawScreen,&prefs);
for(int i=firstAnnotation;i<currentMessage;i++)
if(firstAnnotation!=currentMessage)
{
//after the search, Annotations must be redrawn
Annotation::mustRedraw=true;
Annotation::annotations.clear();
}
for(int i=firstAnnotation;i<min;i++)
if(messages[i]->type==ANNOTATION)
messages[i]->paint(annScreen,&prefs);
Annotation::redraw(annScreen,&prefs);
if(firstAnnotation!=currentMessage||Annotation::mustRedraw)
Annotation::redraw(annScreen,&prefs);
currentMessage=min;
redrawScreen(controls,true);
......@@ -303,11 +325,10 @@ void Video::readExtensions(Inflater* in){
in->readInt(&len);
char tag;
while (len > 0) {
printf("len=%d\n",len);
in->readByte(&tag);
switch(tag){
case EXTENSION_INDEX_TABLE:
printf("read EXTENSION_INDEX_TABLE\n");
//printf("read EXTENSION_INDEX_TABLE\n");
int error;
// no original, but modified recording
original = false;
......
build/Debug/GNU-Linux-x86/Messages/Annotation.o: Messages/Annotation.cpp \
Messages/Annotation.h Messages/Message.h Messages/../Inflater.h \
Messages/../SizedArray.h Messages/../ProtocolPreferences.h \
Messages/../Constants.h Messages/../ColorConverter.h
Messages/../Constants.h Messages/../ColorConverter.h \
Messages/WhiteboardMessage.h Messages/../Player.h \
Messages/../AudioInterface.h Messages/../Audio.h Messages/../Video.h \
Messages/../Inflater.h Messages/../ProtocolPreferences.h \
Messages/../Messages/Message.h Messages/../Index.h \
Messages/../IndexEntry.h Messages/../Controls.h
Messages/Annotation.h:
......@@ -16,3 +21,25 @@ Messages/../ProtocolPreferences.h:
Messages/../Constants.h:
Messages/../ColorConverter.h:
Messages/WhiteboardMessage.h:
Messages/../Player.h: