mmserv/sts/inc/stsplayer.h
changeset 20 b67dd1fc57c5
parent 19 4a629bc82c5e
child 21 2ed61feeead6
equal deleted inserted replaced
19:4a629bc82c5e 20:b67dd1fc57c5
     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 PlayComplete(unsigned int aContext) = 0;
       
    28     };
       
    29 
       
    30 class CStsPlayer : private MMdaAudioPlayerCallback
       
    31     {
       
    32 public:
       
    33     static CStsPlayer* CreateTonePlayer(MStsPlayerObserver& aObserver,
       
    34             CSystemToneService::TToneType aTone, unsigned int aContext);
       
    35     static CStsPlayer* CreateAlarmPlayer(MStsPlayerObserver& aObserver,
       
    36             CSystemToneService::TAlarmType aAlarm, unsigned int aContext);
       
    37     virtual ~CStsPlayer();
       
    38     void Play();
       
    39     void Stop();
       
    40 
       
    41 protected:
       
    42     CStsPlayer(MStsPlayerObserver& aObserver, const TDesC& aFileName,
       
    43             int aRepeatNumberOfTimes, unsigned int aContext);
       
    44     bool Init();
       
    45 
       
    46 private:
       
    47     void MapcInitComplete(TInt aError,
       
    48             const TTimeIntervalMicroSeconds& aDuration);
       
    49     void MapcPlayComplete(TInt aError);
       
    50 
       
    51     MStsPlayerObserver& iObserver;
       
    52     CMdaAudioPlayerUtility* iPlayer;
       
    53     TPtrC iFileName;
       
    54     int iRepeatNumberOfTimes;
       
    55     unsigned int iContext;
       
    56     };
       
    57 
       
    58 #endif // STSPLAYER_H_