Panda3D
Public Member Functions | Static Public Member Functions | Friends | List of all members
RecorderBase Class Referenceabstract

This is the base class to a number of objects that record particular kinds of user input (like a MouseRecorder) to use in conjunction with a RecorderController to record the user's inputs for a session. More...

#include "recorderBase.h"

Inheritance diagram for RecorderBase:
MouseRecorder

Public Member Functions

virtual int get_ref_count () const =0
 
virtual TypeHandle get_type () const
 
bool is_playing () const
 Returns true if this recorder is presently playing back data from session file, false otherwise. More...
 
bool is_recording () const
 Returns true if this recorder is presently recording data for saving to a session file, false otherwise. More...
 
virtual void play_frame (DatagramIterator &scan, BamReader *manager)
 Reloads the most recent data collected from the indicated datagram. More...
 
virtual void record_frame (BamWriter *manager, Datagram &dg)
 Records the most recent data collected into the indicated datagram. More...
 
virtual void ref () const =0
 
virtual bool unref () const =0
 
virtual void write_recorder (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for encoding in the session file. More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 

Friends

class RecorderController
 
class RecorderTable
 

Detailed Description

This is the base class to a number of objects that record particular kinds of user input (like a MouseRecorder) to use in conjunction with a RecorderController to record the user's inputs for a session.

Note that RecorderBase does not actually inherit from TypedObject, even though it defines get_type(). The assumption is that the classes that derive from RecorderBase might also inherit independently from TypedObject.

It also does not inherit from TypedWritable, but it defines a method called write_recorder() which is very similar to a TypedWritable's write_datagram(). Classes that derive from RecorderBase and also inherit from TypedWritable may choose to remap write_recorder() to do exactly the same thing as write_datagram(), or they may choose to write something slightly different.

Most types of recorders should derive from Recorder, as it derives from ReferenceCount, except for MouseRecorder, which would otherwise doubly inherit from ReferenceCount.

Definition at line 46 of file recorderBase.h.

Member Function Documentation

◆ is_playing()

bool RecorderBase::is_playing ( ) const
inline

Returns true if this recorder is presently playing back data from session file, false otherwise.

If this is true, play_data() will be called from time to time.

Definition at line 30 of file recorderBase.I.

◆ is_recording()

bool RecorderBase::is_recording ( ) const
inline

Returns true if this recorder is presently recording data for saving to a session file, false otherwise.

If this is true, record_data() will be called from time to time.

Definition at line 20 of file recorderBase.I.

◆ play_frame()

void RecorderBase::play_frame ( DatagramIterator scan,
BamReader manager 
)
virtual

Reloads the most recent data collected from the indicated datagram.

Reimplemented in MouseRecorder.

Definition at line 45 of file recorderBase.cxx.

Referenced by RecorderTable::play_frame().

◆ record_frame()

void RecorderBase::record_frame ( BamWriter manager,
Datagram dg 
)
virtual

Records the most recent data collected into the indicated datagram.

Reimplemented in MouseRecorder.

Definition at line 38 of file recorderBase.cxx.

Referenced by RecorderTable::record_frame().

◆ write_recorder()

void RecorderBase::write_recorder ( BamWriter manager,
Datagram dg 
)
virtual

Writes the contents of this object to the datagram for encoding in the session file.

This is very similar to write_datagram() for TypedWritable objects, but it is used specifically to write the Recorder object when generating the session file. In many cases, it will be the same as write_datagram().

This balances with fillin_recorder().

Reimplemented in MouseRecorder.

Definition at line 58 of file recorderBase.cxx.

Referenced by RecorderTable::write_datagram(), and MouseRecorder::write_recorder().


The documentation for this class was generated from the following files: