cornelluniversity::vetserial::mp3_play_request Class Reference

base_command Implements a request to initiate the playing of an MP3 device on the remote device. More...

#include <vetprot.h>

Inheritance diagram for cornelluniversity::vetserial::mp3_play_request:

cornelluniversity::vetserial::base_command List of all members.

Public Member Functions

 mp3_play_request (void)
 Default constructor Zeroes out device, track, and duration.
 mp3_play_request (const uint8_ dev, const uint8_ trk, const uint16_ dur=0)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Overloaded constructor Accepts values for initializing device, track, and duration.
virtual ~mp3_play_request (void)
const uint8_ track (void) const
 Track number private member accessor.
void track (const uint8_ track_number)
 Track number private member mutator.
const uint8_ device (void) const
 Device number private member accessor.
void device (const uint8_ device_number)
 Device number private member mutator.
const uint16_ duration (void) const
 Duration private member accessor The duration value is in milliseconds (i.e.
void duration (const uint16_ duration)
 Duration value private member mutator.
virtual void execute (void)
 Overridden virtual function.

Detailed Description

base_command Implements a request to initiate the playing of an MP3 device on the remote device.

Definition at line 433 of file vetprot.h.


Constructor & Destructor Documentation

cornelluniversity::vetserial::mp3_play_request::mp3_play_request ( void   )  [inline]

Default constructor Zeroes out device, track, and duration.

Be careful with duration, zero equals infinite play.

Todo:
Determine the domain of device IDs (do they start at zero or one)?

Determine the range of acceptble track numbers (255, but starting at zero or one)?

See also:
mp3_play_request(const uint8_ dev, const uint8_ trk, const uint16_ dur = 0)

Definition at line 443 of file vetprot.h.

cornelluniversity::vetserial::mp3_play_request::mp3_play_request ( const uint8_  dev,
const uint8_  trk,
const uint16_  dur = 0 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Overloaded constructor Accepts values for initializing device, track, and duration.

Duration defualts to zero (infinite play).

See also:
mp3_play_request(void)

Definition at line 451 of file vetprot.h.


Member Function Documentation

void cornelluniversity::vetserial::mp3_play_request::device ( const uint8_  device_number  )  [inline]

Device number private member mutator.

Parameters:
device_number - unsigned char based device number to be accessed
Todo:
Once we determine the valid range of device numbers, we should validate

Definition at line 474 of file vetprot.h.

const uint8_ cornelluniversity::vetserial::mp3_play_request::device ( void   )  const [inline]

Device number private member accessor.

Returns:
unsigned char - device number currently set to be played

Definition at line 468 of file vetprot.h.

void cornelluniversity::vetserial::mp3_play_request::duration ( const uint16_  duration  )  [inline]

Duration value private member mutator.

Parameters:
duration - unsigned short based duration value. The duration value is in milliseconds (i.e. 1000 will play for 1 second). Setting the duration to zero plays the track until told to stop.

Definition at line 487 of file vetprot.h.

const uint16_ cornelluniversity::vetserial::mp3_play_request::duration ( void   )  const [inline]

Duration private member accessor The duration value is in milliseconds (i.e.

1000 will play for 1 second).

Returns:
unsigned short - track number currently set to be played

Definition at line 480 of file vetprot.h.

virtual void cornelluniversity::vetserial::mp3_play_request::execute ( void   )  [virtual]

Overridden virtual function.

Builds a play request packet by instantiating a header, adding the payload, and capping it off with a trailer. The full packet is left in buffer for you to access via this->packet().

Exceptions:
std::bad_alloc standard memory allocation failure

Implements cornelluniversity::vetserial::base_command.

void cornelluniversity::vetserial::mp3_play_request::track ( const uint8_  track_number  )  [inline]

Track number private member mutator.

Parameters:
track_number - unsigned char based track number to be played
Todo:
Once we determine the valid range of track numbers, we should validate

Definition at line 463 of file vetprot.h.

const uint8_ cornelluniversity::vetserial::mp3_play_request::track ( void   )  const [inline]

Track number private member accessor.

Returns:
unsigned char - track number currently set to be played

Definition at line 457 of file vetprot.h.


The documentation for this class was generated from the following file:
Generated on Thu Sep 27 11:11:49 2012 for VetSim by  doxygen 1.4.7