Free Electron
VideoRecorder.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __viewer_VideoRecorder_h__
8 #define __viewer_VideoRecorder_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Saves a snapshot for every handle call that time advances
17 
18  @ingroup viewer
19 
20  As RecorderI, the pathname is the directory name and the integer limit
21  sets the number of cycled files.
22  The scalar for findNameFor() indicates the desired time to find a file for.
23 *//***************************************************************************/
24 class FE_DL_EXPORT VideoRecorder:
25  virtual public HandlerI,
26  public Initialize<VideoRecorder>,
27  virtual public RecorderI
28 {
29  public:
30  VideoRecorder(void):
31  m_basename("test/video"),
32  m_index(0),
33  m_ringSize(20)
34  { m_timeStamp.resize(m_ringSize); }
35 
36  void initialize(void);
37 
38  //* as HandlerI
39 virtual void handle(Record &record);
40 
41  //* as RecorderI
42 virtual void configure(String pathname,U32 limit);
43 virtual String findNameFor(Real scalar);
44 
45  private:
46  String m_basename;
47  U32 m_index;
48  U32 m_ringSize;
49  std::vector<Real> m_timeStamp;
50 
51  Accessor< sp<Component> > m_aDrawI;
52  AsTemporal m_asTemporal;
53  AsViewer m_asViewer;
54  sp<ImageI> m_spImageI;
55 };
56 
57 inline void VideoRecorder::configure(String pathname,U32 limit)
58 {
59  m_basename=pathname;
60  m_ringSize=limit;
61  m_timeStamp.resize(m_ringSize);
62 }
63 
64 } /* namespace ext */
65 } /* namespace fe */
66 
67 #endif /* __viewer_VideoRecorder_h__ */
68 
kernel
Definition: namespace.dox:3
Saves a snapshot for every handle call that time advances.
Definition: VideoRecorder.h:24
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
The main data access class for the data system.
Definition: Accessor.h:128
void resize(U32 size, char c=' ')
Add or remove characters to set the string length.
Definition: String.cc:590
Storage of incremental state to a resource, like a file.
Definition: RecorderI.h:20
Interface to handle signals from an SignalerI.
Definition: HandlerI.h:22
Automatically reference-counted string container.
Definition: String.h:128
Time-based Operator.
Definition: datatoolAS.h:73
Reference to an instance of a Layout.
Definition: RecordSB.h:35
SignalerViewerI attributes.
Definition: SignalerViewerI.h:37