mtpdataproviders/mtpplaybackcontroldp/mtpplaybackinterface/src/cmtpplaybackevent.cpp
changeset 49 c20dd21d1eb4
parent 29 3ae5cb0b4c02
equal deleted inserted replaced
41:2c19c7cf5550 49:c20dd21d1eb4
    18  @internalComponent
    18  @internalComponent
    19 */
    19 */
    20 
    20 
    21 #include "cmtpplaybackevent.h"
    21 #include "cmtpplaybackevent.h"
    22 #include "mtpplaybackcontrolpanic.h"
    22 #include "mtpplaybackcontrolpanic.h"
       
    23 #include "OstTraceDefinitions.h"
       
    24 #ifdef OST_TRACE_COMPILER_IN_USE
       
    25 #include "cmtpplaybackeventTraces.h"
       
    26 #endif
    23 
    27 
    24 // Class constants.
       
    25 __FLOG_STMT(_LIT8(KComponent,"CMtpPbEvent");)
       
    26 
    28 
    27 CMTPPbEventParam* CMTPPbEventParam::NewL(TMTPPbCategory aCategory, const TDesC& aSuid)
    29 CMTPPbEventParam* CMTPPbEventParam::NewL(TMTPPbCategory aCategory, const TDesC& aSuid)
    28     {
    30     {
       
    31     OstTraceFunctionEntry0( CMTPPBEVENTPARAM_NEWL_ENTRY );
    29     CMTPPbEventParam* self = new (ELeave) CMTPPbEventParam(aCategory, aSuid);
    32     CMTPPbEventParam* self = new (ELeave) CMTPPbEventParam(aCategory, aSuid);
    30     CleanupStack::PushL(self);
    33     CleanupStack::PushL(self);
    31     self->ConstructL(aCategory, aSuid);
    34     self->ConstructL(aCategory, aSuid);
    32     CleanupStack::Pop(self);
    35     CleanupStack::Pop(self);
       
    36     OstTraceFunctionExit0( CMTPPBEVENTPARAM_NEWL_EXIT );
    33     return self;
    37     return self;
    34     }
    38     }
    35 
    39 
    36 CMTPPbEventParam* CMTPPbEventParam::NewL(TInt32 aValue)
    40 CMTPPbEventParam* CMTPPbEventParam::NewL(TInt32 aValue)
    37     {
    41     {
       
    42     OstTraceFunctionEntry0( DUP1_CMTPPBEVENTPARAM_NEWL_ENTRY );
    38     CMTPPbEventParam* self = new (ELeave) CMTPPbEventParam(aValue);
    43     CMTPPbEventParam* self = new (ELeave) CMTPPbEventParam(aValue);
    39     CleanupStack::PushL(self);
    44     CleanupStack::PushL(self);
    40     self->ConstructL(aValue);
    45     self->ConstructL(aValue);
    41     CleanupStack::Pop(self);
    46     CleanupStack::Pop(self);
       
    47     OstTraceFunctionExit0( DUP1_CMTPPBEVENTPARAM_NEWL_EXIT );
    42     return self;
    48     return self;
    43     }
    49     }
    44 
    50 
    45 CMTPPbEventParam* CMTPPbEventParam::NewL(TUint32 aValue)
    51 CMTPPbEventParam* CMTPPbEventParam::NewL(TUint32 aValue)
    46     {
    52     {
       
    53     OstTraceFunctionEntry0( DUP2_CMTPPBEVENTPARAM_NEWL_ENTRY );
    47     CMTPPbEventParam* self = new (ELeave) CMTPPbEventParam(aValue);
    54     CMTPPbEventParam* self = new (ELeave) CMTPPbEventParam(aValue);
    48     CleanupStack::PushL(self);
    55     CleanupStack::PushL(self);
    49     self->ConstructL(aValue);
    56     self->ConstructL(aValue);
    50     CleanupStack::Pop(self);
    57     CleanupStack::Pop(self);
       
    58     OstTraceFunctionExit0( DUP2_CMTPPBEVENTPARAM_NEWL_EXIT );
    51     return self;
    59     return self;
    52     }
    60     }
    53 
    61 
    54 CMTPPbEventParam::~CMTPPbEventParam()
    62 CMTPPbEventParam::~CMTPPbEventParam()
    55     {
    63     {
    56     
    64     OstTraceFunctionEntry0( CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_ENTRY );
       
    65     OstTraceFunctionExit0( CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_EXIT );
    57     }
    66     }
    58 
    67 
    59 CMTPPbEventParam::CMTPPbEventParam(TMTPPbCategory aCategory, const TDesC& aSuid):
    68 CMTPPbEventParam::CMTPPbEventParam(TMTPPbCategory aCategory, const TDesC& aSuid):
    60     CMTPPbParamBase(aCategory, aSuid)
    69     CMTPPbParamBase(aCategory, aSuid)
    61     {
    70     {
    62 
    71     OstTraceFunctionEntry0( DUP1_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_ENTRY );
       
    72     OstTraceFunctionExit0( DUP1_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_EXIT );
    63     }
    73     }
    64 
    74 
    65 CMTPPbEventParam::CMTPPbEventParam(TInt32 aValue):
    75 CMTPPbEventParam::CMTPPbEventParam(TInt32 aValue):
    66     CMTPPbParamBase(aValue)
    76     CMTPPbParamBase(aValue)
    67     {
    77     {
    68     
    78     OstTraceFunctionEntry0( DUP2_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_ENTRY );
       
    79     OstTraceFunctionExit0( DUP2_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_EXIT );
    69     }
    80     }
    70 
    81 
    71 CMTPPbEventParam::CMTPPbEventParam(TUint32 aValue):
    82 CMTPPbEventParam::CMTPPbEventParam(TUint32 aValue):
    72     CMTPPbParamBase(aValue)
    83     CMTPPbParamBase(aValue)
    73     {
    84     {
    74     
    85     OstTraceFunctionEntry0( DUP3_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_ENTRY );
       
    86     OstTraceFunctionExit0( DUP3_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_EXIT );
    75     }
    87     }
    76 
    88 
    77 /**
    89 /**
    78 Two-phase constructor.
    90 Two-phase constructor.
    79 */  
    91 */  
    80 CMTPPlaybackEvent* CMTPPlaybackEvent::NewL(TMTPPlaybackEvent aEvent, CMTPPbEventParam* aParam)
    92 CMTPPlaybackEvent* CMTPPlaybackEvent::NewL(TMTPPlaybackEvent aEvent, CMTPPbEventParam* aParam)
    81     {
    93     {
       
    94     OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_NEWL_ENTRY );
    82     __ASSERT_DEBUG((aEvent > EPlaybackEventNone && aEvent < EPlaybackEventEnd), Panic(EMTPPBArgumentErr));
    95     __ASSERT_DEBUG((aEvent > EPlaybackEventNone && aEvent < EPlaybackEventEnd), Panic(EMTPPBArgumentErr));
    83     __ASSERT_ALWAYS((aEvent > EPlaybackEventNone && aEvent < EPlaybackEventEnd), User::Leave(KErrArgument));
    96     __ASSERT_ALWAYS_OST((aEvent > EPlaybackEventNone && aEvent < EPlaybackEventEnd), OstTrace0( TRACE_ERROR, CMTPPLAYBACKEVENT_NEWL, "Error argument" ), User::Leave(KErrArgument));
    84     
    97     
    85     CMTPPlaybackEvent* self = new (ELeave) CMTPPlaybackEvent(aEvent, aParam);
    98     CMTPPlaybackEvent* self = new (ELeave) CMTPPlaybackEvent(aEvent, aParam);
    86     CleanupStack::PushL(self);
    99     CleanupStack::PushL(self);
    87     self->ConstructL();
   100     self->ConstructL();
    88     CleanupStack::Pop(self);
   101     CleanupStack::Pop(self);
       
   102     OstTraceFunctionExit0( CMTPPLAYBACKEVENT_NEWL_EXIT );
    89     return self;
   103     return self;
    90     }
   104     }
    91 
   105 
    92 /**
   106 /**
    93 Destructor.
   107 Destructor.
    94 */    
   108 */    
    95 CMTPPlaybackEvent::~CMTPPlaybackEvent()
   109 CMTPPlaybackEvent::~CMTPPlaybackEvent()
    96     {    
   110     {    
    97     __FLOG(_L8("~CMTPPlaybackEvent - Entry"));
   111     OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_CMTPPLAYBACKEVENT_ENTRY );
    98     delete iParam;
   112     delete iParam;
    99     __FLOG(_L8("~CMTPPlaybackEvent - Exit"));
   113     OstTraceFunctionExit0( CMTPPLAYBACKEVENT_CMTPPLAYBACKEVENT_EXIT );
   100     __FLOG_CLOSE;
       
   101     }
   114     }
   102 
   115 
   103 /**
   116 /**
   104 Constructor.
   117 Constructor.
   105 */    
   118 */    
   106 CMTPPlaybackEvent::CMTPPlaybackEvent(TMTPPlaybackEvent aEvent,
   119 CMTPPlaybackEvent::CMTPPlaybackEvent(TMTPPlaybackEvent aEvent,
   107                                      CMTPPbEventParam* aParam):
   120                                      CMTPPbEventParam* aParam):
   108     iPbEvent(aEvent),iParam(aParam)
   121     iPbEvent(aEvent),iParam(aParam)
   109     {    
   122     {    
       
   123     OstTraceFunctionEntry0( DUP1_CMTPPLAYBACKEVENT_CMTPPLAYBACKEVENT_ENTRY );
       
   124     OstTraceFunctionExit0( DUP1_CMTPPLAYBACKEVENT_CMTPPLAYBACKEVENT_EXIT );
   110     }
   125     }
   111     
   126     
   112 /**
   127 /**
   113 Second-phase constructor.
   128 Second-phase constructor.
   114 */        
   129 */        
   115 void CMTPPlaybackEvent::ConstructL()
   130 void CMTPPlaybackEvent::ConstructL()
   116     {
   131     {
   117     __FLOG_OPEN(KMTPSubsystem, KComponent);
   132     OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_CONSTRUCTL_ENTRY );
   118     __FLOG(_L8("CMTPPlaybackEvent: ConstructL - Entry")); 
   133     OstTraceFunctionExit0( CMTPPLAYBACKEVENT_CONSTRUCTL_EXIT );
   119     __FLOG(_L8("CMTPPlaybackEvent: ConstructL - Exit")); 
       
   120     }
   134     }
   121 
   135 
   122 void CMTPPlaybackEvent::SetParam(CMTPPbEventParam* aParam)
   136 void CMTPPlaybackEvent::SetParam(CMTPPbEventParam* aParam)
   123     {
   137     {
       
   138     OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_SETPARAM_ENTRY );
   124     delete iParam;
   139     delete iParam;
   125     iParam = aParam;
   140     iParam = aParam;
       
   141     OstTraceFunctionExit0( CMTPPLAYBACKEVENT_SETPARAM_EXIT );
   126     }
   142     }
   127 
   143 
   128 TMTPPlaybackEvent CMTPPlaybackEvent::PlaybackEvent()
   144 TMTPPlaybackEvent CMTPPlaybackEvent::PlaybackEvent()
   129     {
   145     {
       
   146     OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_PLAYBACKEVENT_ENTRY );
   130     __ASSERT_DEBUG((iPbEvent > EPlaybackEventNone && iPbEvent < EPlaybackEventEnd), Panic(EMTPPBArgumentErr));
   147     __ASSERT_DEBUG((iPbEvent > EPlaybackEventNone && iPbEvent < EPlaybackEventEnd), Panic(EMTPPBArgumentErr));
       
   148     OstTraceFunctionExit0( CMTPPLAYBACKEVENT_PLAYBACKEVENT_EXIT );
   131     return iPbEvent;
   149     return iPbEvent;
   132     }
   150     }
   133 
   151 
   134 const CMTPPbEventParam& CMTPPlaybackEvent::ParamL()
   152 const CMTPPbEventParam& CMTPPlaybackEvent::ParamL()
   135     {
   153     {
       
   154     OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_PARAML_ENTRY );
   136     __ASSERT_DEBUG((iParam != NULL), Panic(EMTPPBDataNullErr));
   155     __ASSERT_DEBUG((iParam != NULL), Panic(EMTPPBDataNullErr));
   137     __ASSERT_ALWAYS((iParam != NULL), User::Leave(KErrArgument));
   156     __ASSERT_ALWAYS_OST((iParam != NULL), OstTrace0( TRACE_ERROR, CINTERNETCONNECTIONHANDLER_CONSTRUCTL, "Error argument" ), User::Leave(KErrArgument));
   138 
   157 
       
   158 		
       
   159     OstTraceFunctionExit0( CMTPPLAYBACKEVENT_PARAML_EXIT );
   139     return *iParam;
   160     return *iParam;
   140     }
   161     }