FlightGear next
replay-internal.cxx File Reference
#include <float.h>
#include <locale>
#include <string.h>
#include <simgear/misc/sg_dir.hxx>
#include <simgear/props/props_io.hxx>
#include <simgear/structure/commands.hxx>
#include <simgear/structure/exception.hxx>
#include <simgear/structure/subsystem_mgr.hxx>
#include <Main/fg_props.hxx>
#include <MultiPlayer/mpmessages.hxx>
#include <Time/TimeManager.hxx>
#include <Viewer/viewmgr.hxx>
#include "continuous.hxx"
#include "flightrecorder.hxx"
#include "replay.hxx"

Go to the source code of this file.

Classes

struct  NumberCommasHelper
 

Namespaces

namespace  ReplayContainer
 

Enumerations

enum  ReplayContainer::Type {
  ReplayContainer::Invalid = -1 , ReplayContainer::Header = 0 , ReplayContainer::MetaData = 1 , ReplayContainer::Properties = 2 ,
  ReplayContainer::RawData = 3
}
 

Functions

template<typename T>
static void readRaw (std::istream &in, T &data)
 
template<typename T>
static void writeRaw (std::ostream &out, const T &data)
 
static int PropertiesRead (std::istream &in, SGPropertyNode *node)
 
static void popupTip (const char *message, int delay)
 
SGPath makeSavePath (FGTapeType type, SGPath *path_timeless)
 
static void clear (FGReplayInternal &self)
 
static void loadMessages (FGReplayInternal &self)
 
void fillRecycler (FGReplayInternal &self)
 
static void printTimeStr (char *pStrBuffer, int bufferSize, double _Time, bool ShowDecimal=true)
 
static void setTimeStr (const char *property_path, double t, bool show_decimal=false)
 
static void guiMessage (const char *message)
 
double get_start_time (FGReplayInternal &self)
 
double get_end_time (FGReplayInternal &self)
 
static const char * MultiplayerMessageCallsign (const std::vector< char > &raw_message)
 
static bool CallsignsEqual (const std::vector< char > &a_message, const std::vector< char > &b_message)
 
static void MoveFrontMultiplayerPackets (std::deque< FGReplayData * > &list)
 
static bool saveRawReplayData (simgear::gzContainerWriter &output, const std::deque< FGReplayData * > &replay_data, size_t record_size, SGPropertyNode *meta)
 Save raw replay data in a separate container.
 
SGPropertyNode_ptr saveSetup (const SGPropertyNode *extra, const SGPath &path, double duration, FGTapeType tape_type, int continuous_compression)
 
std::ostream & operator<< (std::ostream &out, const FGFrameInfo &frame_info)
 
static void replayMessage (FGReplayInternal &self, double time)
 
static void replayNormal2 (FGReplayInternal &self, double time, const FGReplayData *current_frame, const FGReplayData *old_frame=nullptr, int *xpos=nullptr, int *ypos=nullptr, int *xsize=nullptr, int *ysize=nullptr)
 given two FGReplayData elements and a time, interpolate between them
 
static void interpolate (FGReplayInternal &self, double time, const std::deque< FGReplayData * > &list)
 interpolate a specific time from a specific list
 
bool replayNormal (FGReplayInternal &self, double time)
 
bool replay (FGReplayInternal &self, double time)
 Replay a saved frame based on time, interpolate from the two nearest saved frames.
 
static FGReplayDatarecord (FGReplayInternal &self, double sim_time)
 
static bool loadRawReplayData (simgear::gzContainerReader &input, std::deque< FGReplayData * > &replay_data, size_t record_size, bool multiplayer, bool multiplayer_legacy)
 Load raw replay data from a separate container.
 
static bool saveTape2 (FGReplayInternal &self, const SGPath &filename, SGPropertyNode_ptr metadata)
 Write flight recorder tape with given filename and meta properties to disk.
 
int loadContinuousHeader (const std::string &path, std::istream *in, SGPropertyNode *properties)
 
static void indexContinuousRecording (FGReplayInternal &self, const void *data, size_t numbytes)
 
bool loadTapeContinuous (FGReplayInternal &replay_internal, std::ifstream &in, const SGPath &filename, bool preview, bool create_video, double fixed_dt, SGPropertyNode &meta_meta, simgear::HTTP::FileRequestRef file_request)
 
static std::locale s_comma_locale (std::locale(), new NumberCommasHelper())
 
static std::string numberCommas (size_t n)
 
bool listTapes (bool same_aircraft_filter, const SGPath &tape_directory)
 List available tapes in current directory.
 

Variables

const char *const FlightRecorderFileMagic = "FlightGear Flight Recorder Tape"
 Magic string to verify valid FG flight recorder tapes.
 

Function Documentation

◆ CallsignsEqual()

static bool CallsignsEqual ( const std::vector< char > & a_message,
const std::vector< char > & b_message )
static

Definition at line 475 of file replay-internal.cxx.

◆ clear()

static void clear ( FGReplayInternal & self)
static

Definition at line 203 of file replay-internal.cxx.

◆ fillRecycler()

void fillRecycler ( FGReplayInternal & self)

Definition at line 278 of file replay-internal.cxx.

◆ get_end_time()

double get_end_time ( FGReplayInternal & self)

Definition at line 403 of file replay-internal.cxx.

◆ get_start_time()

double get_start_time ( FGReplayInternal & self)

Definition at line 373 of file replay-internal.cxx.

◆ guiMessage()

static void guiMessage ( const char * message)
static

Definition at line 368 of file replay-internal.cxx.

◆ indexContinuousRecording()

static void indexContinuousRecording ( FGReplayInternal & self,
const void * data,
size_t numbytes )
static

Definition at line 1331 of file replay-internal.cxx.

◆ interpolate()

static void interpolate ( FGReplayInternal & self,
double time,
const std::deque< FGReplayData * > & list )
static

interpolate a specific time from a specific list

Definition at line 683 of file replay-internal.cxx.

◆ listTapes()

bool listTapes ( bool same_aircraft_filter,
const SGPath & tape_directory )

List available tapes in current directory.

Limits to tapes matching current aircraft when same_aircraft_filter is enabled.

Definition at line 1767 of file replay-internal.cxx.

◆ loadContinuousHeader()

int loadContinuousHeader ( const std::string & path,
std::istream * in,
SGPropertyNode * properties )

Definition at line 1286 of file replay-internal.cxx.

◆ loadMessages()

static void loadMessages ( FGReplayInternal & self)
static

Definition at line 257 of file replay-internal.cxx.

◆ loadRawReplayData()

static bool loadRawReplayData ( simgear::gzContainerReader & input,
std::deque< FGReplayData * > & replay_data,
size_t record_size,
bool multiplayer,
bool multiplayer_legacy )
static

Load raw replay data from a separate container.

Definition at line 1120 of file replay-internal.cxx.

◆ loadTapeContinuous()

bool loadTapeContinuous ( FGReplayInternal & replay_internal,
std::ifstream & in,
const SGPath & filename,
bool preview,
bool create_video,
double fixed_dt,
SGPropertyNode & meta_meta,
simgear::HTTP::FileRequestRef file_request )

Definition at line 1479 of file replay-internal.cxx.

◆ makeSavePath()

SGPath makeSavePath ( FGTapeType type,
SGPath * path_timeless )

Definition at line 175 of file replay-internal.cxx.

◆ MoveFrontMultiplayerPackets()

static void MoveFrontMultiplayerPackets ( std::deque< FGReplayData * > & list)
static

Definition at line 489 of file replay-internal.cxx.

◆ MultiplayerMessageCallsign()

static const char * MultiplayerMessageCallsign ( const std::vector< char > & raw_message)
static

Definition at line 469 of file replay-internal.cxx.

◆ numberCommas()

static std::string numberCommas ( size_t n)
static

Definition at line 1573 of file replay-internal.cxx.

◆ operator<<()

std::ostream & operator<< ( std::ostream & out,
const FGFrameInfo & frame_info )

Definition at line 636 of file replay-internal.cxx.

◆ popupTip()

static void popupTip ( const char * message,
int delay )
static

Definition at line 166 of file replay-internal.cxx.

◆ printTimeStr()

static void printTimeStr ( char * pStrBuffer,
int bufferSize,
double _Time,
bool ShowDecimal = true )
static

Definition at line 334 of file replay-internal.cxx.

◆ PropertiesRead()

static int PropertiesRead ( std::istream & in,
SGPropertyNode * node )
static

Definition at line 156 of file replay-internal.cxx.

◆ readRaw()

template<typename T>
static void readRaw ( std::istream & in,
T & data )
static

Definition at line 143 of file replay-internal.cxx.

◆ record()

static FGReplayData * record ( FGReplayInternal & self,
double sim_time )
static

Definition at line 800 of file replay-internal.cxx.

◆ replay()

bool replay ( FGReplayInternal & self,
double time )

Replay a saved frame based on time, interpolate from the two nearest saved frames.

Returns true when replay sequence has finished, false otherwise.

Definition at line 782 of file replay-internal.cxx.

◆ replayMessage()

static void replayMessage ( FGReplayInternal & self,
double time )
static

Definition at line 645 of file replay-internal.cxx.

◆ replayNormal()

bool replayNormal ( FGReplayInternal & self,
double time )

Definition at line 718 of file replay-internal.cxx.

◆ replayNormal2()

static void replayNormal2 ( FGReplayInternal & self,
double time,
const FGReplayData * current_frame,
const FGReplayData * old_frame = nullptr,
int * xpos = nullptr,
int * ypos = nullptr,
int * xsize = nullptr,
int * ysize = nullptr )
static

given two FGReplayData elements and a time, interpolate between them

Definition at line 667 of file replay-internal.cxx.

◆ s_comma_locale()

static std::locale s_comma_locale ( std::locale() ,
new NumberCommasHelper() )
static

◆ saveRawReplayData()

static bool saveRawReplayData ( simgear::gzContainerWriter & output,
const std::deque< FGReplayData * > & replay_data,
size_t record_size,
SGPropertyNode * meta )
static

Save raw replay data in a separate container.

Definition at line 518 of file replay-internal.cxx.

◆ saveSetup()

SGPropertyNode_ptr saveSetup ( const SGPropertyNode * extra,
const SGPath & path,
double duration,
FGTapeType tape_type,
int continuous_compression )

Definition at line 577 of file replay-internal.cxx.

◆ saveTape2()

static bool saveTape2 ( FGReplayInternal & self,
const SGPath & filename,
SGPropertyNode_ptr metadata )
static

Write flight recorder tape with given filename and meta properties to disk.

Definition at line 1204 of file replay-internal.cxx.

◆ setTimeStr()

static void setTimeStr ( const char * property_path,
double t,
bool show_decimal = false )
static

Definition at line 360 of file replay-internal.cxx.

◆ writeRaw()

template<typename T>
static void writeRaw ( std::ostream & out,
const T & data )
static

Definition at line 150 of file replay-internal.cxx.

Variable Documentation

◆ FlightRecorderFileMagic

const char* const FlightRecorderFileMagic = "FlightGear Flight Recorder Tape"

Magic string to verify valid FG flight recorder tapes.

Definition at line 29 of file replay-internal.cxx.