devsound/a3facf/inc/audiocontextfactory.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 /*
       
     2 * Copyright (c) 2006-2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 /**
       
    22  @publishedPartner
       
    23  @file
       
    24  @released
       
    25 */
       
    26 
       
    27 
       
    28 #ifndef AUDIOCONTEXTFACTORY_H
       
    29 #define AUDIOCONTEXTFACTORY_H
       
    30 
       
    31 #include <e32base.h>
       
    32 
       
    33 #include <a3f/a3fbase.h>
       
    34 
       
    35 class MAudioContext;
       
    36 
       
    37 /**
       
    38  * An interface to an AudioContextFactory.
       
    39  *
       
    40  * Audio Context Factory is the entry point to the low level audio functionality of the device.
       
    41  * Audio Context Factory is used for creating new audio contexts.
       
    42  *
       
    43  *  @lib AudioContextFactory.lib
       
    44  */
       
    45 class CAudioContextFactory : public CBase
       
    46 	{
       
    47 public:
       
    48 	/**
       
    49 	 * Constructs and returns a pointer to a new CAudioContextFactory object.
       
    50 	 *
       
    51 	 * @return CAudioContextFactory* - on success, pointer to new class instance.
       
    52 	 * This call returns ownership, as in the standard NewL() pattern.
       
    53 	 */
       
    54 	IMPORT_C static CAudioContextFactory* NewL();
       
    55 
       
    56 	/**
       
    57 	 * Destructor.
       
    58 	 *
       
    59 	 * Deletes all objects and releases all resource owned by this instance.
       
    60 	 */
       
    61 	IMPORT_C virtual ~CAudioContextFactory();
       
    62 
       
    63 	/**
       
    64 	 * Creates a new audio context.
       
    65 	 *
       
    66 	 * The context must be removed using DeleteAudioContext() when it is no longer needed.
       
    67 	 * @param aContext on return contains a reference to the created context.
       
    68 	 * @return an error code. KErrNone if successful, otherwise one of the system wide error codes.
       
    69  	 */
       
    70 	IMPORT_C TInt CreateAudioContext(MAudioContext*& aContext);
       
    71 
       
    72 
       
    73 	/**
       
    74 	 * Deletes the audio context.
       
    75 	 * All processing units have to be removed from the context by the client.
       
    76 	 * before the context is removed. This is a null-operation if aContext is NULL on DeleteAudioContext being called.
       
    77 	 * aContext is set to NULL on completion of the call.
       
    78 	 * @param aContext a pointer to the context to remove.
       
    79 	 * @return an error code. KErrNone if successful, otherwise one of the system wide error codes.
       
    80 	 */
       
    81 	IMPORT_C void DeleteAudioContext(MAudioContext*& aContext);
       
    82 
       
    83 protected:
       
    84 	/**
       
    85 	 * Constructor
       
    86 	 */
       
    87 	CAudioContextFactory();
       
    88 	/**
       
    89 	 * Second phase contructor.
       
    90 	 */
       
    91 	void ConstructL();
       
    92 	};
       
    93 
       
    94 #endif // AUDIOCONTEXTFACTORY_H