⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vrexvideocontainer.h

📁 symbian s60 有关音频的代码实例,供参考
💻 H
字号:
/*
* ============================================================================
*  Name     : CVRexVideoContainer from VRexVideoContainer.h
*  Part of  : Video Example
*  Created  : 30/08/2006 by Forum  Nokia
*  Implementation notes:
*  Version  : 2.0
*  Copyright: Nokia Corporation, 2006
* ============================================================================
*/

#ifndef VREXVIDEOCONTAINER_H
#define VREXVIDEOCONTAINER_H

// INCLUDES
#include <eikapp.h>
#include <eikdoc.h>
#include <e32std.h>

#include <coecntrl.h>
#include <coeccntx.h>
#include <aknappui.h>

#include "VRexEngine.h"
#include "VRexVideoView.h"
#include "VRexViewFinder.h"

// FORWARD DECLARATIONS
class CVRexEngine;
class CVRexVideoView;

class CAknNavigationControlContainer;
class CAknNavigationDecorator;
class CEikButtonGroupContainer;
class CVideoViewFinder;
// CLASS DECLARATION

/**
*  CVRexVideoContainer  container control class.
*
*/
class CVRexVideoContainer : public CCoeControl,
						public		MCoeControlObserver,
						public		MPlayerUIControllerListener
    {
    public: // Constructors and destructor

        /**
        * EPOC default constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL(const TRect& aRect, CVRexVideoView* aView, 
            CVRexEngine* aEngine);

        /**
        * Destructor.
        */
        ~CVRexVideoContainer();

	public: // Functions from MPlayerUIControllerListener
        /**
		 * This method is called when controller has been initialized completely.
		 * @param aError, error code returned
         * @return void
         */
        void InitControllerCompletedL(TInt aError);

		/**
		 * This method is called when playing a video has been completed.
		 * @param aError, error code returned
		 * @return void
		 */
        void PlayCompletedL(TInt aError);

		/**
		 * This method is called when recording a video has been completed.
		 * @param aError, error code returned
		 * @return void
		 */
        void RecordCompletedL(TInt aError);

        /**
         * This method is called when UI controller's playback position is 
         * changed.
         * @param aPlaybackPosInSeconds, new playback postions
         * @param aTotalLengthInSeconds, clips duration
         * @return void
	     */
        void PlaybackPositionChangedL(TInt64 aPlaybackPosInSeconds, 
            TInt64 aTotalLengthInSeconds);

    public: // New functions

		/**
		 * This method returns CVideoViewFinder.
		 * @return CVideoViewFinder
		 */
		CVideoViewFinder* Finder() const { return iFinder; }

        /**
         * This method sets a text to the time navi pane.
         * @param aLabel, text to set
         * @return void
         */
	    void SetNaviLabelL(const TDesC & aLabel);


   		/**
         * This method returns containers RWindow.
         * @return RWindow
         */
        inline RWindow& ClientWindow();

		/**
         * This method returns TRect of the video area.
         * @return TRect
         */
        inline TRect VideoRect() const;

        /**
         * This method returns containers RWsSession.
         * @return RWsSession
         */
        inline RWsSession& ClientWsSession();

        /**
         * This method returns containers CWsScreenDevice.
         * @return CWsScreenDevice
         */
        inline CWsScreenDevice& ScreenDevice();


    public: // Functions from base classes

      	/**
		 * See CCoeControl::OfferKeyEventL(const TKeyEvent& aKeyEvent,
         * TEventCode aType).
		 */
		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
            TEventCode aType);

    private: // Functions from base classes

       /**
        * From CoeControl,SizeChanged.
        */
        void SizeChanged();

       /**
        * From CoeControl,CountComponentControls.
        */
        TInt CountComponentControls() const;

       /**
        * From CCoeControl,ComponentControl.
        */
        CCoeControl* ComponentControl(TInt aIndex) const;

       /**
        * From CCoeControl,Draw.
        */
        void Draw(const TRect& aRect) const;

		/**
		* From MCoeControlObserver
		* Acts upon changes in the hosted control's state.
		*
		* @param	aControl	The control changing its state
		* @param	aEventType	The type of control event
		*/
        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);

         /**
	     * This method creates time display navigation decorator.
         * @return navigation decorator object pointer
	     */
	    CAknNavigationDecorator* CreateTimeNaviL();

    private: //data
		CVRexEngine* iEngine;
       	CVRexVideoView* iView;

		CAknNavigationControlContainer* iNaviPane;
        CAknNavigationDecorator*	iTimeNavi;

        HBufC* iMinSecFormatString;
        HBufC* iHourMinSecFormatString;

        TRect iVideoRect;
		CVideoViewFinder* iFinder;
   };


// INLINED FUNCTIONS!

/*
-----------------------------------------------------------------------------

    inline RWindow& CVRexVideoContainer::ClientWindow()

	Description: This method returns client window handle.
	Comments   :

    Return values: Client window handle

-----------------------------------------------------------------------------
*/
    inline RWindow& CVRexVideoContainer::ClientWindow()
        {
        return Window();
        }

/*
-----------------------------------------------------------------------------

    inline TRect CVRexVideoContainer::VideoRect() const

	Description: This method returns video area.
	Comments   :

    Return values: Video area

-----------------------------------------------------------------------------
*/
    inline TRect CVRexVideoContainer::VideoRect() const
        {
        return iVideoRect;
        }

/*
-----------------------------------------------------------------------------

    inline RWsSession& CVRexVideoContainer::ClientWsSession()

	Description: This method returns client WsSession.
	Comments   :

    Return values: WsSession

-----------------------------------------------------------------------------
*/
    inline RWsSession& CVRexVideoContainer::ClientWsSession()
        {
        return ControlEnv()->WsSession();
        }

/*
-----------------------------------------------------------------------------

    inline CWsScreenDevice& CVRexVideoContainer::ScreenDevice()

	Description: This method returns client ScreenDevice.
	Comments   :

    Return values: ScreenDevice

-----------------------------------------------------------------------------
*/
    inline CWsScreenDevice& CVRexVideoContainer::ScreenDevice()
        {
        return *(ControlEnv()->ScreenDevice());
        }


#endif //VREXVIDEOCONTAINER_H

⌨️ 快捷键说明

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