mmserv/sts/inc/stsplayer.h
changeset 14 80975da52420
child 16 43d09473c595
equal deleted inserted replaced
12:5a06f39ad45b 14:80975da52420
       
     1 /*
       
     2  * Copyright (c) 2010 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 file defines the interface for creating, playing,
       
    16  * stopping, and deleting an MMF player for a tone type.
       
    17  */
       
    18 #ifndef STSPLAYER_H_
       
    19 #define STSPLAYER_H_
       
    20 
       
    21 #include <MdaAudioSamplePlayer.h>
       
    22 #include <systemtoneservice.h>
       
    23 
       
    24 class MStsPlayerObserver
       
    25     {
       
    26 public:
       
    27     virtual void PlayToneComplete(unsigned int aPlayToneContext) = 0;
       
    28     };
       
    29 
       
    30 class CStsPlayer : private MMdaAudioPlayerCallback
       
    31     {
       
    32 public:
       
    33     static CStsPlayer* Create(MStsPlayerObserver& aObserver,
       
    34             CSystemToneService::TToneType aToneType, unsigned int aPlayToneContext);
       
    35     virtual ~CStsPlayer();
       
    36     void Play();
       
    37     void Stop();
       
    38 
       
    39 protected:
       
    40     CStsPlayer(MStsPlayerObserver& aObserver, const TDesC& aFileName,
       
    41             int aRepeatNumberOfTimes, unsigned int aPlayToneContext);
       
    42     bool Init();
       
    43 
       
    44 private:
       
    45     void MapcInitComplete(TInt aError,
       
    46             const TTimeIntervalMicroSeconds& aDuration);
       
    47     void MapcPlayComplete(TInt aError);
       
    48 
       
    49     MStsPlayerObserver& iObserver;
       
    50     CMdaAudioPlayerUtility* iPlayer;
       
    51     TPtrC iFileName;
       
    52     int iRepeatNumberOfTimes;
       
    53     unsigned int iPlayToneContext;
       
    54     };
       
    55 
       
    56 #endif // STSPLAYER_H_