Go to the documentation of this file.00001
00002
00003
00004
00005
00008
00009 #ifndef lgrPlaybackInterface_H_
00010 #define lgrPlaybackInterface_H_
00011
00012 #include "lgrTimeInterface.h"
00013 #include "virtualConstructor.h"
00014
00015 #include <vlutil/vlString.h>
00016 #include "signalSlot.h"
00017
00018 namespace MAKLogger
00019 {
00020 class DtLogger;
00021 class DtLgrPlaybackDriver;
00022 class DtLgrPlaybackCommandFactory;
00023
00027 class DT_DLL_LGRCORE DtLgrPlaybackInterface : public virtual DtLgrTimeInterface
00028 {
00029 public:
00030
00031
00032 typedef DtLgrPlaybackCommandFactory Factory;
00033
00034
00035 typedef DtLgrPlaybackInterface ThisClass;
00036
00038 static DtLgrPlaybackInterface* create(DtLogger&);
00039
00042 static DtLgrPlaybackInterface* createNonThreadsafe(DtLogger& logger,
00043 const DtLgrPlaybackDriver& driver);
00044
00045 protected:
00046
00048 DtLgrPlaybackInterface(DtLogger& logger,const DtLgrPlaybackDriver& driver);
00049
00050 public:
00051
00053 virtual ~DtLgrPlaybackInterface();
00054
00055 private:
00057 DtLgrPlaybackInterface(const DtLgrPlaybackInterface&);
00059 DtLgrPlaybackInterface& operator=(const DtLgrPlaybackInterface&);
00060 public:
00061
00063 virtual void openFile(const DtString& filename) const;
00064
00066 virtual void closeFile() const;
00067
00069 virtual void saveFile() const;
00070
00072 virtual void saveFileAs(const DtString& filename) const;
00073
00075 virtual void revertFile() const;
00076
00078 virtual void play() const;
00079
00081 virtual void stop() const;
00082
00084 virtual void pause() const;
00085
00087 virtual void unpause() const;
00088
00090 virtual void togglePlayPause() const;
00091
00093 virtual void restart() const;
00094
00096 virtual void jumpToTime(DtAbsoluteTime time) const;
00097
00100 virtual void setPlaybackSpeed(double speedMultiplier, bool skipping) const;
00101
00104 virtual void setSkippingPlaybackThreshold(double skippingThreshold) const;
00105
00107 virtual void setStartStopTimes(DtAbsoluteTime startTime,
00108 DtAbsoluteTime stopTime) const;
00109
00111 virtual void setLoopAtEnd(bool enable) const;
00112
00114 virtual void setPlayOnLoad(bool playOnLoad) const;
00115
00117 virtual void setBackupOnSave(bool backup) const;
00118
00120
00122 virtual bool isFileLoaded() const;
00123
00125 virtual bool isFileSaved() const;
00126
00128 virtual bool isPlaying() const;
00129
00131 virtual bool isStopped() const;
00132
00134 virtual bool isPaused() const;
00135
00137 virtual bool loopAtEnd() const;
00138
00140 virtual bool playOnLoad() const;
00141
00143 virtual const DtString& filename() const;
00144
00146 virtual double playbackSpeed() const;
00147
00149 virtual bool skippingPlayback() const;
00150
00152 virtual double skippingPlaybackThreshold() const;
00153
00155 virtual bool isFileFormatCurrent() const;
00156
00158 virtual bool isFileIncomplete() const;
00159
00161
00162 DtValueSignal<DtString> fileOpenedSignal;
00163 DtValueSignal<bool> playbackChangedSignal;
00164 DtValueSignal<double> playbackSpeedChangedSignal;
00165 DtValueSignal<bool> loopAtEndChangedSignal;
00166 DtValueSignal<bool> playOnLoadChangedSignal;
00167 DtValueSignal<bool> fileSaveChangedSignal;
00168
00170 DtValueSignal<DtString> fileInvalidSignal;
00171 DtValueSignal<DtString> fileDoesNotExistSignal;
00173
00174 protected:
00175
00177
00178
00180 void fileOpened(DtResponse);
00181
00183 void fileClosed(DtResponse);
00184
00186 void fileChanged(DtResponse);
00187
00189 void fileSaved(DtResponse);
00190
00192 void playbackChanged(DtResponse);
00193
00195 void playbackSpeedChanged(DtResponse);
00196
00198 void skippingPlaybackChanged(DtResponse);
00199
00201 void skippingPlaybackThresholdChanged(DtResponse);
00202
00204 void fileInvalid(DtResponse);
00205
00207 void fileDoesNotExist(DtResponse);
00208
00210 void fileIncomplete(DtResponse);
00211
00213 void loopAtEndChanged(DtResponse);
00214
00216 void playOnLoadChanged(DtResponse);
00217
00219 void fileFormatCurrent(DtResponse);
00220
00222 void pausedChanged(DtResponse);
00223
00225
00227 void connectResponseHandlers();
00228
00230 void connectResponse(DtLgrCommandId,
00231 void (DtLgrPlaybackInterface::*)(DtResponse));
00232
00233 protected:
00234
00235 bool myFileLoadedFlag;
00236 bool myPlayingFlag;
00237 bool myLoopAtEnd;
00238 bool myPlayOnLoadFlag;
00239 bool myFileSavedFlag;
00240 bool myFileFormatCurrentFlag;
00241 bool myPausedFlag;
00242 bool myFileIncompleteFlag;
00243 double myPlaybackSpeed;
00244 bool mySkippingPlayback;
00245 double mySkippingPlaybackThreshold;
00246 DtString myFilename;
00247 DtString myLastErrorMessage;
00248 };
00249
00250 }
00251
00252 #endif