CTspClientMapper Class Reference

class CTspClientMapper : public CBase
The tsp client mapper component is used to create mappings between remote control clients. The tsp client mapper is used in such cases where a client could not be correctly mapped by it's default information. For example if a remote control event is listened by the active audio client but the actual remote control client is in a different process than the one that is listening the remote control events. In this case a mapping has to be created between the active audio process and the remote control client. This mapping is created simply by setting the process identifier of the remote control client of the active audio to this api. Mapping types define the different states for the tsp clients. The states are defined in TTspClientMappingType. After one state is completed the mapping should be removed or set to another state. In the following an example where a value is set when a player is registered.
        CTspClientMapper* mapper = CTspClientMapper::NewLC();
 RThread client;
 RMessage2& message = aMessage;
 // Message from the client
 RProcess process;
 client.Process( process );
 TProcessId processId = proceess.Id();
 mapper->SetTspTargetClient( processId,
                             CTspClientMapper::ERegisteredClients );
 CleanupStack::PopAndDestroy( mapper );
       

An example of changing the state of the remote control client:

        CTspClientMapper* mapper = CTspClientMapper::NewLC();
 RThread client;
 RMessage2& message = aMessage;
 // Message from the client
 RProcess process;
 client.Process( process );
 TProcessId processId = proceess.Id();
 mapper->SetTspTargetClientToOtherType( processId,
                                        CTspClientMapper::EPlayingClients );
 CleanupStack::PopAndDestroy( mapper );
       

An example of removing a tsp mapping client:

        CTspClientMapper* mapper = CTspClientMapper::NewLC();
 RThread client;
 RMessage2& message = aMessage;
 // Message from the client
 RProcess process;
 client.Process( process );
 TProcessId processId = proceess.Id();
 mapper->RemoveTspTargetClient( processId,
                                CTspClientMapper::EPlayingClients );
 CleanupStack::PopAndDestroy( mapper );
       
Since
S60 5.0

Inherits from

Constructor & Destructor Documentation

CTspClientMapper()

CTspClientMapper ( ) [protected]

Default Constructor

Member Functions Documentation

GetTspTargetClients(TTspClientMappingType, RArray< TProcessId > &)

TInt GetTspTargetClients ( TTspClientMappingType aMappingType,
RArray < TProcessId > & aPidArray
) [private, pure virtual]

This function is used to get the audio clients that are currently playing audio. The function is used by TSP.

TspClientMappingType

Parameters

TTspClientMappingType aMappingType
RArray < TProcessId > & aPidArray is given as a reference. The playing audio clients are added to this array.

NewL()

IMPORT_C CTspClientMapper * NewL ( ) [static]

Symbian two phased constructor.

NewLC()

IMPORT_C CTspClientMapper * NewLC ( ) [static]

Symbian two phased constructor. Puts the instance to cleanup stack.

RemoveTspTargetClient(TTspClientMappingType, TProcessId)

TInt RemoveTspTargetClient ( TTspClientMappingType aMappingType,
TProcessId aProcessId
) [pure virtual]

This function is used to remove a target client from TSP. This way Target Selector Plugin creates a mapping to the correct client. The process id's that are set to the tsp client mapper must be removed from the array after the state is finished with this function. The mappings aren't destroyed automatically in the destructor.

TspClientMappingType

Parameters

TTspClientMappingType aMappingType
TProcessId aProcessId is the process identifier of the client

SetTspTargetClient(TTspClientMappingType, TProcessId)

void SetTspTargetClient ( TTspClientMappingType aMappingType,
TProcessId aProcessId
) [pure virtual]

This function is used to set a target client for TSP. This way Target Selector Plugin creates a mapping to the correct client.

TspClientMappingType

Parameters

TTspClientMappingType aMappingType
TProcessId aProcessId is the process identifier of the client. If the process id is already in the array the process id that needs to be set is moved to the first place in the array.

SetTspTargetClientToOtherType(TTspClientMappingType, TProcessId)

TInt SetTspTargetClientToOtherType ( TTspClientMappingType aMappingType,
TProcessId aProcessId
) [pure virtual]

This function is used to set a TSP target client for another type then it was originally set for. This way targets don't have to be removed from one type and then added to another.

Parameters

TTspClientMappingType aMappingType is the type this client has to be set for
TProcessId aProcessId is the process identifier of the client

Member Enumerations Documentation

Enum TTspClientMappingType

Enumerations for tsp mapping types.

EPlayingClients is used when the client is in playing state. ERegisteredClients is used when the client is in registered state. EStoppedClients is used when the client is in stopped state.

Enumerators

EPlayingClients = 0
ERegisteredClients
EStoppedClients