fmradio/fmradio/src/fmradioscanlocalstationsview.cpp
branchRCL_3
changeset 11 97dcae98e602
parent 7 95ac6b0f7f5b
child 15 04aa446da81c
equal deleted inserted replaced
9:0004e923f486 11:97dcae98e602
   820         // then start the whole scan
   820         // then start the whole scan
   821         if ( iScanAndSaveActivated )
   821         if ( iScanAndSaveActivated )
   822             {
   822             {
   823             AppUi()->HandleCommandL( EFMRadioCmdScanLocalStationsScan );
   823             AppUi()->HandleCommandL( EFMRadioCmdScanLocalStationsScan );
   824             }
   824             }
       
   825         else
       
   826             {
       
   827             iRadioEngine.SetMuteOn( EFalse );
       
   828             }
   825         }
   829         }
   826     else if ( iScanAndSaveActivated )
   830     else if ( iScanAndSaveActivated )
   827         {
   831         {
   828         // No channels found or user has canceled search before any channels are found
   832         // No channels found or user has canceled search before any channels are found
   829         if ( iRadioEngine.GetTunedFrequency() == iLowerFrequencyBound &&
   833         if ( iRadioEngine.GetTunedFrequency() == iLowerFrequencyBound &&
   844                     }
   848                     }
   845 
   849 
   846                 iScanAndSaveActivated = EFalse;
   850                 iScanAndSaveActivated = EFalse;
   847 
   851 
   848                 RemoveScanningInProgressNoteL();
   852                 RemoveScanningInProgressNoteL();
   849                 RestoreRadio( EFalse );
   853                 RestoreRadio();
   850                 appUi->AutoTuneInMainView(ETrue);
   854                 appUi->AutoTuneInMainView(ETrue);
   851                 
   855                 
   852                 ActivateMainViewL();
   856                 ActivateMainViewL();
   853                 }
   857                 }
   854             else
   858             else
   888                 iScannedChannels.Count() == 0 )
   892                 iScannedChannels.Count() == 0 )
   889             {
   893             {
   890             restoreFrequency = ETrue;
   894             restoreFrequency = ETrue;
   891             }
   895             }
   892         UpdateToolbar();
   896         UpdateToolbar();
   893         RestoreRadio( restoreFrequency, EFalse );
   897         RestoreRadio( restoreFrequency );
   894         
   898         
   895         // update now playing index if the tuning is triggered from accessory 
   899         // update now playing index if the tuning is triggered from accessory 
   896         TInt frequencyIndex = FrequencyIndex( tunedFrequency );
   900         TInt frequencyIndex = FrequencyIndex( tunedFrequency );
   897         
   901         
   898         if ( frequencyIndex != KErrNotFound )
   902         if ( frequencyIndex != KErrNotFound )
   910 // -----------------------------------------------------------------------------------------------
   914 // -----------------------------------------------------------------------------------------------
   911 // CFMRadioScanLocalStationsView::RestoreRadio
   915 // CFMRadioScanLocalStationsView::RestoreRadio
   912 // Restores the radio after scanning
   916 // Restores the radio after scanning
   913 // -----------------------------------------------------------------------------------------------
   917 // -----------------------------------------------------------------------------------------------
   914 //
   918 //
   915 void CFMRadioScanLocalStationsView::RestoreRadio( TBool aTuneInitialFrequency, TBool aUnmute )
   919 void CFMRadioScanLocalStationsView::RestoreRadio( TBool aTuneInitialFrequency )
   916     {
   920     {
   917     FTRACE( FPrint( _L("CFMRadioScanLocalStationsView::RestoreRadio") ) );
   921     FTRACE( FPrint( _L("CFMRadioScanLocalStationsView::RestoreRadio") ) );
   918     CFMRadioAppUi* appUi = static_cast<CFMRadioAppUi*>( iCoeEnv->AppUi() );
   922     CFMRadioAppUi* appUi = static_cast<CFMRadioAppUi*>( iCoeEnv->AppUi() );
   919     // if iInitialTunedFrequency is 0, radio has already been restored
   923     // if iInitialTunedFrequency is 0, radio has already been restored
   920     if ( iInitialTunedFrequency )
   924     if ( iInitialTunedFrequency )
   921         {
   925         {
   922         if ( aTuneInitialFrequency )
   926         if ( aTuneInitialFrequency )
   923             {
   927             {
   924             iTuneRequested = ETrue;
   928             iTuneRequested = ETrue;
   925             iRadioEngine.Tune( iInitialTunedFrequency );
   929             iRadioEngine.Tune( iInitialTunedFrequency );
   926             }
       
   927         if ( aUnmute ) // set mute off by default
       
   928             {
       
   929             iRadioEngine.SetMuteOn( EFalse );
       
   930             }
   930             }
   931         iInitialTunedFrequency = 0;
   931         iInitialTunedFrequency = 0;
   932         }
   932         }
   933     appUi->SetStartupWizardRunning( EFalse );
   933     appUi->SetStartupWizardRunning( EFalse );
   934     }
   934     }
   989             {
   989             {
   990             iContainer->UpdateLastListenedChannel( 0 ); // select the first channel
   990             iContainer->UpdateLastListenedChannel( 0 ); // select the first channel
   991             PlayCurrentlySelectedChannelL();
   991             PlayCurrentlySelectedChannelL();
   992             iContainer->DrawDeferred();
   992             iContainer->DrawDeferred();
   993             }
   993             }
   994 
   994         
   995         //unmute radio
       
   996         iRadioEngine.SetMuteOn( EFalse );
       
   997 
       
   998         CFMRadioAppUi* appUi = static_cast<CFMRadioAppUi*>( iCoeEnv->AppUi() );
   995         CFMRadioAppUi* appUi = static_cast<CFMRadioAppUi*>( iCoeEnv->AppUi() );
   999 
   996 
  1000         if ( appUi->IsStartupWizardRunning() )
   997         if ( appUi->IsStartupWizardRunning() )
  1001             {
   998             {
  1002             appUi->SetStartupWizardRunning( EFalse );
   999             appUi->SetStartupWizardRunning( EFalse );
  1237             }
  1234             }
  1238         else
  1235         else
  1239             {
  1236             {
  1240             SetNowPlayingChannelL( selectedChannel );
  1237             SetNowPlayingChannelL( selectedChannel );
  1241             SetLastListenedChannel( selectedChannel );
  1238             SetLastListenedChannel( selectedChannel );
       
  1239             iRadioEngine.SetMuteOn( EFalse );
  1242             }
  1240             }
  1243         }
  1241         }
  1244     }
  1242     }
  1245 
  1243 
  1246 // ---------------------------------------------------------
  1244 // ---------------------------------------------------------