Main Page | Class Hierarchy | Class List | File List | Class Members

Member Class Reference

#include <member.h>

Collaboration diagram for Member:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Member (Manager &manager, PString _roomId, PString _memberId)
 ~Member ()
virtual void PrintOn (ostream &strm) const
void AddMemberToRoom (PString newMember)
void RemoveFromRoom ()
void MemberHasEnded (PString deadMember)
PString GetMemberId ()
PString GetRoomId ()
void WriteAudio (BYTE *dataPtr, PINDEX size)
void ReadAudio (BYTE *dataPtr, PINDEX readSize)
PINDEX GetBufferSize ()
void ReadAndMixAudio (BYTE *ptr, PINDEX amount, PINDEX &currentReadIndex)
PString GetDurationInfo ()

Protected Member Functions

void Mix (BYTE *dst, const BYTE *src, PINDEX count)
virtual void EmptyParticipantList (PThread &, INT)

Protected Attributes

Managermanager
ParticipantList participants
BOOL keepGoing
PString roomId
PString memberId
PTime memberCreatedAt
Variables to manage the audio buffer for this member.
BYTE * buffer
PINDEX currentWriteIndex
PINDEX bufferSize
PMutex audioBufferMutex

Detailed Description

A class the combines the PSafeObject structure from PWLib with a handler for maintaining one entity in a conference room.

The member may be descended off to give a filemember (someone who is announcing to the conference, or recording the conference), so we there may well be more members than active calls.


Constructor & Destructor Documentation

Member::Member Manager manager,
PString  _roomId,
PString  _memberId
 

Constructor, which creates this member, who has link to the manger and knows the conference we are a part of

Member::~Member  ) 
 

Destructor


Member Function Documentation

void Member::AddMemberToRoom PString  newMember  ) 
 

A new member has joined this conference room. This method is then called to add the new member to this Members's list of other members

void Member::EmptyParticipantList PThread &  ,
INT 
[protected, virtual]
 

This contains a separate thread who goes through each element in the list of participants, and advises each of them to loose (*this) from its list of participants

PINDEX Member::GetBufferSize  ) 
 

Get the length of the audio buffer (which is used by the Participant class)

PString Member::GetDurationInfo  ) 
 

Get information about how long this member has been created for

PString Member::GetMemberId  )  [inline]
 

Retrieve the unique Id that identifies this member

PString Member::GetRoomId  )  [inline]
 

Retrieve the unique Id that identifies the room we are in

void Member::MemberHasEnded PString  deadMember  ) 
 

A member of this conference room has ended. That member has asked us (via this method), to be removed from our member list

void Member::Mix BYTE *  dst,
const BYTE *  src,
PINDEX  count
[protected]
 

Do the multiplexing of audio together

void Member::PrintOn ostream &  strm  )  const [virtual]
 

pretty print information in this class

Parameters:
strm  Stream to output text representation

void Member::ReadAndMixAudio BYTE *  ptr,
PINDEX  amount,
PINDEX &  currentReadIndex
 

This method is used to to multiplex together the audio from each of the other Members in this conference room.

Suppose there are five Members in this conference. (A,B,C,D,E). Member A will call this method for Members B,C,D,E.

Similarily, Member E will call this method for Members A,B,C,D.

The other Member who has called this method, keeps track of how far through the buffer he is, via the the currentReadIndex variable.

void Member::ReadAudio BYTE *  dataPtr,
PINDEX  readSize
 

copy audio from each of the participants, and put the result into the region pointed to by dataptr

void Member::RemoveFromRoom  ) 
 

Remove this member from the conference room

void Member::WriteAudio BYTE *  dataPtr,
PINDEX  size
 

copy some audio to this member, which is then copied to all the other members of this ConferenceRoom.


Member Data Documentation

PMutex Member::audioBufferMutex [protected]
 

Lock on the audio buffer & assocated variables

BYTE* Member::buffer [protected]
 

Pointer to the data that holds the audio from this endpont's remote user. The muxing is done by the ReadAndMix method, which steps through the otherMembers list.

This buffer is circular, in that once data has been written to the end, data will then be written to the start

PINDEX Member::bufferSize [protected]
 

Total number of bytes in buffer. Never gets changed.

PINDEX Member::currentWriteIndex [protected]
 

The position that we next put data to

BOOL Member::keepGoing [protected]
 

Flag to indicate we are still active and running in this room

Manager& Member::manager [protected]
 

Link to our control manager

PTime Member::memberCreatedAt [protected]
 

The time at which this structure was created, which is the time this call was started at

PString Member::memberId [protected]
 

The globally unique id that we have been assigned to, which is the same as the same as the sofaswitch Id used by the corresponding control channel

ParticipantList Member::participants [protected]
 

list of the other members in this room, which is contained in a thread safe list.

Alternatively, you could say that participants contains everyone in this conference room, except for (this)..

PString Member::roomId [protected]
 

The id of the conference room we are joined to


The documentation for this class was generated from the following files:
Generated on Sun Jan 29 19:49:33 2006 for Sofa Switch Multipoint Conf. Utility by  doxygen 1.4.4