|
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 the License "Symbian Foundation License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Definition for asynchronous play commands sender object. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __HAPTICSTEST_ASYNCPLAYSENDER_H__ |
|
20 #define __HAPTICSTEST_ASYNCPLAYSENDER_H__ |
|
21 |
|
22 #include <e32base.h> |
|
23 class CHapticsTestAppView; |
|
24 class CHapticsTestAppUi; |
|
25 |
|
26 /** |
|
27 * Active Object for sending async play methods |
|
28 */ |
|
29 class CHapticsTestAsyncPlaySender : public CActive |
|
30 { |
|
31 public: |
|
32 |
|
33 /** |
|
34 * Constructor |
|
35 * |
|
36 * @param aUi Pointer to the test appl UI object. |
|
37 */ |
|
38 CHapticsTestAsyncPlaySender( CHapticsTestAppUi* aUi ); |
|
39 |
|
40 /** |
|
41 * Destructor |
|
42 */ |
|
43 virtual ~CHapticsTestAsyncPlaySender(); |
|
44 |
|
45 /** |
|
46 * Method for fileHandle type playing of effects repeatedly in asynch mode |
|
47 * |
|
48 * @param aHaptics Pointer to the haptics interface object. |
|
49 * @param aFileHandle Handle for the effect data buffer from which to |
|
50 * play the effects. |
|
51 * @param aEffectIndex Index of the effect that is being played. |
|
52 * @param aRepeat Number of repeats. |
|
53 * @param aEffectHandle Out-parameter to which the handle for the played |
|
54 * effect is returned. |
|
55 */ |
|
56 void PlayRepeat( CHWRMHaptics* aHaptics, |
|
57 TInt aFileHandle, |
|
58 TInt aEffectIndex, |
|
59 TUint8 aRepeat, |
|
60 TInt& aEffectHandle ); |
|
61 |
|
62 /** |
|
63 * Method for fileHandle type playing of effects in asynch mode |
|
64 * |
|
65 * @param aHaptics Pointer to the haptics interface object. |
|
66 * @param aFileHandle Handle for the effect data buffer from which to |
|
67 * play the effects. |
|
68 * @param aEffectIndex Index of the effect that is being played. |
|
69 * @param aEffectHandle Out-parameter to which the handle for the played |
|
70 * effect is returned. |
|
71 */ |
|
72 void Play( CHWRMHaptics* aHaptics, |
|
73 TInt aFileHandle, |
|
74 TInt aEffectIndex, |
|
75 TInt& aEffectHandle ); |
|
76 |
|
77 public: |
|
78 |
|
79 /** |
|
80 * From CActive |
|
81 */ |
|
82 virtual void RunL(); |
|
83 |
|
84 /** |
|
85 * From CActive |
|
86 */ |
|
87 virtual void DoCancel(); |
|
88 |
|
89 /** |
|
90 * From CActive |
|
91 */ |
|
92 virtual TInt RunError( TInt aError ); |
|
93 |
|
94 private: |
|
95 |
|
96 /** |
|
97 * Pointer to the application UI object. |
|
98 * Not owned. |
|
99 */ |
|
100 CHapticsTestAppUi* iUi; |
|
101 |
|
102 /** |
|
103 * Index of the effect for which the play request was made. |
|
104 */ |
|
105 TInt iIndex; |
|
106 }; |
|
107 |
|
108 #endif // __HAPTICSTEST_ASYNCPLAYSENDER_H__ |
|
109 |