Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
RecorderBase Class Reference

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:
ReferenceCount MemoryBase MouseRecorder

List of all members.

Public Member Functions

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

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()

Protected Member Functions

void fillin_recorder (DatagramIterator &scan, BamReader *manager)
 This internal function is called by make_recorder (in derived classes) to read in all of the relevant data from the session file.

Friends

class RecorderController

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.

Definition at line 50 of file recorderBase.h.


Member Function Documentation

void RecorderBase::fillin_recorder ( DatagramIterator scan,
BamReader manager 
) [protected]

This internal function is called by make_recorder (in derived classes) to read in all of the relevant data from the session file.

It balances with write_recorder().

Reimplemented in MouseRecorder.

Definition at line 84 of file recorderBase.cxx.

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 37 of file recorderBase.I.

Referenced by MouseRecorder::do_transmit_data(), and MouseRecorder::play_frame().

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 25 of file recorderBase.I.

Referenced by MouseRecorder::do_transmit_data(), and MouseRecorder::record_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 56 of file recorderBase.cxx.

Referenced by RecorderFrame::play_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 46 of file recorderBase.cxx.

Referenced by RecorderFrame::write_datagram().

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 72 of file recorderBase.cxx.

Referenced by RecorderTable::write_datagram().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations