CTactileFeedbackResolver Class Reference

class CTactileFeedbackResolver : public CBase

Class for procuding physical feedback based on logical feedback type.

Feedback is generated according to Tactile Feedback settings and current device state, and it may be that feedback is not even generated at all.

tactilefeedbackresolver.lib
Since
S60 5.2

Inherits from

Public Member Functions
~CTactileFeedbackResolver ()
void ModifyFeedback ( TInt )
CTactileFeedbackResolver * NewL ()
void PlayFeedback ( TTouchLogicalFeedback , TBool , TBool )
void PlayPreviewFeedback ( TInt , TTouchLogicalFeedback , TTouchFeedbackType )
void StartFeedback ( TTouchContinuousFeedback , TInt )
void StartPreviewFeedback ( TInt , TTouchContinuousFeedback , TInt , TTouchFeedbackType )
void StopFeedback ()
void StopPreviewFeedback ()
Private Member Functions
CTactileFeedbackResolver ()
void ConstructL ()
void CreateAudioPlayerL ( TUid )
void CreateHapticsPlayerL ( TUid )
void DoHandleNotifyGenericL ( TUint32 )
void HandleNotifyGeneric ( TUint32 )
void InitializeCrKeysL ()
void InitializePsKeysL ()
TBool IsHigherThanPlaying ( TTouchLogicalFeedback )
void PropertyChangedL (const TUid , const TUint )
void ReadFeedbackEnabledFromPS ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
TBool iAudioEnabled
CTactilePlayer * iAudioPlayer
CCenRepNotifyHandler * iCenRepNotifier
TBool iFeedbackStarted
CTactilePlayer * iHapticsPlayer
TTouchLogicalFeedback iLastFeedback
TTime iLastFeedbackTimeStamp
TTimeIntervalMicroSeconds iMinimumInterval
CTactilePropertyWatcher * iPropertyWatcher
CRepository * iRepository
TBool iVibraEnabled
TBool iVibraFirst

Constructor & Destructor Documentation

CTactileFeedbackResolver()

CTactileFeedbackResolver ( ) [private]

Constructor.

~CTactileFeedbackResolver()

~CTactileFeedbackResolver ( ) [virtual]

Member Functions Documentation

ConstructL()

void ConstructL ( ) [private]

2nd phase constructor..

CreateAudioPlayerL(TUid)

void CreateAudioPlayerL ( TUid aAudioUid ) [private]

Create audio player. ECom implementation uid is used for selecting the player plugin.

Parameters

TUid aAudioUid

CreateHapticsPlayerL(TUid)

void CreateHapticsPlayerL ( TUid aHapticsUid ) [private]

Create haptics player. ECom implementation uid is used for selecting the player plugin.

Parameters

TUid aHapticsUid

DoHandleNotifyGenericL(TUint32)

void DoHandleNotifyGenericL ( TUint32 aId ) [private]

Handle changes in tactile feedback settings.

Parameters

TUint32 aId

HandleNotifyGeneric(TUint32)

void HandleNotifyGeneric ( TUint32 aId ) [private]

From MCenRepNotifyHandlerCallback .

This is called when Tactile Feedback settings in Central Repository are changed.

Parameters

TUint32 aId - The id of the changed Central Repository value.

InitializeCrKeysL()

void InitializeCrKeysL ( ) [private]

Central repository related initializations.

InitializePsKeysL()

void InitializePsKeysL ( ) [private]

Publish & Subscribe related initializations.

IsHigherThanPlaying(TTouchLogicalFeedback)

TBool IsHigherThanPlaying ( TTouchLogicalFeedback aFeedback ) const [private]

Return ETrue if aFeedback's priority is higher than current playing feedback, namely iLastFeedback.

TODO: Currently, we only take Popup and Button effects into account. Ultimately, a complete priority queue should be set up.

Parameters

TTouchLogicalFeedback aFeedback

ModifyFeedback(TInt)

void ModifyFeedback ( TInt aIntensity )
Modifies the intensity of ongoing continuous feedback.
Since
S60 5.2

Parameters

TInt aIntensity - New intensity for continuous feedback. Value range for intensity is 0-100%.

NewL()

CTactileFeedbackResolver * NewL ( ) [static]

PlayFeedback(TTouchLogicalFeedback, TBool, TBool)

void PlayFeedback ( TTouchLogicalFeedback aFeedback,
TBool aPlayVibra,
TBool aPlayAudio
)

Produces immediately physical feedback according to given logical feedback type.

Actual physical feedback type depends on settings of existing player plugins and current device state.

Parameters

TTouchLogicalFeedback aFeedback - Logical feedback type.
TBool aPlayVibra - If EFalse then vibra feedback is not played.
TBool aPlayAudio - If EFalse then audio feedback is not played.

PlayPreviewFeedback(TInt, TTouchLogicalFeedback, TTouchFeedbackType)

void PlayPreviewFeedback ( TInt aLevel,
TTouchLogicalFeedback aFeedback,
TTouchFeedbackType aType
)

Produces immediate physical feedback according to given logical feedback type and given level.

Since
S60 5.2

Parameters

TInt aLevel - Level value defines the strength of playing effect. Maximum level value is player dependent.
TTouchLogicalFeedback aFeedback
TTouchFeedbackType aType - Type of feedback to be previewed.

PropertyChangedL(const TUid, const TUint)

void PropertyChangedL ( const TUid aCategory,
const TUint aKey
) [private]

From MTactilePropertyObserver

This is called when the property for temporary disabling feedback is updated.

Parameters

const TUid aCategory - The UID of the changed property
const TUint aKey - The key (i.e. identifier) of the changed property

ReadFeedbackEnabledFromPS()

void ReadFeedbackEnabledFromPS ( ) [private]

This function reads the feedback enabled/disabled value from the dedicated P&S key, and stores it into iFeedbackEnabled -member variable.

Dedicated fuction used for avoiding duplicate code (in construction and when the P&S key changes)

StartFeedback(TTouchContinuousFeedback, TInt)

void StartFeedback ( TTouchContinuousFeedback aType,
TInt aIntensity
)

Starts playing continuous feedback.

Since
S60 5.2

Parameters

TTouchContinuousFeedback aType - Type of continuous feedback to be played.
TInt aIntensity - Intensity of continuous feedback. Value range for intensity is 0-100%.

StartPreviewFeedback(TInt, TTouchContinuousFeedback, TInt, TTouchFeedbackType)

void StartPreviewFeedback ( TInt aLevel,
TTouchContinuousFeedback aFeedback,
TInt aIntensity,
TTouchFeedbackType aType
)

Starts playing continuous feedback of given type on given level.

Since
S60 5.2

Parameters

TInt aLevel - Level value defines the strength of playing effect. Maximum level value is player dependent.
TTouchContinuousFeedback aFeedback - Type of continuous feedback to be played.
TInt aIntensity - Intensity of continuous feedback. Value range for intensity is 0-100% from basic strength (aLevel).
TTouchFeedbackType aType - Type of feedback to be previewed.

StopFeedback()

void StopFeedback ( )

Stops the ongoing feedback.

Since
S60 5.2

StopPreviewFeedback()

void StopPreviewFeedback ( )

Stops the ongoing preview of continuous feedback.

Since
S60 5.2

Member Data Documentation

TBool iAudioEnabled

TBool iAudioEnabled [private]

This flag indicates the audio feedback state according to the P&S key that can be used for globally disabling vibra and/or audio feedback.

CTactilePlayer * iAudioPlayer

CTactilePlayer * iAudioPlayer [private]

Audio player. Own.

CCenRepNotifyHandler * iCenRepNotifier

CCenRepNotifyHandler * iCenRepNotifier [private]

Central repository notifier, which sends notification when tactile feedback settings has been changed. Own.

TBool iFeedbackStarted

TBool iFeedbackStarted [private]

This flag indicates whether the continuous feedback is started or not.

CTactilePlayer * iHapticsPlayer

CTactilePlayer * iHapticsPlayer [private]

Haptics player. Own.

TTouchLogicalFeedback iLastFeedback

TTouchLogicalFeedback iLastFeedback [private]

Name of the last played feedback.

TTime iLastFeedbackTimeStamp

TTime iLastFeedbackTimeStamp [private]

Timestamp of the last played feedback.

TTimeIntervalMicroSeconds iMinimumInterval

TTimeIntervalMicroSeconds iMinimumInterval [private]

Minimum interval between feedbacks.

CTactilePropertyWatcher * iPropertyWatcher

CTactilePropertyWatcher * iPropertyWatcher [private]

Access to the P&S property, which is used for temporary disabling the feedback. Own.

CRepository * iRepository

CRepository * iRepository [private]

Central repository for reading tactile feedback settings. Own.

TBool iVibraEnabled

TBool iVibraEnabled [private]

This flag indicates the vibra feedback state according to the P&S key that can be used for globally disabling vibra and/or audio feedback.

TBool iVibraFirst

TBool iVibraFirst [private]

This flag determinates the playing order of feedback types. ETrue - vibra feedback is played first. EFalse - audio feedback is played first.