📄 vrexplayeradapter.h
字号:
/*
* ============================================================================
* Name : CVideoPlayerAdapter from VRexPlayerAdapter.h
* Part of : Video Example
* Created : 30/08/2006 by Forum Nokia
* Implementation notes:
* Version : 2.0
* Copyright: Nokia Corporation, 2006
* ============================================================================
*/
#ifndef __VIDEOPLAYERADAPTER_H__
#define __VIDEOPLAYERADAPTER_H__
#include <e32base.h>
#include <mmferrors.h>
#include <VideoPlayer.h>
#include <DocumentHandler.h>
#include "VRex.hrh"
#include "VRexEngine.h"
#include "VRexFileDetails.h"
#include "MPlayerUIControllerListener.h"
class CVideoFileDetails;
class CVRexEngine;
class CVideoPlayerUtility;
class MPlayerUIControllerListener;
class CDocumentHandler;
class CHeartbeat;
/**
* CVideoPlayerAdapter
* Used to handle video player specific tasks.
*/
class CVideoPlayerAdapter : public CBase, public MVideoPlayerUtilityObserver,
public MBeating
{
public: // Constructors and destructor
enum TPlayerState
{
ENotInitialized,
EInitializing,
EStopped,
EPlaying,
EPaused
};
enum TPlayerErrorCode
{
EErrReOpen = 101,
EErrAutoDisconnect,
EErrAudioLost
};
/**
* Two-phased constructor.
*/
static CVideoPlayerAdapter* NewL();
/**
* Two-phased constructor.
*/
static CVideoPlayerAdapter* NewLC();
/**
* Destructor.
*/
~CVideoPlayerAdapter();
private:
/**
* EPOC 2nd phase constructor.
*/
void ConstructL();
/**
* Default constructor.
*/
CVideoPlayerAdapter();
public: // New functions
/**
* This method plays a video clip.
* @return void
*/
void PlayL();
/**
* This method pauses a playing video clip.
* @return void
*/
void PauseL();
/**
* This method stops a playing video clip.
* @return void
*/
void Stop();
/**
* This method sets the new video file to be played.
* @param aFileName, file name
* @return void
*/
void SetNewFileL(const TDesC& aFileName);
/**
* This method returns a document handler.
* @return document handler
*/
CDocumentHandler& DocumentHandlerL();
/**
* This method initializes controller. Sets the Display Window,
* area of the display to render the current video frame.
* @param aCallback, UI controller callback
* @param aWs, a session with the window server
* @param aScreenDevice, the screen device
* @param aWindow, the window to display
* @param aWindowRect, the rectangle to display
* @param aClipRect, the clip rectangle
* @leaves Can leave with one of the system wide error codes
* @return void
*/
void InitControllerL( MPlayerUIControllerListener* aCallback,
RWsSession& aWs,
CWsScreenDevice& aScreenDevice,
RWindowBase& aWindow,
TRect& aScreenRect,
TRect& aClipRect);
public: // Functions from MBeating
/**
* See MBeating::Beat()
*/
void Beat();
/**
* See MBeating::Synchronize()
*/
void Synchronize();
public: // Functions from MVideoPlayerUtilityObserver
/**
* See MVideoPlayerUtilityObserver::MvpuoOpenComplete(TInt aError).
*/
void MvpuoOpenComplete(TInt aError);
/**
* See MVideoPlayerUtilityObserver::MvpuoPrepareComplete(TInt aError).
*/
void MvpuoPrepareComplete(TInt aError);
/**
* See MVideoPlayerUtilityObserver::MvpuoFrameReady(CFbsBitmap& aFrame,
* TInt aError).
*/
void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);
/**
* See MVideoPlayerUtilityObserver::MvpuoPlayComplete(TInt aError).
*/
void MvpuoPlayComplete(TInt aError);
/**
* See MVideoPlayerUtilityObserver::MvpuoEvent(const TMMFEvent& aEvent).
*/
void MvpuoEvent(const TMMFEvent& aEvent);
public:
/**
* This method gets the state of video player engine.
* @return player state
*/
TPlayerState State() const { return iState; }
private:
// The state of video player engine
TPlayerState iState;
// Video player utility
CVideoPlayerUtility* iPlayer;
HBufC* iMediaFile;
// The file details
CVideoFileDetails* iFileDetails;
// The UI listener for the video engine
MPlayerUIControllerListener* iCtrlrListener;
// Document handler
CDocumentHandler* iDocHandler;
// Update the time progress when video is playing
CHeartbeat* iProgressUpdater;
// The position of a playing video clip
TInt64 iPlayPosition;
};
#endif //__VIDEOPLAYERADAPTER_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -