1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: IVT effect get functions' high level helper functions |
|
15 * (for basis effects) implementation file. |
|
16 */ |
|
17 |
|
18 #include "basisivtgetters.h" |
|
19 |
|
20 // --------------------------------------------------------------------------- |
|
21 // Gets the periodic effect data from the effect data buffer to which pointer |
|
22 // is given as argument. |
|
23 // --------------------------------------------------------------------------- |
|
24 // |
|
25 void BasisIVTGetters::VibeIVTGetPeriodic( |
|
26 const TUint8* aMsg, |
|
27 TVibeIVTMessageTime* aDuration, |
|
28 TVibeIVTMessageTime* aStartDelay, |
|
29 TVibeIVTMagnitude* aMagnitude, |
|
30 TInt* aStartFlag, |
|
31 TInt* aType, |
|
32 TVibeIVTFreqPer* aFreqPer, |
|
33 TInt* aControlMode ) |
|
34 { |
|
35 if ( aMsg ) |
|
36 { |
|
37 if ( aDuration ) |
|
38 { |
|
39 *aDuration = VIBE_IVT_GET_PERIODIC_DURATION( aMsg ); |
|
40 } |
|
41 if ( aStartDelay ) |
|
42 { |
|
43 *aStartDelay = VIBE_IVT_GET_PERIODIC_START_DELAY( aMsg ); |
|
44 } |
|
45 if ( aMagnitude ) |
|
46 { |
|
47 *aMagnitude = VIBE_IVT_GET_PERIODIC_MAGNITUDE( aMsg ); |
|
48 } |
|
49 if ( aStartFlag ) |
|
50 { |
|
51 *aStartFlag = VIBE_IVT_GET_PERIODIC_START_FLAG( aMsg ); |
|
52 } |
|
53 if ( aType ) |
|
54 { |
|
55 *aType = VIBE_IVT_GET_PERIODIC_TYPE( aMsg ); |
|
56 } |
|
57 if ( aFreqPer ) |
|
58 { |
|
59 *aFreqPer = VIBE_IVT_GET_PERIODIC_FREQPER( aMsg ); |
|
60 } |
|
61 if ( aControlMode ) |
|
62 { |
|
63 *aControlMode = VIBE_IVT_GET_PERIODIC_CONTROLMODE( aMsg ); |
|
64 } |
|
65 } |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------------------------- |
|
69 // Gets the periodic modifier data from the effect data buffer to which |
|
70 // pointer is given as argument. |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 void BasisIVTGetters::VibeIVTGetPeriodicModifier( |
|
74 const TUint8* aMsg, |
|
75 TVibeIVTMessageTime* aImpulseTime, |
|
76 TVibeIVTMessageTime* aFadeTime, |
|
77 TVibeIVTMagnitude* aImpulseLevel, |
|
78 TVibeIVTMagnitude* aFadeLevel ) |
|
79 { |
|
80 if ( aMsg ) |
|
81 { |
|
82 if ( aImpulseTime ) |
|
83 { |
|
84 *aImpulseTime = |
|
85 VIBE_IVT_GET_PERIODIC_MODIFIER_IMPULSE_TIME( aMsg ); |
|
86 } |
|
87 if ( aFadeTime ) |
|
88 { |
|
89 *aFadeTime = VIBE_IVT_GET_PERIODIC_MODIFIER_FADE_TIME( aMsg ); |
|
90 } |
|
91 if ( aImpulseLevel ) |
|
92 { |
|
93 *aImpulseLevel = |
|
94 VIBE_IVT_GET_PERIODIC_MODIFIER_IMPULSE_LEVEL( aMsg ); |
|
95 } |
|
96 if ( aFadeLevel ) |
|
97 { |
|
98 *aFadeLevel = VIBE_IVT_GET_PERIODIC_MODIFIER_FADE_LEVEL( aMsg ); |
|
99 } |
|
100 } |
|
101 } |
|
102 |
|
103 // end of file |
|