17 |
17 |
18 #ifndef CSPAUDIOHANDLER_H |
18 #ifndef CSPAUDIOHANDLER_H |
19 #define CSPAUDIOHANDLER_H |
19 #define CSPAUDIOHANDLER_H |
20 |
20 |
21 #include <e32base.h> |
21 #include <e32base.h> |
|
22 #include "cspaudiohandlerbase.h" |
|
23 #include "mtmshandlerobserver.h" |
|
24 #include "mcsptimerobserver.h" |
22 |
25 |
|
26 //FORWARD DECLARATIONS |
23 class TmsHandler; |
27 class TmsHandler; |
|
28 class CSPTimer; |
|
29 |
24 /** |
30 /** |
25 * Handles call adding from calls not done by the plugin. |
31 * Handles call adding from calls not done by the plugin. |
26 * |
32 * |
27 */ |
33 */ |
28 class CSPAudioHandler : public CBase |
34 class CSPAudioHandler : public CSPAudioHandlerBase, |
|
35 public MTmsHandlerObserver, |
|
36 public MCSPTimerObserver |
29 { |
37 { |
30 public: |
38 public: |
31 //Constructors and descructor |
39 //Constructors and descructor |
32 |
40 |
33 /** |
41 /** |
34 * Two-phased constructing for the monitor. |
42 * Two-phased constructing for the monitor. |
35 * |
|
36 * @param aObserver the observer for getting notification |
|
37 * @param aLine the line to monitor |
|
38 * @param aLineId line identifier |
|
39 */ |
43 */ |
40 static CSPAudioHandler* NewL(); |
44 static CSPAudioHandler* NewL(); |
41 |
45 |
42 /** |
46 /** |
43 * C++ default destructor. |
47 * C++ default destructor. |
44 */ |
48 */ |
45 virtual ~CSPAudioHandler(); |
49 virtual ~CSPAudioHandler(); |
|
50 |
|
51 // from base class CSPAudioHandlerBase |
|
52 |
|
53 /* |
|
54 * From CSPAudioHandlerBase |
|
55 * Set observer to receive call audio stream events. |
|
56 */ |
|
57 void SetObserver(MCSPAudioHandlerObserver& aObserver); |
46 |
58 |
47 /** |
59 /** |
48 * Start audio streams. |
60 * From CSPAudioHandlerBase |
|
61 * Start audio streams. |
49 */ |
62 */ |
50 void Start(); |
63 void Start(); |
51 |
64 |
52 /** |
65 /** |
53 * Stop audio streams. |
66 * From CSPAudioHandlerBase |
|
67 * Stop audio streams. |
54 */ |
68 */ |
55 void Stop(); |
69 void Stop(); |
56 |
70 |
|
71 /* |
|
72 * From CSPAudioHandlerBase |
|
73 * Specify timeout after which stream start retry will be terminated. |
|
74 */ |
|
75 void ReportAudioFailureAfterTimeout(TInt aTimeout); |
|
76 |
57 protected: |
77 protected: |
58 // From CActive |
78 /* |
59 /** |
79 * From MTmsHandlerObserver |
60 * From CActive |
80 * Indicates call audio stream start success. |
61 * RunL |
|
62 */ |
81 */ |
63 void RunL(); |
82 void AudioStreamsStarted(); |
|
83 |
|
84 /* |
|
85 * From MTmsHandlerObserver |
|
86 * Indicates call audio stream start failure. |
|
87 */ |
|
88 void AudioStreamsError(TInt aError); |
64 |
89 |
65 /** |
90 /** |
66 * From CActive |
91 * From MCSPTimerObserver. |
67 * Catches errors if RunL leaves |
|
68 * @param aError error code |
|
69 * @return error code |
|
70 */ |
92 */ |
71 TInt RunError(TInt aError); |
93 void TimerEvent(); |
72 |
|
73 /** |
|
74 * From CActive |
|
75 * Cancels the monitor |
|
76 */ |
|
77 void DoCancel(); |
|
78 |
94 |
79 private: |
95 private: |
80 /** |
96 /** |
81 * C++ default constructor |
97 * C++ default constructor |
82 * @param aObserver the observer for status change (incoming call) |
|
83 * @param aLine the line associated with the call |
|
84 * @param aLineId line identifier |
|
85 */ |
98 */ |
86 CSPAudioHandler(); |
99 CSPAudioHandler(); |
87 |
100 |
88 /** |
101 /** |
89 * Constructs the monitor in the second phase. |
102 * Constructs the monitor in the second phase. |