javauis/mmapi_akn/baseline/inc/cmmaplayer.h
branchRCL_3
changeset 60 6c158198356e
parent 46 4376525cdefb
equal deleted inserted replaced
59:e5618cc85d74 60:6c158198356e
    23 #include "cmmacontrol.h"
    23 #include "cmmacontrol.h"
    24 #include "cmmasourcestream.h"
    24 #include "cmmasourcestream.h"
    25 #include "cmmaplayerevent.h"
    25 #include "cmmaplayerevent.h"
    26 #include "mmmasourcestreamlistener.h"
    26 #include "mmmasourcestreamlistener.h"
    27 #include "mmmaplayerstatelistener.h"
    27 #include "mmmaplayerstatelistener.h"
       
    28 #include "mmmacallstateobserver.h"
    28 
    29 
    29 //  FORWARD DECLARATIONS
    30 //  FORWARD DECLARATIONS
    30 class CMMADurationUpdater;
    31 class CMMADurationUpdater;
       
    32 class CMMACallStateMonitor;
    31 
    33 
    32 //  CONTANTS
    34 //  CONTANTS
    33 
    35 
    34 // Not enough stream to realize to player
    36 // Not enough stream to realize to player
    35 const TInt KErrNotEnoughStreams = -7002;
    37 const TInt KErrNotEnoughStreams = -7002;
    50 *
    52 *
    51 *
    53 *
    52 */
    54 */
    53 
    55 
    54 class CMMAPlayer : public CBase,
    56 class CMMAPlayer : public CBase,
    55         public MMMASourceStreamListener
    57         public MMMASourceStreamListener, MMMACallStateObserver
    56 
    58 
    57 {
    59 {
    58 public:
    60 public:
    59     /**
    61     /**
    60      * Player state. Same that in Java side.
    62      * Player state. Same that in Java side.
   172 
   174 
   173     /**
   175     /**
   174      * Close the Player and release its resources. After this player is in
   176      * Close the Player and release its resources. After this player is in
   175      * EClosed state and cannot be used anymore.
   177      * EClosed state and cannot be used anymore.
   176      */
   178      */
   177     virtual void CloseL();
   179     IMPORT_C virtual void CloseL();
   178 
   180 
   179     /**
   181     /**
   180      * Gets duration.
   182      * Gets duration.
   181      *
   183      *
   182      * @param aDuration Duration or KTimeUnknown if not specified.
   184      * @param aDuration Duration or KTimeUnknown if not specified.
   214      * @return The content type being played back by this Player. NULL if
   216      * @return The content type being played back by this Player. NULL if
   215      * content type is not available.
   217      * content type is not available.
   216      */
   218      */
   217     HBufC* ContentType() const;
   219     HBufC* ContentType() const;
   218 
   220 
       
   221 public: // from MMMACallStateObserver
       
   222 	
       
   223     void HandleCallStateEventL(TUid aUid, TInt aKey);
       
   224     
   219 public: // new methods
   225 public: // new methods
   220     /**
   226     /**
   221      * Sets Java listener object that will be used to post player events
   227      * Sets Java listener object that will be used to post player events
   222      * and control specific events.
   228      * and control specific events.
   223      *
   229      *
   449      * Player state listener that sends duration update event to Java
   455      * Player state listener that sends duration update event to Java
   450      * if duration has changed when player state changes.
   456      * if duration has changed when player state changes.
   451      */
   457      */
   452     CMMADurationUpdater* iDurationUpdater;
   458     CMMADurationUpdater* iDurationUpdater;
   453 
   459 
       
   460 		/**
       
   461     * Used to get the callback for Call State Events.
       
   462     */
       
   463     CMMACallStateMonitor* iStateObserver; 
       
   464     
       
   465     /**
       
   466      *  Used to determine if the Player is in Paused state
       
   467      *  due to call or done by user.
       
   468      */
       
   469     TBool isPausedByCall;
   454 };
   470 };
   455 
   471 
   456 
   472 
   457 inline TInt CMMAPlayer::State()
   473 inline TInt CMMAPlayer::State()
   458 {
   474 {