advgroup.h
上传用户:zhongxx05
上传日期:2007-06-06
资源大小:33641k
文件大小:14k
源码类别:

Symbian

开发平台:

C/C++

  1. /* ***** BEGIN LICENSE BLOCK ***** 
  2.  * Version: RCSL 1.0/RPSL 1.0 
  3.  *  
  4.  * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
  5.  *      
  6.  * The contents of this file, and the files included with this file, are 
  7.  * subject to the current version of the RealNetworks Public Source License 
  8.  * Version 1.0 (the "RPSL") available at 
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed 
  10.  * the file under the RealNetworks Community Source License Version 1.0 
  11.  * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
  12.  * in which case the RCSL will apply. You may also obtain the license terms 
  13.  * directly from RealNetworks.  You may not use this file except in 
  14.  * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
  15.  * applicable to this file, the RCSL.  Please see the applicable RPSL or 
  16.  * RCSL for the rights, obligations and limitations governing use of the 
  17.  * contents of the file.  
  18.  *  
  19.  * This file is part of the Helix DNA Technology. RealNetworks is the 
  20.  * developer of the Original Code and owns the copyrights in the portions 
  21.  * it created. 
  22.  *  
  23.  * This file, and the files included with this file, is distributed and made 
  24.  * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
  25.  * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
  26.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
  27.  * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
  28.  * 
  29.  * Technology Compatibility Kit Test Suite(s) Location: 
  30.  *    http://www.helixcommunity.org/content/tck 
  31.  * 
  32.  * Contributor(s): 
  33.  *  
  34.  * ***** END LICENSE BLOCK ***** */ 
  35. #ifndef _ADVANCEDGROUP_H_
  36. #define _ADVANCEDGROUP_H_
  37. #include "basgroup.h"
  38. struct IHXValues;
  39. struct IHXGroup;
  40. struct IHXGroup2;
  41. struct IHXGroupManager;
  42. struct IHXGroupSink;
  43. struct IHXTrack;
  44. struct IHXStreamSource;
  45. struct IHXAudioHook;
  46. struct IHXPrefetch;
  47. struct IHXPrefetchSink;
  48. class HXAdvancedTrack;
  49. class HXAdvancedGroup;
  50. class HXAdvancedGroupManager;
  51. class CHXSimpleList;
  52. class   HXPlayer;
  53. class HXMasterTAC;
  54. class CHXMapStringToOb;
  55. class HXAdvancedTrack : public HXBasicTrack
  56. #if defined(HELIX_FEATURE_AUDIOHOOK)
  57.               , public IHXAudioHook
  58. #endif /* HELIX_FEATURE_AUDIOHOOK */
  59. {
  60. protected:
  61.     CHXSimpleList*     m_pRepeatList;
  62.     BOOL     m_bInSoundLevelAnimation;
  63.     UINT16     m_uSoundLevel;
  64.     UINT32     m_ulSoundLevelAnimationTime;   
  65.     UINT32     m_ulGranularity;
  66.     virtual     ~HXAdvancedTrack();
  67.     PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME
  68.     friend class HXAdvancedGroup;
  69. public:
  70.     HXAdvancedTrack(HXAdvancedGroup* pHXGroup);
  71. #if defined(HELIX_FEATURE_AUDIOHOOK)
  72.     /*
  73.      *  IUnknown methods
  74.      */
  75.     STDMETHOD(QueryInterface)       (THIS_
  76.     REFIID riid,
  77.     void** ppvObj);
  78.     STDMETHOD_(ULONG32,AddRef)      (THIS);
  79.     STDMETHOD_(ULONG32,Release)     (THIS);
  80.     /*
  81.      *  IHXAudioHook methods
  82.      */
  83.     /************************************************************************
  84.      *  Method:
  85.      *      IHXAudioHook::OnInit
  86.      *  Purpose:
  87.      *      Audio Services calls OnInit() with the audio data format of the
  88.      *     audio data that will be provided in the OnBuffer() method.
  89.      */
  90.     STDMETHOD(OnInit) (THIS_
  91.                      HXAudioFormat* /*IN*/ pFormat);
  92.     /************************************************************************
  93.      *  Method:
  94.      *      IHXAudioHook::OnBuffer
  95.      *  Purpose:
  96.      *      Audio Services calls OnBuffer() with audio data packets. The
  97.      *     renderer should not modify the data in the IHXBuffer part of
  98.      *     pAudioInData.  If the renderer wants to write a modified
  99.      *     version of the data back to Audio Services, then it should 
  100.      *     create its own IHXBuffer, modify the data and then associate 
  101.      *     this buffer with the pAudioOutData->pData member.
  102.      */
  103.     STDMETHOD(OnBuffer) (THIS_
  104.                      HXAudioData* /*IN*/   pAudioInData,
  105.                      HXAudioData* /*OUT*/  pAudioOutData);
  106. #endif /* HELIX_FEATURE_AUDIOHOOK */
  107.     STDMETHOD(Begin)             (THIS);
  108.     STDMETHOD(Pause)             (THIS);
  109.     STDMETHOD(Seek)             (THIS_
  110.             UINT32 ulSeekTime);
  111.     STDMETHOD(Stop)             (THIS);
  112.     STDMETHOD(AddRepeat)            (THIS_
  113.             IHXValues* pValues);
  114.     STDMETHOD(GetSource)     (THIS_
  115.     REF(IHXStreamSource*) pStreamSource);
  116.     STDMETHOD(SetSoundLevel)        (THIS_
  117.             UINT16 uSoundLevel);
  118.     STDMETHOD_(UINT16, GetSoundLevel)(THIS);
  119.     STDMETHOD(BeginSoundLevelAnimation)(THIS_
  120. UINT16 uSoundLevelBeginWith);
  121.     STDMETHOD(EndSoundLevelAnimation)(THIS_
  122.       UINT16 uSoundLevelEndWith);
  123.     virtual void    Close(void);
  124. };
  125. class HXAdvancedGroup : public HXBasicGroup
  126.       , public IHXGroup2
  127. #if defined(HELIX_FEATURE_PREFETCH)
  128.       , public IHXPrefetch
  129.       , public IHXPrefetchSink
  130. #endif /* HELIX_FEATURE_PREFETCH */
  131. {
  132. protected:
  133.     IHXValues*     m_pGroupProperties;
  134.     BOOL     m_bPrefetchSinkAdded;
  135.     UINT16     m_uPrefetchTrackCount;
  136.     CHXMapLongToObj*     m_pPrefetchTrackMap;
  137.     CHXMapLongToObj*     m_pPersistentComponentPropertyMap;
  138.     CHXSimpleList*     m_pTrackSinkList;
  139.     CHXSimpleList*     m_pPrefetchSinkList;
  140.     virtual     ~HXAdvancedGroup();
  141.     PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME
  142.     
  143.     friend class HXAdvancedTrack;
  144.     friend class HXAdvancedGroupManager;
  145.     friend class HXPlayer;
  146. public:
  147.                             HXAdvancedGroup(HXAdvancedGroupManager* pManager);
  148.     /*
  149.      *  IUnknown methods
  150.      */
  151.     STDMETHOD(QueryInterface)       (THIS_
  152.     REFIID riid,
  153.     void** ppvObj);
  154.     STDMETHOD_(ULONG32,AddRef)      (THIS);
  155.     STDMETHOD_(ULONG32,Release)     (THIS);
  156.     STDMETHOD(SetGroupProperties)   (THIS_
  157.     IHXValues*  /*IN*/ pProperties);
  158.     STDMETHOD_(IHXValues*, GetGroupProperties)   (THIS);
  159.     STDMETHOD(AddTrack)             (THIS_
  160.             IHXValues* /*IN*/ pTrack);
  161.     STDMETHOD(RemoveTrack)          (THIS_
  162.             UINT16 /*IN*/ uTrackIndex);
  163.     /************************************************************************
  164.     *  Method:
  165.     *      IHXGroup2::GetIHXTrack
  166.     *  Purpose:
  167.     * Get ith track in this group
  168.     */
  169.     STDMETHOD(GetIHXTrack) (THIS_
  170. UINT16  /*IN*/ uTrackIndex,
  171. REF(IHXTrack*) /*OUT*/ pTrack);
  172.     /************************************************************************
  173.     *  Method:
  174.     *      IHXGroup2::AddTrackSink
  175.     *  Purpose:
  176.     * add advise sink on track
  177.     */
  178.     STDMETHOD(AddTrackSink) (THIS_
  179. IHXTrackSink*   /*IN*/  pSink);
  180.     /************************************************************************
  181.     *  Method:
  182.     *      IHXGroup2::RemoveTrackSink
  183.     *  Purpose:
  184.     * remove advise sink on track
  185.     */
  186.     STDMETHOD(RemoveTrackSink) (THIS_
  187. IHXTrackSink*   /*IN*/  pSink);
  188.     /************************************************************************
  189.     *  Method:
  190.     *      IHXGroup2::AddTrack2
  191.     *  Purpose:
  192.     * Add Tracks to the group, including the props set in RequestHeader
  193.     */
  194.     STDMETHOD(AddTrack2)     (THIS_
  195.     IHXValues* /*IN*/ pTrack,
  196.     IHXValues* /*IN*/ pRequestProp);
  197.     /************************************************************************
  198.     *  Method:
  199.     *      IHXGroup2::GetTrack2
  200.     *  Purpose:
  201.     * Get ith track in this group
  202.     */
  203.     STDMETHOD(GetTrack2)     (THIS_
  204.     UINT16  /*IN*/ uTrackIndex,
  205.     REF(IHXValues*) /*OUT*/ pTrack,
  206.     REF(IHXValues*) /*OUT*/ pTrackPropInRequest);
  207.     /************************************************************************
  208.     *  Method:
  209.     *      IHXGroup2::SetPersistentComponentProperties
  210.     *  Purpose:
  211.     * Set persistent component properties associated with this group
  212.     * One group may contain multiple persistent components
  213.     */
  214.     STDMETHOD(SetPersistentComponentProperties)   (THIS_
  215.    UINT32 /*IN*/ ulPersistentComponentID,
  216.    IHXValues*  /*IN*/ pProperties);
  217.     /************************************************************************
  218.     *  Method:
  219.     *      IHXGroup2::GetPersistentComponentProperties
  220.     *  Purpose:
  221.     * Get any persistent component specific information associated with 
  222.     * the group.
  223.     * One group may contain multiple persistent components
  224.     */
  225.     STDMETHOD(GetPersistentComponentProperties)   (THIS_
  226.    UINT32     /*IN*/  ulPersistentComponentID,
  227.    REF(IHXValues*) /*OUT*/ pProperties);
  228. #if defined(HELIX_FEATURE_PREFETCH)
  229.     /************************************************************************
  230.     *  Method:
  231.     *      IHXPrefetch::AddPrefetchTrack
  232.     *  Purpose:
  233.     *      adds prefetch track by specifying "PrefetchType" and "PrefetchValue"
  234.     *      in pTrack's IHXValues
  235.     */
  236.     STDMETHOD(AddPrefetchTrack) (THIS_
  237.  IHXValues* /*IN*/  pTrack);
  238.     /************************************************************************
  239.     *  Method:
  240.     *      IHXPrefetch::RemovePrefetchTrack
  241.     *  Purpose:
  242.     *      removes prefetched track
  243.     */
  244.     STDMETHOD(RemovePrefetchTrack)  (THIS_
  245.      UINT16 /*IN*/ uTrackIndex);
  246.     /************************************************************************
  247.     *  Method:
  248.     *      IHXPrefetch::GetPrefetchTrackCount
  249.     *  Purpose:
  250.     *      get number of prefetch tracks added
  251.     */
  252.     STDMETHOD_(UINT16,GetPrefetchTrackCount)    (THIS);
  253.     /************************************************************************
  254.     *  Method:
  255.     *      IHXPrefetch::GetPrefetchTrack
  256.     *  Purpose:
  257.     *      get prefetch track based on the index
  258.     */
  259.     STDMETHOD(GetPrefetchTrack) (THIS_
  260.  UINT16           /*IN*/  uTrackIndex,
  261.  REF(IHXValues*) /*OUT*/ pTrack);
  262.     /************************************************************************
  263.     *  Method:
  264.     *      IHXPrefetch::AddPrefetchSink
  265.     *  Purpose:
  266.     *      add prefetch sink
  267.     */
  268.     STDMETHOD(AddPrefetchSink) (THIS_
  269. IHXPrefetchSink* /*IN*/ pSink);
  270.     /************************************************************************
  271.     *  Method:
  272.     *      IHXPrefetch::RemovePrefetchSink
  273.     *  Purpose:
  274.     *      remove prefetch sink
  275.     */
  276.     STDMETHOD(RemovePrefetchSink) (THIS_
  277.    IHXPrefetchSink* /*IN*/ pSink);
  278.     /************************************************************************
  279.     *  Method:
  280.     *     IHXPrefetchSink::PrefetchTrackAdded()
  281.     *  Purpose:
  282.     *     prefetch track is added
  283.     */
  284.     STDMETHOD(PrefetchTrackAdded)   (THIS_
  285.      UINT16  uGroupIndex,
  286.      UINT16      uTrackIndex,
  287.      IHXValues* pTrack);
  288.     /************************************************************************
  289.     *  Method:
  290.     *     IHXPrefetchSink::PrefetchTrackRemoved()
  291.     *  Purpose:
  292.     *     prefetch track is removed
  293.     */
  294.     STDMETHOD(PrefetchTrackRemoved) (THIS_
  295.      UINT16  uGroupIndex,
  296.      UINT16      uTrackIndex,
  297.      IHXValues* pTrack);
  298.     /************************************************************************
  299.     *  Method:
  300.     *     IHXPrefetchSink::PrefetchTrackDone()
  301.     *  Purpose:
  302.     *     prefetch track is done
  303.     */
  304.     STDMETHOD(PrefetchTrackDone) (THIS_
  305.   UINT16    uGroupIndex,
  306.   UINT16    uTrackIndex,
  307.   HX_RESULT status);
  308. #endif /* HELIX_FEATURE_PREFETCH */
  309.     /* Other public fuctions */
  310.     virtual HX_RESULT CurrentGroupSet(void);
  311.             HX_RESULT RepeatTrackAdded(UINT16 uTrackIndex, IHXValues* pValues);
  312.             HX_RESULT BeginTrack(UINT16 uTrackIndex, IHXValues* pTrack);
  313.             HX_RESULT PauseTrack(UINT16 uTrackIndex, IHXValues* pTrack);
  314.             HX_RESULT SeekTrack(UINT16 uTrackIndex, IHXValues* pTrack, UINT32 ulSeekTime);
  315.             HX_RESULT StopTrack(UINT16 uTrackIndex, IHXValues* pTrack);
  316.             HX_RESULT GetSource(UINT16 uTrackIndex, IHXStreamSource*& pStreamSource);
  317.             HX_RESULT SetSoundLevel(UINT16 uTrackIndex, UINT16 uSoundLevel, BOOL bReflushAudioDevice);
  318.             HX_RESULT BeginSoundLevelAnimation(UINT16 uTrackIndex, UINT16 uSoundLevelBeginWith);
  319.             HX_RESULT EndSoundLevelAnimation(UINT16 uTrackIndex, UINT16 uSoundLevelEndWith);
  320.             HX_RESULT OnSoundLevelAnimation(UINT16 uTrackIndex, UINT16 uSoundLevel, UINT32 ulSoundLevelAnimationTime);
  321.             void PersistentComponentAdded(UINT16 uTrackIndex);
  322.             void        PersistentComponentRemoved(UINT16 uTrackIndex);
  323.     virtual void        Close(void);
  324. };
  325. class HXAdvancedGroupManager : public HXBasicGroupManager
  326. {
  327. protected:
  328.     HXMasterTAC*    m_pMasterTAC;
  329.     
  330.     virtual     ~HXAdvancedGroupManager();
  331.     PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME
  332.     HX_RESULT     RepeatTrackAdded(UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pTrack);
  333.     friend class HXAdvancedGroup;
  334.     friend class HXPlayer;
  335. public:
  336.         HXAdvancedGroupManager(HXPlayer* pPlayer = NULL);
  337.     STDMETHOD(CreateGroup)      (REF(IHXGroup*) pGroup);
  338.     STDMETHOD(AddGroup)         (THIS_
  339.         IHXGroup*   /*IN*/ pGroup);
  340.     STDMETHOD(RemoveGroup)      (THIS_
  341.         UINT16      /*IN*/ uGroupIndex);
  342.     STDMETHOD(SetCurrentGroup)  (THIS_
  343.                                 UINT16      /*IN*/ uGroupIndex);
  344.             void        SetMasterTAC(HXMasterTAC* pMasterTAC);
  345.     virtual void        PersistentComponentAdded(UINT16 uGroupIndex, UINT16 uTrackIndex);
  346.     virtual void        PersistentComponentRemoved(UINT16 uGroupIndex, UINT16 uTrackIndex);
  347.     virtual void        Close(void);
  348. };
  349. #endif /* _ADVANCEDGROUP_H_ */