mmfenh/enhancedaudioplayerutility/AudioStreaming/AudioClientStreamSource/src/WriteRequest.h
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Definition of the audio buffer write request active object class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CWRITEREQUEST_H
       
    21 #define CWRITEREQUEST_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "S60AudioClientStreamSource.h"
       
    26 
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *  S60 Audio Buffer class encapsulating a client audio buffer write request to the server-side data source.
       
    32 *
       
    33 *  @lib S60AudioClientStreamSource.lib
       
    34 *  @since 3.1
       
    35 */
       
    36 class CWriteRequest : public CActive
       
    37     {
       
    38     public: // Constructors and destructor
       
    39 
       
    40         /**
       
    41         * Two-phased constructor.
       
    42         */
       
    43         static CWriteRequest* NewL(TMMFMessageDestinationPckg aMessageHandler, RMMFController& aController,
       
    44         							 CS60SourceEventDispatcher& aCallback);
       
    45 
       
    46         /**
       
    47         * Destructor.
       
    48         */
       
    49         virtual ~CWriteRequest();
       
    50 
       
    51     public: // New functions
       
    52 
       
    53 		/**
       
    54         * Write the specified buffer to source
       
    55         * @param aBuffer Buffer to be processed.
       
    56         * @since 3.1
       
    57         * @return One of the Standard Return Error Codes
       
    58         */
       
    59         void WriteAudioData(CClientAudioBuffer& aBuffer);
       
    60 
       
    61         /**
       
    62         * Returns if the WriteRequest is Free
       
    63         * @since Series 60 3.1
       
    64         * @return return the status of the WriteRequest
       
    65         */
       
    66         TBool IsFree();
       
    67 
       
    68 
       
    69     private:
       
    70 
       
    71         /**
       
    72         * C++ default constructor.
       
    73         */
       
    74         CWriteRequest(TMMFMessageDestinationPckg aMessageHandler, RMMFController& aController,
       
    75         							 CS60SourceEventDispatcher& aCallback);
       
    76 
       
    77         /**
       
    78         * By default Symbian 2nd phase constructor is private.
       
    79         */
       
    80         void ConstructL();
       
    81 
       
    82         void RunL();
       
    83 
       
    84         void DoCancel();
       
    85 
       
    86     private:
       
    87 
       
    88 		// Pointer to controller with custom command facility
       
    89 		RMMFController& iController;
       
    90 		// Message handler handle
       
    91 		TMMFMessageDestinationPckg iMessageHandler;
       
    92 		// Object to notify upon request completion
       
    93 		CS60SourceEventDispatcher& iCallback;
       
    94 		// Last buffer indicator to be sent to server-side
       
    95 		TPckgBuf<TInt> iLastBufferPckg;
       
    96 		// Buffer to be sent to server-side
       
    97 		//TDesC8* iBuffer;
       
    98 		CClientAudioBuffer* iClientBuffer;
       
    99 		// Indicates whether the buffer has been processed
       
   100 		TBool iProcessed;
       
   101 		// Indicates whether this object is free to reuse
       
   102 		TBool iFree;
       
   103 	};
       
   104 
       
   105 #endif 		// CWRITEREQUEST_H
       
   106 
       
   107 //  End of File