mmserv/sts/src/systemtoneservice.cpp
changeset 52 4ce423f34688
parent 47 c2e43643db4c
equal deleted inserted replaced
47:c2e43643db4c 52:4ce423f34688
    18  */
    18  */
    19 
    19 
    20 //  Include Files  
    20 //  Include Files  
    21 #include <systemtoneservice.h>	// CSystemToneService
    21 #include <systemtoneservice.h>	// CSystemToneService
    22 #include "stsimplementation.h"
    22 #include "stsimplementation.h"
       
    23 #include "stsdebug.h"
    23 
    24 
    24 //  Member Functions
    25 //  Member Functions
    25 EXPORT_C /*static*/CSystemToneService* CSystemToneService::Create()
    26 EXPORT_C /*static*/CSystemToneService* CSystemToneService::Create()
    26     {
    27     {
       
    28     TRACE_FUNCTION_ENTRY;
    27     CSystemToneService* self = 0;
    29     CSystemToneService* self = 0;
    28     CStsImplementation* implementation = CStsImplementation::Create();
    30     CStsImplementation* implementation = CStsImplementation::Create();
    29     if (implementation != 0)
    31     if (implementation != 0)
    30         {
    32         {
    31         self = new CSystemToneService(*implementation);
    33         self = new CSystemToneService(*implementation);
    32         if (self == 0)
    34         if (self == 0)
    33             {
    35             {
       
    36             TRACE_LOG(_L(" Unable to instantiate CSystemToneService"));
    34             delete implementation;
    37             delete implementation;
    35             }
    38             }
    36         }
    39         }
       
    40     TRACE_FUNCTION_EXIT;
    37     return self;
    41     return self;
    38     }
    42     }
    39 
    43 
    40 EXPORT_C /*static*/void CSystemToneService::Delete(
    44 EXPORT_C /*static*/void CSystemToneService::Delete(
    41         CSystemToneService* aSystemToneService)
    45         CSystemToneService* aSystemToneService)
    42     {
    46     {
       
    47     TRACE_FUNCTION_ENTRY;
    43     delete &(aSystemToneService->iImplementation);
    48     delete &(aSystemToneService->iImplementation);
    44     delete aSystemToneService;
    49     delete aSystemToneService;
       
    50     TRACE_FUNCTION_EXIT;
    45     }
    51     }
    46 
    52 
    47 CSystemToneService::CSystemToneService(CStsImplementation& aImplementation) :
    53 CSystemToneService::CSystemToneService(CStsImplementation& aImplementation) :
    48     iImplementation(aImplementation)
    54     iImplementation(aImplementation)
    49     {
    55     {
       
    56     TRACE_FUNCTION_ENTRY_EXIT;
    50     }
    57     }
    51 
    58 
    52 CSystemToneService::~CSystemToneService()
    59 CSystemToneService::~CSystemToneService()
    53     {
    60     {
       
    61     TRACE_FUNCTION_ENTRY_EXIT;
    54     }
    62     }
    55 
    63 
    56 EXPORT_C void CSystemToneService::PlayTone(TToneType aTone)
    64 EXPORT_C void CSystemToneService::PlayTone(TToneType aTone)
    57     {
    65     {
       
    66     TRACE_FUNCTION_ENTRY;
       
    67     TRACE_LOG((_L("TToneType[0x%x]"), aTone));
    58     iImplementation.PlayTone(aTone);
    68     iImplementation.PlayTone(aTone);
       
    69     TRACE_FUNCTION_EXIT;
    59     }
    70     }
    60 
    71 
    61 EXPORT_C void CSystemToneService::PlayAlarm(TAlarmType aAlarm,
    72 EXPORT_C void CSystemToneService::PlayAlarm(TAlarmType aAlarm,
    62         unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver)
    73         unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver)
    63     {
    74     {
       
    75     TRACE_FUNCTION_ENTRY;
       
    76     TRACE_LOG((_L("TAlarmType[0x%x]"), aAlarm));
    64     iImplementation.PlayAlarm(aAlarm, aAlarmContext, aObserver);
    77     iImplementation.PlayAlarm(aAlarm, aAlarmContext, aObserver);
       
    78     TRACE_LOG((_L("AlarmContext[%u]"), aAlarmContext));
       
    79     TRACE_FUNCTION_EXIT;
    65     }
    80     }
    66 
    81 
    67 EXPORT_C void CSystemToneService::PlayAlarm(TToneType aTone,
    82 EXPORT_C void CSystemToneService::PlayAlarm(TToneType aTone,
    68         unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver)
    83         unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver)
    69     {
    84     {
       
    85     TRACE_FUNCTION_ENTRY;
       
    86     TRACE_LOG((_L("TToneType[0x%x]"), aTone));
    70     iImplementation.PlayAlarm(aTone, aAlarmContext, aObserver);
    87     iImplementation.PlayAlarm(aTone, aAlarmContext, aObserver);
       
    88     TRACE_LOG((_L("AlarmContext[%u]"), aAlarmContext));
       
    89     TRACE_FUNCTION_EXIT;
    71     }
    90     }
    72 
    91 
    73 EXPORT_C void CSystemToneService::StopAlarm(unsigned int aAlarmContext)
    92 EXPORT_C void CSystemToneService::StopAlarm(unsigned int aAlarmContext)
    74     {
    93     {
       
    94     TRACE_FUNCTION_ENTRY;
       
    95     TRACE_LOG((_L("AlarmContext[%u]"), aAlarmContext));
    75     iImplementation.StopAlarm(aAlarmContext);
    96     iImplementation.StopAlarm(aAlarmContext);
       
    97     TRACE_FUNCTION_EXIT;
    76     }
    98     }