mtpdataproviders/mtpplaybackcontroldp/src/cmtppbcskip.cpp
changeset 47 63cf70d3ecd8
parent 33 883e91c086aa
equal deleted inserted replaced
44:a5deb6b96675 47:63cf70d3ecd8
    27 #include "cmtpplaybackmap.h"
    27 #include "cmtpplaybackmap.h"
    28 #include "cmtpplaybackcontroldp.h"
    28 #include "cmtpplaybackcontroldp.h"
    29 #include "cmtpplaybackproperty.h"
    29 #include "cmtpplaybackproperty.h"
    30 #include "cmtpplaybackcommand.h"
    30 #include "cmtpplaybackcommand.h"
    31 #include "mtpplaybackcontrolpanic.h"
    31 #include "mtpplaybackcontrolpanic.h"
       
    32 #include "OstTraceDefinitions.h"
       
    33 #ifdef OST_TRACE_COMPILER_IN_USE
       
    34 #include "cmtppbcskipTraces.h"
       
    35 #endif
    32 
    36 
    33 
       
    34 // Class constants.
       
    35 __FLOG_STMT(_LIT8(KComponent,"Skip");)
       
    36 
    37 
    37 /**
    38 /**
    38 Two-phase constructor.
    39 Two-phase constructor.
    39 @param aPlugin  The data provider plugin
    40 @param aPlugin  The data provider plugin
    40 @param aFramework The data provider framework
    41 @param aFramework The data provider framework
    43 */  
    44 */  
    44 MMTPRequestProcessor* CMTPPbcSkip::NewL(MMTPDataProviderFramework& aFramework,
    45 MMTPRequestProcessor* CMTPPbcSkip::NewL(MMTPDataProviderFramework& aFramework,
    45                                      MMTPConnection& aConnection,
    46                                      MMTPConnection& aConnection,
    46                                      CMTPPlaybackControlDataProvider& aDataProvider)
    47                                      CMTPPlaybackControlDataProvider& aDataProvider)
    47     {
    48     {
       
    49     OstTraceFunctionEntry0( CMTPPBCSKIP_NEWL_ENTRY );
    48     CMTPPbcSkip* self = new (ELeave) CMTPPbcSkip(aFramework, aConnection, aDataProvider);
    50     CMTPPbcSkip* self = new (ELeave) CMTPPbcSkip(aFramework, aConnection, aDataProvider);
       
    51     OstTraceFunctionExit0( CMTPPBCSKIP_NEWL_EXIT );
    49     return self;
    52     return self;
    50     }
    53     }
    51 
    54 
    52 /**
    55 /**
    53 Destructor.
    56 Destructor.
    54 */    
    57 */    
    55 CMTPPbcSkip::~CMTPPbcSkip()
    58 CMTPPbcSkip::~CMTPPbcSkip()
    56     {
    59     {
    57     __FLOG(_L8("CMTPPbcSkip - Entry"));
    60     OstTraceFunctionEntry0( CMTPPBCSKIP_CMTPPBCSKIP_ENTRY );
    58     delete iPbCmd;
    61     delete iPbCmd;
    59     __FLOG(_L8("CMTPPbcSkip - Exit"));
    62     OstTraceFunctionExit0( CMTPPBCSKIP_CMTPPBCSKIP_EXIT );
    60     __FLOG_CLOSE;
       
    61     }
    63     }
    62 
    64 
    63 /**
    65 /**
    64 Constructor.
    66 Constructor.
    65 */    
    67 */    
    67                    MMTPConnection& aConnection,
    69                    MMTPConnection& aConnection,
    68                    CMTPPlaybackControlDataProvider& aDataProvider):
    70                    CMTPPlaybackControlDataProvider& aDataProvider):
    69                    CMTPRequestProcessor(aFramework, aConnection, 0, NULL),
    71                    CMTPRequestProcessor(aFramework, aConnection, 0, NULL),
    70                    iPlaybackControlDp(aDataProvider)
    72                    iPlaybackControlDp(aDataProvider)
    71     {
    73     {
    72     //Open the log system
    74     OstTraceFunctionEntry0( DUP1_CMTPPBCSKIP_CMTPPBCSKIP_ENTRY );
    73     __FLOG_OPEN(KMTPSubsystem, KComponent);
    75     OstTraceFunctionExit0( DUP1_CMTPPBCSKIP_CMTPPBCSKIP_EXIT );
    74     }
    76     }
    75 
    77 
    76 /**
    78 /**
    77 CheckRequestL
    79 CheckRequestL
    78 */
    80 */
    79 TMTPResponseCode CMTPPbcSkip::CheckRequestL()
    81 TMTPResponseCode CMTPPbcSkip::CheckRequestL()
    80     {
    82     {
    81     __FLOG(_L8("CheckRequestL - Entry"));
    83     OstTraceFunctionEntry0( CMTPPBCSKIP_CHECKREQUESTL_ENTRY );
    82     TMTPResponseCode respCode = CMTPRequestProcessor::CheckRequestL();
    84     TMTPResponseCode respCode = CMTPRequestProcessor::CheckRequestL();
    83     if(respCode == EMTPRespCodeOK)
    85     if(respCode == EMTPRespCodeOK)
    84         {
    86         {
    85         respCode = EMTPRespCodeInvalidParameter;
    87         respCode = EMTPRespCodeInvalidParameter;
    86         TUint32 step = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
    88         TUint32 step = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
    87         if(step != 0)
    89         if(step != 0)
    88             {
    90             {
    89             respCode = EMTPRespCodeOK;
    91             respCode = EMTPRespCodeOK;
    90             }
    92             }
    91         }
    93         }
    92     __FLOG(_L8("CheckRequestL - Exit"));
    94     OstTraceFunctionExit0( CMTPPBCSKIP_CHECKREQUESTL_EXIT );
    93     return respCode;
    95     return respCode;
    94     }
    96     }
    95 
    97 
    96 /**
    98 /**
    97 CMTPPbcSkip request handler.
    99 CMTPPbcSkip request handler.
    98 */   
   100 */   
    99 void CMTPPbcSkip::ServiceL()
   101 void CMTPPbcSkip::ServiceL()
   100     {
   102     {
   101     __FLOG(_L8("ServiceL - Entry"));
   103     OstTraceFunctionEntry0( CMTPPBCSKIP_SERVICEL_ENTRY );
   102     CMTPPlaybackMap& map(iPlaybackControlDp.GetPlaybackMap());
   104     CMTPPlaybackMap& map(iPlaybackControlDp.GetPlaybackMap());
   103     MMTPPlaybackControl& control(iPlaybackControlDp.GetPlaybackControlL());
   105     MMTPPlaybackControl& control(iPlaybackControlDp.GetPlaybackControlL());
   104 
   106 
   105     TMTPPbCtrlData data;
   107     TMTPPbCtrlData data;
   106     data.iOptCode = EMTPOpCodeSkip;
   108     data.iOptCode = EMTPOpCodeSkip;
   115         }
   117         }
   116     else
   118     else
   117         {
   119         {
   118         SendResponseL(EMTPRespCodeInvalidParameter);
   120         SendResponseL(EMTPRespCodeInvalidParameter);
   119         }
   121         }
   120     __FLOG(_L8("ServiceL - Exit"));
   122     OstTraceFunctionExit0( CMTPPBCSKIP_SERVICEL_EXIT );
   121     }
   123     }
   122 
   124 
   123 void CMTPPbcSkip::HandlePlaybackCommandCompleteL(CMTPPlaybackCommand* aCmd, TInt aErr)
   125 void CMTPPbcSkip::HandlePlaybackCommandCompleteL(CMTPPlaybackCommand* aCmd, TInt aErr)
   124     {
   126     {
   125     __FLOG(_L8("HandlePlaybackCommandCompleteL - Entry"));
   127     OstTraceFunctionEntry0( CMTPPBCSKIP_HANDLEPLAYBACKCOMMANDCOMPLETEL_ENTRY );
   126     __FLOG_1(_L8("aErr %d"), aErr);
   128     OstTrace1( TRACE_NORMAL, CMTPPBCSKIP_HANDLEPLAYBACKCOMMANDCOMPLETEL, "aErr %d", aErr );
   127 
   129     
   128     //Handle error response.
   130     //Handle error response.
   129     TMTPResponseCode response;
   131     TMTPResponseCode response;
   130     switch(aErr)
   132     switch(aErr)
   131         {
   133         {
   132         case KPlaybackErrNone:
   134         case KPlaybackErrNone:
   155     SendResponseL(response);
   157     SendResponseL(response);
   156     
   158     
   157     if(aCmd != NULL)
   159     if(aCmd != NULL)
   158         {
   160         {
   159         __ASSERT_DEBUG((aCmd->PlaybackCommand() == iPbCmd->PlaybackCommand()), Panic(EMTPPBArgumentErr));
   161         __ASSERT_DEBUG((aCmd->PlaybackCommand() == iPbCmd->PlaybackCommand()), Panic(EMTPPBArgumentErr));
   160         __FLOG_1(_L8("aCmd %d"), aCmd->PlaybackCommand());
   162         OstTrace1( TRACE_NORMAL, DUP1_CMTPPBCSKIP_HANDLEPLAYBACKCOMMANDCOMPLETEL, "aCmd %d", aCmd->PlaybackCommand() );
   161         }
   163         }
   162 
   164 
   163     __FLOG(_L8("HandlePlaybackCommandCompleteL - Exit"));
   165     OstTraceFunctionExit0( CMTPPBCSKIP_HANDLEPLAYBACKCOMMANDCOMPLETEL_EXIT );
   164     }
   166     }