javauis/nokiasound/inc/CMIDSoundImpl.h
branchRCL_3
changeset 83 26b2b12093af
parent 77 7cee158cb8cd
child 84 0553e2305d00
equal deleted inserted replaced
77:7cee158cb8cd 83:26b2b12093af
     1 /*
       
     2 * Copyright (c) 2006-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:  Interface and a base class for CMIDClip and CMIDTone.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMIDSOUNDIMPL_H
       
    21 #define CMIDSOUNDIMPL_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MMIDEventSender;
       
    28 
       
    29 
       
    30 //  CLASS DEFINITION
       
    31 /**
       
    32  * This class is interface and a base class for CMIDClip and CMIDTone
       
    33  *
       
    34  */
       
    35 NONSHARABLE_CLASS(CMIDSoundImpl): public CBase
       
    36 {
       
    37 
       
    38 public:
       
    39 
       
    40     enum TState
       
    41     {
       
    42         ENotReady,
       
    43         EReadyToPlay,
       
    44         EPlaying,
       
    45         ENotSupported,
       
    46         EInitialising
       
    47     };
       
    48 
       
    49 public:
       
    50 
       
    51     // destructor
       
    52     ~CMIDSoundImpl();
       
    53 
       
    54 protected:
       
    55 
       
    56     void ConstructL();
       
    57 
       
    58     // C++ constructor
       
    59     CMIDSoundImpl(MMIDEventSender* aEventSender);
       
    60 
       
    61 public:
       
    62 
       
    63     void Resume();
       
    64 
       
    65     virtual TInt Play(TInt aLoop) = 0;
       
    66     virtual void Stop() = 0;
       
    67     virtual void SetVolume(TInt aVolume) = 0;
       
    68     virtual TInt Volume() = 0;
       
    69     virtual void Release() = 0;
       
    70 
       
    71     inline TInt State() const;
       
    72 
       
    73 protected:
       
    74 
       
    75 
       
    76     TInt iState;
       
    77 
       
    78     // true if playback has been started.
       
    79     TBool iPlayed;
       
    80 
       
    81     CActiveSchedulerWait* iSchedulerWait;
       
    82 
       
    83     // events are sent through this interface
       
    84     MMIDEventSender* iEventSender;
       
    85 
       
    86 };
       
    87 
       
    88 inline TInt CMIDSoundImpl::State() const
       
    89 {
       
    90     return iState;
       
    91 };
       
    92 
       
    93 #endif // CMIDSOUNDIMPL_H