mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/MetaDataWrite/Src/MetaDataWriteCustomCommandParser.cpp
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation file for MetaDataWriteCustomCommandParser
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include "MetaDataWrite.h"
       
    21 #include "MetaDataWrite.hrh"
       
    22 
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CMetaDataWriteCustomCommandParser::NewL
       
    28 // Two-phased constructor.
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 EXPORT_C CMetaDataWriteCustomCommandParser* CMetaDataWriteCustomCommandParser::NewL(MMetaDataWriteCustomCommandImplementor& aImplementor)
       
    32 {
       
    33     CMetaDataWriteCustomCommandParser* self = new(ELeave) CMetaDataWriteCustomCommandParser(aImplementor);
       
    34     return self;
       
    35 }
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CMetaDataWriteCustomCommandParser::CMetaDataWriteCustomCommandParser
       
    39 // C++ default constructor can NOT contain any code that might leave.
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 CMetaDataWriteCustomCommandParser::CMetaDataWriteCustomCommandParser(MMetaDataWriteCustomCommandImplementor& aImplementor) :
       
    43     CMMFCustomCommandParserBase(KUidMetaDataWriteCustomCommand),
       
    44     iImplementor(aImplementor)
       
    45 {
       
    46     // do nothing
       
    47 }
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // CMetaDataWriteCustomCommandParser::CMetaDataWriteCustomCommandParser
       
    51 // Decode and handle the message from the client
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 void CMetaDataWriteCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
       
    55 {
       
    56     if (aMessage.Destination().InterfaceId() == KUidMetaDataWriteCustomCommand)
       
    57     {
       
    58         TInt err = KErrNone;
       
    59 
       
    60         switch (aMessage.Function())
       
    61         {
       
    62             case KMetaDataWriteEnableDelayWrite:
       
    63                 err = iImplementor.MmdwcEnableDelayWrite();
       
    64                 break;
       
    65             case KMetaDataWriteCommitMetaData:
       
    66                 err = iImplementor.MmdwcCommitMetaData();
       
    67                 break;
       
    68             default:
       
    69                 err = KErrNotSupported;
       
    70                 break;
       
    71         }
       
    72         
       
    73         aMessage.Complete(err);
       
    74     }
       
    75     else
       
    76     {
       
    77         aMessage.Complete(KErrNotSupported);
       
    78     }
       
    79 }
       
    80 
       
    81 // End of file