advgroup.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:14k
源码类别:

Symbian

开发平台:

Visual C++

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