--- a/devsoundextensions/globalaudiosettings/BWINS/GlobalAudioSettings.def Mon Aug 23 20:19:06 2010 +0100
+++ b/devsoundextensions/globalaudiosettings/BWINS/GlobalAudioSettings.def Mon Aug 23 21:33:25 2010 +0100
@@ -21,4 +21,5 @@
?KeyPadToneVolume@CGlobalAudioSettings@@QAE?AW4TGASKeypadVolume@1@XZ @ 20 NONAME ; enum CGlobalAudioSettings::TGASKeypadVolume CGlobalAudioSettings::KeyPadToneVolume(void)
?MessageAlertTone@CGlobalAudioSettings@@QAEAAVTDesC16@@XZ @ 21 NONAME ; class TDesC16 & CGlobalAudioSettings::MessageAlertTone(void)
?EmailAlertTone@CGlobalAudioSettings@@QAEAAVTDesC16@@XZ @ 22 NONAME ; class TDesC16 & CGlobalAudioSettings::EmailAlertTone(void)
+ ?IsSilenceModeEnabled@CGlobalAudioSettings@@QAEHXZ @ 23 NONAME ; int CGlobalAudioSettings::IsSilenceModeEnabled(void)
--- a/devsoundextensions/globalaudiosettings/EABI/GlobalAudioSettings.def Mon Aug 23 20:19:06 2010 +0100
+++ b/devsoundextensions/globalaudiosettings/EABI/GlobalAudioSettings.def Mon Aug 23 21:33:25 2010 +0100
@@ -27,4 +27,5 @@
_ZTI26CAudioClientsListManagerAO @ 26 NONAME
_ZTV20CGlobalAudioSettings @ 27 NONAME
_ZTV26CAudioClientsListManagerAO @ 28 NONAME
+ _ZN20CGlobalAudioSettings20IsSilenceModeEnabledEv @ 29 NONAME
--- a/devsoundextensions/globalaudiosettings/inc/GlobalAudioSettingsData.h Mon Aug 23 20:19:06 2010 +0100
+++ b/devsoundextensions/globalaudiosettings/inc/GlobalAudioSettingsData.h Mon Aug 23 21:33:25 2010 +0100
@@ -57,6 +57,7 @@
HBufC *iRingingTone1Name;
HBufC *iRingingTone2Name;
CGlobalAudioSettings::TGASKeypadVolume iKeyPadVolume;
+ TBool iSilenceMode;
};
#endif // GlobalAudioSETTINGSDATA_H
--- a/devsoundextensions/globalaudiosettings/inc/GlobalAudioSettingsImpl.h Mon Aug 23 20:19:06 2010 +0100
+++ b/devsoundextensions/globalaudiosettings/inc/GlobalAudioSettingsImpl.h Mon Aug 23 21:33:25 2010 +0100
@@ -42,7 +42,7 @@
class CRingingTone1ObserverAO;
class CRingingTone2ObserverAO;
class CKeypadToneObserverAO;
-
+class CSilenceModeObserverAO;
/**
* Defines functions that client uses to set phone profile settings.
*
@@ -251,7 +251,13 @@
* is returned
*/
CGlobalAudioSettings::TGASKeypadVolume KeyPadToneVolume();
-
+ /**
+ * Returns silent mode status.
+ *
+ *
+ * @return TBool aEnable. ETrue if the silent mode is enabled else EFalse.
+ */
+ TBool IsSilenceModeEnabled();
/**
* Registers audio clients list observer.
*
@@ -337,6 +343,7 @@
CRingingTone1ObserverAO* iRingingTone1ObserverAO;
CRingingTone2ObserverAO* iRingingTone2ObserverAO;
CKeypadToneObserverAO* iKeypadToneObserverAO;
+ CSilenceModeObserverAO* iSilenceModeObserverAO;
};
@@ -648,6 +655,34 @@
RProperty iKeypadToneVolumeProperty;
TGlobalAudioSettings& iGlobalAudioSettingsData;
};
+
+NONSHARABLE_CLASS(CSilenceModeObserverAO) : public CActive
+ {
+public:
+ // Ist Phase constr and Destr
+ static CSilenceModeObserverAO* NewL(CGlobalAudioSettings &aGlobalAudioSettings,
+ MAudioSettingsObserver& aAudioSettingsObserver,
+ TGlobalAudioSettings& aGlobalAudioSettingsData);
+ ~CSilenceModeObserverAO();
+ void Subscribe();
+
+protected:
+ // From CActive
+ void RunL();
+ void DoCancel();
+ TInt RunError(TInt aError);
+
+private:
+ // Constr and IInd phase constr
+ CSilenceModeObserverAO(CGlobalAudioSettings &aGlobalAudioSettings,
+ MAudioSettingsObserver& aAudioSettingsObserver,
+ TGlobalAudioSettings& aGlobalAudioSettingsData);
+ void ConstructL();
+ CGlobalAudioSettings& iGlobalAudioSettings;
+ MAudioSettingsObserver& iAudioSettingsObserver;
+ RProperty iSilenceModeProperty;
+ TGlobalAudioSettings& iGlobalAudioSettingsData;
+ };
#endif // GLOBALAUDIOSETTINGSIMPL_H
// End of file
--- a/devsoundextensions/globalaudiosettings/src/GlobalAudioSettings.cpp Mon Aug 23 20:19:06 2010 +0100
+++ b/devsoundextensions/globalaudiosettings/src/GlobalAudioSettings.cpp Mon Aug 23 21:33:25 2010 +0100
@@ -165,6 +165,11 @@
{
return (iBody->KeyPadToneVolume());
}
+
+EXPORT_C TBool CGlobalAudioSettings::IsSilenceModeEnabled()
+ {
+ return (iBody->IsSilenceModeEnabled());
+ }
// -----------------------------------------------------------------------------
// CGlobalAudioSettings::RegisterAudioClientsListObserver
//
--- a/devsoundextensions/globalaudiosettings/src/GlobalAudioSettingsImpl.cpp Mon Aug 23 20:19:06 2010 +0100
+++ b/devsoundextensions/globalaudiosettings/src/GlobalAudioSettingsImpl.cpp Mon Aug 23 21:33:25 2010 +0100
@@ -137,7 +137,11 @@
iGlobalAudioSettingsData);
iKeypadToneObserverAO->Subscribe();
-
+ iSilenceModeObserverAO = CSilenceModeObserverAO::NewL(
+ iGlobalAudioSettings,
+ iAudioSettingsObserver,
+ iGlobalAudioSettingsData);
+ iSilenceModeObserverAO->Subscribe();
RProperty publicSilenceProperty;
User::LeaveIfError(publicSilenceProperty.Attach(KGASPSUidGlobalAudioSettings, KGASPublicSilence));
@@ -163,6 +167,7 @@
delete iRingingTone1ObserverAO;
delete iRingingTone2ObserverAO;
delete iKeypadToneObserverAO;
+ delete iSilenceModeObserverAO;
delete iCAudioClientsListManagerAO;
delete iPausedClientsListManagerAO;
iAudioClientsListObserverArray.Close();
@@ -312,6 +317,11 @@
{
return (CGlobalAudioSettings::TGASKeypadVolume)iGlobalAudioSettingsData.iKeyPadVolume;
}
+
+ TBool CGlobalAudioSettingsImpl::IsSilenceModeEnabled()
+ {
+ return iGlobalAudioSettingsData.iSilenceMode;
+ }
// -----------------------------------------------------------------------------
// CGlobalAudioSettingsImpl::RegisterAudioClientsListObserver
//
@@ -1412,4 +1422,100 @@
return KErrNone;
}
+
+/////////////////////////////////////////////////////////////////////
+// CSilenceModeObserverAO //
+//////////////////////////////////////////////////////////////////////
+CSilenceModeObserverAO::CSilenceModeObserverAO(
+ CGlobalAudioSettings &aGlobalAudioSettings,
+ MAudioSettingsObserver& aAudioSettingsObserver,
+ TGlobalAudioSettings& aGlobalAudioSettingsData)
+:CActive(EPriorityStandard),
+ iGlobalAudioSettings(aGlobalAudioSettings),
+ iAudioSettingsObserver(aAudioSettingsObserver),
+ iGlobalAudioSettingsData(aGlobalAudioSettingsData)
+ {
+ CActiveScheduler::Add(this);
+ }
+
+CSilenceModeObserverAO::~CSilenceModeObserverAO()
+ {
+ Cancel();
+ iSilenceModeProperty.Close();
+ }
+
+CSilenceModeObserverAO* CSilenceModeObserverAO::NewL(
+ CGlobalAudioSettings &aGlobalAudioSettings,
+ MAudioSettingsObserver& aAudioSettingsObserver,
+ TGlobalAudioSettings& aGlobalAudioSettingsData)
+ {
+ CSilenceModeObserverAO* self = new (ELeave) CSilenceModeObserverAO(
+ aGlobalAudioSettings,
+ aAudioSettingsObserver,
+ aGlobalAudioSettingsData);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+ return self;
+ }
+
+void CSilenceModeObserverAO::ConstructL()
+ {
+
+
+ User::LeaveIfError(iSilenceModeProperty.Attach(KGASPSUidGlobalAudioSettings, KGASSilenceMode));
+
+ User::LeaveIfError(iSilenceModeProperty.Get(iGlobalAudioSettingsData.iSilenceMode));
+ RDebug::Printf("in constructL,silence mode %d",iGlobalAudioSettingsData.iSilenceMode);
+
+ }
+
+void CSilenceModeObserverAO::Subscribe()
+ {
+ if (!IsActive())
+ {
+ SetActive();
+
+ iSilenceModeProperty.Subscribe(iStatus);
+ }
+ }
+
+void CSilenceModeObserverAO::RunL()
+ {
+ TInt status(iStatus.Int());
+#ifdef PRINT_MESSAGE
+ RDebug::Print(_L(" CSilenceModeObserverAO::RunL:iStatus[%d]"), status);
+#endif // PRINT_MESSAGE
+ if ( status == KErrNone )
+ {
+ Subscribe();
+
+ status=iSilenceModeProperty.Get( iGlobalAudioSettingsData.iSilenceMode);
+ RDebug::Printf("value of silent mode :%d",iGlobalAudioSettingsData.iSilenceMode);
+
+
+ if( status == KErrNone)
+ {
+ MAudioSettingsObserver::TGASEventId id=MAudioSettingsObserver::EGASSilenceMode;
+ iAudioSettingsObserver.SettingsChanged(iGlobalAudioSettings, id);
+ }
+#ifdef PRINT_MESSAGE
+ else
+ {
+ RDebug::Print(_L(" CKeypadToneObserverAO::RunL:Property.Get Error[%d]"), status);
+ }
+#endif // PRINT_MESSAGE
+ }
+ }
+
+void CSilenceModeObserverAO::DoCancel()
+ {
+ iSilenceModeProperty.Cancel();
+ }
+
+TInt CSilenceModeObserverAO::RunError(TInt /*aError*/)
+ {
+ return KErrNone;
+ }
+
//End of file
--- a/mm_plat/global_audio_settings_api/inc/GlobalAudioSettings.h Mon Aug 23 20:19:06 2010 +0100
+++ b/mm_plat/global_audio_settings_api/inc/GlobalAudioSettings.h Mon Aug 23 21:33:25 2010 +0100
@@ -305,6 +305,14 @@
IMPORT_C TGASKeypadVolume KeyPadToneVolume();
/**
+ * Returns silent mode status.
+ *
+ *
+ * @return TBool aEnable. ETrue if the silent mode is enabled else EFalse.
+ */
+
+ IMPORT_C TBool IsSilenceModeEnabled();
+ /**
* Registers audio clients list observer.
*
* When registered successfully, the observer will start receiveing
--- a/mm_plat/global_audio_settings_api/inc/MGlobalAudioSettingsObserver.h Mon Aug 23 20:19:06 2010 +0100
+++ b/mm_plat/global_audio_settings_api/inc/MGlobalAudioSettingsObserver.h Mon Aug 23 21:33:25 2010 +0100
@@ -53,7 +53,8 @@
EGASVideoCallToneName,
EGASRingingTone1Name,
EGASRingingTone2Name,
- EGASKeyPadVolume
+ EGASKeyPadVolume,
+ EGASSilenceMode
};
public:
--- a/mm_plat/global_audio_settings_api/tsrc/Conf/GlobalASTestClass.cfg Mon Aug 23 20:19:06 2010 +0100
+++ b/mm_plat/global_audio_settings_api/tsrc/Conf/GlobalASTestClass.cfg Mon Aug 23 21:33:25 2010 +0100
@@ -20,6 +20,7 @@
GAS GetRingingTone2Name
GAS IsRingingAlertTone2Enabled
GAS GetKeypadToneVolume
+GAS IsSilenceModeActive
GAS GetAudioClientsList
GAS GetPausedClientsList
GAS UnregisterAudioClientsListObserver
--- a/mm_plat/global_audio_settings_api/tsrc/GlobalASTestClass/inc/GlobalASTestClass.h Mon Aug 23 20:19:06 2010 +0100
+++ b/mm_plat/global_audio_settings_api/tsrc/GlobalASTestClass/inc/GlobalASTestClass.h Mon Aug 23 21:33:25 2010 +0100
@@ -132,7 +132,7 @@
TInt RingingAlertTone2( CStifItemParser& aItem );
TInt IsRingingAlertTone2Enabled( CStifItemParser& aItem );
TInt KeypadAlertTone( CStifItemParser& aItem );
-
+ TInt IsSilenceModeActive(CStifItemParser& aItem);
private: // Data
// reference to TestModuleIf
--- a/mm_plat/global_audio_settings_api/tsrc/GlobalASTestClass/src/GlobalASTestClassBlocks.cpp Mon Aug 23 20:19:06 2010 +0100
+++ b/mm_plat/global_audio_settings_api/tsrc/GlobalASTestClass/src/GlobalASTestClassBlocks.cpp Mon Aug 23 21:33:25 2010 +0100
@@ -78,7 +78,8 @@
ENTRY( "IsRingingAlertTone1Enabled", CGlobalASTestClass::IsRingingAlertTone1Enabled ),
ENTRY( "GetRingingTone2Name", CGlobalASTestClass::RingingAlertTone2 ),
ENTRY( "IsRingingAlertTone2Enabled", CGlobalASTestClass::IsRingingAlertTone2Enabled ),
- ENTRY( "GetKeypadToneVolume", CGlobalASTestClass::KeypadAlertTone )
+ ENTRY( "GetKeypadToneVolume", CGlobalASTestClass::KeypadAlertTone ),
+ ENTRY( "IsSilenceModeActive", CGlobalASTestClass::IsSilenceModeActive )
};
@@ -105,6 +106,7 @@
{
TRAP(status,iPhoneProfileSettings = CGlobalAudioSettings::NewL(*this));
}
+ CActiveScheduler::Start();
return status;
}
@@ -352,7 +354,7 @@
void CGlobalASTestClass::SettingsChanged(CGlobalAudioSettings& /*aGlobalAudioSettings*/, MAudioSettingsObserver::TGASEventId aSetting)
{
RDebug::Printf("settings changed %d",aSetting);
- // CActiveScheduler::Stop();
+ CActiveScheduler::Stop();
}
void CGlobalASTestClass::Event( const CGlobalAudioSettings& /*aGlobalAudioSettings*/, TUint aEvent )
@@ -547,4 +549,19 @@
return status;
}
+
+TInt CGlobalASTestClass::IsSilenceModeActive(CStifItemParser& /*aItem*/)
+ {
+ RDebug::Printf("CGlobalASTestClass::IsSilenceProfileActive");
+ TInt status(KErrNone);
+ if(iPhoneProfileSettings)
+ {
+ TInt enable=iPhoneProfileSettings->IsSilenceModeEnabled();
+ RDebug::Print(_L("enable:%d"),enable);
+ }
+ else
+ status=KErrNotFound;
+
+ return status;
+ }
// End of File
--- a/mm_plat/global_audio_settings_definition_api/inc/GlobalAudioSettingsPSKeys.h Mon Aug 23 20:19:06 2010 +0100
+++ b/mm_plat/global_audio_settings_definition_api/inc/GlobalAudioSettingsPSKeys.h Mon Aug 23 21:33:25 2010 +0100
@@ -150,8 +150,15 @@
* EGASKeypadVolumeLevel3 = "volume level 3"
*/
const TUint32 KGASKeypadToneVolume=0x0000000c;
-
-
+/**
+* This key is required for the Global Audio Settings to determine whether the
+* silent mode is active or not
+*
+* Possible integer values:
+* 0 = "Silent mode Disabled". Silent mode is disabled
+* 1 = "Warning Tones Enabled". Silent mode is enabled
+*/
+const TUint32 KGASSilenceMode = 0x0000000d;
#endif // GLOBALAUDIOSETTINGSPSKEYS_H
// End of file