Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

frameview.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Bjoern Erik Nilsen & Fredrik Berg Kjoelstad     *
00003  *   bjoern_erik_nilsen@hotmail.com & fredrikbk@hotmail.com                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef FRAMEVIEW_H
00021 #define FRAMEVIEW_H
00022 
00023 #include "src/config.h"
00024 
00025 #include "videoview.h"
00026 #include "src/technical/grabber/imagegrabber.h"
00027 #include "src/presentation/observer.h"
00028 #include "src/domain/animation/frame.h"
00029 #include "imagegrabthread.h"
00030 #include "src/domain/domainfacade.h"
00031 
00032 #include <qtimer.h>
00033 #include <vector>
00034 #include <queue>
00035 #include <qwidget.h>
00036 #include <SDL/SDL.h>
00037 #include <SDL/SDL_image.h>
00038 
00039 
00040 class ImageGrabThread;
00041 struct SDL_Surface;
00042 
00055 class FrameView : public VideoView
00056 {
00057         Q_OBJECT
00058 public:
00066         FrameView(QWidget *parent=0, const char *name=0, int playbackSpeed = 10);
00067         
00071         ~FrameView();
00072         
00076         void setWidescreenRatio();
00077         
00081         void setNormalRatio();
00082         
00087         void updateAdd(const vector<char*>& frames, unsigned int, Frontend*);
00088         
00092         void updateRemove(unsigned int, unsigned int);
00093         
00098         void updateMove(unsigned int fromFrame, unsigned int toFrame, unsigned int movePosition);
00099         
00103         void updateNewActiveFrame(int frameNumber);
00104         
00108         void updateClear();
00109         
00114         void updatePlayFrame(int frameNumber);
00115         
00121         void updateNewScene(int index);
00122         
00128         void updateRemoveScene(int sceneNumber);
00129         
00136         void updateMoveScene(int sceneNumber, int movePosition);
00137         
00146         void updateNewActiveScene(int sceneNumber, vector<char*> frames,
00147                 Frontend *frontend);
00148         
00153         void updateAnimationChanged(int frameNumber);
00154         
00158         bool on();
00159         
00163         void off();
00164         
00173         bool setViewMode(int mode);
00174         
00179         int getViewMode();
00180         
00185         void setPlaybackSpeed(int playbackSpeed);
00186         
00191         void capture();
00192         
00193 public slots:
00197         void redraw();
00198         
00202         void nextPlayBack();
00203         
00204 protected:
00205         void resizeEvent(QResizeEvent *);
00206         void paintEvent(QPaintEvent *);
00207         
00208 private:
00209         SDL_Surface *screen;
00210         SDL_Surface *videoSurface;
00211         
00213         DomainFacade *facade;
00214         
00215         int widthConst, heightConst;
00216         bool isPlayingVideo;
00217         int mode;
00218         int playbackSpeed;
00219         char *capturedImg;
00220         
00221         int activeFrame;
00222         int lastMixCount;
00223         int lastViewMode;
00224         
00225         vector<SDL_Surface*>imageBuffer;
00226         
00227         
00228         ImageGrabThread *grabThread;
00229         QTimer grabTimer;
00230         QTimer playbackTimer;
00231         ImageGrabber *grabber;
00232         
00233         
00234          
00235         
00240         void setActiveFrame(int frameNumber);
00241         
00253         SDL_Surface* differentiateSurfaces(SDL_Surface *s1, SDL_Surface *s2);
00254 };
00255 
00256 #endif

Generated on Thu May 19 01:51:20 2005 for stopmotion.kdevelop by  doxygen 1.4.2