phoneplugins/csplugin/inc/cspaudiohandler.h
changeset 65 2a5d4ab426d3
parent 37 ba76fc04e6c2
equal deleted inserted replaced
60:1eef62f5c541 65:2a5d4ab426d3
    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.
    91     void ConstructL();
   104     void ConstructL();
    92 
   105 
    93 private:
   106 private:
    94     // data
   107     // data
    95 
   108 
    96 
       
    97     /**
   109     /**
    98      * Audio streams handler.
   110      * Audio streams handler.
    99      */
   111      */
   100     TmsHandler* iTmsHandler;
   112     TmsHandler* iTmsHandler;
   101 
   113 
   102     /**
   114     /**
   103      * Call count
   115      * Call count
   104      */
   116      */
   105     TInt iCallCount;
   117     TInt iCallCount;
       
   118 
       
   119     /**
       
   120      * Timer waiting for the activation of streams.
       
   121      */
       
   122     CSPTimer* iTimer;
       
   123 
       
   124     /*
       
   125      * Observer receiving call audio stream start events.
       
   126      */
       
   127     MCSPAudioHandlerObserver* iObserver;
   106     };
   128     };
   107 
   129 
   108 #endif // CSPAUDIOHANDLER_H
   130 #endif // CSPAUDIOHANDLER_H
       
   131