35 * Responsible for sending callbacks to the TMS client app |
35 * Responsible for sending callbacks to the TMS client app |
36 */ |
36 */ |
37 class MQueueHandlerObserver |
37 class MQueueHandlerObserver |
38 { |
38 { |
39 public: |
39 public: |
40 virtual void QueueEvent(TInt aEventType, TInt aError, void* user_data) = 0; |
40 virtual void QueueEvent(gint aEventType, gint aError, void* user_data) = 0; |
41 }; |
41 }; |
42 |
42 |
43 /** |
43 /** |
44 * CQueueHandler class |
44 * TMSQueueHandler class |
45 */ |
45 */ |
46 NONSHARABLE_CLASS(CQueueHandler) : public CActive |
46 NONSHARABLE_CLASS(TMSQueueHandler) : public CActive |
47 { |
47 { |
48 public: |
48 public: |
49 |
49 |
50 /** |
50 /** |
51 * NewL() |
51 * NewL() |
52 * Contructor |
52 * Contructor |
53 * |
53 * |
54 */ |
54 */ |
55 static CQueueHandler* NewL(RMsgQueue<TmsMsgBuf>* aMsgQueue, |
55 static TMSQueueHandler* NewL(RMsgQueue<TmsMsgBuf>* aMsgQueue, |
56 TMSGlobalContext* glblCtx); |
56 TMSGlobalContext* glblCtx); |
57 |
57 |
58 /** |
58 /** |
59 * destructor |
59 * destructor |
60 */ |
60 */ |
61 virtual ~CQueueHandler(); |
61 virtual ~TMSQueueHandler(); |
62 |
62 |
63 /** |
63 /** |
64 * Start |
64 * Start |
65 * Starts listening for events. |
65 * Starts listening for events. |
66 * |
66 * |
70 /** |
70 /** |
71 * Returns request status. |
71 * Returns request status. |
72 */ |
72 */ |
73 TRequestStatus* Status(); |
73 TRequestStatus* Status(); |
74 |
74 |
75 TInt AddObserver(MQueueHandlerObserver& obsvr, TInt aClientId); |
75 gint AddObserver(MQueueHandlerObserver& obsvr, gint aClientId); |
76 TInt RemoveObserver(MQueueHandlerObserver& obsvr); |
76 gint RemoveObserver(MQueueHandlerObserver& obsvr); |
77 |
77 |
78 private: |
78 private: |
79 |
79 |
80 /** |
80 /** |
81 * constructor |
81 * constructor |
82 */ |
82 */ |
83 CQueueHandler(RMsgQueue<TmsMsgBuf>* aMsgQueue, |
83 TMSQueueHandler(RMsgQueue<TmsMsgBuf>* aMsgQueue, |
84 TMSGlobalContext* glblCtx); |
84 TMSGlobalContext* glblCtx); |
85 |
85 |
86 void ConstructL(); |
86 void ConstructL(); |
87 |
87 |
88 // from CActive |
88 // from CActive |
89 void DoCancel(); |
89 void DoCancel(); |
90 void RunL(); |
90 void RunL(); |
91 TInt RunError(TInt aError); |
91 TInt RunError(TInt aError); |
92 void DoFillBuffer(TInt aBufLen, TInt aStatus, TBool flag, TUint32 key); |
92 |
93 void DoEmptyBuffer(TInt aBufLen, TInt aStatus, TBool flag, TUint32 key); |
93 void DoFillBuffer(gint aBufLen, gint aStatus, gboolean flag, guint32 key); |
94 TInt FindStreamInList(); |
94 void DoEmptyBuffer(gint aBufLen, gint aStatus, gboolean flag, guint32 key); |
95 TInt FindGainEffectInList(); |
95 gint FindStreamInList(); |
96 TInt FindVolEffectInList(); |
96 gint FindGainEffectInList(); |
97 TMSStreamState ConvertToStreamState(TInt request); |
97 gint FindVolEffectInList(); |
|
98 TMSStreamState ConvertToStreamState(gint request); |
98 |
99 |
99 private: |
100 private: |
100 // data |
101 // data |
101 |
102 |
102 RPointerArray<MQueueHandlerObserver> iObserversList; // (not owned) |
103 RPointerArray<MQueueHandlerObserver> iObserversList; // (not owned) |
103 MQueueHandlerObserver* iObserver; //not owned |
104 MQueueHandlerObserver* iObserver; //not owned |
104 RArray<TInt> iClientList; |
105 RArray<gint> iClientList; |
105 RMsgQueue<TmsMsgBuf>* iMsgQueue; |
106 RMsgQueue<TmsMsgBuf>* iMsgQueue; |
106 |
107 |
107 RChunk iChunk; |
108 RChunk iChunk; |
108 TPtr8 iChunkDataPtr; |
109 TPtr8 iChunkDataPtr; |
109 TMSBuffer* iBuffer; |
110 TMSBuffer* iBuffer; |