javauis/nokiasound_akn/inc/CMIDTone.h
branchRCL_3
changeset 83 26b2b12093af
parent 19 04becd199f91
equal deleted inserted replaced
77:7cee158cb8cd 83:26b2b12093af
       
     1 /*
       
     2 * Copyright (c) 2006-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:  This class implements beep playing and OTA ringingtone playing.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMIDTONE_H
       
    20 #define CMIDTONE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <mdaaudiotoneplayer.h>
       
    25 
       
    26 #include "CMIDSoundImpl.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MMIDEventSender;
       
    30 
       
    31 //  CLASS DEFINITION
       
    32 /**
       
    33  *  This class implements beep playing and OTA ringingtone playing.
       
    34  *
       
    35  */
       
    36 NONSHARABLE_CLASS(CMIDTone): public CMIDSoundImpl, public MMdaAudioToneObserver
       
    37 {
       
    38 public:
       
    39 
       
    40     static CMIDTone* NewL(TInt aFreq, TInt64 aDuration,
       
    41     MMIDEventSender* aEventSender);
       
    42     static CMIDTone* NewL(const TDesC8& aData, MMIDEventSender* aEventSender);
       
    43     //   Destructor
       
    44     ~CMIDTone();
       
    45 
       
    46 protected:
       
    47 
       
    48     //   C++  constructor
       
    49     CMIDTone(MMIDEventSender* aEventSender);
       
    50     //   Second phase
       
    51     void ConstructL(TInt aFreq, TInt64 aDuration);
       
    52     void ConstructL(const TDesC8& aData);
       
    53 
       
    54 public:
       
    55 
       
    56     virtual TInt Play(TInt aLoop);
       
    57     virtual void Stop();
       
    58     virtual void SetVolume(TInt aVolume);
       
    59     virtual TInt Volume();
       
    60     virtual void Release();
       
    61 
       
    62 public: // from MMdaAudioToneObserver
       
    63 
       
    64     void MatoPrepareComplete(TInt aError);
       
    65     void MatoPlayComplete(TInt aError);
       
    66 
       
    67 private:
       
    68 
       
    69     TInt iFreq;
       
    70     TInt64 iDuration;
       
    71     CMdaAudioToneUtility* iMdaAudioToneUtility;
       
    72 };
       
    73 
       
    74 #endif // CMIDTONE_H