mmserv/audioeffectsui/equalizer/src/EqualizerEditingDialog.cpp
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2005 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:    Defines functionality related to Equalizer Settings Dialog
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21  
       
    22 #include <bautils.h>
       
    23 #include <aknenv.h>      
       
    24 #include <avkon.hrh>
       
    25 #include <e32cmn.h>
       
    26 #include <data_caging_path_literals.hrh>
       
    27 //LAF and Skin changes 
       
    28 #include <aknlayout.cdl.h>
       
    29 #include <aknlayoutscalable_apps.cdl.h>
       
    30 #include <AknLayout2ScalableDef.h>
       
    31 #include <AknLayout2Def.h>
       
    32 #include <AknUtils.h>
       
    33 #include <bldvariant.hrh>
       
    34 #include <featmgr.h>
       
    35 #include <AudioEqualizerUtility.h>
       
    36 #include <hlplch.h>
       
    37 #include <StringLoader.h>
       
    38 #include <akntitle.h> 
       
    39 #include <aknnotewrappers.h>
       
    40 
       
    41 #include <Equalizer.rsg>
       
    42 #include "EqualizerPrivateConstants.h"
       
    43 #include <csxhelp/eq.hlp.hrh>
       
    44 #include "EqualizerEditingDialog.h"
       
    45 #include "EqualizerFreqBandContainer.h"       
       
    46 #include "Equalizer.hrh"
       
    47 
       
    48 // ============================ MEMBER FUNCTIONS =============================
       
    49 
       
    50 // -------------------------------------------------------------------
       
    51 // CEqualizerEditingDialog* CEqualizerEditingDialog::NewL(
       
    52 // CAudioEqualizerUtility& aAudEqUtility, 
       
    53 // const TInt aPresetIndex, TRect& aRect, const TBool aIsActivePreset)
       
    54 // Create instance of concrete ECOM interface implementation
       
    55 // -------------------------------------------------------------------
       
    56 // 
       
    57 CEqualizerEditingDialog* CEqualizerEditingDialog::NewL(
       
    58 CAudioEqualizerUtility* aAudEqUtility, const TInt aPresetIndex,
       
    59  TRect& aRect, const TBool aIsActivePreset,
       
    60  MEqualizerPresetActivationObserver& aObserver,
       
    61  TInt aPresetKey)
       
    62     {
       
    63     CEqualizerEditingDialog* self = new (ELeave) CEqualizerEditingDialog(
       
    64         aAudEqUtility, aPresetIndex, aRect, aIsActivePreset, aObserver,
       
    65         aPresetKey);
       
    66     CleanupStack::PushL(self); 
       
    67     self->ConstructL();
       
    68     CleanupStack::Pop(self); 
       
    69     return self;
       
    70     }
       
    71 
       
    72 // -------------------------------------------------------------------
       
    73 // CEqualizerEditingDialog::ConstructL()
       
    74 // Second Phase Constructor
       
    75 // -------------------------------------------------------------------
       
    76 // 
       
    77 void CEqualizerEditingDialog::ConstructL()
       
    78     {
       
    79     //Initially set these variable to EFalse
       
    80     iIgnoreKeyEvents = EFalse;
       
    81     iContextSensitiveMenu = EFalse;
       
    82 
       
    83     iPresetName = iAudEqUtility->GetPresetL(iPresetIndex);
       
    84     CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
       
    85     iNumberOfFreqBands = audioEqualizer.NumberOfBands();
       
    86     iMover=new(ELeave)CArrayFixSeg<TInt>(KEqualizerArrayGranularity);
       
    87 
       
    88     iFreqBandRect = RArray<TRect>(iNumberOfFreqBands);
       
    89     iScaleRect = RArray<TRect>(iNumberOfFreqBands);
       
    90     iBackgroundRect = RArray<TRect>(iNumberOfFreqBands);
       
    91     iSliderRect = RArray<TRect>(iNumberOfFreqBands);
       
    92     GetLayoutRect();
       
    93 
       
    94     // Find which drive this DLL is installed.
       
    95     TFileName fileName;
       
    96 
       
    97     // Get the full resource file
       
    98     TParse fp;
       
    99 
       
   100     // Add the resource dir
       
   101     fp.Set( KEqualizerResourceFileName, &KDC_APP_RESOURCE_DIR, NULL);
       
   102     // Get the filename with full path
       
   103     fileName = fp.FullName();
       
   104     //for localisation of resource file
       
   105     BaflUtils::NearestLanguageFile( iEikonEnv->FsSession(), fileName );
       
   106     iResourceFileOffset = iEikonEnv->AddResourceFileL( fileName );
       
   107     CAknDialog::ConstructL(R_EQUALIZER_SETTINGS_MENUBAR);
       
   108     }
       
   109 
       
   110 // ---------------------------------------------------------------------
       
   111 // CEqualizerEditingDialog::CEqualizerEditingDialog
       
   112 // (CAudioEqualizerUtility* aAudEqUtility, TInt aPresetIndex, 
       
   113 // TRect& aRect, const TBool aIsActivePreset)
       
   114 // First phase constructor
       
   115 // ---------------------------------------------------------------------
       
   116 // 
       
   117 CEqualizerEditingDialog::CEqualizerEditingDialog(CAudioEqualizerUtility*
       
   118 aAudEqUtility, const TInt aPresetIndex, TRect& aRect, 
       
   119 const TBool aIsActivePreset, MEqualizerPresetActivationObserver& aObserver,
       
   120 TInt aPresetKey ): 
       
   121 iAudEqUtility(aAudEqUtility), 
       
   122 iPresetIndex(aPresetIndex), iRect(aRect), 
       
   123 iIsActivePreset(aIsActivePreset),
       
   124 iObserver( aObserver ), iPresetKey( aPresetKey )
       
   125     {
       
   126     }
       
   127 
       
   128 // --------------------------------------------------------------------
       
   129 // CEqualizerEditingDialog::~CEqualizerEditingDialog()
       
   130 // Destructor
       
   131 // --------------------------------------------------------------------
       
   132 // 
       
   133 CEqualizerEditingDialog::~CEqualizerEditingDialog()
       
   134     {
       
   135     if (iResourceFileOffset)
       
   136         {
       
   137         iEikonEnv->DeleteResourceFile(iResourceFileOffset);      
       
   138         }
       
   139     
       
   140     if (iMover)
       
   141         {
       
   142         iMover->Reset();
       
   143         delete iMover;
       
   144         }
       
   145      
       
   146     iFreqBandRect.Close();
       
   147     iScaleRect.Close();
       
   148     iBackgroundRect.Close();
       
   149     iSliderRect.Close();
       
   150     }
       
   151 
       
   152 // --------------------------------------------------------------------
       
   153 // SEikControlInfo CEqualizerEditingDialog::
       
   154 // CreateCustomControlL  (  TInt  aControlType   )
       
   155 // This function is called by the framework to create a custom control
       
   156 // inside the dialog
       
   157 // --------------------------------------------------------------------
       
   158 // 
       
   159 SEikControlInfo CEqualizerEditingDialog::CreateCustomControlL  (  TInt 
       
   160  aControlType   ) 
       
   161     {
       
   162     SEikControlInfo controlInfo;
       
   163     controlInfo.iControl = NULL;
       
   164     controlInfo.iTrailerTextId = 0;
       
   165     controlInfo.iFlags = 0;
       
   166 
       
   167     SetMoverPositionsL(EFalse);      
       
   168    
       
   169     switch ( aControlType)
       
   170         {
       
   171         case EEqualizerCustomCtrlDlgCtCustomControl:
       
   172             controlInfo.iControl = new(ELeave) CEqualizerFreqBandContainer
       
   173             (this, iAudEqUtility, iPresetIndex, iIsActivePreset, 
       
   174              iRect, iObserver, iPresetKey, iPresetName); 
       
   175              
       
   176             iFreqBandContainer = (CEqualizerFreqBandContainer*)
       
   177                                         controlInfo.iControl; 
       
   178             break;
       
   179         default:
       
   180             break;
       
   181         }
       
   182     
       
   183     return controlInfo;
       
   184     }
       
   185 
       
   186 // -------------------------------------------------------------------
       
   187 // void CEqualizerEditingDialog::SizeChanged()
       
   188 //
       
   189 // This function is called by the framework whenever the control size 
       
   190 // is changed
       
   191 // --------------------------------------------------------------------
       
   192 //
       
   193 void CEqualizerEditingDialog::SizeChanged()
       
   194     {
       
   195     CAknDialog::SizeChanged();    
       
   196     iRect = Rect();
       
   197 	GetLayoutRect();
       
   198     CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
       
   199     iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, audioEqualizer); 
       
   200 	iMover->Reset();
       
   201 	SetMoverPositionsL(EFalse);
       
   202     }
       
   203 
       
   204 // -------------------------------------------------------------------
       
   205 // void CEqualizerEditingDialog::GetLayoutRect()
       
   206 //
       
   207 // This function is called to retrive the freqband rect, scale rect
       
   208 // slider rect from the layout
       
   209 // --------------------------------------------------------------------
       
   210 //
       
   211 void CEqualizerEditingDialog::GetLayoutRect()
       
   212 	{
       
   213 	iFreqBandRect.Reset();
       
   214 	iScaleRect.Reset();
       
   215 	iBackgroundRect.Reset();
       
   216 	iSliderRect.Reset();
       
   217 	
       
   218 	TInt variety = EEqualizerVarietyOne;
       
   219         
       
   220 	if(iNumberOfFreqBands == KEqualizerFiveBands)
       
   221 		variety = EEqualizerVarietyTwo;
       
   222 	
       
   223 	for(TInt count = 0; count < iNumberOfFreqBands; count++)
       
   224 		{
       
   225 		iFreqBandRect.Append(CEqualizerFreqBand::ComponentRect(
       
   226 			iRect,variety+2,count));
       
   227 		iScaleRect.Append(CEqualizerFreqBand::ComponentRect(
       
   228 			iFreqBandRect[count],variety,EEqualizerScale));
       
   229 		iBackgroundRect.Append(CEqualizerFreqBand::ComponentRect(
       
   230 			iScaleRect[count],EEqualizerVarietyNotUsed,EEqualizerBackground));
       
   231 		iSliderRect.Append(CEqualizerFreqBand::ComponentRect(
       
   232 			iScaleRect[count],EEqualizerVarietyNotUsed,EEqualizerSlider));
       
   233 		}
       
   234 	}
       
   235 
       
   236 // --------------------------------------------------------------------
       
   237 // void CEqualizerEditingDialog::SetMoverPositionsL(TBool aReset)
       
   238 // This function is used to read the positions of the mover for the 
       
   239 // various bands from the engine.
       
   240 // --------------------------------------------------------------------
       
   241 // 
       
   242 void CEqualizerEditingDialog::SetMoverPositionsL(TBool aReset)
       
   243     {
       
   244     //Calulate change in db level
       
   245     TInt32 minBandLevel;
       
   246     TInt32 maxBandLevel;
       
   247     iAudEqUtility->GetPresetL(iPresetIndex);
       
   248     CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
       
   249 
       
   250     audioEqualizer.DbLevelLimits(minBandLevel, maxBandLevel);
       
   251 
       
   252     //The minimum band level should always be negative and the
       
   253     // maximum band level should always be positive.
       
   254     if (( minBandLevel > 0 ) || (maxBandLevel < 0))
       
   255         {
       
   256         User::Leave(KErrNotSupported);
       
   257         }
       
   258 
       
   259     for (TInt i =0; i<iNumberOfFreqBands; i++)
       
   260         {
       
   261 	    TInt scaleHeight = iBackgroundRect[i].Height();
       
   262 	    TInt scaleZeroPos = (iBackgroundRect[i].iTl.iY) + (scaleHeight / 2);
       
   263 
       
   264 		TInt halfSliderSize = iSliderRect[i].Height() / 2;
       
   265 		TInt sliderInc = iBackgroundRect[i].Height() / KNumberOfSteps;
       
   266 		TInt diffUIBandLevel = KNumberOfSteps / 2;
       
   267 
       
   268         TInt curBandlevel = audioEqualizer.BandLevel(i+1);
       
   269         
       
   270         
       
   271         __ASSERT_DEBUG((curBandlevel >= minBandLevel) ||
       
   272                          (curBandlevel <= maxBandLevel), User::Invariant());
       
   273         if ((curBandlevel < minBandLevel) || (curBandlevel > maxBandLevel))
       
   274             {
       
   275             curBandlevel = 0; //Band level is invalid, use zero instead.
       
   276             }
       
   277         
       
   278         if (curBandlevel > 0)
       
   279             {
       
   280             TReal frac = (TReal)curBandlevel / maxBandLevel;
       
   281             TInt moverPos = (TInt) (scaleZeroPos - (frac * 
       
   282             								diffUIBandLevel * sliderInc));
       
   283             if((moverPos < (iBackgroundRect[i].iTl.iY + halfSliderSize)) ||
       
   284             			((scaleZeroPos - moverPos) >= (diffUIBandLevel * sliderInc)))
       
   285             	{
       
   286             	moverPos = iBackgroundRect[i].iTl.iY + halfSliderSize;
       
   287             	}
       
   288 
       
   289             if (aReset)
       
   290                 {
       
   291                 (*iMover)[i] = moverPos;    
       
   292                 }
       
   293             else
       
   294                 {
       
   295                 iMover->AppendL(moverPos);    
       
   296                 }
       
   297             }
       
   298         else if (curBandlevel < 0)
       
   299             {
       
   300             TReal frac = (TReal)curBandlevel / minBandLevel;
       
   301             TInt moverPos = (TInt) (scaleZeroPos + (frac * 
       
   302             								diffUIBandLevel * sliderInc));
       
   303             if((moverPos > ((iBackgroundRect[i].iBr.iY ) - halfSliderSize)) ||
       
   304             		((moverPos - scaleZeroPos) >= (diffUIBandLevel * sliderInc)))
       
   305             	{
       
   306             	moverPos = (iBackgroundRect[i].iBr.iY ) - halfSliderSize;
       
   307             	}
       
   308 
       
   309             if (aReset)
       
   310                 {
       
   311                 (*iMover)[i] = moverPos;    
       
   312                 }
       
   313             else
       
   314                 {
       
   315                 iMover->AppendL(moverPos);    
       
   316                 }
       
   317             }
       
   318         else
       
   319             {
       
   320             if (aReset)
       
   321                 {
       
   322                 (*iMover)[i] = scaleZeroPos;    
       
   323                 }
       
   324             else
       
   325                 {
       
   326                 iMover->AppendL(scaleZeroPos);    
       
   327                 }
       
   328             }   
       
   329         }
       
   330     }
       
   331 
       
   332 // ---------------------------------------------------------
       
   333 // CEqualizerEditingDialog::OfferKeyEventL(
       
   334 //     const TKeyEvent& aKeyEvent,TEventCode aType)
       
   335 // This function is used to handle key events
       
   336 // ---------------------------------------------------------
       
   337 //
       
   338 TKeyResponse CEqualizerEditingDialog::OfferKeyEventL(
       
   339     const TKeyEvent& aKeyEvent,
       
   340     TEventCode aType )
       
   341     { 
       
   342     if (iIgnoreKeyEvents)
       
   343         {
       
   344         return EKeyWasNotConsumed;
       
   345         }
       
   346     else
       
   347         {
       
   348         return CAknDialog::OfferKeyEventL( aKeyEvent, aType );        
       
   349         }
       
   350     }
       
   351 
       
   352 // -------------------------------------------------------------------
       
   353 // void CEqualizerEditingDialog::ProcessCommandL(TInt aCommandId)
       
   354 // This function is called by the framework to handle the user's
       
   355 // menubar command options
       
   356 // --------------------------------------------------------------------
       
   357 // 
       
   358 void CEqualizerEditingDialog::ProcessCommandL(TInt aCommandId)
       
   359     {
       
   360     // Need to do this in all cases or menu does not disappear after
       
   361     // a selection is made
       
   362     CAknDialog::ProcessCommandL(aCommandId);
       
   363     
       
   364     switch(aCommandId)
       
   365         {
       
   366         case EAknCmdExit :
       
   367         case EEikCmdExit :
       
   368             {
       
   369             CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
       
   370 			iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, audioEqualizer);
       
   371             iAvkonAppUi->HandleCommandL( aCommandId );
       
   372             break;
       
   373             }
       
   374 
       
   375         case EEqualizerCmdHelp: 
       
   376             {
       
   377             HlpLauncher::LaunchHelpApplicationL
       
   378                 ( iEikonEnv->WsSession(),
       
   379                  CEikonEnv::Static()->AppUi()->AppHelpContextL() );
       
   380             break;
       
   381             }
       
   382 
       
   383         case EEqualizerCmdReset:
       
   384             {
       
   385             iAudEqUtility->GetPresetL(iPresetIndex);
       
   386             CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
       
   387  
       
   388             if (iPresetIndex < iAudEqUtility->NumberOfPreDefinedPresets())
       
   389                  {
       
   390                  //Predefined preset
       
   391                  iAudEqUtility->ResetPresetL(iPresetIndex);     
       
   392                  SetMoverPositionsL(ETrue);
       
   393                  }
       
   394              else
       
   395                  {
       
   396                  //User defined preset, Reset manually
       
   397                  for (TInt i =0; i<iNumberOfFreqBands; i++)
       
   398                      {
       
   399 					 TInt scaleHeight = iBackgroundRect[i].Height();
       
   400 				     TInt scaleZeroPos = (iBackgroundRect[i].iTl.iY) 
       
   401 				     									+ (scaleHeight / 2);
       
   402 				     (*iMover)[i] = scaleZeroPos;
       
   403                      audioEqualizer.SetBandLevelL(i+1, 0);
       
   404                      }
       
   405                  iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, 
       
   406                    audioEqualizer);    
       
   407                  }
       
   408 
       
   409              if (iIsActivePreset)
       
   410                  {
       
   411                  TRAP_IGNORE(iAudEqUtility->ApplyPresetL(iPresetIndex));
       
   412                  }
       
   413              
       
   414              // In MPX, we need to callback to observer when a preset is changed
       
   415              if( iIsActivePreset )
       
   416                  {
       
   417                  iObserver.HandlePresetActivation( iPresetKey );
       
   418                  }
       
   419     		 iFreqBandContainer->SetRect(iRect);
       
   420              DrawNow();
       
   421              break;
       
   422              }
       
   423               
       
   424         default:
       
   425             {
       
   426             break;
       
   427             }
       
   428         }
       
   429     }
       
   430 
       
   431 // -------------------------------------------------------------------
       
   432 // void CEqualizerEditingDialog::GetHelpContext( 
       
   433 //            TCoeHelpContext& aContext ) const
       
   434 // Get help context for the control
       
   435 // --------------------------------------------------------------------
       
   436 //         
       
   437 void CEqualizerEditingDialog::GetHelpContext( 
       
   438             TCoeHelpContext& aContext ) const
       
   439     {
       
   440     aContext.iMajor = KUidEqualizer;
       
   441     aContext.iContext = KEQ_HLP_EDITING_VIEW;
       
   442     }
       
   443 
       
   444 // ---------------------------------------------------------------------------
       
   445 // CEqualizerEditingDialog::DynInitMenuPaneL(
       
   446 //                              TInt aResourceId,CEikMenuPane* aMenuPane)
       
   447 //  This function is called by the EIKON framework just before it displays
       
   448 //  a menu pane. Its default implementation is empty, and by overriding it,
       
   449 //  the application can set the state of menu items dynamically according
       
   450 //  to the state of application data.
       
   451 // ---------------------------------------------------------------------------
       
   452 //
       
   453 void CEqualizerEditingDialog::DynInitMenuPaneL(
       
   454                         TInt aResourceId, CEikMenuPane* aMenuPane)
       
   455     {
       
   456     if ( aResourceId == R_EQUALIZER_SETTINGS_MENU)
       
   457         {
       
   458         iMenuBar->SetMenuType(CEikMenuBar::EMenuOptions);
       
   459         // Help should be displayed only if the feature is supported
       
   460         // according to Feature Manager
       
   461         if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
       
   462             {
       
   463             aMenuPane->SetItemDimmed(EEqualizerCmdHelp, ETrue);
       
   464             }
       
   465             
       
   466         if(iContextSensitiveMenu)
       
   467         	{
       
   468         	iMenuBar->SetMenuType(CEikMenuBar::EMenuContext);
       
   469           	aMenuPane->SetItemDimmed(EAknCmdExit, ETrue);
       
   470           	aMenuPane->SetItemDimmed(EEqualizerCmdHelp, ETrue);
       
   471 			iContextSensitiveMenu = EFalse;
       
   472         	}
       
   473         }
       
   474     }
       
   475 
       
   476 // ----------------------------------------------------------------------------
       
   477 // CEqualizerEditingDialog::SetAudioEqualizerL(CAudioEqualizerUtility* 
       
   478 // aAudEqUtility)
       
   479 // This function is used to set a new CAudioEqualizerUtility* 
       
   480 // ----------------------------------------------------------------------------
       
   481 //    
       
   482 void CEqualizerEditingDialog::SetAudioEqualizerL(
       
   483 CAudioEqualizerUtility* aAudEqUtility)
       
   484 	{
       
   485 	iAudEqUtility=aAudEqUtility;
       
   486 	if (iAudEqUtility)
       
   487 	    {
       
   488 	    iIgnoreKeyEvents = EFalse;
       
   489 	    iFreqBandContainer->SetAudioEqualizerL(aAudEqUtility);
       
   490 	    }
       
   491 	else
       
   492 	    {
       
   493 	    iIgnoreKeyEvents = ETrue; 
       
   494 	    }
       
   495 	}
       
   496 	
       
   497 // -------------------------------------------------------------------
       
   498 // TInt CEqualizerEditingDialog::ExecuteLD()
       
   499 // This function is called to execute and delete the dialog
       
   500 // --------------------------------------------------------------------
       
   501 // 
       
   502 TInt CEqualizerEditingDialog::ExecuteLD()
       
   503     {
       
   504     return CAknDialog::ExecuteLD(R_EQUALIZER_EDITING_DIALOG);
       
   505     }                    
       
   506 
       
   507 // -------------------------------------------------------------------
       
   508 // TBool CEqualizerEditingDialog::OkToExitL(TInt aButtonId)
       
   509 // This function is called when the OK key is pressed
       
   510 // --------------------------------------------------------------------
       
   511 // 
       
   512 TBool CEqualizerEditingDialog::OkToExitL(TInt aButtonId)
       
   513     {
       
   514     TBool ret = EFalse;
       
   515     if (aButtonId == EEikBidOk)
       
   516         {
       
   517         ret = EFalse;
       
   518         }
       
   519     else if (aButtonId == EAknSoftkeyBack) 
       
   520         {
       
   521         CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
       
   522         iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, audioEqualizer);
       
   523         
       
   524         HBufC* iTitleText = StringLoader::LoadLC(R_QTN_EQUALIZER_TITLE_TEXT);
       
   525         CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
       
   526         CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
       
   527         tp->SetTextL(*iTitleText);
       
   528         CleanupStack::PopAndDestroy(iTitleText);
       
   529     
       
   530     	ret = CAknDialog::OkToExitL( aButtonId ); 
       
   531         }        
       
   532     else if(aButtonId == EAknSoftkeyContextOptions)
       
   533         {
       
   534         iContextSensitiveMenu = ETrue;
       
   535     	 DisplayMenuL();
       
   536         }
       
   537     else 
       
   538         {
       
   539         ret = CAknDialog::OkToExitL( aButtonId );        
       
   540         }   
       
   541     return ret;
       
   542     } 
       
   543     
       
   544 // -------------------------------------------------------------------
       
   545 // TInt CEqualizerEditingDialog::GetMoverPosition(TInt aBandIndex)
       
   546 // This function returns the current mover position for each frequency band
       
   547 // --------------------------------------------------------------------
       
   548 // 
       
   549 TInt CEqualizerEditingDialog::GetMoverPosition(TInt aBandIndex)
       
   550 {
       
   551 	return (*iMover)[aBandIndex];
       
   552 }
       
   553 
       
   554 // End of File