startupservices/Startup/inc/StartupTone.h
branchRCL_3
changeset 19 924385140d98
parent 18 0818dd463d41
child 20 c2c61fdca848
equal deleted inserted replaced
18:0818dd463d41 19:924385140d98
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  
       
    15 *           This class is the container class of the CStartupTone.
       
    16 *           It is used for playing startup tone.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __STARTUPTONE_H__
       
    22 #define __STARTUPTONE_H__
       
    23 
       
    24 //  INCLUDES
       
    25 #include <MdaAudioSamplePlayer.h>
       
    26 #include "startupdefines.h"
       
    27 #include "startup.hrh"
       
    28 
       
    29 // CLASS DECLARATION
       
    30 /**
       
    31 *  CStartupTone
       
    32 *  This class is used for playing of startup tone.
       
    33 */
       
    34 class CStartupAppUi;
       
    35 
       
    36 class CStartupTone : public CBase, public MMdaAudioPlayerCallback
       
    37 	{
       
    38 	public:		//Constructors and destructor
       
    39         /**
       
    40         * C++ constructor.
       
    41         */
       
    42         CStartupTone( CStartupAppUi* aStartupAppUi );
       
    43         
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         */
       
    47         static CStartupTone* NewL( CStartupAppUi* aStartupAppUi, TToneType aToneType );
       
    48 
       
    49 		/**
       
    50 		* Destructor
       
    51 		*/
       
    52 		virtual ~CStartupTone();
       
    53 
       
    54 		/**
       
    55 		* Two phase constructor - this creates the audio player object
       
    56 		*/
       
    57 		void ConstructL(TToneType aToneType);
       
    58 
       
    59 	public: // New Functions
       
    60 
       
    61 		/**
       
    62 		* Play tone
       
    63 		*/
       
    64 		TInt Play();
       
    65 
       
    66 		/**
       
    67 		* Stop tone
       
    68 		*/
       
    69         void Stop();
       
    70 
       
    71 		/**
       
    72 		* Check is tone currectly playing
       
    73 		*/        
       
    74         TBool Playing();
       
    75 
       
    76 		/**
       
    77 		* Audio ready query
       
    78 		* @return ETrue= audio ready, EFalse=audio not ready
       
    79 		*/
       
    80 		TBool AudioReady();
       
    81 
       
    82 		/**
       
    83 		* Check if Startup tone is defined and found 
       
    84 		*/
       
    85         TBool ToneFound();
       
    86 
       
    87         /**
       
    88 		*/
       
    89         void StartupWaiting(TBool aValue);
       
    90     private:
       
    91 
       
    92         /**
       
    93 		*/
       
    94         TInt GetRingingToneVolumeL();
       
    95 
       
    96 	public: // Functions from base classes
       
    97 
       
    98         /**
       
    99         * From MMdaAudioPlayerCallback, audio initialization complete (Audio ready)
       
   100         * @param aError
       
   101         * @param aDuration not used internally
       
   102         */
       
   103 		void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
       
   104 
       
   105         /**
       
   106         * From MMdaAudioPlayerCallback, audio playing complete
       
   107         * @param aError
       
   108         */
       
   109 		void MapcPlayComplete(TInt aError);
       
   110 
       
   111 	private: //data
       
   112 		CMdaAudioPlayerUtility*		iTone;
       
   113 		TBool						iAudioReady;
       
   114 		TBool						iPlaying;
       
   115         TToneType                   iToneType;
       
   116         CStartupAppUi*              iStartupAppUi; //uses
       
   117         TBool                       iHiddenReset;
       
   118         TInt                        iVolume;
       
   119         TBool                       iStartupWaitingForTone;
       
   120 	};
       
   121 
       
   122 #endif // __STARTUPTONE_H__
       
   123 
       
   124 // End of File