Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIPlaybackInput.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef _GUIPLAYBACKINPUT_H_
11#define _GUIPLAYBACKINPUT_H_
12
13#include "eC_Types.h"
14#include "GUIInputMedia.h"
15#include "eC_TList_doubleLinked.h"
16#include "eC_String.h"
17
18#include "GUIEvent.h"
19
20//#define DEBUG_OUTPUT_EVENT
21
23// @guiliani_doxygen toplevel_module Playback
34// @endguiliani_doxygen
83{
84public:
91 static void CreateInstance(
92 const eC_Bool bAutomaticMode = true,
93 const eC_String& kEventRecordFilename= "EventRecord.dat");
94
97 static void DeleteInstance();
98
102 virtual void PollEvent();
103
105 virtual void StopIdle();
106
114 void StartPlayback(const eC_Bool& bLoop = false, const eC_Bool& bIgnoreUserInput = false);
115
118
121
128 void StopRecording(const eC_Bool& bKeyboardUsed = false);
129
136 void StopPlaybackOnUserInput(const eC_Bool bStopPlaybackOnUserInput);
137
141 void SetEventRecordFilename(const eC_String& kEventRecordFilename);
142
146 void SetPlaybackSpeed(const eC_Value& vPlaybackSpeed);
147
148 virtual void SetSize(const eC_Int& iSizeX, const eC_Int& iSizeY);
149
150 virtual void GetSize(eC_Int& riSizeX, eC_Int& riSizeY) const;
151
152 virtual void SetOffset(const eC_Int& iOffsetX, const eC_Int& iOffsetY);
153
154 virtual void GetOffset(eC_Int& riOffsetX, eC_Int& riOffsetY) const;
155
156 virtual eC_Bool GetMulitpleTouches() const;
157
158protected:
164 const eC_Bool bAutomaticMode,
165 const eC_String& kEventRecordFilename);
166
168
169private:
170 // Structure to hold recorded events
171 struct RecordedEvent
172 {
173 eC_UInt uiTime; // Time offset at which this event occurred
174 CGUIEvent* pkEvent; // pointer to actual CGUI Event containing all further information
175 };
176
177private:
178#ifdef DEBUG_OUTPUT_EVENT
179 eC_String GetEventString(const EventType_t& eEvent);
180#endif
181
182private:
185 eC_Bool ReadRecordedEvents();
186
190 void WriteRecordedEvents(const eC_Bool& bKeyboardUsed);
191
193 void RecordEvent(CGUIEvent* pEvent);
194
196 CGUIEvent* GetRecordedEvent();
197
199 eC_Int GetTimeUntilNextEvent();
200
202 void ClearEventRecordList();
203
206 CGUIPlaybackInput(const CGUIPlaybackInput& kSource);
207
210 CGUIPlaybackInput& operator=(const CGUIPlaybackInput& kSource);
211
212private:
214 eC_Bool m_bIsRecording;
215
217 eC_Bool m_bIsPlaying;
218
220 eC_Bool m_bLoopPlayback;
221
223 eC_Bool m_bStopPlaybackOnUserInput;
224
226 eC_Bool m_bIgnoreUserInput;
227
229 eC_TListDoubleLinked <RecordedEvent> m_kEventRecordList;
230
232 eC_UInt m_uiStartTime;
233
235 static CGUIInputMedia* ms_pkControlledInputMedia;
236
238 eC_String m_kEventRecordFilename;
239
241 eC_Value m_vPlaybackSpeed;
242};
243#endif
EventType_t
List of event type ids.
Definition: GUIEventTypeResource.h:65
Base class for Guiliani Events.
Definition: GUIEvent.h:26
Definition: GUIInputMedia.h:30
This is the GUI playback input media, which records user-input for later playback.
Definition: GUIPlaybackInput.h:83
virtual void SetSize(const eC_Int &iSizeX, const eC_Int &iSizeY)
void StopPlayback()
Stops any ongoing playback.
void StopPlaybackOnUserInput(const eC_Bool bStopPlaybackOnUserInput)
CGUIPlaybackInput(const eC_Bool bAutomaticMode, const eC_String &kEventRecordFilename)
void StartPlayback(const eC_Bool &bLoop=false, const eC_Bool &bIgnoreUserInput=false)
virtual void GetOffset(eC_Int &riOffsetX, eC_Int &riOffsetY) const
void SetEventRecordFilename(const eC_String &kEventRecordFilename)
void SetPlaybackSpeed(const eC_Value &vPlaybackSpeed)
void StartRecording()
Starts recording events from the actual input media.
virtual void GetSize(eC_Int &riSizeX, eC_Int &riSizeY) const
virtual void SetOffset(const eC_Int &iOffsetX, const eC_Int &iOffsetY)
void StopRecording(const eC_Bool &bKeyboardUsed=false)
static void CreateInstance(const eC_Bool bAutomaticMode=true, const eC_String &kEventRecordFilename="EventRecord.dat")
virtual eC_Bool GetMulitpleTouches() const
virtual void StopIdle()
Forwards the StopIdle call to the actual input media.
static void DeleteInstance()
virtual void PollEvent()