Example #1
0
    // event from back end (draw event from remote or internal server)
    // returns module continuation status, 0 if module want to continue
    // non 0 if it wants to stop (to run another module)
    virtual BackEvent_t draw_event()
    {
        this->event.reset();
        TODO("use system constants for sizes");

        char path[1024];
        char basename[1024];
        char extension[128];
        strcpy(path, "/tmp/"); // default value, actual one should come from movie_path
        strcpy(basename, "replay"); // default value actual one should come from movie_path
        strcpy(extension, ".mwrm"); // extension is currently ignored
        char prefix[4096];
        
        canonical_path(this->movie, path, sizeof(path), basename, sizeof(basename), extension, sizeof(extension));
        sprintf(prefix, "%s%s", path, basename);

        InByMetaSequenceTransport in_trans(prefix, extension);
        timeval begin_capture; begin_capture.tv_sec = 0; begin_capture.tv_usec = 0;
        timeval end_capture; end_capture.tv_sec = 0; end_capture.tv_usec = 0;
        FileToGraphic reader(&in_trans, begin_capture, end_capture, true, 0);
        reader.add_consumer(&this->front);
        this->front.send_global_palette();
        this->front.begin_update();
        while (reader.next_order()){
            reader.interpret_order();
        }
        this->front.end_update();
        return BACK_EVENT_NONE;
    }
Example #2
0
 // event from back end (draw event from remote or internal server)
 // returns module continuation status, 0 if module want to continue
 // non 0 if it wants to stop (to run another module)
 virtual BackEvent_t draw_event()
 {
     this->event->reset();
     const char * movie = "/tmp/replay.wrm";
     int fd = ::open(movie, O_RDONLY);
     assert(fd > 0);
     InFileTransport in_trans(fd);
     RDPUnserializer reader(&in_trans, &this->front, this->get_screen_rect());
     this->front.send_global_palette();
     this->front.begin_update();
     while (reader.next()){
     }
     this->front.end_update();
     return BACK_EVENT_NONE;
 }