mmserv/sts/sts/src/stsplayersettings.cpp
changeset 47 c2e43643db4c
equal deleted inserted replaced
42:1fa3fb47b1e3 47:c2e43643db4c
       
     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 provides the implementation for creating and deleting a
       
    16  * an MMF based player for playing and stopping a tone playback.
       
    17  */
       
    18 
       
    19 //  Include Files  
       
    20 #include "stsplayersettings.h"
       
    21 _LIT(KDefaultFile,"z:\\data\\sounds\\digital\\clock.aac");
       
    22 
       
    23 CStsPlayerSettings::CStsPlayerSettings() :
       
    24     iFileName(0), iNumberOfRepeats(0), iRepeatDelay(0),
       
    25             iVolumePercentage(50), iVolumeRamp(0)
       
    26     {
       
    27     TBufC<40> defaultFile(KDefaultFile); 
       
    28     iFileName = defaultFile.AllocL();
       
    29     }
       
    30 
       
    31 CStsPlayerSettings::~CStsPlayerSettings()
       
    32     {
       
    33     delete iFileName;
       
    34     }
       
    35 
       
    36 TPtrC CStsPlayerSettings::GetFileName()
       
    37     {
       
    38     return iFileName->Des();
       
    39     }
       
    40 
       
    41 int CStsPlayerSettings::GetNumberOfRepeats()
       
    42     {
       
    43     return iNumberOfRepeats;
       
    44     }
       
    45 
       
    46 TTimeIntervalMicroSeconds& CStsPlayerSettings::GetRepeatDelay()
       
    47     {
       
    48     return iRepeatDelay;
       
    49     }
       
    50 
       
    51 int CStsPlayerSettings::GetVolumePercentage()
       
    52     {
       
    53     return iVolumePercentage;
       
    54     }
       
    55 
       
    56 TTimeIntervalMicroSeconds& CStsPlayerSettings::GetVolumeRamp()
       
    57     {
       
    58     return iVolumeRamp;
       
    59     }
       
    60 
       
    61 void CStsPlayerSettings::SetFileName(const TDesC& aFileName)
       
    62     {
       
    63     delete iFileName;
       
    64     iFileName = aFileName.AllocL();
       
    65     }
       
    66 
       
    67 void CStsPlayerSettings::SetNumberOfRepeats(int aNumberOfRepeats)
       
    68     {
       
    69     iNumberOfRepeats = aNumberOfRepeats;
       
    70     }
       
    71 
       
    72 void CStsPlayerSettings::SetRepeatDelay(
       
    73         TTimeIntervalMicroSeconds aRepeatDelay)
       
    74     {
       
    75     iRepeatDelay = aRepeatDelay;
       
    76     }
       
    77 
       
    78 void CStsPlayerSettings::SetVolumePercentage(int aVolumePercentage)
       
    79     {
       
    80     iVolumePercentage = aVolumePercentage;
       
    81     }
       
    82 
       
    83 void CStsPlayerSettings::SetVolumeRamp(TTimeIntervalMicroSeconds aVolumeRamp)
       
    84     {
       
    85     iVolumeRamp = aVolumeRamp;
       
    86     }