mpengine/src/mpaudioeffectsframeworkwrapper_p.cpp
changeset 29 8192e5b5c935
equal deleted inserted replaced
25:3ec52facab4d 29:8192e5b5c935
       
     1 /*
       
     2 * Copyright (c) 2009 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: Framework wraper for Audio Effects - Private.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "mpaudioeffectsframeworkwrapper_p.h"
       
    19 #include "mpxaudioeffectproperties.h"
       
    20 #include "mpcommondefs.h"
       
    21 #include "mptrace.h"
       
    22 
       
    23 /*!
       
    24     \class MpAudioEffectsFrameworkWrapperPrivate
       
    25     \brief Wrapper for audio effects framework utilities - private implementation.
       
    26 
       
    27     This is a private implementation of the audio effects framework wrapper utilties interface.
       
    28 */
       
    29 
       
    30 /*!
       
    31  \internal
       
    32  */
       
    33 MpAudioEffectsFrameworkWrapperPrivate::MpAudioEffectsFrameworkWrapperPrivate()
       
    34     :mAudioEffectProperties( new CMPXAudioEffectProperties() )
       
    35 {
       
    36 }
       
    37 
       
    38 /*!
       
    39  \internal
       
    40  */
       
    41 MpAudioEffectsFrameworkWrapperPrivate::~MpAudioEffectsFrameworkWrapperPrivate()
       
    42 {
       
    43     delete mAudioEffectProperties;
       
    44 }
       
    45 
       
    46 /*!
       
    47  \internal
       
    48  */
       
    49 void MpAudioEffectsFrameworkWrapperPrivate::init()
       
    50 {
       
    51     TRAPD( err, doInitL() );
       
    52     if ( err != KErrNone ) {
       
    53         mAudioEffectProperties->Reset();
       
    54     }
       
    55 }
       
    56 
       
    57 /*!
       
    58  \internal
       
    59  */
       
    60 void MpAudioEffectsFrameworkWrapperPrivate::setBalance( int balance )
       
    61 {
       
    62     mAudioEffectProperties->SetBalance( balance );
       
    63     saveToFile();
       
    64 }
       
    65 
       
    66 /*!
       
    67  \internal
       
    68  */
       
    69 void MpAudioEffectsFrameworkWrapperPrivate::setLoudness( bool mode )
       
    70 {
       
    71     mAudioEffectProperties->SetLoudness( mode );
       
    72     saveToFile();
       
    73 }
       
    74 
       
    75 /*!
       
    76  \internal
       
    77  */
       
    78 int MpAudioEffectsFrameworkWrapperPrivate::balance()
       
    79 {
       
    80     return mAudioEffectProperties->Balance();
       
    81 }
       
    82 
       
    83 /*!
       
    84  \internal
       
    85  */
       
    86 bool MpAudioEffectsFrameworkWrapperPrivate::loudness()
       
    87 {
       
    88     return mAudioEffectProperties->Loudness();
       
    89 }
       
    90 
       
    91 /*!
       
    92  \internal
       
    93  */
       
    94 void MpAudioEffectsFrameworkWrapperPrivate::saveToFile()
       
    95 {
       
    96     TRAPD( err, mAudioEffectProperties->SaveToFileL() );
       
    97     if ( err != KErrNone ) {
       
    98         TX_LOG_ARGS( "Error: " << err << "; should never get here." );
       
    99     }
       
   100 }
       
   101 
       
   102 /*!
       
   103  \internal
       
   104  */
       
   105 void MpAudioEffectsFrameworkWrapperPrivate::doInitL()
       
   106 {
       
   107     mAudioEffectProperties->LoadFromFileL();
       
   108 }
       
   109