FlightGear next
replay.cxx
Go to the documentation of this file.
1// replay.cxx - a system to record and replay FlightGear flights
2//
3// Written by Curtis Olson, started July 2003.
4// Updated by Thorsten Brehm, September 2011 and November 2012.
5//
6// Copyright (C) 2003 Curtis L. Olson - http://www.flightgear.org/~curt
7//
8// This program is free software; you can redistribute it and/or
9// modify it under the terms of the GNU General Public License as
10// published by the Free Software Foundation; either version 2 of the
11// License, or (at your option) any later version.
12//
13// This program is distributed in the hope that it will be useful, but
14// WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21//
22// $Id$
23
24
25#include "replay.hxx"
26#include "replay-internal.hxx"
27
28
34
38
39void
41{
42 m_internal->init();
43}
44
45void
47{
48 m_internal->reinit();
49}
50
51void
53{
54 m_internal->bind();
55}
56
57void
59{
60 m_internal->unbind();
61}
62
63
66bool
67FGReplay::start(bool NewTape)
68{
69 return m_internal->start(NewTape);
70}
71
72void
73FGReplay::update( double dt )
74{
75 timingInfo.clear();
76 stamp("begin");
77 m_internal->update(dt);
78}
79
80
82bool
83FGReplay::saveTape(const SGPropertyNode* Extra)
84{
85 return m_internal->saveTape(Extra);
86}
87
88
89bool
91 const SGPath& filename,
92 bool preview,
93 bool create_video,
94 double fixed_dt,
95 SGPropertyNode& meta_meta,
96 simgear::HTTP::FileRequestRef file_request
97 )
98{
99 return m_internal->loadTape(filename, preview, create_video, fixed_dt, meta_meta, file_request);
100}
101
102
103std::string FGReplay::makeTapePath(const std::string& tape_name)
104{
105 return FGReplayInternal::makeTapePath(tape_name);
106}
107
108int FGReplay::loadContinuousHeader(const std::string& path, std::istream* in, SGPropertyNode* properties)
109{
110 return FGReplayInternal::loadContinuousHeader(path, in, properties);
111}
112
114bool
115FGReplay::loadTape(const SGPropertyNode* ConfigData)
116{
117 return m_internal->loadTape(ConfigData);
118}
123
124
125// Register the subsystem.
126SGSubsystemMgr::Registrant<FGReplay> registrantFGReplay(
127 SGSubsystemMgr::POST_FDM);
SGSubsystemMgr::Registrant< FGReplay > registrantFGReplay(SGSubsystemMgr::POST_FDM)
static void resetStatisticsProperties()
static int loadContinuousHeader(const std::string &path, std::istream *in, SGPropertyNode *properties)
static std::string makeTapePath(const std::string &tape_name)
void init() override
Definition replay.cxx:40
void update(double dt) override
Definition replay.cxx:73
FGReplay()
Definition replay.cxx:29
bool loadTape(const SGPropertyNode *ConfigData)
Load a flight recorder tape from disk.
Definition replay.cxx:115
virtual ~FGReplay()
Definition replay.cxx:35
bool saveTape(const SGPropertyNode *ConfigData)
Write flight recorder tape to disk.
Definition replay.cxx:83
void unbind() override
Definition replay.cxx:58
static std::string makeTapePath(const std::string &tape_name)
Definition replay.cxx:103
static int loadContinuousHeader(const std::string &path, std::istream *in, SGPropertyNode *properties)
Definition replay.cxx:108
void reinit() override
Definition replay.cxx:46
bool start(bool new_tape=false)
Start replay session.
Definition replay.cxx:67
static void resetStatisticsProperties()
Definition replay.cxx:119
void bind() override
Definition replay.cxx:52
std::unique_ptr< struct FGReplayInternal > m_internal
Definition replay.hxx:104