camerauis/cameraapp/generic/inc/audioplayer/mcamplayerwrapper.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Player Wrapper interface and base class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MCAM_PLAYERWRAPPER_H
       
    21 #define MCAM_PLAYERWRAPPER_H
       
    22 
       
    23 // ===========================================================================
       
    24 // Includes
       
    25 #include <e32base.h>
       
    26 
       
    27 // ===========================================================================
       
    28 // Forward declarations
       
    29 
       
    30 
       
    31 // ===========================================================================
       
    32 // Class definitions
       
    33 
       
    34 /**
       
    35 * Mixin class for Player Wrappers.
       
    36 *
       
    37 */
       
    38 class MCamPlayerWrapper
       
    39   {
       
    40   public: 
       
    41 
       
    42     /**
       
    43     * Player id
       
    44     */
       
    45     virtual TInt Id() const = 0;
       
    46 
       
    47     /**
       
    48     * Play the sound of this player
       
    49     */
       
    50     virtual void Play( TBool aCallback ) = 0;
       
    51 
       
    52     /**
       
    53     * Cancel any pending or ongoing playing.
       
    54     */
       
    55     virtual void CancelPlay() = 0;
       
    56   };
       
    57 
       
    58 // ===========================================================================
       
    59 
       
    60 /**
       
    61 * Base class for Player Wrappers.
       
    62 *
       
    63 */
       
    64 class CCamPlayerWrapperBase : public CBase,
       
    65                               public MCamPlayerWrapper
       
    66   {
       
    67   public:
       
    68 
       
    69     /**
       
    70     * Destructor.
       
    71     * Needed to be able to use this base class pointer for delete.
       
    72     */
       
    73     virtual ~CCamPlayerWrapperBase() {};
       
    74 
       
    75   public: // from MCamPlayerWrapper
       
    76 
       
    77     virtual TInt Id() const = 0;
       
    78 
       
    79     /**
       
    80     * Comparison function to tell if this player's sound
       
    81     * is equal to the sound which id is given. There might
       
    82     * be a situation where the sound ids are as such different,
       
    83     * but still the sound is the same. In that case, the
       
    84     * same player could be used for both sounds.
       
    85     */
       
    86     virtual TBool IsEqualSound( TInt aSoundId ) const = 0;
       
    87     
       
    88     virtual void Play( TBool aCallback ) = 0;
       
    89     virtual void CancelPlay() = 0;
       
    90   };
       
    91 
       
    92 
       
    93 #endif // MCAM_PLAYERWRAPPER_H
       
    94 
       
    95 // ===========================================================================
       
    96 // end of file