chxavplayview.h

来自「symbian 下的helix player源代码」· C头文件 代码 · 共 202 行

H
202
字号
/************************************************************************
 * chxavplayview.h
 * ---------------
 *
 * Synopsis:
 * Contains the declaration of the CHXAvPlayView class.  This class 
 * implements the play/stop/pause view.
 *
 * Target:
 * Symbian OS
 *
 *
 * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
 *
 ************************************************************************/

#ifndef _chxavplayview_h_
#define _chxavplayview_h_

// Helix includes...
#include "ihxpckts.h"
#include "hxfiles.h"
#include "unkimp.h"
#include "hxurl.h"
#include "hxwintyp.h"
#include "hxcom.h"
#include "hxcomm.h"
#include "hxmon.h"
#include "hxslist.h"
#include "hxstring.h"

// Includes for this project...
#include "chxavcallback.h"
#include "chxavplayviewwindow.h"
//#include "chxavwaitnote.h"
#include "chxavviewbase.h"
#include "chxsymsysagentwatcher.h"
#include "ihxsymplayerstateobserver.h"

// Forward declarations...
class CHXAvPlayerUI;
class CAknTitlePane;
class CHXAvPlayView;


class CHXAvPlayView
: public CHXAvViewBase
, public IHXSymPlayerStateObserver
{
public:
    friend class CHXAvPlayViewWindow;

public:

    CHXAvPlayView(TInt idxView, CHXAvPlayerUI *pContext);
    virtual ~CHXAvPlayView(); 
    virtual void ConstructL();

    comptr<CHXAvPlayer> GetPlayer();

    // CHXAvAppViewBase 
    void HandleCommandL(TInt command);
    void UpdateViewStateL();    
    CCoeControl* CreateViewWindowForActivatingViewL();
    void FinishViewActivateL();
    void FinishViewDeactivateL();
    void HandleLosePlayFocus();
    void HandleForegroundEventL(TBool bEnterForeground);


     // IHXSymPlayerStateObserver
    void OnLoadSession(IHXRequest* request);
    void OnResume();
    void OnStop();
    void OnPause();
    void OnPlayInitiate(const char *url);
    void OnBeginBuffering(bool bIsBegin);
    void OnBeginSeek();
    void OnVolume(unsigned int percentVol);
    void OnMute(bool bMute);
    void OnNetConnect();
    void OnAdvancePlaylist();
    void OnError(HX_RESULT code);

    void SetViewActivateClipL(const TDesC& file);
    void SetShutdownOnViewDeactivation(bool bDoShutdownAutomatically);


protected:
    // implementation helpers
    void UpdateSoftkeyMenuStateL();

    void DoSaveL();
    void DoViewClipInfoL();


    // seek related
    void EnterSeekMode(bool bEnter);
    void HandleSeekKeyCommand(bool bForward);
    UINT32 GetNextSeekStep(UINT32 msSeekStep);
    void SetEndSeekCallback(bool bEnable);
    void OnEndSeekCallback();


    void ActivateNaviVolumeControlL(TUint msHide);
    void UpdateNaviVolumeControlL();
    void DeactivateNaviVolumeControl();

    void ActivateNaviPlaylistControlL(TUint msHide);
    void UpdateNaviPlaylistControlL();
    void DeactivateNaviPlaylistControl();
    void DrawNaviPlaylistControlNowL();
    void EnsureExitPlaylistMode();
    
    void HideTempNaviControlNowL();
    void UpdateNaviDefaultControlL();
    void DrawNaviDefaultControlNowL();

    void UpdateTitleL();
    void HandleVolumeCommand(TInt idCmd);
    bool TryHandlePlaylistCommandL(TInt command);

    void HaltPlayer();
    void OnPhoneEvent();
    void OnBacklightTimer();
    void InitBacklightState();

    bool IsPlaylistMode();
    void HandleShowPopupL();

    // CAknView and derived...
    void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);

    // misc implementation
    void InitIdleOptionsMenu(CEikMenuPane* aMenuPane);
    void InitPausedOptionsMenu(CEikMenuPane* aMenuPane);
    void InitSaveMenuItem(CEikMenuPane* aMenuPane);
    void InitLivePlayOptionsMenu(CEikMenuPane* aMenuPane);
    void InitClipInfoMenuItem(CEikMenuPane* aMenuPane);
    void InitPlaylistMenuItems(CEikMenuPane* pMenuPane);
    void InitNonIdleMenuOptions(CEikMenuPane* pMenuPane);
    
    void UpdateContextPaneL();
    void OnUserCancelConnect();

    void DoExitPlaylistModeL(bool bPlayCurrent);
    void DoTogglePlayState();
    void ShowTempPlaylistControlL();

private:

   

    CHXAvPlayViewWindowPtr m_spWindow;

    refptr<HBufC> m_spViewActivateClip;


    refptr<CAknNavigationDecorator> m_spNaviDefaultDecorator;
    refptr<CAknNavigationDecorator> m_spNaviVolDecorator;
    refptr<CAknNavigationDecorator> m_spNaviPlaylistDecorator;
    CHXAvCallback m_cbTempNaviDisplay;
    CHXAvCallback m_cbBacklight;
    CHXAvCallback m_cbEndSeek;
    bool m_bViewPlaylistMode;
    bool m_bEnsureResumeOnExitPlaylistMode;
    UINT32 m_msSeekStep;
    
    TInt    m_lastPhoneState;
    CHXSymSysAgentWatcher m_saWatcher;
    
    bool m_bShutDownOnViewDeactivate;

    CHXAvNetConnectUIPtr m_spNetConnectUi;
    comptr<CHXAvPlayer> m_player;
};

inline 
bool CHXAvPlayView::IsPlaylistMode()
{
    return m_bViewPlaylistMode;
}

inline
comptr<CHXAvPlayer> CHXAvPlayView::GetPlayer()
{
    return m_player;
}

inline
void CHXAvPlayView::SetShutdownOnViewDeactivation(bool bDoShutdownAutomatically)
{
    //
    // this flag will prevent player from shutting down when view switches (presumably
    // so when we return to the view the player state is same as before)
    //
    m_bShutDownOnViewDeactivate = bDoShutdownAutomatically;
}

#endif // _chxavplayview_h_

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?