mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/src/mpxprogressdownloadsb.cpp
branchRCL_3
changeset 28 56b11cf8addb
parent 26 70a8526f03f2
child 50 26a1709b9fec
equal deleted inserted replaced
26:70a8526f03f2 28:56b11cf8addb
   470     TBool isSupported=ETrue;
   470     TBool isSupported=ETrue;
   471     switch(aProperty)
   471     switch(aProperty)
   472         {
   472         {
   473         case EPbPropertyVolume:
   473         case EPbPropertyVolume:
   474             {
   474             {
   475             SetVolume(aValue);
   475             SetVolume( aValue, EFalse ); // don't notify MPX because playback engine converts EPSetComplete to EPropertyChanged
   476             }
   476             }
   477             break;
   477             break;
   478         case EPbPropertyVolumeRamp:
   478         case EPbPropertyVolumeRamp:
   479             {
   479             {
   480             TInt curVol = 0;
   480             TInt curVol = 0;
   487                 iMVolumeControl->Apply();
   487                 iMVolumeControl->Apply();
   488                 }
   488                 }
   489             }
   489             }
   490             break;
   490             break;
   491         case EPbPropertyMute:
   491         case EPbPropertyMute:
   492             SetMute( aValue );
   492             SetMute( aValue, EFalse );  // don't notify MPX because playback engine converts EPSetComplete to EPropertyChanged
   493             break;
   493             break;
   494         case EPbPropertyBalance:
   494         case EPbPropertyBalance:
   495             break;
   495             break;
   496         default:
   496         default:
   497             isSupported=EFalse;
   497             isSupported=EFalse;
  1370 
  1370 
  1371 // ----------------------------------------------------------------------------
  1371 // ----------------------------------------------------------------------------
  1372 // Sets the volume level in audio controller
  1372 // Sets the volume level in audio controller
  1373 // ----------------------------------------------------------------------------
  1373 // ----------------------------------------------------------------------------
  1374 //
  1374 //
  1375 void CMPXProgressDownloadSB::SetVolume( TInt aVolume )
  1375 void CMPXProgressDownloadSB::SetVolume( TInt aVolume, TBool aNotifyChange )
  1376     {
  1376     {
  1377     MPX_DEBUG2("CMPXProgressDownloadSB::SetVolume(%d) entering", aVolume);
  1377     MPX_DEBUG2("CMPXProgressDownloadSB::SetVolume(%d) entering", aVolume);
  1378 
  1378 
  1379     // Ensure that level is within min and max values
  1379     // Ensure that level is within min and max values
  1380     if ( aVolume > KPbPlaybackVolumeLevelMax )
  1380     if ( aVolume > KPbPlaybackVolumeLevelMax )
  1428             }
  1428             }
  1429         }
  1429         }
  1430 
  1430 
  1431 
  1431 
  1432     // Notify observer if value changed
  1432     // Notify observer if value changed
  1433     if ( changed )
  1433     if ( changed && aNotifyChange )
  1434         {
  1434         {
  1435         iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPVolumeChanged,
  1435         iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPVolumeChanged,
  1436                                  aVolume,
  1436                                  aVolume,
  1437                                  KErrNone);
  1437                                  KErrNone);
  1438         }
  1438         }
  1442 
  1442 
  1443 // ----------------------------------------------------------------------------
  1443 // ----------------------------------------------------------------------------
  1444 // Sets the volume level in audio controller
  1444 // Sets the volume level in audio controller
  1445 // ----------------------------------------------------------------------------
  1445 // ----------------------------------------------------------------------------
  1446 //
  1446 //
  1447 void CMPXProgressDownloadSB::SetMute( TBool aMute )
  1447 void CMPXProgressDownloadSB::SetMute( TBool aMute, TBool aNotifyChange )
  1448     {
  1448     {
  1449     MPX_DEBUG3("-->CMPXProgressDownloadSB::SetMute 0x%08x vol (%d)", this, aMute);
  1449     MPX_DEBUG3("-->CMPXProgressDownloadSB::SetMute 0x%08x vol (%d)", this, aMute);
  1450 
  1450 
  1451     TBool changed( EFalse );
  1451     TBool changed( EFalse );
  1452     // Change MMF Audio player's volume
  1452     // Change MMF Audio player's volume
  1481             MPX_TRAP( muteError, iMuteWatcher->SetValueL( aMute ) );
  1481             MPX_TRAP( muteError, iMuteWatcher->SetValueL( aMute ) );
  1482             }
  1482             }
  1483         }
  1483         }
  1484 
  1484 
  1485     // Notify observer if value changed
  1485     // Notify observer if value changed
  1486     if ( changed )
  1486     if ( changed && aNotifyChange )
  1487         {
  1487         {
  1488         iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPMuteChanged,
  1488         iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPMuteChanged,
  1489                                  aMute,
  1489                                  aMute,
  1490                                  KErrNone);
  1490                                  KErrNone);
  1491         }
  1491         }