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 );
Constructor & Destructor Documentation
CTspClientMapper()
CTspClientMapper
|
(
|
)
|
[protected]
|
Member Functions Documentation
GetTspTargetClients(TTspClientMappingType, RArray< TProcessId > &)
This function is used to get the audio clients that are currently playing audio. The function is used by TSP.
TspClientMappingType
NewL()
Symbian two phased constructor.
NewLC()
Symbian two phased constructor. Puts the instance to cleanup stack.
RemoveTspTargetClient(TTspClientMappingType, TProcessId)
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
SetTspTargetClient(TTspClientMappingType, TProcessId)
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)
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.
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
|
|
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.