lgrPlaybackDriver.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 
00008 
00009 #ifndef lgrPlaybackDriver_H_
00010 #define lgrPlaybackDriver_H_
00011 
00012 #include "lgrDriver.h"
00013 #include "lgrClock.h"
00014 #include "virtualConstructor.h"
00015 
00016 #include <vlutil/vlString.h>
00017 #include <deque>
00018 
00019 namespace MAKLogger
00020 {
00021    class DtLgrFileInput;
00022    class DtMessagePipeline;
00023    class DtLgrSystemDriver;
00024    class DtLgrPlaybackCommandFactory;
00025    class DtLgrPlaybackInterface;
00026    class DtLgrEntityTracker;
00027 
00032    class DT_DLL_LGRCORE DtLgrPlaybackDriver : public DtLgrCommandHandler
00033    {
00034    public:
00035 
00036       typedef DtLgrPlaybackCommandFactory Factory;
00037       typedef DtLgrPlaybackInterface Interface;
00038 
00039       DT_VIRTUAL_CTR(DtLgrPlaybackDriver,(DtLgrSystemDriver&))
00040       virtual ~DtLgrPlaybackDriver();
00041 
00042       virtual void tick();
00043 
00044       virtual bool getPipeline();
00045       virtual bool hasPipeline() const;
00046       virtual bool releasePipeline();
00047 
00050       virtual void setUnsavedFile(const DtString& filename, bool selectAll);
00051 
00053       virtual void openVirtualFile(const DtString& actualFileName, const DtString& desiredName);
00054 
00056       virtual void configurePipeline();
00057 
00059       virtual bool isFileSaved() const;
00060 
00062       virtual bool isFileOpen() const;
00063 
00065       virtual bool isPlaying() const;
00066 
00068       virtual bool isStopped() const;
00069 
00071       virtual bool isPaused() const;
00072 
00074       virtual bool isFileIncomplete() const;
00075 
00077       virtual double playbackSpeed() const;
00078 
00080       virtual bool skippingPlayback() const;
00081 
00083       virtual double skippingPlaybackThreshold() const;
00084 
00086       virtual DtAbsoluteTime currentTime() const;
00087 
00089       virtual DtAbsoluteTime startTime() const;
00090 
00092       virtual DtAbsoluteTime stopTime() const;
00093 
00095       virtual DtAbsoluteTime firstMessageTime() const;
00096 
00098       virtual DtAbsoluteTime lastTime() const;
00099 
00101       virtual const DtString& currentFilename() const;
00102 
00105       virtual const DtString& savedFilename() const;
00106 
00108       virtual bool loopAtEnd() const;
00109 
00111       virtual bool playOnLoad() const;
00112 
00114       virtual bool fileFormatCurrent() const;
00115 
00117       virtual bool backupOnSave() const;
00118 
00120       virtual DtLgrEntityTracker* entityTracker() const;
00121 
00123       virtual void addTemporaryTrackedEntity(const DtString& name);
00124 
00125    protected:
00126 
00128       bool prepareDriverForOpen();
00129 
00130       virtual void tickStopPlayback();
00131       virtual void tickNormalPlayback();
00132       virtual void tickPausePlayback();
00133       virtual void tickSkippingPlayback();
00134 
00136       virtual bool doSwapInFile(const DtString& filename, bool selectAll);
00137 
00138       virtual bool doPlay();
00139       virtual bool doStop();
00140       virtual bool doPause();
00141       virtual bool doUnpause();
00142       virtual bool doPlaybackSpeedChange(double speed);
00143       virtual void doTimeJump(const DtAbsoluteTime& time);
00144       virtual void doSkippingPlay(const DtAbsoluteTime& time);
00145 
00147       DtResponse openFile(const DtCommand& command);
00148 
00150       virtual bool doOpenFile( DtString filename );
00151 
00153       void sendFileInputChangedResponses(const DtString& filename);
00154 
00156       DtResponse closeFile(const DtCommand& command);
00157 
00159       DtResponse saveFile(const DtCommand& command);
00160 
00162       DtResponse saveFileAs(const DtCommand& command);
00163 
00165       DtResponse revertFile(const DtCommand& command);
00166 
00168       DtResponse play(const DtCommand& command);
00169 
00171       DtResponse playPause(const DtCommand& command);
00172 
00174       DtResponse stop(const DtCommand& command);
00175 
00177       DtResponse restart(const DtCommand& command);
00178 
00180       DtResponse setStartStopTimes(const DtCommand& command);
00181 
00183       DtResponse setPlaybackSpeed(const DtCommand& command);
00184 
00186       DtResponse setCurrentTime(const DtCommand& command);
00187 
00189       DtResponse skipTime(const DtCommand& command);
00190 
00192       DtResponse pause(const DtCommand& command);
00193 
00195       DtResponse unpause(const DtCommand& command);
00196 
00198       DtResponse setLoopAtEnd(const DtCommand& command);
00199 
00201       DtResponse setPlayOnLoad(const DtCommand& command);
00202 
00204       DtResponse setBackupOnSave(const DtCommand& command);
00205 
00207       DtResponse setSkippingPlaybackThreshold(const DtCommand& command);
00208 
00210       virtual bool openFileInput(const DtString& filename, DtString& failureReason);
00211 
00213       virtual void closeFileInput(bool clearHistory);
00214 
00216       virtual void setFileHistoryCount(int count);
00217 
00219       virtual void addFileToHistory(const DtString& filename);
00220 
00222       virtual void clearFileHistory();
00223    protected:
00224 
00225       static const unsigned short theDomain   = DtLgrCommandType::Domain_Player;
00226       static const unsigned short theProtocol = DtLgrCommandType::Protocol_None;
00227 
00228       std::deque<DtString> myFileStack;
00229       //DtString myUnsavedFileName;
00230       DtString mySavedFileName;
00231       //bool myFileSavedFlag;
00232 
00233       DtLgrFileInput* myFileInput;
00234       DtLgrSystemDriver* myDriver;
00235       DtMessagePipeline* myPipeline;
00236 
00237       //Playback Parameters
00238       bool myPausedFlag;
00239       bool myLoopAtEnd;
00240       bool myPlayOnLoadFlag;
00241       double myTimeScale;
00242       DtLgrClock* myPlaybackClock;
00243       DtAbsoluteTime myStartTime;
00244       DtAbsoluteTime myStopTime;
00245       DtAbsoluteTime myCurrentTime;
00246       bool myPlayingFlag;
00247       bool myBackupFlag;
00248       bool mySkippingPlayback;
00249       double mySkippingPlaybackThreshold;
00250       DtAbsoluteTime myNextSkipTime;
00251 
00252       unsigned int myFileHistoryCount;
00253       static const int theDefaultFileHistoryCount = 1;
00254    };
00255 
00256 }
00257 
00258 #endif

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)