From f3793bc31c227b0747ef2ab7861e4054877a6eec Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 16 Nov 2008 17:43:47 +0100 Subject: [PATCH] Check for silent profile at startup. Don't enable audio when silent profile is selected at application's startup. --- src/main/symbian/ProfileWatcher.h | 2 ++ src/main/symbian/SDL_main.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/main/symbian/ProfileWatcher.h b/src/main/symbian/ProfileWatcher.h index de6e73e..d3ff9a7 100644 --- a/src/main/symbian/ProfileWatcher.h +++ b/src/main/symbian/ProfileWatcher.h @@ -13,6 +13,8 @@ class ProfileWatcher : public CActive ProfileWatcher(MProfileWatcher& observer); ~ProfileWatcher(); + int GetProfile(); + private: void RunL(); void DoCancel(); diff --git a/src/main/symbian/SDL_main.cpp b/src/main/symbian/SDL_main.cpp index 094198c..1ccdc76 100644 --- a/src/main/symbian/SDL_main.cpp +++ b/src/main/symbian/SDL_main.cpp @@ -93,6 +93,13 @@ ProfileWatcher::~ProfileWatcher() delete m_repository; } +int ProfileWatcher::GetProfile() +{ + int value; + m_repository->Get(KProEngActiveProfile, value); + return value; +} + void ProfileWatcher::DoCancel() { m_repository->NotifyCancel(KProEngActiveProfile); @@ -281,6 +288,11 @@ CSDL::CSDL() , m_soundPauseReason( SPR_NONE ) , m_profileWatcher( new ProfileWatcher(*this) ) { + if(m_profileWatcher->GetProfile() == 1) + { + m_soundPauseReason |= SPR_SILENTPROFILE; + } + __ASSERT_ALWAYS(gEpocEnv == NULL, PANIC(KErrAlreadyExists)); gEpocEnv = new EpocSdlEnvData; Mem::FillZ(gEpocEnv, sizeof(EpocSdlEnvData)); -- 2.11.4.GIT