radioengine/utils/api/cradioroutableaudio.h
changeset 13 46974bebc798
child 57 21be958eb3ce
equal deleted inserted replaced
0:f3d95d9c00ab 13:46974bebc798
       
     1 /*
       
     2 * Copyright (c) 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 #ifndef C_RADIOROUTABLEAUDIO_H
       
    19 #define C_RADIOROUTABLEAUDIO_H
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 
       
    24 // User includes
       
    25 #include "radioenginedef.h"
       
    26 
       
    27 // Forward declarations
       
    28 class CAudioOutput;
       
    29 class CRadioAudioRouter;
       
    30 
       
    31 /**
       
    32  * CRadioRoutableAudio
       
    33  *
       
    34  * Defines common functionality for routable audio sources by defining common
       
    35  * skeleton method for routing.
       
    36  *
       
    37  */
       
    38 class CRadioRoutableAudio : public CBase
       
    39     {
       
    40 
       
    41 public:
       
    42 
       
    43     IMPORT_C CRadioRoutableAudio( CRadioAudioRouter* aAudioRouter );
       
    44 
       
    45     IMPORT_C ~CRadioRoutableAudio();
       
    46 
       
    47     /**
       
    48      * Sets audio routing. Please note that subclasses must define
       
    49      * <code>RoutedAudio</code> method otherwise this will not do anything.
       
    50      * @param aDestination 'Not documented'? old documentation: if <code>true</code> audio routing will be set to
       
    51      * speaker otherwise to headset.
       
    52      */
       
    53     IMPORT_C void SetAudioRouteL( RadioEngine::TRadioAudioRoute aRoute );
       
    54 
       
    55     /**
       
    56      * Tells if audio routing is supported
       
    57      * @return EFalse if routing is not supported, otherwise true
       
    58      */
       
    59     IMPORT_C TBool AudioRoutingSupported() const;
       
    60 
       
    61 protected:
       
    62 
       
    63     /**
       
    64      * Sets audio output. Must be called from subclass.
       
    65      * Ownership is moved.
       
    66      * @param aAudioOutput for setting routing.
       
    67      */
       
    68     IMPORT_C void SetAudioOutput( CAudioOutput* aAudioOutput );
       
    69 
       
    70     /**
       
    71      * Deletes audio output.
       
    72      * Must be called from subclass before
       
    73      * the actual audio utility class is deleted.
       
    74      */
       
    75     IMPORT_C void DeleteAudioOutput();
       
    76 
       
    77 protected: //data
       
    78 
       
    79     /**
       
    80      * Routes audio. Used to register/unregister this routable audio for routing.
       
    81      * Own.
       
    82      */
       
    83     CRadioAudioRouter* iAudioRouter;
       
    84 
       
    85 private: // data
       
    86 
       
    87     /**
       
    88      * AudioOutput for setting routing.
       
    89      * Own.
       
    90      */
       
    91     CAudioOutput*       iAudioOutput;
       
    92 
       
    93     };
       
    94 
       
    95 #endif // C_RADIOROUTABLEAUDIO_H