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

Symbian

开发平台:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: basgroup.h,v 1.1.20.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 _BASICGROUP_H_
  50. #define _BASICGROUP_H_
  51. struct IHXValues;
  52. struct IHXGroup;
  53. struct IHXGroupManager;
  54. struct IHXGroupSink;
  55. struct IHXTrack;
  56. struct IHXStreamSource;
  57. class CHXSimpleList;
  58. class HXBasicGroup;
  59. class HXBasicGroupManager;
  60. class   HXPlayer;
  61. class CHXMapStringToOb;
  62. class HXBasicTrack;
  63. class   HXMasterTAC;
  64. class HXBasicTrack :  public IHXTrack
  65. {
  66. protected:
  67.     LONG32     m_lRefCount;
  68.     HXBasicGroup*           m_pHXGroup;
  69.     IHXValues*     m_pValues;
  70.     IHXValues*     m_pValuesInRequest;
  71.     BOOL     m_bActive;
  72.     virtual     ~HXBasicTrack();
  73.     PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME
  74.     friend class HXBasicGroup;
  75. public:
  76.     HXBasicTrack(HXBasicGroup* pHXGroup);
  77.     UINT16     m_uTrackIndex;
  78.     /*
  79.      *  IUnknown methods
  80.      */
  81.     STDMETHOD(QueryInterface)       (THIS_
  82.     REFIID riid,
  83.     void** ppvObj);
  84.     STDMETHOD_(ULONG32,AddRef)      (THIS);
  85.     STDMETHOD_(ULONG32,Release)     (THIS);
  86.     /*
  87.      *  IHXTrack methods
  88.      */
  89.     /************************************************************************
  90.     *  Method:
  91.     *     IHXTrack::Begin()
  92.     *  Purpose:
  93.     *     start the track
  94.     */
  95.     STDMETHOD(Begin) (THIS);
  96.     /************************************************************************
  97.     *  Method:
  98.     *     IHXTrack::Pause()
  99.     *  Purpose:
  100.     *     pause the track
  101.     */
  102.     STDMETHOD(Pause) (THIS);
  103.     /************************************************************************
  104.     *  Method:
  105.     *     IHXTrack::Seek()
  106.     *  Purpose:
  107.     *     seek the track
  108.     */
  109.     STDMETHOD(Seek) (THIS_
  110. UINT32 ulSeekTime);
  111.     /************************************************************************
  112.     *  Method:
  113.     *     IHXTrack::Stop()
  114.     *  Purpose:
  115.     *     stop the track
  116.     */
  117.     STDMETHOD(Stop) (THIS);
  118.     /************************************************************************
  119.     *  Method:
  120.     *     IHXTrack::AddRepeat()
  121.     *  Purpose:
  122.     *     add repeat tracks
  123.     */
  124.     STDMETHOD(AddRepeat)(THIS_
  125. IHXValues* pValues);
  126.     /************************************************************************
  127.     *  Method:
  128.     *     IHXTrack::GetTrackProperties()
  129.     *  Purpose:
  130.     *     get track properties
  131.     */
  132.     STDMETHOD(GetTrackProperties)(THIS_
  133.  REF(IHXValues*) pValues,
  134.  REF(IHXValues*) pValuesInRequest);
  135.     /************************************************************************
  136.      * Method:
  137.      *     IHXTrack::GetSource
  138.      * Purpose:
  139.      *     Returns the Nth source instance supported by this player.
  140.      */
  141.     STDMETHOD(GetSource) (THIS_
  142. REF(IHXStreamSource*) pStreamSource);
  143.     /************************************************************************
  144.     *  Method:
  145.     *     IHXTrack::SetSoundLevel()
  146.     *  Purpose:
  147.     *     Set Audio Level
  148.     */
  149.     STDMETHOD(SetSoundLevel)(THIS_
  150.     UINT16 uSoundLevel);
  151.     /************************************************************************
  152.     *  Method:
  153.     *     IHXTrack::GetSoundLevel()
  154.     *  Purpose:
  155.     *     Get Audio Level
  156.     */
  157.     STDMETHOD_(UINT16, GetSoundLevel)(THIS);
  158.     /************************************************************************
  159.     *  Method:
  160.     *     IHXTrack::BeginSoundLevelAnimation()
  161.     *  Purpose:
  162.     *     notify the start of soundlevel animation
  163.     */
  164.     STDMETHOD(BeginSoundLevelAnimation)(THIS_
  165. UINT16 uSoundLevelBeginWith);
  166.     /************************************************************************
  167.     *  Method:
  168.     *     IHXTrack::EndSoundLevelAnimation()
  169.     *  Purpose:
  170.     *     notify the stop of soundlevel animation
  171.     */
  172.     STDMETHOD(EndSoundLevelAnimation)(THIS_
  173.       UINT16 uSoundLevelEndWith);
  174.     virtual HX_RESULT SetTrackProperties(IHXValues* pValues,
  175.            IHXValues* pValuesInRequest);    
  176.     virtual void        Close(void);
  177. };
  178. class HXBasicGroup :  public IHXGroup
  179. {
  180. protected:
  181.     LONG32     m_lRefCount;
  182.     HXBasicGroupManager*    m_pGroupManager;
  183.     HXPlayer*     m_pPlayer;
  184.     BOOL     m_bToNotifyTrack;    
  185.     UINT16     m_uTrackCount;
  186.     CHXMapLongToObj*     m_pTrackMap;
  187.     virtual     ~HXBasicGroup();
  188.     PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME
  189.     HX_RESULT       DoGetTrack(UINT16 uTrackIndex, 
  190.                                REF(IHXValues*) pTrack, 
  191.                                REF(IHXValues*) pTrackPropInRequest);
  192.     HX_RESULT       DoAddTrack(IHXValues* pTrack,
  193.                                IHXValues* pTrackPropInRequest,
  194.                                HXBasicTrack* pHXTrack);
  195.         
  196.     void     StartTrackNotification(void);
  197.     friend class HXBasicTrack;
  198.     friend class HXBasicGroupManager;
  199.     friend class HXPlayer;
  200. #if defined(HELIX_FEATURE_ADVANCEDGROUPMGR)
  201.     friend class HXAdvancedTrack;
  202.     friend class HXAdvancedGroupManager;
  203. #endif /* HELIX_FEATURE_ADVANCEDGROUPMGR */
  204. public:
  205.     UINT16     m_uGroupIndex;
  206.     HXBasicGroup(HXBasicGroupManager* pManager);
  207.     /*
  208.      *  IUnknown methods
  209.      */
  210.     STDMETHOD(QueryInterface)       (THIS_
  211.     REFIID riid,
  212.     void** ppvObj);
  213.     STDMETHOD_(ULONG32,AddRef)      (THIS);
  214.     STDMETHOD_(ULONG32,Release)     (THIS);
  215.     /*
  216.      *  IHXGroup methods
  217.      */
  218.     /************************************************************************
  219.     *  Method:
  220.     *      IHXGroup::SetGroupProperties
  221.     *  Purpose:
  222.     * Set any group specific information like Title Author 
  223.     * Copyright etc. 
  224.     */
  225.     STDMETHOD(SetGroupProperties)   (THIS_
  226.      IHXValues*  /*IN*/ pProperties);
  227.     /************************************************************************
  228.     *  Method:
  229.     *      IHXGroup::GetGroupProperties
  230.     *  Purpose:
  231.     * Get any group specific information. May return NULL.
  232.     */
  233.     STDMETHOD_(IHXValues*, GetGroupProperties)   (THIS);
  234.     /************************************************************************
  235.     *  Method:
  236.     *      IHXGroup::GetTrackCount
  237.     *  Purpose:
  238.     * Get the number of tracks within this group.
  239.     */
  240.     STDMETHOD_(UINT16,GetTrackCount)    (THIS);
  241.     /************************************************************************
  242.     *  Method:
  243.     *      IHXGroup::GetTrack
  244.     *  Purpose:
  245.     * Call this to hook audio data after all audio streams in this
  246.     * have been mixed.
  247.     */
  248.     STDMETHOD(GetTrack) (THIS_
  249. UINT16      /*IN*/ uTrackIndex,
  250. REF(IHXValues*)  /*OUT*/ pTrack);
  251.     /************************************************************************
  252.     *  Method:
  253.     *      IHXGroup::AddTrack
  254.     *  Purpose:
  255.     * Add Tracks to the group.
  256.     */
  257.     STDMETHOD(AddTrack) (THIS_
  258. IHXValues* /*IN*/ pTrack);
  259.     /************************************************************************
  260.     *  Method:
  261.     *      IHXGroup::RemoveTrack
  262.     *  Purpose:
  263.     * Remove an already added track
  264.     */
  265.     STDMETHOD(RemoveTrack)  (THIS_
  266.     UINT16 /*IN*/ uTrackIndex);
  267.     /* Other public fuctions */
  268.     virtual HX_RESULT CurrentGroupSet(void);
  269.     virtual void Close(void);
  270. };
  271. class HXBasicGroupManager : public IHXGroupManager,
  272.     public IHXPreCacheGroupMgr
  273. {
  274. protected:
  275.     LONG32 m_lRefCount;
  276.     CHXMapLongToObj* m_pGroupMap;
  277.     CHXSimpleList* m_pSinkList;
  278.     IHXValues* m_pPresentationProperties;
  279.     
  280.     // required for precache support
  281.     UINT16     m_uGroupCount;
  282.     UINT16     m_uCurrentGroup;
  283.     UINT16      m_uNextGroup;
  284.     BOOL      m_bDefaultNextGroup;
  285.     BOOL     m_bCurrentGroupInitialized;
  286.     HXPlayer*     m_pPlayer;
  287.     virtual     ~HXBasicGroupManager();
  288.     PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME
  289.     HX_RESULT     TrackAdded (UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pTrack);
  290.     HX_RESULT     TrackRemoved(UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pTrack);
  291.     void      RemoveAllGroup(void);
  292.     friend class HXBasicGroup;
  293.     friend class HXPlayer;
  294. #if defined(HELIX_FEATURE_ADVANCEDGROUPMGR)
  295.     friend class HXAdvancedGroup;
  296. #endif /* HELIX_FEATURE_ADVANCEDGROUPMGR */
  297. public:
  298.     HXBasicGroupManager(HXPlayer* pPlayer = NULL);
  299.     /*
  300.      *  IUnknown methods
  301.      */
  302.     STDMETHOD(QueryInterface)       (THIS_
  303.     REFIID riid,
  304.     void** ppvObj);
  305.     STDMETHOD_(ULONG32,AddRef)      (THIS);
  306.     STDMETHOD_(ULONG32,Release)     (THIS);
  307.     /*
  308.      *  IHXGroupManager methods
  309.      */
  310.     /************************************************************************
  311.     *  Method:
  312.     *      IHXGroupManager::CreateGroup
  313.     *  Purpose:
  314.     * Create a group
  315.     */
  316.     STDMETHOD(CreateGroup)    (REF(IHXGroup*) pGroup);
  317.     /************************************************************************
  318.     *  Method:
  319.     *      IHXGroupManager::GetGroupCount
  320.     *  Purpose:
  321.     * Get the number of groups within the presentation.
  322.     */
  323.     STDMETHOD_(UINT16,GetGroupCount)    (THIS);
  324.     /************************************************************************
  325.     *  Method:
  326.     *      IHXGroupManager::GetGroup
  327.     *  Purpose:
  328.     * Get ith group in the presentation
  329.     */
  330.     STDMETHOD(GetGroup) (THIS_
  331. UINT16    /*IN*/  uGroupIndex,
  332. REF(IHXGroup*)  /*OUT*/ pGroup);
  333.     /************************************************************************
  334.     *  Method:
  335.     *      IHXGroupManager::SetCurrentGroup
  336.     *  Purpose:
  337.     * Play this group in the presentation.
  338.     */
  339.     STDMETHOD(SetCurrentGroup) (THIS_
  340. UINT16      /*IN*/ uGroupIndex);
  341.     /************************************************************************
  342.     *  Method:
  343.     *      IHXGroupManager::GetCurrentGroup
  344.     *  Purpose:
  345.     * Get current group index
  346.     */
  347.     STDMETHOD(GetCurrentGroup) (THIS_
  348. REF(UINT16) /*OUT*/ uGroupIndex);
  349.     /************************************************************************
  350.     *  Method:
  351.     *      IHXGroupManager::AddGroup
  352.     *  Purpose:
  353.     * Add a group to the presentation.
  354.     */
  355.     STDMETHOD(AddGroup) (THIS_
  356. IHXGroup*     /*IN*/ pGroup);
  357.     /************************************************************************
  358.     *  Method:
  359.     *      IHXGroupManager::RemoveGroup
  360.     *  Purpose:
  361.     * Remove an already added group
  362.     */
  363.     STDMETHOD(RemoveGroup)  (THIS_
  364.     UINT16  /*IN*/ uGroupIndex);
  365.     /************************************************************************
  366.     *  Method:
  367.     *      IHXGroupManager::AddSink
  368.     *  Purpose:
  369.     * Add a sink to get notifications about any tracks or groups
  370.     * being added to the presentation.
  371.     */
  372.     STDMETHOD(AddSink) (THIS_
  373. IHXGroupSink* /*IN*/ pGroupSink);
  374.     /************************************************************************
  375.     *  Method:
  376.     *      IHXGroupManager::RemoveSink
  377.     *  Purpose:
  378.     * Remove Sink
  379.     */
  380.     STDMETHOD(RemoveSink)   (THIS_
  381.     IHXGroupSink* /*IN*/ pGroupSink);
  382.     /************************************************************************
  383.     *  Method:
  384.     *      IHXGroupManager::SetPresentationProperties
  385.     *  Purpose:
  386.     * Set any presentation information like Title Author 
  387.     * Copyright etc. 
  388.     */
  389.     STDMETHOD(SetPresentationProperties)   (THIS_
  390.     IHXValues*  /*IN*/ pProperties);
  391.     /************************************************************************
  392.     *  Method:
  393.     *      IHXGroupManager::GetPresentationProperties
  394.     *  Purpose:
  395.     * Get any presentation information. May return NULL.
  396.     */
  397.     STDMETHOD_(IHXValues*, GetPresentationProperties)   (THIS);
  398.     /************************************************************************
  399.     *  Method:
  400.     *      IHXPreCacheGroupMgr::SetNextGroup
  401.     *  Purpose:
  402.     * Play this as the next group in the presentation.
  403.     */
  404.     STDMETHOD(SetNextGroup) (THIS_
  405. UINT16      /*IN*/ uGroupIndex);
  406.                 
  407.     /************************************************************************
  408.     *  Method:
  409.     *      IHXPreCacheGroupMgr::GetNextGroup
  410.     *  Purpose:
  411.     * Get the next group to be played in the presentation.
  412.     */
  413.     STDMETHOD(GetNextGroup) (THIS_ REF(UINT16) uGroupIndex);
  414.     /************************************************************************
  415.     *  Method:
  416.     *      IHXPreCacheGroupMgr::DefaultNextGroup
  417.     *  Purpose:
  418.     * Reset to default the next group to play in the presentation.
  419.     */
  420.     STDMETHOD(DefaultNextGroup) (THIS);
  421.     virtual void     SetMasterTAC(HXMasterTAC* pMasterTAC);
  422.     virtual HX_RESULT     TrackStarted(UINT16 uGroupIndex, UINT16 uTrackIndex);
  423.     virtual HX_RESULT     TrackStopped(UINT16 uGroupIndex, UINT16 uTrackIndex);
  424.     virtual void     PersistentComponentAdded(UINT16 uGroupIndex, UINT16 uTrackIndex);
  425.     virtual void     PersistentComponentRemoved(UINT16 uGroupIndex, UINT16 uTrackIndex);
  426.     virtual HX_RESULT     InsertGroupAt(UINT16 uGroupIndex, IHXGroup* pGroup);
  427.     virtual void            Close(void);
  428. };
  429. #endif /*_BASICGROUP_H_*/