Video.h 1.71 KB
Newer Older
daFischer's avatar
first  
daFischer committed
1 2
/* 
 * File:   Video.h
3
 * Author: Johannes Fischer
daFischer's avatar
first  
daFischer committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * Created on April 30, 2014, 8:36 PM
 */

#ifndef VIDEO_H
#define	VIDEO_H

#include <SDL/SDL.h>

#include <stdio.h>
#include <list>
#include <fstream>
#include <zlib.h>
#include <time.h>
#include <assert.h>

#include "Inflater.h"
#include "ProtocolPreferences.h"
22
#include "Messages/Message.h"
daFischer's avatar
first  
daFischer committed
23
#include "SizedArray.h"
daFischer's avatar
daFischer committed
24
#include "Index.h"
25 26
//#include "Controls.h"
class Controls;
daFischer's avatar
first  
daFischer committed
27 28 29 30 31 32 33

//#include "ProtocolPreferences.h"

using namespace std;

class Video {
public:
daFischer's avatar
daFischer committed
34
    Video(const char* path);
daFischer's avatar
first  
daFischer committed
35
    virtual ~Video();
daFischer's avatar
daFischer committed
36
    bool loadAsync();
37 38
    void update(int zeit, Controls* controls);
    void redrawScreen(Controls* controls, bool fully);
39
    void toggleFullscreen();
40
    void seekPosition(int position, Controls* controls);
daFischer's avatar
daFischer committed
41
    void drawThumbnail(int zeit,int x,int y);
daFischer's avatar
first  
daFischer committed
42 43
    
    bool failed;
daFischer's avatar
daFischer committed
44
    bool hasThumbnails;
daFischer's avatar
first  
daFischer committed
45
    
daFischer's avatar
daFischer committed
46
private:    
daFischer's avatar
daFischer committed
47 48
    void readExtension(Inflater* in);
    void showProgress();
49
    long int fileSize;          //size of the .ttt FILE. needed to show parsing progress
daFischer's avatar
daFischer committed
50 51
    long int progress;
    
52 53 54
    SDL_Surface* screen;	//Pointer to the main screen surface
    SDL_Surface* rawScreen;     //SDL_Surface that buffers FrameBuffer Messages
    SDL_Surface* annScreen;     //SDL_Surface that buffers Annotations
daFischer's avatar
daFischer committed
55
    list<Message*> m;
daFischer's avatar
first  
daFischer committed
56 57 58
    Message** messages;
    int numMessages;
    int currentMessage;
59
    
daFischer's avatar
daFischer committed
60
    Index* index;
61
    SDL_Rect lastThumbnail;     //Bounding Box of the last drawn IndexEntry. needed when redrawing screen 
daFischer's avatar
first  
daFischer committed
62
    bool original;
63
    int lastTime;               //Milliseconds since the last IndexEntry has been filled
daFischer's avatar
first  
daFischer committed
64
    ProtocolPreferences prefs;
daFischer's avatar
daFischer committed
65 66 67
    
    Inflater* inflater;
    char loadPhase;
daFischer's avatar
first  
daFischer committed
68 69 70 71 72
};
bool readServerInit(Inflater* in);

#endif	/* VIDEO_H */