audiostubs/devsoundextensions_stubs/mmfdevsoundadaptation_stub/src/TonePlayCompleteTimer.h
changeset 39 65e91466a14b
parent 31 931072794a66
child 40 b7e5ed8c1342
equal deleted inserted replaced
31:931072794a66 39:65e91466a14b
     1 /*
       
     2 * Copyright (c) 2006 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: Audio Stubs -  Utility timer object used for playing tone sequence.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef TONEPLAYCOMPLETETIMER_H
       
    21 #define TONEPLAYCOMPLETETIMER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <sounddevice.h>
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30 *  Utility timer object used for playing tone sequence.
       
    31 *
       
    32 *  @lib MmfDevSoundAdaptation_Stub.lib
       
    33 *  @since Series 60 3.0
       
    34 */
       
    35 class CTonePlayCompleteTimer : public CActive
       
    36     {
       
    37     public:  // Constructors and destructor
       
    38 
       
    39         /**
       
    40         * Constructs, and returns a pointer to, a new CTonePlayCompleteTimer
       
    41         * object.
       
    42         * Leaves on failure..
       
    43         * @since Series 60 3.0
       
    44         * @return CTonePlayCompleteTimer* A pointer to newly created object.
       
    45         */
       
    46         static CTonePlayCompleteTimer* NewL(MDevSoundAdaptationObserver&
       
    47                                             aDevSoundObserver);
       
    48 
       
    49         /**
       
    50         * Destructor.
       
    51         */
       
    52         ~CTonePlayCompleteTimer();
       
    53 
       
    54     public: // New functions
       
    55 
       
    56         /**
       
    57         * Sets the timeout duration.
       
    58         * @since Series 60 3.0
       
    59         * @return void
       
    60         */
       
    61         void SetTimeOut(TTimeIntervalMicroSeconds32& aTimeOut);
       
    62 
       
    63         /**
       
    64         * Starts the timer for timeout duration set by SetTimeOut().
       
    65         * @since Series 60 3.0
       
    66         * @return void
       
    67         */
       
    68         void Start();
       
    69 
       
    70     protected:  // Functions from base classes
       
    71 
       
    72         /**
       
    73         * Called by CActive object framework when local timer times out.
       
    74         * @since Series 60 3.0
       
    75         * @return void
       
    76         */
       
    77         void RunL();
       
    78 
       
    79         /**
       
    80         * Called by CActive object framework when client cancels active object.
       
    81         * @since Series 60 3.0
       
    82         * @return void
       
    83         */
       
    84         void DoCancel();
       
    85 
       
    86         /**
       
    87         * Called by CActive object framework when RunL leaves.
       
    88         * @since Series 60 3.0
       
    89         * @param TInt aError Error code.
       
    90         * @return KErrNone
       
    91         */
       
    92         TInt RunError(TInt aError);
       
    93 
       
    94     private:
       
    95 
       
    96         /**
       
    97         * C++ default constructor.
       
    98         */
       
    99         CTonePlayCompleteTimer(MDevSoundAdaptationObserver&
       
   100                                aDevSoundObserver);
       
   101 
       
   102         /**
       
   103         * By default Symbian 2nd phase constructor is private.
       
   104         */
       
   105         void ConstructL();
       
   106 
       
   107     private:    // Data
       
   108         // Pointer reference to HwDevice observer.
       
   109         MDevSoundAdaptationObserver&    iObserver;
       
   110         // Time out duration
       
   111         TTimeIntervalMicroSeconds32     iTimeOut;
       
   112         // Local timer object
       
   113         RTimer                          iTimer;
       
   114 
       
   115     };
       
   116 
       
   117 #endif      // TONEPLAYCOMPLETETIMER_H
       
   118 
       
   119 // End of File