Infrared4Arduino
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
IrSignal Class Reference

This class models an IR signal with intro-, repeat-, and ending sequences. More...

#include <IrSignal.h>

Public Member Functions

 IrSignal ()
 
 IrSignal (const IrSignal &orig)
 
virtual ~IrSignal ()
 
 IrSignal (const microseconds_t *intro, size_t lengthIntro, const microseconds_t *repeat, size_t lengthRepeat, const microseconds_t *ending, size_t lengthEnding, frequency_t frequency=defaultFrequency, boolean toBeFreed=false)
 
 IrSignal (const microseconds_t *intro, size_t lengthIntro, const microseconds_t *repeat, size_t lengthRepeat, frequency_t frequency=defaultFrequency, boolean toBeFreed=false)
 
 IrSignal (const IrSequence &intro, const IrSequence &repeat, const IrSequence &ending, frequency_t frequency, boolean toBeFreed)
 
 IrSignal (const IrSequence &intro, const IrSequence &repeat, const IrSequence &ending, frequency_t frequency=defaultFrequency)
 
IrSignalclone () const
 Creates a (deep) copy of the current object. More...
 
frequency_t getFrequency () const
 
const IrSequencegetEnding () const
 
const IrSequencegetRepeat () const
 
const IrSequencegetIntro () const
 
void dump (Stream &stream, boolean usingSigns=false) const
 Print a human readable representation of the IrSignal on the Stream supplied. More...
 
void dumpWithSigns (Stream &stream) const
 Print a human readable representation of the IrSignal on the Stream supplied, using signs. More...
 
boolean dumpFrequency (Stream &stream) const
 If the frequency is sensible, print it to the stream and return true. More...
 
unsigned int noRepetitions (unsigned int noSends) const
 Implementation of the count semantics, i.e., how many repetitions should be sent if the signal is sent noSend times. More...
 

Static Public Member Functions

static boolean dumpFrequency (Stream &stream, frequency_t frequency)
 Static version of dumpFrequency. More...
 

Static Public Attributes

static const frequency_t defaultFrequency = 38000U
 
static const frequency_t invalidFrequency = (frequency_t) -1
 

Detailed Description

This class models an IR signal with intro-, repeat-, and ending sequences.

This class is immutable.

Definition at line 11 of file IrSignal.h.

Constructor & Destructor Documentation

IrSignal::IrSignal ( )
IrSignal::IrSignal ( const IrSignal orig)

Definition at line 18 of file IrSignal.cpp.

IrSignal::~IrSignal ( )
virtual

Definition at line 32 of file IrSignal.cpp.

IrSignal::IrSignal ( const microseconds_t intro,
size_t  lengthIntro,
const microseconds_t repeat,
size_t  lengthRepeat,
const microseconds_t ending,
size_t  lengthEnding,
frequency_t  frequency = defaultFrequency,
boolean  toBeFreed = false 
)

Definition at line 22 of file IrSignal.cpp.

IrSignal::IrSignal ( const microseconds_t intro,
size_t  lengthIntro,
const microseconds_t repeat,
size_t  lengthRepeat,
frequency_t  frequency = defaultFrequency,
boolean  toBeFreed = false 
)
IrSignal::IrSignal ( const IrSequence intro,
const IrSequence repeat,
const IrSequence ending,
frequency_t  frequency,
boolean  toBeFreed 
)

Definition at line 4 of file IrSignal.cpp.

IrSignal::IrSignal ( const IrSequence intro,
const IrSequence repeat,
const IrSequence ending,
frequency_t  frequency = defaultFrequency 
)

Definition at line 9 of file IrSignal.cpp.

Member Function Documentation

IrSignal * IrSignal::clone ( ) const

Creates a (deep) copy of the current object.

The user must delete it manually.

Returns
Pointer to the cloned object.

Definition at line 38 of file IrSignal.cpp.

void IrSignal::dump ( Stream &  stream,
boolean  usingSigns = false 
) const

Print a human readable representation of the IrSignal on the Stream supplied.

Parameters
streamStream onto the output is printed.
usingSignsis true, prepend marks with '+' and gaps with '-'.

Definition at line 42 of file IrSignal.cpp.

boolean IrSignal::dumpFrequency ( Stream &  stream) const
inline

If the frequency is sensible, print it to the stream and return true.

Otherwise do nothing and return false. No extra spaces or line feeds are generated.

Definition at line 88 of file IrSignal.h.

boolean IrSignal::dumpFrequency ( Stream &  stream,
frequency_t  frequency 
)
static

Static version of dumpFrequency.

Parameters
streamStream onto the output is printed.
frequencymodulation frequency

Definition at line 51 of file IrSignal.cpp.

void IrSignal::dumpWithSigns ( Stream &  stream) const
inline

Print a human readable representation of the IrSignal on the Stream supplied, using signs.

Parameters
streamStream onto the output is printed.

Definition at line 79 of file IrSignal.h.

const IrSequence& IrSignal::getEnding ( ) const
inline

Definition at line 56 of file IrSignal.h.

frequency_t IrSignal::getFrequency ( ) const
inline

Definition at line 52 of file IrSignal.h.

const IrSequence& IrSignal::getIntro ( ) const
inline

Definition at line 64 of file IrSignal.h.

const IrSequence& IrSignal::getRepeat ( ) const
inline

Definition at line 60 of file IrSignal.h.

unsigned int IrSignal::noRepetitions ( unsigned int  noSends) const
inline

Implementation of the count semantics, i.e., how many repetitions should be sent if the signal is sent noSend times.

Parameters
noSendsnumber of times to "send signal".

Definition at line 104 of file IrSignal.h.

Member Data Documentation

const frequency_t IrSignal::defaultFrequency = 38000U
static

Definition at line 13 of file IrSignal.h.

const frequency_t IrSignal::invalidFrequency = (frequency_t) -1
static

Definition at line 14 of file IrSignal.h.


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