tsrc/consoleplayer/player/src/openmax_al/openmaxplayerutility.h
changeset 35 b0f0be18af85
child 36 20d2741ccdad
equal deleted inserted replaced
32:106971a9964d 35:b0f0be18af85
       
     1 #ifndef OPENMAX_PLAYER_UTILITY_H
       
     2 #define OPENMAX_PLAYER_UTILITY_H
       
     3 
       
     4 #include <string.h>
       
     5 #include <e32std.h>
       
     6 #include <w32std.h>
       
     7 #include <mmf\common\Mmfvideo.h> // for TVideoRotation and TAutoScaleType
       
     8 #include "playerwindow.h"
       
     9 #include "openmaxal.h"
       
    10 
       
    11 #define MAX_NUMBER_INTERFACES 5
       
    12 
       
    13 class COpenMaxPlayerUtility
       
    14 {
       
    15 public:
       
    16     COpenMaxPlayerUtility();
       
    17     ~COpenMaxPlayerUtility();
       
    18     
       
    19     void VideoFrameSize(TSize& aSize) const;
       
    20     TTimeIntervalMicroSeconds Position() const;
       
    21     TTimeIntervalMicroSeconds Duration() const;
       
    22     TInt Volume() const;
       
    23     TInt MaxVolume() const;
       
    24     TInt Balance()const;
       
    25     TVideoRotation Rotation() const;
       
    26     
       
    27     void SetVolume(TInt aVolume);
       
    28     void SetBalance(TInt aBalance);
       
    29     void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
       
    30     void SetRotation(const RWindow& aWindow, TVideoRotation aRotation);
       
    31     void SetScaleFactor(const RWindow& aWindow, TReal32 aWidthPercentage, TReal32 aHeightPercentage);
       
    32     void SetAutoScale(const RWindow& aWindow, TAutoScaleType aScaleType);
       
    33     void StepFrame(TInt aStep);
       
    34     
       
    35     void OpenFile(const TDesC& aFileName,TUid aControllerUid = KNullUid);
       
    36     void OpenUrl(const TDesC& aUrl);
       
    37     void Prepare();
       
    38     void Close();
       
    39     void Play();
       
    40     TInt Stop();
       
    41     void Pause();
       
    42 
       
    43     void AddDisplayWindow(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindow& aWindow);
       
    44     void SetWindowClipRect(const RWindow& aWindow, const TRect& aWindowClipRect);
       
    45     void SetVideoExtent(const RWindow& aWindow, const TRect& aVideoExtent);
       
    46 
       
    47     bool CheckErr (XAresult res, char* aMsg = "");
       
    48 
       
    49     void Init (void);
       
    50     void DestroyPlayer ();
       
    51     void DrawEQDisplay (void);
       
    52     void SetBandLevel(XAint16 band, XAboolean increase);
       
    53     void PlaySource(const XADataLocator_URI &source);
       
    54     void PlayPause(bool);
       
    55     void MuteChanged(bool);
       
    56     TInt SetPlayVelocity( TInt aVelocity );
       
    57     
       
    58 protected:
       
    59     void StartBackLightTimer();
       
    60     void CancelBackLightTimer();
       
    61     
       
    62 private:
       
    63     XAObjectItf m_engine; /* OpenMAX AL Engine */
       
    64     XAObjectItf player;
       
    65     XAObjectItf m_outputMix;
       
    66 
       
    67     XAEngineItf m_EngineItf;
       
    68     XAPlayItf m_playItf;
       
    69     XAEqualizerItf m_equalizerItf;
       
    70     XAVolumeItf m_volumeItf;
       
    71 
       
    72     XAInterfaceID m_iidArray[MAX_NUMBER_INTERFACES];
       
    73     XAboolean m_required[MAX_NUMBER_INTERFACES];
       
    74 
       
    75     XADataSource m_dataSource;
       
    76     XADataSink          m_audioSink;
       
    77     XADataSink          m_videoSink;
       
    78     XADataFormat_MIME m_mime;
       
    79     XADataLocator_OutputMix m_locator_outputmix;
       
    80     XADataLocator_NativeDisplay m_locator_displayregion;
       
    81     XADataLocator_URI uri;
       
    82     
       
    83     TRect   m_displayRect;
       
    84     int     m_nVolume;
       
    85     int     m_Velocity;
       
    86     XAchar  m_sourceName[1000];
       
    87 };
       
    88 
       
    89 #endif // OPENMAX_PLAYER_UTILITY_H